Author: ozizka(a)redhat.com
Date: 2009-05-19 13:38:29 -0400 (Tue, 19 May 2009)
New Revision: 447
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
Log:
EAR tests updated.
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-19
17:15:27 UTC (rev 446)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java 2009-05-19
17:38:29 UTC (rev 447)
@@ -189,16 +189,25 @@
verify the archive has been deployed successfully.
*/
- public void testBadEarRedeploy() throws IOException, HtmlElementNotFoundException,
ActionNotAvailableException {
+ public void testBadEarRedeploy() throws IOException, EmbJoprTestException {
+ final String DEPLOYABLE_NAME = EAR_MALFORMED_APP_FILENAME;
+
try {
- String earFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) +
"/ear/"+EAR_MALFORMED_APP_FILENAME;
- deployEar(earFilePath);
+ String earFilePath = ejtt.getTestDataDir() + "/ear/"+DEPLOYABLE_NAME;
+ //deployEar(earFilePath);
+ ejtt.deployment.deployViaEmbJopr(APP_TYPE, earFilePath);
checkClientAndServerMessages("Failed to create Resource", "Failed to
create Resource", true);
+
+ if( ejtt.deployment.isDeployedAccordingToEmbJopr(APP_TYPE, DEPLOYABLE_NAME)){
+ ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
+ throw new EmbJoprTestException("An EAR witt malformed descriptor " +
+ "stays deployed after the deployment failed.");
+ }
}
finally {
- undeployEar(BASIC_EAR);
+
}
}
@@ -1049,8 +1058,8 @@
try {
// Deploy the EAR.
- String appFilePath = ejtt.getTestDataDir() +
"/"+DeployableTypes.EAR.getDataDir()+"/"+DEPLOYABLE_NAME;
- ejtt.deployment.deployViaEmbJopr( DeployableTypes.EAR, appFilePath );
+ String appFilePath = ejtt.getTestDataDir() +
"/"+APP_TYPE.getDataDir()+"/"+DEPLOYABLE_NAME;
+ ejtt.deployment.deployViaEmbJopr( APP_TYPE, appFilePath );
// Check that we get an error message.
assertTrue( "We should get an error message.",
server.getFacesMessages().hasNext() );
@@ -1059,14 +1068,15 @@
// Check that the EAR is not listed as deployed.
assertFalse( "The EAR should not be listed as deployed.",
- ejtt.deployment.isDeployedAccordingToEmbJopr(DeployableTypes.EAR, DEPLOYABLE_NAME,
false) );
+ ejtt.deployment.isDeployedAccordingToEmbJopr(APP_TYPE, DEPLOYABLE_NAME, false) );
}
finally {
try {
- undeployEar(DEPLOYABLE_NAME);
- }catch( Exception ex ){
- log.error("Caught exception when undeploying: "+ex, ex);
+ //undeployEar(DEPLOYABLE_NAME);
+ ejtt.deployment.undeployViaEmbJopr(APP_TYPE, DEPLOYABLE_NAME);
+ }catch( EmbJoprTestException ex ){
+ log.info("Caught expected exception when undeploying: "+ex);
}
}
Show replies by date