User: starksm Date: 01/07/14 14:27:37 Modified: src/main/org/jboss/test/util Tag: Branch_2_4 Deploy.java Added: src/main/org/jboss/test/util Tag: Branch_2_4 AppCallbackHandler.java Log: Merge changes from main Revision Changes Path No revision No revision 1.1.2.2 +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.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- Deploy.java 2001/07/09 01:06:06 1.1.2.1 +++ Deploy.java 2001/07/14 21:27:37 1.1.2.2 @@ -17,107 +17,119 @@ * * @author [EMAIL PROTECTED] * @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a> - * @version $Revision: 1.1.2.1 $ + * @version $Revision: 1.1.2.2 $ */ 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]); + } + } + } } No revision No revision 1.1.2.1 +0 -0 jbosstest/src/main/org/jboss/test/util/AppCallbackHandler.java Index: AppCallbackHandler.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/util/AppCallbackHandler.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- AppCallbackHandler.java 2001/07/14 16:02:43 1.1 +++ AppCallbackHandler.java 2001/07/14 21:27:37 1.1.2.1 @@ -10,7 +10,7 @@ /** @author [EMAIL PROTECTED] -@version $Revision: 1.1 $ +@version $Revision: 1.1.2.1 $ */ public class AppCallbackHandler implements CallbackHandler { _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development