User: user57
Date: 01/07/09 19:34:05
Modified: src/main/org/jboss/test/util Deploy.java
Log:
o changed all deploy tests to deploy as a test and to not call System.exit().
this should allow reports to be generated for tests that fail to deploy.
o modified run_tests.xml basic-security-tests to not-halt on error, so that
test-and-report will produce reports even if the security tests fail.
Revision Changes Path
1.5 +108 -96 jbosstest/src/main/org/jboss/test/util/Deploy.java
Index: Deploy.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/util/Deploy.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Deploy.java 2001/07/06 02:29:21 1.4
+++ Deploy.java 2001/07/10 02:34:05 1.5
@@ -17,107 +17,119 @@
*
* @author [EMAIL PROTECTED]
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class Deploy
{
- /** A map of jarname -> Boolean deployment status. */
- private static Map deployed = new Hashtable();
+ /** A map of jarname -> Boolean deployment status. */
+ private static Map deployed = new Hashtable();
- /**
- * Check if a jar is deployed.
- */
- private static boolean isDeployed(final String jarName) {
- Boolean bool = (Boolean)deployed.get(jarName);
- if (bool == null)
- return false;
- return bool.booleanValue();
- }
-
- /**
- * Mark a jar as deployed or undeployed.
- */
- private static void setDeployed(final String jarName, final boolean flag)
- {
- deployed.put(jarName, new Boolean(flag));
- }
-
- /** Return the deployment directory to use. */
- private static String getDeployFilename(final String filename) {
- String deployDir = System.getProperty("jbosstest.deploy.dir");
- if (deployDir == null) {
- deployDir = "../deploy";
- }
- return deployDir + "/" + filename;
- }
+ /**
+ * Check if a jar is deployed.
+ */
+ private static boolean isDeployed(final String jarName) {
+ Boolean bool = (Boolean)deployed.get(jarName);
+ if (bool == null)
+ return false;
+ return bool.booleanValue();
+ }
+
+ /**
+ * Mark a jar as deployed or undeployed.
+ */
+ private static void setDeployed(final String jarName, final boolean flag)
+ {
+ deployed.put(jarName, new Boolean(flag));
+ }
+
+ /** Return the deployment directory to use. */
+ private static String getDeployFilename(final String filename) {
+ String deployDir = System.getProperty("jbosstest.deploy.dir");
+ if (deployDir == null) {
+ deployDir = "../deploy";
+ }
+ return deployDir + "/" + filename;
+ }
- /**
- * Deploy the security ejb jar one time.
- */
- public static void deploy(final String jarName) throws Exception
- {
- String noDeploy = System.getProperty("no-deploy");
- if (noDeploy != null || isDeployed(jarName)) {
- return;
- }
-
- String filename = getDeployFilename(jarName);
- System.out.print("Deploying: "+ jarName + "...");
- new org.jboss.jmx.client.Deployer().deploy(filename);
- setDeployed(jarName, true);
- System.out.println("Done");
- }
-
- /**
- * Undeploy an archive from a the remote JBoss server.
- */
- public static void undeploy(final String jarName) throws Exception
- {
- String noUndeploy = System.getProperty("no-undeploy");
- if (noUndeploy != null || !isDeployed(jarName)) {
- return;
- }
-
- String filename = getDeployFilename(jarName);
- System.out.print("Undeploying: "+ jarName + "...");
- new org.jboss.jmx.client.Deployer().undeploy(filename);
- setDeployed(jarName, false);
- System.out.println("Done");
- }
-
- /**
- * A psuedo test case, which provides hooks to deploy.
- */
- public static class Deployer
- extends TestCase
- {
- String jarName;
-
- public Deployer(final String jarName) {
- super("deploy");
- this.jarName = jarName;
- }
-
- public void deploy() throws Exception {
- Deploy.deploy(this.jarName);
- }
- }
+ /**
+ * Deploy the security ejb jar one time.
+ */
+ public static void deploy(final String jarName) throws Exception
+ {
+ String noDeploy = System.getProperty("no-deploy");
+ if (noDeploy != null || isDeployed(jarName)) {
+ return;
+ }
+
+ String filename = getDeployFilename(jarName);
+ System.out.print("Deploying: "+ jarName + "...");
+ new org.jboss.jmx.client.Deployer().deploy(filename);
+ setDeployed(jarName, true);
+ System.out.println("Done");
+ }
+
+ /**
+ * Undeploy an archive from a the remote JBoss server.
+ */
+ public static void undeploy(final String jarName) throws Exception
+ {
+ String noUndeploy = System.getProperty("no-undeploy");
+ if (noUndeploy != null || !isDeployed(jarName)) {
+ return;
+ }
+
+ String filename = getDeployFilename(jarName);
+ System.out.print("Undeploying: "+ jarName + "...");
+ new org.jboss.jmx.client.Deployer().undeploy(filename);
+ setDeployed(jarName, false);
+ System.out.println("Done");
+ }
+
+ /**
+ * A psuedo test case, which provides hooks to deploy.
+ */
+ public static class Deployer
+ extends TestCase
+ {
+ String[] jarNames;
+
+ public Deployer(final String[] jarNames) {
+ super("deploy");
+ this.jarNames = jarNames;
+ }
+
+ public Deployer(final String jarName) {
+ this(new String[] { jarName });
+ }
+
+ public void deploy() throws Exception {
+ for (int i=0; i<jarNames.length; i++) {
+ Deploy.deploy(this.jarNames[i]);
+ }
+ }
+ }
- /**
- * A psuedo test case, which provides hooks to undeploy.
- */
- public static class Undeployer
- extends TestCase
- {
- String jarName;
+ /**
+ * A psuedo test case, which provides hooks to undeploy.
+ */
+ public static class Undeployer
+ extends TestCase
+ {
+ String[] jarNames;
- public Undeployer(final String jarName) {
- super("undeploy");
- this.jarName = jarName;
- }
-
- public void undeploy() throws Exception {
- Deploy.undeploy(this.jarName);
- }
- }
+ public Undeployer(final String[] jarNames) {
+ super("undeploy");
+ this.jarNames = jarNames;
+ }
+
+ public Undeployer(final String jarName) {
+ this(new String[] { jarName });
+ }
+
+ public void undeploy() throws Exception {
+ for (int i=0; i<jarNames.length; i++) {
+ Deploy.undeploy(this.jarNames[i]);
+ }
+ }
+ }
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development