Skip to content

Commit 4feb714

Browse files
committed
Minor tweak to make GWT integration tests TomEE compatible
1 parent 85c0764 commit 4feb714

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎integration-gwt/src/test/java/org/ocpsoft/rewrite/gwt/config/HistoryRewriteRootContextConfigurationTest.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
*/
1616
package org.ocpsoft.rewrite.gwt.config;
1717

18-
import junit.framework.Assert;
19-
2018
import org.apache.http.client.methods.HttpGet;
2119
import org.apache.http.client.methods.HttpHead;
2220
import org.jboss.arquillian.container.test.api.Deployment;
2321
import org.jboss.arquillian.junit.Arquillian;
2422
import org.jboss.shrinkwrap.api.asset.StringAsset;
2523
import org.jboss.shrinkwrap.api.spec.WebArchive;
24+
import org.junit.Assert;
2625
import org.junit.Test;
2726
import org.junit.runner.RunWith;
2827
import org.ocpsoft.rewrite.config.ConfigurationProvider;
@@ -41,6 +40,8 @@ public static WebArchive getDeployment()
4140
{
4241
WebArchive deployment = RewriteTest
4342
.getDeployment("ROOT.war")
43+
// The TomEE Arquillian adapter doesn't like ROOT.war, so we force the root context path via context.xml
44+
.addAsManifestResource(new StringAsset("<Context path=\"\"/>"), "context.xml")
4445
.addAsWebResource(new StringAsset(""), "index.html")
4546
.addAsServiceProvider(ConfigurationProvider.class, HistoryRewriteConfiguration.class);
4647
return deployment;
@@ -52,7 +53,7 @@ public void testContextPathServedFromHeadRequest()
5253
HttpAction<HttpHead> action = head("/?org.ocpsoft.rewrite.gwt.history.contextPath");
5354
Assert.assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
5455

55-
Assert.assertEquals(action.getContextPath(),
56+
Assert.assertEquals("/",
5657
action.getResponseHeaderValues("org.ocpsoft.rewrite.gwt.history.contextPath").get(0));
5758
}
5859

‎test-harness/src/main/resources/arquillian.xml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@
3636

3737
<container qualifier="tomee">
3838
<configuration>
39-
<property name="dir">target/container/tomee-1.5</property>
4039
<property name="httpPort">-1</property>
41-
<property name="ajpPort">-1</property>
4240
<property name="stopPort">-1</property>
43-
<property name="appWorkingDir">target/arquillian-test-working-dir</property>
41+
<property name="removeUnusedWebapps">true</property>
4442
</configuration>
4543
</container>
4644

0 commit comments

Comments
 (0)