Author: ozizka(a)redhat.com
Date: 2009-10-27 19:40:19 -0400 (Tue, 27 Oct 2009)
New Revision: 819
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java
Log:
* Rar and War tests updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java 2009-10-27
19:42:06 UTC (rev 818)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java 2009-10-27
23:40:19 UTC (rev 819)
@@ -31,6 +31,7 @@
import java.util.*;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.RandomUtils;
import org.jboss.jopr.jsfunit.AppConstants.DeployableTypes;
@@ -114,13 +115,13 @@
/**
* assertion: Verify the navigation sequence to Resource Adapters.
- *
- * test Strategy:
+ *
+ * test Strategy:
*
* From the root of the navigation tree:i
- * Click JBossAS Servers ==> JBoss App Server:${config}
- * ==> Applications ==> Resource Adapters
- *
+ * Click JBossAS Servers ==> JBoss App Server:${config}
+ * ==> Applications ==> Resource Adapters
+ *
*/
public void testRarNavigation() throws IOException, HtmlElementNotFoundException,
ActionOutOfSyncException, ActionNotAvailableException, EmbJoprTestException,
InterruptedException
@@ -193,34 +194,55 @@
// Concrete appliction node.
{
+ final String DEPLOYABLE_NAME = "testRarNavigation02.rar";
+
// Deploy the RAR.
- String rarFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) +
"/rar/"+BASIC_RAR;
- deployRar( rarFilePath );
+ //String rarFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) +
"/rar/"+BASIC_RAR;
+ String rarFilePathOrig = ejtt.getTestFilePath(APP_TYPE, BASIC_RAR);
+ String rarFilePath = ejtt.getTempDir() + "/" + DEPLOYABLE_NAME;
- ejtt.getNavTree().getNodeByLabel(NAV_RAR).click();
+ FileUtils.copyFile( new File(rarFilePathOrig), new File(rarFilePath) );
- ContentTableRow rarRow =
ejtt.getDefaultContentTable().getFirstRowContainingLink(BASIC_RAR);
- assertTrue("Page doesn't list "+BASIC_RAR+" in Summary tab.",
rarRow != null );
+ //deployRar( rarFilePath );
+ ejtt.deployment.deployViaEmbJopr(APP_TYPE, rarFilePath);
- // Go to the summary through listed item.
- rarRow.getLinkByLabel(BASIC_RAR).click();
- // Check that we have the summary tab for the selected RAR.
- assertTrue( "RAR name ("+BASIC_RAR+") not found in the content
box.",
- ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(BASIC_RAR)
);
+ Exception ex = null;
+ try {
- // Go to the summary through nav tree node.
- NavTreeNode rarNode = ejtt.getNavTree().getNodeByLabel(NAV_RAR);
- if( !rarNode.isExpanded() ){
- log.info("Expanding.");
- rarNode.getArrowLink().click();
- Thread.sleep(2000);
+ ejtt.getNavTree().getNodeByLabel(NAV_RAR).click();
+
+ // FAILS: Can't find the link using...
+ ContentTableRow rarRow =
ejtt.getDefaultContentTable().getFirstRowContainingLink(BASIC_RAR);
+ assertTrue("Page doesn't list "+BASIC_RAR+" in Summary tab.",
rarRow != null );
+
+ // Go to the summary through listed item.
+ rarRow.getLinkByLabel(BASIC_RAR).click();
+ // Check that we have the summary tab for the selected RAR.
+ assertTrue( "RAR name ("+BASIC_RAR+") not found in the content
box.",
+ ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(BASIC_RAR)
);
+
+ // Go to the summary through nav tree node.
+ NavTreeNode rarNode = ejtt.getNavTree().getNodeByLabel(NAV_RAR);
+ if( !rarNode.isExpanded() ){
+ log.info("Expanding.");
+ rarNode.getArrowLink().click();
+ Thread.sleep(2000);
+ }
+ ejtt.getNavTree().getNodeByLabel(BASIC_RAR).click();
+ // Check that we have the summary tab for the selected RAR.
+ ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(BASIC_RAR);
}
- ejtt.getNavTree().getNodeByLabel(BASIC_RAR).click();
- // Check that we have the summary tab for the selected RAR.
- ejtt.getTabMenu().getTabContentBox().getElement().getTextContent().contains(BASIC_RAR);
+ catch( Exception ex1 ){ ex = ex1; }
+ finally {
+ //undeployRar(BASIC_RAR);
+ try {
+ ejtt.deployment.undeployViaEmbJopr(APP_TYPE, BASIC_RAR);
+ } catch( Exception ex2 ){
+ log.warn("Failed to undeploy: "+ex2.getMessage());
+ if( ex == null ) ex = ex2;
+ }
+ }
- undeployRar(BASIC_RAR);
-
}
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-10-27
19:42:06 UTC (rev 818)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java 2009-10-27
23:40:19 UTC (rev 819)
@@ -935,23 +935,23 @@
log.info("Unzipping "+archivePath+" to "+tempDir);
ejtt.deployment.unzipArchive( archivePath, tempDir );
- log.info("Moving "+tempDir+"/"+WAR_UNPACKED+" to
"+destDir+"/"+WAR_UNPACKED);
- ejtt.deployment.moveDir(tempDir+"/"+WAR_UNPACKED,
destDir+"/"+WAR_UNPACKED);
+ log.info("Moving "+tempDir+"/"+DEPLOYABLE_NAME+" to
"+destDir+"/"+DEPLOYABLE_NAME);
+ ejtt.deployment.moveDir(tempDir+"/"+DEPLOYABLE_NAME,
destDir+"/"+DEPLOYABLE_NAME);
try {
// Loop, wait for the app to appear.
log.info("Waiting for WAR to appear.");
- ejtt.deployment.waitActivelyForDeployment(DeployableTypes.WAR, WAR_UNPACKED,
+ ejtt.deployment.waitActivelyForDeployment(DeployableTypes.WAR, DEPLOYABLE_NAME,
DEPLOY_UP_STATE_WAIT_CHECK_INTERVAL, DEPLOY_UP_STATE_WAIT_CHECK_RETRIES, this);
ejtt.getNavTree().getNodeByLabel(NAV_WAR).click();
//ContentTableRow row =
ejtt.getDefaultContentTable().getFirstRowContainingLink(WAR_UNPACKED);
- if( ! ejtt.deployment.isDeployedAccordingToEmbJopr(APP_TYPE, WAR_UNPACKED) )
- throw new EmbJoprTestException("Unpacked hotdeployed war not found:
"+WAR_UNPACKED, this);
+ if( ! ejtt.deployment.isDeployedAccordingToEmbJopr(APP_TYPE, DEPLOYABLE_NAME) )
+ throw new EmbJoprTestException("Unpacked hotdeployed war not found:
"+DEPLOYABLE_NAME, this);
@@ -965,7 +965,9 @@
}
finally {
// Delete the WAR dir.
- ejtt.deployment.deleteFromDeployDir(WAR_UNPACKED);
+ //Couldn't delete following files:
+ //
/home/ondra/work/JOPRembedded/embjopr-svn-trunk/jsfunit/target/jboss5x/deploy/unpacked-web1.war
+ ejtt.deployment.deleteFromDeployDir(DEPLOYABLE_NAME);
}
}
Show replies by date