[jboss-cvs] JBossAS SVN: r87739 - projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 23 17:17:56 EDT 2009


Author: alesj
Date: 2009-04-23 17:17:56 -0400 (Thu, 23 Apr 2009)
New Revision: 87739

Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java
Log:
Fix the test.

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java	2009-04-23 21:15:34 UTC (rev 87738)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/redeploy/test/VFSRedeployTestCase.java	2009-04-23 21:17:56 UTC (rev 87739)
@@ -24,11 +24,12 @@
 import java.lang.reflect.Method;
 
 import junit.framework.Test;
-import org.jboss.deployers.client.spi.DeployerClient;
 import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.DeploymentState;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.deployers.client.spi.DeployerClient;
 import org.jboss.test.deployers.BaseDeployersVFSTest;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
@@ -117,8 +118,14 @@
       addStructureDeployer(main, new JARStructure());
 
       VFSDeployment context = createDeployment("/bean", "/toplevel/test.jar");
-      addDeployment(main, context);
-      assertUndeploy(main, context);
+      try
+      {
+         assertAddDeployment(main, context);
+      }
+      finally
+      {
+         assertUndeploy(main, context);
+      }
    }
 
    public void testRedeploy() throws Exception
@@ -127,8 +134,20 @@
       addStructureDeployer(main, new JARStructure());
 
       VFSDeployment context = createDeployment("/bean", "/toplevel/test.jar");
+      try
+      {
+         assertAddDeployment(main, context);
+         assertAddDeployment(main, context);
+      }
+      finally
+      {
+         assertUndeploy(main, context);
+      }
+   }
+
+   protected void assertAddDeployment(DeployerClient main, VFSDeployment context) throws Exception
+   {
       addDeployment(main, context);
-      addDeployment(main, context);
-      assertUndeploy(main, context);
+      assertEquals("Should be Deployed " + context, DeploymentState.DEPLOYED, main.getDeploymentState(context.getName()));
    }
 }




More information about the jboss-cvs-commits mailing list