[jboss-cvs] JBossAS SVN: r88261 - in projects/jboss-osgi/trunk: bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap and 20 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 6 09:23:24 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-05-06 09:23:23 -0400 (Wed, 06 May 2009)
New Revision: 88261

Added:
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JMXCapability.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JNDICapability.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/MicrocontainerCapability.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerTestCase.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/old-basic-felix-framework.properties
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/Capability.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedFrameworkWrapper.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiFrameworkWrapper.java
Removed:
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/BlueprintTest.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java
Modified:
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/SystemBundleTestCase.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/JMXTestCase.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jndi/JNDITestCase.java
   projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
   projects/jboss-osgi/trunk/bundle/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
   projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java
   projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java
   projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
   projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
   projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/java/org/jboss/osgi/knopflerfish/KnopflerfishIntegration.java
   projects/jboss-osgi/trunk/runtime/knopflerfish/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.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/jbosgi38/OSGI38TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/FELIX1040TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
Log:
Abstract bundle deployment to Capabilities - WIP

Deleted: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/BlueprintTest.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/BlueprintTest.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/BlueprintTest.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint;
-
-//$Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.osgi.spi.junit.OSGiTest;
-
-/**
- * The base class for Blueprint Service tests
- * 
- * @author thomas.diesler at jboss.com
- * @since 24-Apr-2009
- */
-public abstract class BlueprintTest extends OSGiTest
-{
-   @SuppressWarnings("unchecked")
-   protected MBeanServer getMBeanServer()
-   {
-      ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
-      if (serverArr.size() > 1)
-         throw new IllegalStateException("Multiple MBeanServer instances not supported");
-
-      MBeanServer server = null;
-      if (serverArr.size() == 1)
-         server = serverArr.get(0);
-
-      if (server == null)
-         server = MBeanServerFactory.createMBeanServer();
-
-      return server;
-   }
-}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JMXCapability.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JMXCapability.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JMXCapability.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.blueprint;
+
+import java.util.Properties;
+
+import org.jboss.osgi.spi.junit.Capability;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+//$Id$
+
+/**
+ * [TODO]
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class JMXCapability extends Capability
+{
+   public JMXCapability()
+   {
+      Properties props = new Properties();
+      props.setProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
+      props.setProperty("org.jboss.osgi.jmx.rmi.port", "1198");
+      setProperties(props);
+   }
+
+   public void deploy(BundleContext context) throws BundleException
+   {
+      super.deploy(context);
+      deploy(context, "bundles/jboss-osgi-jmx.jar", true);
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JMXCapability.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JNDICapability.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JNDICapability.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JNDICapability.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.blueprint;
+
+import java.util.Properties;
+
+import org.jboss.osgi.spi.junit.Capability;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+//$Id$
+
+/**
+ * [TODO]
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class JNDICapability extends Capability
+{
+   public JNDICapability()
+   {
+      Properties props = new Properties();
+      props.setProperty("org.jboss.osgi.jndi.host", System.getProperty("jboss.bind.address", "localhost"));
+      props.setProperty("org.jboss.osgi.jndi.rmi.port", "1198");
+      props.setProperty("org.jboss.osgi.jndi.port", "1199");
+      setProperties(props);
+   }
+
+   public void deploy(BundleContext context) throws BundleException
+   {
+      super.deploy(context);
+      deploy(context, "bundles/jboss-common-core-bundle.jar", true);
+      deploy(context, "bundles/jboss-osgi-jndi.jar", true);
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/JNDICapability.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/MicrocontainerCapability.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/MicrocontainerCapability.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/MicrocontainerCapability.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.blueprint;
+
+import java.util.Properties;
+
+import org.jboss.osgi.spi.junit.Capability;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+//$Id$
+
+/**
+ * [TODO]
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class MicrocontainerCapability extends Capability
+{
+   public MicrocontainerCapability()
+   {
+      Properties props = new Properties();
+      setProperties(props);
+   }
+
+   public void deploy(BundleContext context) throws BundleException
+   {
+      super.deploy(context);
+      deploy(context, "bundles/apache-xerces-bundle.jar", true);
+      deploy(context, "bundles/jaxb-bundle.jar", true);
+      deploy(context, "bundles/jbossxb-bundle.jar", true);
+      deploy(context, "bundles/jboss-osgi-microcontainer.jar", true);
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/MicrocontainerCapability.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -43,12 +43,10 @@
    public void testApacheXercesBundle() throws BundleException
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
-      configProvider.configure("basic-felix-framework.properties");
-      
       OSGiFramework framework = configProvider.getFramework();
       try
       {
-         BundleContext context = framework.getSystemBundleContext();
+         BundleContext context = framework.getBundleContext();
          
          Bundle bundle = installBundle(context, "bundles/apache-xerces-bundle.jar", true);
          
@@ -63,12 +61,10 @@
    public void testJAXBBundle() throws BundleException
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
-      configProvider.configure("basic-felix-framework.properties");
-      
       OSGiFramework framework = configProvider.getFramework();
       try
       {
-         BundleContext context = framework.getSystemBundleContext();
+         BundleContext context = framework.getBundleContext();
          
          Bundle bundle = installBundle(context, "bundles/jaxb-bundle.jar", true);
          
@@ -83,12 +79,10 @@
    public void testJBossCommonCoreBundle() throws BundleException
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
-      configProvider.configure("basic-felix-framework.properties");
-      
       OSGiFramework framework = configProvider.getFramework();
       try
       {
-         BundleContext context = framework.getSystemBundleContext();
+         BundleContext context = framework.getBundleContext();
          
          Bundle bundle = installBundle(context, "bundles/apache-xerces-bundle.jar", true);
          bundle = installBundle(context, "bundles/jboss-common-core-bundle.jar", true);
@@ -104,12 +98,10 @@
    public void testJBossXBBundle() throws BundleException
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
-      configProvider.configure("basic-felix-framework.properties");
-      
       OSGiFramework framework = configProvider.getFramework();
       try
       {
-         BundleContext context = framework.getSystemBundleContext();
+         BundleContext context = framework.getBundleContext();
          
          Bundle bundle = installBundle(context, "bundles/apache-xerces-bundle.jar", true);
          bundle = installBundle(context, "bundles/jboss-common-core-bundle.jar", true);
@@ -127,12 +119,10 @@
    public void testJNDIBundle() throws BundleException
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
-      configProvider.configure("basic-felix-framework.properties");
-      
       OSGiFramework framework = configProvider.getFramework();
       try
       {
-         BundleContext context = framework.getSystemBundleContext();
+         BundleContext context = framework.getBundleContext();
          
          Bundle bundle = installBundle(context, "bundles/jboss-common-core-bundle.jar", true);
          bundle = installBundle(context, "bundles/jboss-osgi-jndi.jar", true);
@@ -148,12 +138,10 @@
    public void testJMXBundle() throws Exception
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
-      configProvider.configure("basic-felix-framework.properties");
-      
       OSGiFramework framework = configProvider.getFramework();
       try
       {
-         BundleContext context = framework.getSystemBundleContext();
+         BundleContext context = framework.getBundleContext();
          
          Bundle bundle = installBundle(context, "bundles/jboss-common-core-bundle.jar", true);
          bundle = installBundle(context, "bundles/jboss-osgi-jndi.jar", true);

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/SystemBundleTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/SystemBundleTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -44,7 +44,7 @@
       OSGiFramework framework = configProvider.getFramework();
       try
       {
-         Bundle bundle = framework.getSystemBundle();
+         Bundle bundle = framework.getBundle();
 
          assertEquals("BundleId == 0", 0, bundle.getBundleId());
          assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/JMXTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/JMXTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -29,12 +29,13 @@
 
 import junit.framework.Test;
 
-import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiFrameworkWrapper;
+import org.jboss.osgi.spi.junit.OSGiTest;
 import org.jboss.osgi.spi.junit.OSGiTestSetup;
 import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.test.osgi.blueprint.BlueprintTest;
+import org.jboss.test.osgi.blueprint.JMXCapability;
+import org.jboss.test.osgi.blueprint.JNDICapability;
 import org.jboss.test.osgi.blueprint.jmx.bundle.FooMBean;
-import org.jboss.test.osgi.blueprint.mcservice.MicrocontainerServiceTestCase;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -43,22 +44,23 @@
  * @author thomas.diesler at jboss.com
  * @since 12-Feb-2009
  */
-public class JMXTestCase extends BlueprintTest
+public class JMXTestCase extends OSGiTest
 {
-   private static OSGiFramework framework;
+   private static OSGiFrameworkWrapper framework;
 
    public static Test suite()
    {
-      OSGiTestSetup setup = new OSGiTestSetup(MicrocontainerServiceTestCase.class)
+      OSGiTestSetup setup = new OSGiTestSetup(JMXTestCase.class)
       {
          @Override
          protected void setUp() throws Exception
          {
             super.setUp();
-            framework = getBootstrapProvider().getFramework();
-            framework.start();
+            framework = wrapFramework(getBootstrapProvider().getFramework());
+            framework.addCapability(new JNDICapability());
+            framework.addCapability(new JMXCapability());
 
-            BundleContext sysContext = framework.getSystemBundleContext();
+            BundleContext sysContext = framework.getBundleContext();
             installBundle(sysContext, "jmx-test.jar", true);
          }
 

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jndi/JNDITestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jndi/JNDITestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jndi/JNDITestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -26,8 +26,12 @@
 import javax.naming.InitialContext;
 import javax.naming.NameNotFoundException;
 
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.test.osgi.blueprint.BlueprintTest;
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.OSGiFrameworkWrapper;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.jboss.osgi.spi.junit.OSGiTestSetup;
+import org.jboss.test.osgi.blueprint.JNDICapability;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 
@@ -37,38 +41,54 @@
  * @author thomas.diesler at jboss.com
  * @since 05-May-2009
  */
-public class JNDITestCase extends BlueprintTest
+public class JNDITestCase extends OSGiTest
 {
-   public void testJNDIAccess() throws Exception
+   private static OSGiFrameworkWrapper framework;
+
+   public static Test suite()
    {
-      OSGiFramework framework = getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
-      
-      try
+      OSGiTestSetup setup = new OSGiTestSetup(JNDITestCase.class)
       {
-         Bundle bundle = installBundle(sysContext, "jndi-test.jar", true);
-         assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-         
-         InitialContext iniCtx = new InitialContext();
-         String lookup = (String)iniCtx.lookup("test/Foo");
-         assertEquals("JNDI bound String expected", "Bar", lookup);
-         
-         // Uninstall should unbind the object
-         bundle.uninstall();
-         
-         try
+         @Override
+         protected void setUp() throws Exception
          {
-            iniCtx.lookup("test/Foo");
-            fail("NameNotFoundException expected");
+            super.setUp();
+            framework = wrapFramework(getBootstrapProvider().getFramework());
+            framework.addCapability(new JNDICapability());
          }
-         catch (NameNotFoundException ex) 
+
+         @Override
+         protected void tearDown() throws Exception
          {
-            // expected
+            framework.stop();
+            super.tearDown();
          }
+      };
+      return setup;
+   }
+
+   public void testJNDIAccess() throws Exception
+   {
+      BundleContext sysContext = framework.getBundleContext();
+
+      Bundle bundle = installBundle(sysContext, "jndi-test.jar", true);
+      assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+
+      InitialContext iniCtx = new InitialContext();
+      String lookup = (String)iniCtx.lookup("test/Foo");
+      assertEquals("JNDI bound String expected", "Bar", lookup);
+
+      // Uninstall should unbind the object
+      bundle.uninstall();
+
+      try
+      {
+         iniCtx.lookup("test/Foo");
+         fail("NameNotFoundException expected");
       }
-      finally
+      catch (NameNotFoundException ex)
       {
-         framework.stop();
+         // expected
       }
    }
 }
\ No newline at end of file

Deleted: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.blueprint.mcservice;
-
-//$Id$
-
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MAIN_DEPLOYER;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
-import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
-
-import java.util.List;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import junit.framework.Test;
-
-import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.junit.OSGiTestSetup;
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.test.osgi.blueprint.BlueprintTest;
-
-/**
- * A test that checks whether the MicrocontainerService can be accessed
- * 
- * @author thomas.diesler at jboss.com
- * @since 12-Feb-2009
- */
-public class MicrocontainerServiceTestCase extends BlueprintTest
-{
-   private static OSGiFramework framework;
-
-   public static Test suite()
-   {
-      OSGiTestSetup setup = new OSGiTestSetup(MicrocontainerServiceTestCase.class)
-      {
-         @Override
-         protected void setUp() throws Exception
-         {
-            super.setUp();
-            framework = getBootstrapProvider().getFramework();
-            framework.start();
-         }
-
-         @Override
-         protected void tearDown() throws Exception
-         {
-            framework.stop();
-            super.tearDown();
-         }
-      };
-      return setup;
-   }
-
-   public void testServiceAccess() throws Exception
-   {
-      MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
-      List<String> registeredBeans = mcService.getRegisteredBeans();
-      assertTrue("BundleContext registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
-      assertTrue("MainDeployer registered with MC", registeredBeans.contains(BEAN_MAIN_DEPLOYER));
-      assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
-      assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
-   }
-
-   /**
-    * Test whether the bundle can be deployed through the MicrocontainerServiceMBean 
-    */
-   public void testBundleDeployment() throws Exception
-   {
-      MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
-      mcService.deploy(getTestArchiveURL("mcservice-bundleA.jar"));
-      
-      ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
-      Set<ObjectName> bundles = frameworkMBean.getBundles();
-      assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=mcservice-bundleA") > 0);
-
-      mcService.undeploy(getTestArchiveURL("mcservice-bundleA.jar"));
-}
-
-   public void testBeansDeployment() throws Exception
-   {
-      MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
-      mcService.deploy(getTestArchiveURL("mcservice-bundleB.jar"));
-
-      ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
-      Set<ObjectName> bundles = frameworkMBean.getBundles();
-      assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=mcservice-bundleB") > 0);
-
-      // Check whether the bean is registered
-      List<String> registeredBeans = mcService.getRegisteredBeans();
-      assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
-      
-      mcService.undeploy(getTestArchiveURL("mcservice-bundleB.jar"));
-
-      // Check whether the bean is unregistered
-      registeredBeans = mcService.getRegisteredBeans();
-      assertFalse("SomeBean unregistered", registeredBeans.contains("SomeBean"));
-   }
-}
\ No newline at end of file

Copied: projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerTestCase.java (from rev 88253, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerServiceTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.blueprint.mcservice;
+
+//$Id$
+
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MAIN_DEPLOYER;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.junit.OSGiFrameworkWrapper;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.jboss.osgi.spi.junit.OSGiTestSetup;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.test.osgi.blueprint.JMXCapability;
+import org.jboss.test.osgi.blueprint.JNDICapability;
+import org.jboss.test.osgi.blueprint.MicrocontainerCapability;
+
+/**
+ * A test that checks whether the MicrocontainerService can be accessed
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class MicrocontainerTestCase extends OSGiTest
+{
+   private static OSGiFrameworkWrapper framework;
+
+   public static Test suite()
+   {
+      OSGiTestSetup setup = new OSGiTestSetup(MicrocontainerTestCase.class)
+      {
+         @Override
+         protected void setUp() throws Exception
+         {
+            super.setUp();
+            framework = wrapFramework(getBootstrapProvider().getFramework());
+            framework.addCapability(new JNDICapability());
+            //framework.addCapability(new JMXCapability());
+            //framework.addCapability(new MicrocontainerCapability());
+         }
+
+         @Override
+         protected void tearDown() throws Exception
+         {
+            framework.stop();
+            super.tearDown();
+         }
+      };
+      return setup;
+   }
+   
+   public void testFoo() throws Exception
+   {}
+
+   public void _testServiceAccess() throws Exception
+   {
+      MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
+      List<String> registeredBeans = mcService.getRegisteredBeans();
+      assertTrue("BundleContext registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
+      assertTrue("MainDeployer registered with MC", registeredBeans.contains(BEAN_MAIN_DEPLOYER));
+      assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
+      assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
+   }
+
+   /**
+    * Test whether the bundle can be deployed through the MicrocontainerServiceMBean 
+    */
+   public void _testBundleDeployment() throws Exception
+   {
+      MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
+      mcService.deploy(getTestArchiveURL("mcservice-bundleA.jar"));
+      
+      ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
+      Set<ObjectName> bundles = frameworkMBean.getBundles();
+      assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=mcservice-bundleA") > 0);
+
+      mcService.undeploy(getTestArchiveURL("mcservice-bundleA.jar"));
+}
+
+   public void _testBeansDeployment() throws Exception
+   {
+      MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, getMBeanServer());
+      mcService.deploy(getTestArchiveURL("mcservice-bundleB.jar"));
+
+      ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
+      Set<ObjectName> bundles = frameworkMBean.getBundles();
+      assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=mcservice-bundleB") > 0);
+
+      // Check whether the bean is registered
+      List<String> registeredBeans = mcService.getRegisteredBeans();
+      assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
+      
+      mcService.undeploy(getTestArchiveURL("mcservice-bundleB.jar"));
+
+      // Check whether the bean is unregistered
+      registeredBeans = mcService.getRegisteredBeans();
+      assertFalse("SomeBean unregistered", registeredBeans.contains("SomeBean"));
+   }
+}
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jboss-osgi-framework.properties	2009-05-06 13:23:23 UTC (rev 88261)
@@ -20,15 +20,6 @@
   	org.jboss.net.protocol, \
   	org.jboss.virtual.protocol
 
-# JMX bundle properties  	
-org.jboss.osgi.jmx.host=@jboss.bind.address@
-org.jboss.osgi.jmx.rmi.port=1198
-
-# JNDI bundle properties  	
-org.jboss.osgi.jndi.host=@jboss.bind.address@
-org.jboss.osgi.jndi.rmi.port=1198
-org.jboss.osgi.jndi.port=1199
-
 # Bundles that need to be installed with the Framework automatically 
 org.jboss.osgi.spi.framework.autoInstall=\
 	file://${test.archive.directory}/bundles/org.osgi.compendium.jar
@@ -36,13 +27,5 @@
 # Bundles that need to be started automatically 
 org.jboss.osgi.spi.framework.autoStart=\
 	file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
-	file://${test.archive.directory}/bundles/apache-xerces-bundle.jar \
-	file://${test.archive.directory}/bundles/jboss-common-core-bundle.jar \
-	file://${test.archive.directory}/bundles/jaxb-bundle.jar \
-	file://${test.archive.directory}/bundles/jbossxb-bundle.jar \
 	file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
-	file://${test.archive.directory}/bundles/jboss-osgi-logging.jar \
-	file://${test.archive.directory}/bundles/jboss-osgi-jndi.jar \
-	file://${test.archive.directory}/bundles/jboss-osgi-jmx.jar \
-	file://${test.archive.directory}/bundles/jboss-osgi-microcontainer.jar
-	
\ No newline at end of file
+	file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
\ No newline at end of file

Added: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/old-basic-felix-framework.properties
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/old-basic-felix-framework.properties	                        (rev 0)
+++ projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/old-basic-felix-framework.properties	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,33 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+# 
+# $Id$
+#
+
+# The OSGiFramework implementation 
+org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
+
+# Properties to configure the Framework
+org.osgi.framework.storage.clean=onFirstInit
+org.osgi.framework.system.packages.extra=\
+	org.jboss.logging
+
+# JMX bundle properties  	
+org.jboss.osgi.jmx.host=@jboss.bind.address@
+org.jboss.osgi.jmx.rmi.port=1198
+
+# JNDI bundle properties  	
+org.jboss.osgi.jndi.host=@jboss.bind.address@
+org.jboss.osgi.jndi.rmi.port=1198
+org.jboss.osgi.jndi.port=1199
+
+# Bundles that need to be installed with the Framework automatically 
+org.jboss.osgi.spi.framework.autoInstall=\
+	file://${test.archive.directory}/bundles/org.osgi.compendium.jar
+
+# Bundles that need to be started automatically 
+org.jboss.osgi.spi.framework.autoStart=\
+	file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
+	file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
+	file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
+	
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/old-basic-felix-framework.properties
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: projects/jboss-osgi/trunk/bundle/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/bundle/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -80,10 +80,12 @@
          
          namingMain.setRmiBindAddress(jndiHost);
          namingMain.setRmiPort(jndiRmiPort);
+         
+         log.log(LogService.LOG_DEBUG, "Naming server created");
       }
       catch (IOException ex)
       {
-         log.log(LogService.LOG_ERROR, "Cannot create JMXConnectorServer", ex);
+         log.log(LogService.LOG_ERROR, "Cannot create Naming server", ex);
       }
    }
 
@@ -95,11 +97,11 @@
       try
       {
          namingMain.start();
-         log.log(LogService.LOG_DEBUG, "JNDI server started");
+         log.log(LogService.LOG_DEBUG, "Naming server started");
       }
       catch (Exception ex)
       {
-         log.log(LogService.LOG_ERROR, "Cannot start JNDI server", ex);
+         log.log(LogService.LOG_ERROR, "Cannot start Naming server", ex);
       }
    }
 
@@ -108,7 +110,7 @@
       if (namingMain != null)
       {
          namingMain.stop();
-         log.log(LogService.LOG_DEBUG, "JMXConnector stopped");
+         log.log(LogService.LOG_DEBUG, "Naming server stopped");
       }
    }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/java/org/jboss/osgi/equinox/framework/EquinoxIntegration.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -87,14 +87,14 @@
       this.autoStart = autoStart;
    }
 
-   public Bundle getSystemBundle()
+   public Bundle getBundle()
    {
       return framework.getBundle(0);
    }
 
-   public BundleContext getSystemBundleContext()
+   public BundleContext getBundleContext()
    {
-      return getSystemBundle().getBundleContext();
+      return getBundle().getBundleContext();
    }
 
    public void create()
@@ -130,7 +130,7 @@
    public void start()
    {
       // Get system bundle context
-      BundleContext context = getSystemBundleContext();
+      BundleContext context = getBundleContext();
       if (context == null)
          throw new FrameworkException("Cannot obtain system context");
 

Modified: projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/test/java/org/jboss/test/osgi/equinox/SystemBundleTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -44,7 +44,7 @@
       framework.create();
       framework.start();
       
-      Bundle bundle = framework.getSystemBundle();
+      Bundle bundle = framework.getBundle();
 
       assertEquals("BundleId == 0", 0, bundle.getBundleId());
       assertEquals("SymbolicName", "org.eclipse.osgi", bundle.getSymbolicName());
@@ -54,7 +54,7 @@
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
       OSGiFramework framework = configProvider.getFramework();
-      Bundle bundle = framework.getSystemBundle();
+      Bundle bundle = framework.getBundle();
 
       assertEquals("BundleId == 0", 0, bundle.getBundleId());
       assertEquals("SymbolicName", "org.eclipse.osgi", bundle.getSymbolicName());

Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -85,16 +85,16 @@
       this.autoStart = autoStart;
    }
 
-   public Bundle getSystemBundle()
+   public Bundle getBundle()
    {
       assertFrameworkStart();
       return framework;
    }
 
-   public BundleContext getSystemBundleContext()
+   public BundleContext getBundleContext()
    {
       assertFrameworkStart();
-      return getSystemBundle().getBundleContext();
+      return getBundle().getBundleContext();
    }
 
    public void create()

Modified: projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -44,7 +44,7 @@
       framework.create();
       framework.start();
       
-      Bundle bundle = framework.getSystemBundle();
+      Bundle bundle = framework.getBundle();
 
       assertEquals("BundleId == 0", 0, bundle.getBundleId());
       assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
@@ -54,7 +54,7 @@
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
       OSGiFramework framework = configProvider.getFramework();
-      Bundle bundle = framework.getSystemBundle();
+      Bundle bundle = framework.getBundle();
 
       assertEquals("BundleId == 0", 0, bundle.getBundleId());
       assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());

Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/java/org/jboss/osgi/knopflerfish/KnopflerfishIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/java/org/jboss/osgi/knopflerfish/KnopflerfishIntegration.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/java/org/jboss/osgi/knopflerfish/KnopflerfishIntegration.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -87,14 +87,14 @@
       this.autoStart = autoStart;
    }
 
-   public Bundle getSystemBundle()
+   public Bundle getBundle()
    {
       return framework.getSystemBundleContext().getBundle();
    }
 
-   public BundleContext getSystemBundleContext()
+   public BundleContext getBundleContext()
    {
-      return getSystemBundle().getBundleContext();
+      return getBundle().getBundleContext();
    }
 
    public void create()
@@ -156,7 +156,7 @@
    public void start()
    {
       // Get system bundle context
-      BundleContext context = getSystemBundleContext();
+      BundleContext context = getBundleContext();
       if (context == null)
          throw new FrameworkException("Cannot obtain system context");
 

Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/src/test/java/org/jboss/test/osgi/knopflerfish/SystemBundleTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -44,7 +44,7 @@
       framework.create();
       framework.start();
       
-      Bundle bundle = framework.getSystemBundle();
+      Bundle bundle = framework.getBundle();
 
       assertEquals("BundleId == 0", 0, bundle.getBundleId());
       assertEquals("SymbolicName", "system.bundle", bundle.getSymbolicName());
@@ -54,7 +54,7 @@
    {
       OSGiBootstrapProvider configProvider = OSGiBootstrap.getBootstrapProvider();
       OSGiFramework framework = configProvider.getFramework();
-      Bundle bundle = framework.getSystemBundle();
+      Bundle bundle = framework.getBundle();
 
       assertEquals("BundleId == 0", 0, bundle.getBundleId());
       assertEquals("SymbolicName", "system.bundle", bundle.getSymbolicName());

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/OSGiFramework.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -84,10 +84,10 @@
    /**
     * Get the System Bundle associated with this Framework
     */
-   Bundle getSystemBundle();
+   Bundle getBundle();
 
    /**
     * Get the System Bundle Context associated with this Framework
     */
-   BundleContext getSystemBundleContext();
+   BundleContext getBundleContext();
 }
\ No newline at end of file

Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/Capability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/Capability.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/Capability.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+//$Id$
+
+/**
+ * [TODO]
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public abstract class Capability
+{
+   private OSGiFrameworkWrapper framework;
+   private Properties props;
+   private List<Bundle> bundles = new ArrayList<Bundle>();
+
+   public Capability()
+   {
+   }
+
+   public Capability(Properties props)
+   {
+      this.props = props;
+   }
+
+   public Properties getProperties()
+   {
+      return props;
+   }
+
+   public void setProperties(Properties props)
+   {
+      this.props = props;
+   }
+
+   public void setFrameworkWrapper(OSGiFrameworkWrapper framework)
+   {
+      this.framework = framework;
+   }
+   
+   protected void initProperties(BundleContext context)
+   {
+      if (props != null)
+      {
+         Enumeration<?> keys = props.propertyNames();
+         while (keys.hasMoreElements())
+         {
+            String key = (String)keys.nextElement();
+            String value = props.getProperty(key);
+            System.setProperty(key, value);
+         }
+      }
+   }
+
+   protected void deploy(BundleContext context, String bundlePath, boolean start) throws BundleException
+   {
+      addBundle(framework.installBundle(context, bundlePath, start));
+   }
+
+   protected void addBundle(Bundle bundle)
+   {
+      bundles.add(0, bundle);
+   }
+
+   public void deploy(BundleContext context) throws BundleException
+   {
+      initProperties(context);
+   }
+
+   public void undeploy(BundleContext context) throws BundleException
+   {
+      for (Bundle bundle : bundles)
+      {
+         bundle.uninstall();
+      }
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/Capability.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedFrameworkWrapper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedFrameworkWrapper.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedFrameworkWrapper.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+//$Id$
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * [TODO]
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class EmbeddedFrameworkWrapper extends OSGiFrameworkWrapper
+{
+   private OSGiTestHelper helper = new OSGiTestHelper();
+   
+   public EmbeddedFrameworkWrapper(OSGiFramework framework)
+   {
+      super(framework);
+   }
+
+   @Override
+   public Bundle installBundle(BundleContext context, String bundlePath, boolean start) throws BundleException
+   {
+      return helper.installBundle(context, bundlePath, start);
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/EmbeddedFrameworkWrapper.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -105,9 +105,9 @@
       return getDelegate().getRemoteFramework();
    }
    
-   protected MBeanServerConnection getMBeanServer()
+   protected MBeanServerConnection getMBeanServerConnection()
    {
-      return getDelegate().getMBeanServer();
+      return getDelegate().getMBeanServerConnection();
    }
 
    protected String getServerHost()

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -74,7 +74,7 @@
    {
       // Bootstrap the Framework and get the system bundle
       OSGiFramework framework = getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
       
       // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
       ServiceTracker tracker = new ServiceTracker(sysContext, RemoteLogReaderService.class.getName(), null)
@@ -140,7 +140,7 @@
          try
          {
             ObjectName oname = new ObjectName("jboss.system:type=ServerConfig");
-            jbossVersion = (String)getMBeanServer().getAttribute(oname, "SpecificationVersion");
+            jbossVersion = (String)getMBeanServerConnection().getAttribute(oname, "SpecificationVersion");
          }
          catch (Exception ex)
          {
@@ -156,7 +156,7 @@
    }
 
    @SuppressWarnings("unchecked")
-   public MBeanServerConnection getMBeanServer()
+   public MBeanServerConnection getMBeanServerConnection()
    {
       if (server == null)
       {
@@ -179,7 +179,7 @@
    {
       if (isRemoteIntegration())
       {
-         return new RemoteArchiveDeployer(getMBeanServer());
+         return new RemoteArchiveDeployer(getMBeanServerConnection());
       }
       else
       {
@@ -212,7 +212,7 @@
    public RemoteFramework getRemoteFramework() throws Exception
    {
       if (managedFramework == null)
-         managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
+         managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServerConnection());
       
       return new RemoteFramework()
       {
@@ -224,7 +224,7 @@
             
             try
             {
-               return MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
+               return MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServerConnection());
             }
             catch (MBeanProxyException ex)
             {
@@ -239,7 +239,7 @@
             {
                try
                {
-                  RemoteBundle remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
+                  RemoteBundle remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServerConnection());
                   remBundles.add(remBundle);
                }
                catch (MBeanProxyException ex)

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -78,9 +78,9 @@
       return getDelegate().isTargetJBoss50();
    }
 
-   public MBeanServerConnection getMBeanServer()
+   public MBeanServerConnection getMBeanServerConnection()
    {
-      return getDelegate().getMBeanServer();
+      return getDelegate().getMBeanServerConnection();
    }
 
    public String getServerHost()

Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiFrameworkWrapper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiFrameworkWrapper.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiFrameworkWrapper.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+//$Id$
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * [TODO]
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public abstract class OSGiFrameworkWrapper
+{
+   private OSGiFramework framework;
+   
+   public OSGiFrameworkWrapper(OSGiFramework framework)
+   {
+      this.framework = framework;
+   }
+
+   public BundleContext getBundleContext()
+   {
+      return framework.getBundleContext();
+   }
+   
+   public void addCapability(Capability cap) throws BundleException
+   {
+      cap.setFrameworkWrapper(this);
+      BundleContext context = framework.getBundleContext();
+      cap.deploy(context);
+   }
+
+   public void removeCapability(Capability cap) throws BundleException
+   {
+      BundleContext context = framework.getBundleContext();
+      cap.undeploy(context);
+   }
+
+   public abstract Bundle installBundle(BundleContext context, String bundlePath, boolean start) throws BundleException;
+   
+   public void start()
+   {
+      framework.start();
+   }
+
+   public void stop()
+   {
+      framework.stop();
+   }
+
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiFrameworkWrapper.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -25,10 +25,13 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
+import javax.management.MBeanServer;
+
 import junit.framework.TestCase;
 
 import org.jboss.logging.Logger;
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
 import org.jboss.osgi.spi.logging.LogEntryCache;
 import org.jboss.virtual.VFS;
 import org.osgi.framework.Bundle;
@@ -138,4 +141,14 @@
    {
       return delegate.installBundle(sysContext, bundlePath, start);
    }
+
+   protected MBeanServer getMBeanServer()
+   {
+      return delegate.getMBeanServer();
+   }
+
+   protected OSGiFrameworkWrapper wrapFramework(OSGiFramework framework)
+   {
+      return delegate.wrapFramework(framework);
+   }
 }

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -24,7 +24,11 @@
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.ArrayList;
 
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
 import org.jboss.osgi.spi.framework.ExportedPackageHelper;
 import org.jboss.osgi.spi.framework.OSGiBootstrap;
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
@@ -76,7 +80,7 @@
    {
       // Bootstrap the Framework and get the system bundle
       OSGiFramework framework = getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
       
       // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
       ServiceTracker tracker = new ServiceTracker(sysContext, LogReaderService.class.getName(), null)
@@ -186,4 +190,26 @@
 
       return bundle;
    }
+
+   @SuppressWarnings("unchecked")
+   public MBeanServer getMBeanServer()
+   {
+      ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
+      if (serverArr.size() > 1)
+         throw new IllegalStateException("Multiple MBeanServer instances not supported");
+   
+      MBeanServer server = null;
+      if (serverArr.size() == 1)
+         server = serverArr.get(0);
+   
+      if (server == null)
+         server = MBeanServerFactory.createMBeanServer();
+   
+      return server;
+   }
+
+   public OSGiFrameworkWrapper wrapFramework(OSGiFramework framework)
+   {
+      return new EmbeddedFrameworkWrapper(framework);
+   }
 }

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -25,11 +25,14 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
+import javax.management.MBeanServer;
+
 import junit.extensions.TestSetup;
 import junit.framework.TestSuite;
 
 import org.jboss.logging.Logger;
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
 import org.jboss.virtual.VFS;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -108,4 +111,14 @@
    {
       return delegate.installBundle(sysContext, bundlePath, start);
    }
+   
+   protected MBeanServer getMBeanServer()
+   {
+      return delegate.getMBeanServer();
+   }
+   
+   protected OSGiFrameworkWrapper wrapFramework(OSGiFramework framework)
+   {
+      return delegate.wrapFramework(framework);
+   }
 }

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -65,7 +65,7 @@
    {
       // Bootstrap the Framework and get the system bundle
       OSGiFramework framework = getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
 
       // Install and start the test bundle
       URL testURL = getTestArchiveURL("example/example-log.jar");

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -46,7 +46,7 @@
 
    public void testMBeanAccess() throws Exception
    {
-      FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBeanTestService.OBJECT_NAME, getMBeanServer());
+      FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBeanTestService.OBJECT_NAME, getMBeanServerConnection());
       assertEquals("hello", foo.echo("hello"));
    }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -44,7 +44,7 @@
       OSGiFramework framework = bootProvider.getFramework();
       assertNotNull("Framework not null", framework);
 
-      Bundle bundle = framework.getSystemBundle();
+      Bundle bundle = framework.getBundle();
 
       assertEquals("BundleId == 0", 0, bundle.getBundleId());
       assertNotNull("SymbolicName not null", bundle.getSymbolicName());

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -39,12 +39,12 @@
  */
 public class MockFramework implements OSGiFramework
 {
-   public Bundle getSystemBundle()
+   public Bundle getBundle()
    {
       return null;
    }
 
-   public BundleContext getSystemBundleContext()
+   public BundleContext getBundleContext()
    {
       return null;
    }

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -82,7 +82,7 @@
 
    private FooMBean getFooMBean() throws MBeanProxyException
    {
-      FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, getMBeanServer());
+      FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, getMBeanServerConnection());
       return foo;
    }
 }
\ No newline at end of file

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-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -49,7 +49,7 @@
       super.setUp();
       
       OSGiFramework framework = getBootstrapProvider().getFramework();
-      sysContext = framework.getSystemBundleContext();
+      sysContext = framework.getBundleContext();
    }
 
    public void testNestedBundle() throws Exception

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-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -51,7 +51,7 @@
    public void testInstallStartX() throws Exception
    {
       OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
 
       Bundle bundleX = null;
       try
@@ -74,7 +74,7 @@
    public void testInstallXBeforeB() throws Exception
    {
       OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
 
       Bundle bundleB = null;
       Bundle bundleX = null;
@@ -102,7 +102,7 @@
    public void testInstallBBeforeA() throws Exception
    {
       OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
 
       Bundle bundleA = null;
       Bundle bundleB = null;
@@ -135,7 +135,7 @@
    public void testInstallBBeforeX() throws Exception
    {
       OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
 
       Bundle bundleB = null;
       Bundle bundleX = null;
@@ -173,7 +173,7 @@
    public void testInstallABeforeB() throws Exception
    {
       OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
 
       Bundle bundleA = null;
       Bundle bundleB = null;

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/FELIX1040TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/FELIX1040TestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/FELIX1040TestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -44,7 +44,7 @@
       OSGiFramework fwOne = createBootstrapProvider().getFramework();
       try
       {
-         BundleContext ctxOne = fwOne.getSystemBundleContext();
+         BundleContext ctxOne = fwOne.getBundleContext();
          
          Bundle bundleA = ctxOne.installBundle(getTestArchiveURL("jbosgi37-bundleA.jar").toExternalForm());
          assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
@@ -59,7 +59,7 @@
       OSGiFramework fwTwo = createBootstrapProvider().getFramework();
       try
       {
-         BundleContext ctxTwo = fwTwo.getSystemBundleContext();
+         BundleContext ctxTwo = fwTwo.getBundleContext();
          
          Bundle bundleB = ctxTwo.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
          assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java	2009-05-06 13:12:42 UTC (rev 88260)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java	2009-05-06 13:23:23 UTC (rev 88261)
@@ -48,7 +48,7 @@
    public void testVerifyUnresolved() throws Exception
    {
       OSGiFramework framework = getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
       
       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
       assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
@@ -88,7 +88,7 @@
    public void testWiringToUninstalled() throws Exception
    {
       OSGiFramework framework = getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
       
       Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
@@ -115,7 +115,7 @@
    public void testWiringToUninstalledPackageAdmin() throws Exception
    {
       OSGiFramework framework = getBootstrapProvider().getFramework();
-      BundleContext sysContext = framework.getSystemBundleContext();
+      BundleContext sysContext = framework.getBundleContext();
       
       Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
       Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());




More information about the jboss-cvs-commits mailing list