[jboss-cvs] JBossAS SVN: r97667 - in projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi: bundle and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Dec 10 00:34:47 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-12-10 00:34:45 -0500 (Thu, 10 Dec 2009)
New Revision: 97667

Modified:
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTest.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java
Log:
Add installBundle to FrameworkTest

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTest.java	2009-12-10 05:26:04 UTC (rev 97666)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTest.java	2009-12-10 05:34:45 UTC (rev 97667)
@@ -21,8 +21,7 @@
 */
 package org.jboss.test.osgi;
 
-import static org.junit.Assert.assertEquals;
-
+import java.io.InputStream;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.Collection;
@@ -168,6 +167,18 @@
       return getDelegate().deployBundle(file);
    }
 
+   protected Bundle installBundle(String location) throws BundleException
+   {
+      BundleContext context = getBundleManager().getSystemContext();
+      return context.installBundle(location);
+   }
+
+   protected Bundle installBundle(String location, InputStream instream) throws BundleException
+   {
+      BundleContext context = getBundleManager().getSystemContext();
+      return context.installBundle(location, instream);
+   }
+   
    /**
     * Remove a bundle 
     * 
@@ -584,7 +595,7 @@
       assertEquals(reference, event.getServiceReference());
    }
 
-   @SuppressWarnings({"unchecked", "SynchronizationOnLocalVariableOrMethodParameter"})
+   @SuppressWarnings("rawtypes")
    private void waitForEvent(List events, int type) throws InterruptedException
    {
 	  // Timeout for event delivery: 3 sec 

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java	2009-12-10 05:26:04 UTC (rev 97666)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/bundle/BundleContextUnitTestCase.java	2009-12-10 05:34:45 UTC (rev 97667)
@@ -215,11 +215,10 @@
    public void testInstallBundle() throws Exception
    {
       OSGiTestHelper helper = new OSGiTestHelper();
-      BundleContext context = getBundleManager().getSystemContext();
       
       // Test URL location
       URL url = helper.getTestArchiveURL("bundles/jboss-osgi-common.jar");
-      Bundle bundle = context.installBundle(url.toExternalForm());
+      Bundle bundle = installBundle(url.toExternalForm());
       try
       {
          assertBundleState(Bundle.INSTALLED, bundle.getState());
@@ -233,7 +232,7 @@
       
       // Test file location
       String location = helper.getTestArchivePath("bundles/jboss-osgi-common.jar");
-      bundle = context.installBundle(location);
+      bundle = installBundle(location);
       try
       {
          assertBundleState(Bundle.INSTALLED, bundle.getState());
@@ -246,7 +245,7 @@
       }
       
       // Test symbolic location
-      bundle = context.installBundle("/symbolic/location", url.openStream());
+      bundle = installBundle("/symbolic/location", url.openStream());
       try
       {
          assertBundleState(Bundle.INSTALLED, bundle.getState());
@@ -258,7 +257,7 @@
          assertBundleState(Bundle.UNINSTALLED, bundle.getState());
       }
    }
-   
+
    public void testServiceListener() throws Exception
    {
       Bundle bundle = addBundle("/bundles/simple/", "simple-bundle1");




More information about the jboss-cvs-commits mailing list