Skip to content

Commit 1a5f14c

Browse files
committed
Fixed test for ocpsoft#182 ocpsoft#183
1 parent 172592a commit 1a5f14c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,24 @@
1616
package org.ocpsoft.rewrite.faces.outbound;
1717

1818
import static org.junit.Assert.assertEquals;
19+
import static org.junit.Assert.assertThat;
1920

21+
import org.hamcrest.Matchers;
2022
import org.jboss.arquillian.container.test.api.Deployment;
2123
import org.jboss.arquillian.junit.Arquillian;
2224
import org.jboss.shrinkwrap.api.spec.WebArchive;
2325
import org.junit.Test;
2426
import org.junit.experimental.categories.Category;
2527
import org.junit.runner.RunWith;
2628
import org.ocpsoft.rewrite.category.IgnoreForGlassfish4;
29+
import org.ocpsoft.rewrite.config.ConfigurationProvider;
2730
import org.ocpsoft.rewrite.faces.annotation.RewriteFacesAnnotationsTest;
2831
import org.ocpsoft.rewrite.test.RewriteTest;
2932
import org.ocpsoft.rewrite.test.RewriteTestBase;
3033

3134
import com.gargoylesoftware.htmlunit.html.DomElement;
3235
import com.gargoylesoftware.htmlunit.html.DomNodeList;
3336
import com.gargoylesoftware.htmlunit.html.HtmlPage;
34-
import org.ocpsoft.rewrite.config.ConfigurationProvider;
3537

3638
/**
3739
* This test doesn't work on Glassfish 4.0 at all. For some reason Glassfish _always_ appends the JSESSIONID, even if
@@ -67,7 +69,7 @@ public void testResourceUrlRewritten() throws Exception
6769
HtmlPage page = getWebClient("/outbound").getPage();
6870
DomNodeList<DomElement> stylesheets = page.getElementsByTagName("link");
6971
assertEquals(1, stylesheets.size());
70-
assertEquals("/css/style.css", stylesheets.get(0).getAttribute("href"));
72+
assertThat(stylesheets.get(0).getAttribute("href"), Matchers.endsWith("/css/style.css?ln=test"));
7173
}
7274

7375
}

integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTestProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public Configuration getConfiguration(final ServletContext context)
4545
{
4646
return ConfigurationBuilder.begin()
4747
.addRule(Join.path("/outbound").to("/faces/outbound.xhtml"))
48-
.addRule(Join.path("/css/{file}").to("/faces/javax.faces.resource/css/{file}?ln=test"))
48+
.addRule(Join.path("/css/{file}").to("/faces/javax.faces.resource/css/{file}"))
4949
.addRule()
5050
.when(Direction.isInbound().and(DispatchType.isRequest()))
5151
.perform(SendStatus.error(403));

0 commit comments

Comments
 (0)