From 1a5f14c4083af70db2e5a2258f1b6bd1c6fc9494 Mon Sep 17 00:00:00 2001 From: Christian Kaltepoth Date: Thu, 4 Sep 2014 08:25:49 +0200 Subject: [PATCH] Fixed test for #182 #183 --- .../rewrite/faces/outbound/OutboundResourceTest.java | 6 ++++-- .../faces/outbound/OutboundResourceTestProvider.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTest.java b/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTest.java index 8832fdda7..858009f8d 100644 --- a/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTest.java +++ b/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTest.java @@ -16,7 +16,9 @@ package org.ocpsoft.rewrite.faces.outbound; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import org.hamcrest.Matchers; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.spec.WebArchive; @@ -24,6 +26,7 @@ import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.ocpsoft.rewrite.category.IgnoreForGlassfish4; +import org.ocpsoft.rewrite.config.ConfigurationProvider; import org.ocpsoft.rewrite.faces.annotation.RewriteFacesAnnotationsTest; import org.ocpsoft.rewrite.test.RewriteTest; import org.ocpsoft.rewrite.test.RewriteTestBase; @@ -31,7 +34,6 @@ import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.DomNodeList; import com.gargoylesoftware.htmlunit.html.HtmlPage; -import org.ocpsoft.rewrite.config.ConfigurationProvider; /** * 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 HtmlPage page = getWebClient("/outbound").getPage(); DomNodeList stylesheets = page.getElementsByTagName("link"); assertEquals(1, stylesheets.size()); - assertEquals("/css/style.css", stylesheets.get(0).getAttribute("href")); + assertThat(stylesheets.get(0).getAttribute("href"), Matchers.endsWith("/css/style.css?ln=test")); } } diff --git a/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTestProvider.java b/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTestProvider.java index 76f552a0e..c94dba93c 100644 --- a/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTestProvider.java +++ b/integration-faces-tests/src/test/java/org/ocpsoft/rewrite/faces/outbound/OutboundResourceTestProvider.java @@ -45,7 +45,7 @@ public Configuration getConfiguration(final ServletContext context) { return ConfigurationBuilder.begin() .addRule(Join.path("/outbound").to("/faces/outbound.xhtml")) - .addRule(Join.path("/css/{file}").to("/faces/javax.faces.resource/css/{file}?ln=test")) + .addRule(Join.path("/css/{file}").to("/faces/javax.faces.resource/css/{file}")) .addRule() .when(Direction.isInbound().and(DispatchType.isRequest())) .perform(SendStatus.error(403));