[jboss-cvs] JBossAS SVN: r93649 - projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 17 10:50:56 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-09-17 10:50:55 -0400 (Thu, 17 Sep 2009)
New Revision: 93649

Modified:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
Log:
Remove Before/AfterClass

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java	2009-09-17 14:43:57 UTC (rev 93648)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java	2009-09-17 14:50:55 UTC (rev 93649)
@@ -28,11 +28,8 @@
 import org.jboss.osgi.spi.testing.OSGiBundle;
 import org.jboss.osgi.spi.testing.OSGiRuntime;
 import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
 
 /**
  * [JBOSGI-99] No explicit control over bundle.start()
@@ -44,30 +41,23 @@
  */
 public class OSGI99TestCase
 {
-   private static OSGiRuntime runtime;
-
-   @BeforeClass
-   public static void beforeClass() throws BundleException
-   {
-      runtime = new OSGiTestHelper().getDefaultRuntime();
-   }
-
-   @AfterClass
-   public static void afterClass() throws BundleException
-   {
-      if (runtime != null)
-         runtime.shutdown();
-   }
-
    @Test
    public void testInstallOnly() throws Exception
    {
-      OSGiBundle bundleA = runtime.installBundle("jbosgi99-bundleA.jar");
-      assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+      OSGiRuntime runtime = new OSGiTestHelper().getDefaultRuntime();
+      try
+      {
+         OSGiBundle bundleA = runtime.installBundle("jbosgi99-bundleA.jar");
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
 
-      bundleA.start();
-      assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-      
-      bundleA.uninstall();
+         bundleA.start();
+         assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+         
+         bundleA.uninstall();
+      }
+      finally
+      {
+         runtime.shutdown();
+      }
    }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list