[jboss-osgi-commits] JBoss-OSGI SVN: r93346 - in projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi: jbosgi37 and 5 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Thu Sep 10 05:44:09 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-09-10 05:44:08 -0400 (Thu, 10 Sep 2009)
New Revision: 93346

Modified:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
Log:
Fix functional tests

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java	2009-09-10 08:55:40 UTC (rev 93345)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java	2009-09-10 09:44:08 UTC (rev 93346)
@@ -60,6 +60,10 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         runtime.installBundle("bundles/org.apache.felix.log.jar").start();
+         runtime.installBundle("bundles/jboss-osgi-common.jar").start();
+         
          OSGiBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
          assertNull("Test bundle null", bundle);
          
@@ -89,6 +93,10 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         runtime.installBundle("bundles/org.apache.felix.log.jar").start();
+         runtime.installBundle("bundles/jboss-osgi-common.jar").start();
+         
          OSGiBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
          assertNull("Test bundle null", bundle);
          
@@ -109,6 +117,10 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         runtime.installBundle("bundles/org.apache.felix.log.jar").start();
+         runtime.installBundle("bundles/jboss-osgi-common.jar").start();
+         
          OSGiBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
          assertNull("Test bundle null", bundle);
          
@@ -129,6 +141,10 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         runtime.installBundle("bundles/org.apache.felix.log.jar").start();
+         runtime.installBundle("bundles/jboss-osgi-common.jar").start();
+         
          OSGiBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
          assertNull("Test bundle null", bundle);
          
@@ -149,6 +165,10 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         runtime.installBundle("bundles/org.apache.felix.log.jar").start();
+         runtime.installBundle("bundles/jboss-osgi-common.jar").start();
+         
          OSGiBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
          assertNull("Test bundle null", bundle);
          

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java	2009-09-10 08:55:40 UTC (rev 93345)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java	2009-09-10 09:44:08 UTC (rev 93346)
@@ -50,6 +50,8 @@
       OSGiRuntime runtime = getDefaultRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         
          OSGiBundle bundleA = runtime.installBundle("jbosgi37-bundleA.jar");
          bundleA.start();
          

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java	2009-09-10 08:55:40 UTC (rev 93345)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java	2009-09-10 09:44:08 UTC (rev 93346)
@@ -23,23 +23,16 @@
 
 //$Id: ServiceA.java 87351 2009-04-15 14:25:32Z thomas.diesler at jboss.com $
 
-import org.jboss.osgi.common.log.LogServiceTracker;
 import org.jboss.test.osgi.jbosgi37.subA.PojoA;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
 
 /**
  * ServiceA has a dependecy on PojoA
  */
 public class ServiceA
 {
-   private LogService log;
-   
    ServiceA(BundleContext context)
    {
-      log = new LogServiceTracker(context);
-      
-      PojoA pojo = new PojoA(context.getBundle().getSymbolicName());
-      log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
+      new PojoA(context.getBundle().getSymbolicName());
    }
 }

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java	2009-09-10 08:55:40 UTC (rev 93345)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java	2009-09-10 09:44:08 UTC (rev 93346)
@@ -23,23 +23,16 @@
 
 //$Id: ServiceB.java 87351 2009-04-15 14:25:32Z thomas.diesler at jboss.com $
 
-import org.jboss.osgi.common.log.LogServiceTracker;
 import org.jboss.test.osgi.jbosgi37.subB.PojoB;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
 
 /**
  * ServiceB has a dependecy on PojoB
  */
 public class ServiceB
 {
-   private LogService log;
-   
    ServiceB(BundleContext context)
    {
-      log = new LogServiceTracker(context);
-      
-      PojoB pojo = new PojoB(context.getBundle().getSymbolicName());
-      log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
+      new PojoB(context.getBundle().getSymbolicName());
    }
 }

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java	2009-09-10 08:55:40 UTC (rev 93345)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java	2009-09-10 09:44:08 UTC (rev 93346)
@@ -58,6 +58,8 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         
          OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
          assertTrue("Bundle installed", bundleX.getState() <= Bundle.RESOLVED);
 
@@ -81,6 +83,8 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         
          OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
          assertTrue("Bundle installed", bundleX.getState() <= Bundle.RESOLVED);
 
@@ -108,6 +112,8 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         
          OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
          assertTrue("Bundle installed", bundleX.getState() <= Bundle.RESOLVED);
 
@@ -139,6 +145,8 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         
          OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
          assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
 
@@ -176,6 +184,8 @@
       OSGiRuntime runtime = getEmbeddedRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         
          OSGiBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
          assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
 

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java	2009-09-10 08:55:40 UTC (rev 93345)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java	2009-09-10 09:44:08 UTC (rev 93346)
@@ -45,6 +45,8 @@
       OSGiRuntime runtime = getDefaultRuntime();
       try
       {
+         runtime.installBundle("bundles/org.osgi.compendium.jar");
+         
          OSGiBundle bundle = runtime.installBundle("service/startlevel.jar");
          bundle.start();
          

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java	2009-09-10 08:55:40 UTC (rev 93345)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java	2009-09-10 09:44:08 UTC (rev 93346)
@@ -23,10 +23,8 @@
 
 //$Id: ServiceActivator.java 87336 2009-04-15 11:31:26Z thomas.diesler at jboss.com $
 
-import org.jboss.osgi.common.log.LogServiceTracker;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
 import org.osgi.service.startlevel.StartLevel;
 import org.osgi.util.tracker.ServiceTracker;
 
@@ -40,17 +38,14 @@
 {
    public void start(BundleContext context)
    {
-      LogService log = new LogServiceTracker(context);
-      
       ServiceTracker tracker = new ServiceTracker(context, StartLevel.class.getName(), null);
       tracker.open();
       
       StartLevel service = (StartLevel)tracker.getService();
       if (service == null)
-         log.log(LogService.LOG_ERROR, "Cannot get StartLevel. Loaded with: " + StartLevel.class.getClassLoader());
+         throw new IllegalStateException("Cannot obtain StartLevel");
       
-      int level = service.getStartLevel();
-      log.log(LogService.LOG_INFO, "StartLevel: " + level);
+      service.getStartLevel();
    }
 
    /*



More information about the jboss-osgi-commits mailing list