Author: smcgowan(a)redhat.com
Date: 2009-05-18 21:04:50 -0400 (Mon, 18 May 2009)
New Revision: 442
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
Log:
adjustments to testRarInEar test including navigation to Embedded Rar
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-05-18
22:22:54 UTC (rev 441)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-05-19
01:04:50 UTC (rev 442)
@@ -48,6 +48,7 @@
EJB3(AppConstants.NAV_EJB3, "ejb3", ".jar", null,
"application/java-archive"),
SAR(AppConstants.NAV_SAR, "sar", ".sar",
"-service.xml", "application/sar"),
RAR(AppConstants.NAV_RAR, "rar", ".rar", null,
"application/rar"),
+ EMB_RAR(AppConstants.NAV_EMB_RAR,"", ".rar", null,
"application/rar"),
MC_BEAN(AppConstants.NAV_MC, "mc", "", null,
"application/java-archive"),
EMB_WAR(AppConstants.NAV_EMB_WAR,"",".war", null,
"application/war");
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-05-18
22:22:54 UTC (rev 441)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-05-19
01:04:50 UTC (rev 442)
@@ -170,7 +170,20 @@
}
+ public boolean isRarInEarDeployed(String rarName, String earName) throws
RuntimeException
+ {
+ try {
+ String query = "jboss.deployment:id=\"vfszip:" +
+
System.getProperty("jsfunit.deploy.dir") + "/" + earName +
+ "/" + rarName +
"/\",*";
+ return isMBeanStateDeployedByQuery(query);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
}// ApplicationTestBaseAS5
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-05-18
22:22:54 UTC (rev 441)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-05-19
01:04:50 UTC (rev 442)
@@ -1215,50 +1215,37 @@
{
final String DEPLOYABLE_NAME = EAR_WITH_RAR;
- String query = "jboss.deployment:id=\"vfszip:" +
-
System.getProperty("jsfunit.deploy.dir") + "/" + EAR_WITH_RAR +
- "/" + BASIC_RAR + "/\",*";
+
// Deploy the EAR.
+
String earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_NAME;
deployEar( earFilePath );
String expectedMessage = DEPLOYABLE_NAME + " created successfully";
checkClientAndServerMessages(expectedMessage, expectedMessage, false);
- try {
- assertTrue("JMX doesn't report EAR as deployed: testscopedrar.ear",
isEarDeployed(DEPLOYABLE_NAME));
- assertTrue("JMX doesn't report RAR as deployed. jbosstestadapter.rar",
isMBeanStateDeployedByQuery(query));
- }
- catch (Exception e) {
- throw new RuntimeException(e);
- }
- finally {
- try {
- // Undeploy the EAR.
+ assertTrue("JMX doesn't report EAR as deployed: testscopedrar.ear",
isEarDeployed(DEPLOYABLE_NAME));
+ assertTrue("JMX doesn't report RAR as deployed. jbosstestadapter.rar",
isRarInEarDeployed(BASIC_RAR, EAR_WITH_RAR));
- ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
- assertFalse(isEarDeployed(DEPLOYABLE_NAME));
- assertFalse(isMBeanStateDeployedByQuery(query));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ // Check that the Embedded Rar is listed
+ log.info("Navigate to Embedded RAR");
+ ejtt.navTree.getNodeByLabel(DeployableTypes.EMB_RAR.getNavTreeLabel()).getLabelLink().click();
+ log.info("Assert that the Embedded Rar is Available and UP");
+ assertTrue( ejtt.deployment.isDeployedAccordingToEmbJopr(DeployableTypes.EMB_RAR,
BASIC_RAR, true) );
- }
+ // Undeploy the EAR.
+ log.info("Undeploy the EAR");
+ ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
+ log.info("Check that the ear Deployment returns false");
+ assertFalse(isEarDeployed(DEPLOYABLE_NAME));
+ log.info("Check that the rar Deployment returns false");
+ assertFalse(isRarInEarDeployed(BASIC_RAR, EAR_WITH_RAR));
+
}
-
-
-
-
-
-
-
-
-
-
private void deployEar( String earFilePath ) throws IOException,
HtmlElementNotFoundException
{
if( !(new File(earFilePath)).exists())