[jboss-cvs] JBossAS SVN: r70309 - in projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test: bundle/helper and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 3 06:27:12 EST 2008


Author: adrian at jboss.org
Date: 2008-03-03 06:27:12 -0500 (Mon, 03 Mar 2008)
New Revision: 70309

Modified:
   projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/OSGiTestCase.java
   projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/AbstractBundleEntryTestCase.java
   projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/BundleEntryHelperTestCase.java
Log:
No need to reboot the server for every test, just deploy/undeploy the test deployment

Modified: projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/OSGiTestCase.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/OSGiTestCase.java	2008-03-03 10:51:43 UTC (rev 70308)
+++ projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/OSGiTestCase.java	2008-03-03 11:27:12 UTC (rev 70309)
@@ -145,6 +145,17 @@
    }
 
    /**
+    * Remove a deployment
+    * 
+    * @param unit the deployment unit
+    * @throws Exception for any error
+    */
+   protected void removeDeployment(DeploymentUnit unit) throws Exception
+   {
+      getDeployerClient().undeploy(unit.getName());
+   }
+   
+   /**
     * Get MainDeployerStructure from Delegate
     * 
     * @return MainDeployerStructure

Modified: projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/AbstractBundleEntryTestCase.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/AbstractBundleEntryTestCase.java	2008-03-03 10:51:43 UTC (rev 70308)
+++ projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/AbstractBundleEntryTestCase.java	2008-03-03 11:27:12 UTC (rev 70309)
@@ -25,10 +25,6 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 import org.jboss.test.OSGiTestCase;
 import org.jboss.virtual.VirtualFile;
 
@@ -51,11 +47,6 @@
       super(name);
    }
 
-   public static Test suite(Class<? extends TestCase> clazz)
-   {
-      return new TestSuite(clazz);
-   }
-
    /**
     * Assert a returned entry is the expected virtual file based on the root VirtualFile and path
     * 

Modified: projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/BundleEntryHelperTestCase.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/BundleEntryHelperTestCase.java	2008-03-03 10:51:43 UTC (rev 70308)
+++ projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/helper/BundleEntryHelperTestCase.java	2008-03-03 11:27:12 UTC (rev 70309)
@@ -73,6 +73,27 @@
       root = VFSDeploymentUnit.class.cast(deploymentUnit).getRoot();
    }
 
+   protected void tearDown() throws Exception
+   {
+      if (deploymentUnit != null)
+      {
+         try
+         {
+            removeDeployment(deploymentUnit);
+         }
+         catch (Exception ignored)
+         {
+            getLog().warn("Ignored undeployment error", ignored);
+         }
+         finally
+         {
+            deploymentUnit = null;
+            root = null;
+         }
+      }
+      super.tearDown();
+   }
+
    /**
     * Test findEntryMethod
     * 




More information about the jboss-cvs-commits mailing list