[jboss-cvs] JBossAS SVN: r84385 - in trunk: testsuite/src/main/org/jboss/test/deployers/spaces/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Feb 18 09:51:01 EST 2009
Author: adrian at jboss.org
Date: 2009-02-18 09:51:01 -0500 (Wed, 18 Feb 2009)
New Revision: 84385
Modified:
trunk/system-jmx/src/main/org/jboss/deployment/MainDeployer.java
trunk/system-jmx/src/main/org/jboss/deployment/MainDeployerMBean.java
trunk/testsuite/src/main/org/jboss/test/deployers/spaces/test/SpacesUnitTestCase.java
Log:
[JBAS-6521] - Temporary hack for testing to reproduce JBAS-6518
Modified: trunk/system-jmx/src/main/org/jboss/deployment/MainDeployer.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/deployment/MainDeployer.java 2009-02-18 14:47:14 UTC (rev 84384)
+++ trunk/system-jmx/src/main/org/jboss/deployment/MainDeployer.java 2009-02-18 14:51:01 UTC (rev 84385)
@@ -567,4 +567,14 @@
throw new DeploymentException("Deployments are incomplete", e);
}
}
+
+ public void deploy(Deployment deployment) throws org.jboss.deployers.spi.DeploymentException
+ {
+ delegate.deploy(deployment);
+ }
+
+ public void undeploy(Deployment deployment) throws org.jboss.deployers.spi.DeploymentException
+ {
+ delegate.undeploy(deployment);
+ }
}
Modified: trunk/system-jmx/src/main/org/jboss/deployment/MainDeployerMBean.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/deployment/MainDeployerMBean.java 2009-02-18 14:47:14 UTC (rev 84384)
+++ trunk/system-jmx/src/main/org/jboss/deployment/MainDeployerMBean.java 2009-02-18 14:51:01 UTC (rev 84385)
@@ -24,7 +24,7 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Collection;
+
import javax.management.ObjectName;
import org.jboss.deployers.client.spi.DeployerClient;
@@ -178,4 +178,21 @@
*/
void checkIncompleteDeployments() throws DeploymentException;
+ /**
+ * Deploy a deployment
+ *
+ * @param deployment the deployment
+ * @deprecated this is for testing, it should really be handled by the deployment manager
+ * @throws org.jboss.deployers.spi.DeploymentException for any error
+ */
+ void deploy(Deployment deployment) throws org.jboss.deployers.spi.DeploymentException;
+
+ /**
+ * Undeploy a deployment
+ *
+ * @param deployment the deployment
+ * @deprecated this is for testing, it should really be handled by the deployment manager
+ * @throws org.jboss.deployers.spi.DeploymentException for any error
+ */
+ void undeploy(Deployment deployment) throws org.jboss.deployers.spi.DeploymentException;
}
Modified: trunk/testsuite/src/main/org/jboss/test/deployers/spaces/test/SpacesUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/spaces/test/SpacesUnitTestCase.java 2009-02-18 14:47:14 UTC (rev 84384)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/spaces/test/SpacesUnitTestCase.java 2009-02-18 14:51:01 UTC (rev 84385)
@@ -21,11 +21,14 @@
*/
package org.jboss.test.deployers.spaces.test;
-import java.util.HashSet;
+import java.io.File;
+import java.net.URI;
-import junit.framework.Test;
-import org.jboss.test.deployers.AbstractDeploymentTest;
-import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.test.deployers.OldAbstractDeploymentTest;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
/**
* A test that deploys everything in an EAR.
@@ -33,28 +36,30 @@
* @author <a href="adrian at jboss.com">Adrian Brock</a>
* @version $Revision: 81036 $
*/
-public class SpacesUnitTestCase extends AbstractDeploymentTest
+public class SpacesUnitTestCase extends OldAbstractDeploymentTest
{
-
public void testEARDeployment() throws Exception
{
- final HashSet expected = new HashSet();
- expected.add("spaces.ear");
- expected.add("spaces-ejb.jar");
+ // Fixup the uri and get a root context with spaces
+ String deployDir = System.getProperty("jbosstest.deploy.dir");
+ File file = new File(deployDir);
+ file = new File(file, "dir with spaces");
+ URI contextName = file.toURI();
+ VFS vfs = VFS.getVFS(contextName);
- ManagedDeployment topInfo = assertDeployed("spaces.ear");
- CheckExpectedDeploymentInfoVisitor visitor = new AbstractDeploymentTest.CheckExpectedDeploymentInfoVisitor(expected);
- visitor.start(topInfo);
- assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
+ // Create the deployment
+ VirtualFile vf = vfs.getChild("spaces.ear");
+ assertNotNull(vf);
+ Deployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(vf);
+
+ // Make sure we can deploy/undeploy it
+ invoke(getDeployerName(), "deploy", new Object[]{ deployment }, new String[] { Deployment.class.getName() });
+ invoke(getDeployerName(), "checkIncompleteDeployments", null, null);
+ invoke(getDeployerName(), "undeploy", new Object[]{ deployment }, new String[] { Deployment.class.getName() });
}
public SpacesUnitTestCase(String test)
{
super(test);
}
-
- public static Test suite() throws Exception
- {
- return getManagedDeployment(SpacesUnitTestCase.class, "dir with spaces/spaces.ear");
- }
}
More information about the jboss-cvs-commits
mailing list