Author: ozizka(a)redhat.com
Date: 2009-05-21 09:55:48 -0400 (Thu, 21 May 2009)
New Revision: 472
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java
Log:
WAR tests updated
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java 2009-05-20
21:37:40 UTC (rev 471)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java 2009-05-21
13:55:48 UTC (rev 472)
@@ -119,8 +119,69 @@
+ /*
+ <jboss-web>
+ <context-root>test</context-root>
+ <virtual-host>snert.home.pilhuhn.de</virtual-host>
+ <virtual-host>snert.home.bsd.de</virtual-host>
+ </jboss-web>
+ */
+ public void testWarWithVirtualHosts()
+ throws IOException, EmbJoprTestException
+ {
+ final String DEPLOYABLE_NAME = WAR_VIRTUAL_HOSTS;
+ String filePath = ejtt.getTestDataDir() + "/war/"+DEPLOYABLE_NAME;
+
+ try {
+ ejtt.deployment.deployViaEmbJopr(APP_TYPE, filePath);
+
+ // Check the success message.
+ String expectedMessage = "Resource hellothere.war created successfully!";
+ checkClientAndServerMessages(expectedMessage, expectedMessage, false);
+
+ ejtt.deployment.waitActivelyForDeployment(APP_TYPE, DEPLOYABLE_NAME,
+ DEPLOY_UP_STATE_WAIT_CHECK_INTERVAL, DEPLOY_UP_STATE_WAIT_CHECK_RETRIES);
+
+ // Use HtmlUnit to test the newly deployed war in a new WebClient session.
+
+ int port = ejtt.getEmbJoprPort();
+ WebClient webClient = new WebClient();
+ HtmlPage page = (HtmlPage)webClient.getPage("http://localhost:" + port +
"/test/index.jsp");
+ assertTrue(page.asText().contains("HELLO WORLD"));
+
+ // Check that the virtual hosts are listed in EmbJopr.
+
+ // Expand the VHosts node and click it.
+ ejtt.navTree.getNodeByLabel(NAV_JBOSS_WEB).getArrowLink().click();
+ ejtt.navTree.waitUntilNodeLoadedByAjax(NAV_VIRTUAL_HOSTS, 1000, 6);
+ ejtt.navTree.getNodeByLabel(NAV_VIRTUAL_HOSTS).getLabelLink().click();
+
+ // Check that vhosts from the WARare listed.
+ ContentTableRow row = ejtt.tabMenu.getTabContentBox().
+ getDefaultTable().getFirstRowContainingLink("snert.home.pilhuhn.de");
+ if( null == row )
+ throw new EmbJoprTestException("Vhost 'snert.home.pilhuhn.de' is not
listed.", this);
+
+ row = ejtt.tabMenu.getTabContentBox().
+ getDefaultTable().getFirstRowContainingLink("snert.home.bsd.de");
+ if( null == row )
+ throw new EmbJoprTestException("Vhost 'snert.home.bsd.de' is not
listed.", this);
+
+
+
+ }
+ finally {
+ // Undeploy the WAR
+ ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
+ }
+ }
+
+
+
+
+
/**
* Tries to deploy a invalid WAR (with invalid descriptor)
* and checks that EmbJopr rejects this deployment.
Show replies by date