[jboss-osgi-commits] JBoss-OSGI SVN: r89442 - in projects/jboss-osgi/trunk: blueprint/testsuite and 11 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue May 26 10:59:14 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-05-26 10:59:13 -0400 (Tue, 26 May 2009)
New Revision: 89442

Added:
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNPServerTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/RMIRegistryTestCase.java
Modified:
   projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml
   projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
   projects/jboss-osgi/trunk/bundles/jndi/pom.xml
   projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
   projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java
   projects/jboss-osgi/trunk/pom.xml
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
   projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
   projects/jboss-osgi/trunk/testsuite/functional/.project
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java
   projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
More work on JNDI startup/shutdown

Modified: projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml	2009-05-26 14:59:13 UTC (rev 89442)
@@ -139,39 +139,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <redirectTestOutputToFile>false</redirectTestOutputToFile>
-          <failIfNoTests>false</failIfNoTests>
-          <systemProperties>
-            <!--
-              Implement URLStreamHandlerService
-              https://jira.jboss.org/jira/browse/JBOSGI-75 
-            -->
-            <property>
-              <name>java.protocol.handler.pkgs</name>
-              <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
-            </property>
-            <property>
-              <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
-              <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
-            </property>
-            <property>
-              <name>org.jboss.osgi.husky.Invoker</name>
-              <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
-            </property>
-            <property>
-              <name>log4j.output.dir</name>
-              <value>${project.build.directory}</value>
-            </property>
-            <property>
-              <name>test.archive.directory</name>
-              <value>${project.build.directory}/test-libs</value>
-            </property>
-          </systemProperties>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 

Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -69,11 +69,11 @@
          try
          {
             rmiRegistry.list();
-            log.log(LogService.LOG_DEBUG, "Registry running at host=" + host + ",port=" + rmiPort);
+            log.log(LogService.LOG_DEBUG, "RMI Registry running at host=" + host + ",port=" + rmiPort);
          }
          catch (RemoteException e)
          {
-            log.log(LogService.LOG_DEBUG, "No registry running at host=" + host + ",port=" + rmiPort + ".  Will create one.");
+            log.log(LogService.LOG_DEBUG, "No RMI Registry running at host=" + host + ",port=" + rmiPort + ".  Will create one.");
             rmiRegistry = LocateRegistry.createRegistry(rmiPort, null, new DefaultSocketFactory(bindAddress));
             shutdownRegistry = true;
          }
@@ -134,7 +134,10 @@
          
          // Shutdown the registry if this service created it
          if (shutdownRegistry == true)
+         {
+            log.log(LogService.LOG_DEBUG, "Shutdown RMI Registry");
             UnicastRemoteObject.unexportObject(rmiRegistry, true);
+         }
 
          log.log(LogService.LOG_DEBUG, "JMXConnectorServer stopped");
       }

Modified: projects/jboss-osgi/trunk/bundles/jndi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/pom.xml	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/bundles/jndi/pom.xml	2009-05-26 14:59:13 UTC (rev 89442)
@@ -60,7 +60,6 @@
           <instructions>
             <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
             <Bundle-Activator>org.jboss.osgi.jndi.internal.ServiceActivator</Bundle-Activator>
-            <Export-Package>org.jboss.osgi.jndi</Export-Package>
             <Import-Package>
               javax.naming*, 
               javax.net, 
@@ -76,7 +75,7 @@
               jnpserver;inline=false,
             </Embed-Dependency>
             <_exportcontents>
-              org.jnp.interfaces,
+              org.jnp.interfaces;version=${version.jboss.naming},
             </_exportcontents>
           </instructions>
         </configuration>

Modified: projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -23,8 +23,6 @@
 
 //$Id$
 
-import java.io.IOException;
-
 import javax.naming.NamingException;
 
 import org.jboss.osgi.common.log.LogServiceTracker;
@@ -41,61 +39,37 @@
  * @author thomas.diesler at jboss.com
  * @since 24-Apr-2009
  */
-public class JNPServer 
+public class JNPServer
 {
    private LogService log;
+   private String host;
+   private int jndiPort;
+   private int rmiPort;
+   
    private Main namingMain;
    private Naming namingServer;
 
-   public JNPServer(BundleContext context, String jndiHost, int jndiPort, int jndiRmiPort) 
+   public JNPServer(BundleContext context, String host, int jndiPort, int rmiPort)
    {
       this.log = new LogServiceTracker(context);
+      this.host = host;
+      this.jndiPort = jndiPort;
+      this.rmiPort = rmiPort;
+   }
 
+   public void start()
+   {
       try
       {
-         NamingBean namingBean = new NamingBean()
-         {
-            public Naming getNamingInstance()
-            {
-               if (namingServer == null)
-               {
-                  try
-                  {
-                     namingServer = new NamingServer();
-                  }
-                  catch (NamingException ex)
-                  {
-                     throw new IllegalStateException("Cannot create NamingServer", ex);
-                  }
-               }
-               return namingServer;
-            }
-         };
-
          namingMain = new Main();
-         namingMain.setNamingInfo(namingBean);
-         
-         namingMain.setBindAddress(jndiHost);
+         namingMain.setNamingInfo(getNamingBean());
+
+         namingMain.setBindAddress(host);
          namingMain.setPort(jndiPort);
-         
-         namingMain.setRmiBindAddress(jndiHost);
-         namingMain.setRmiPort(jndiRmiPort);
-         
-         log.log(LogService.LOG_DEBUG, "Naming server created");
-      }
-      catch (IOException ex)
-      {
-         log.log(LogService.LOG_ERROR, "Cannot create Naming server", ex);
-      }
-   }
 
-   public void start()
-   {
-      if (namingMain == null)
-         throw new IllegalStateException("Naming server not available");
+         namingMain.setRmiBindAddress(host);
+         namingMain.setRmiPort(rmiPort);
 
-      try
-      {
          namingMain.start();
          log.log(LogService.LOG_DEBUG, "Naming server started");
       }
@@ -110,7 +84,32 @@
       if (namingMain != null)
       {
          namingMain.stop();
+         namingMain = null;
+         namingServer = null;
          log.log(LogService.LOG_DEBUG, "Naming server stopped");
       }
    }
+
+   private NamingBean getNamingBean()
+   {
+      NamingBean namingBean = new NamingBean()
+      {
+         public Naming getNamingInstance()
+         {
+            if (namingServer == null)
+            {
+               try
+               {
+                  namingServer = new NamingServer();
+               }
+               catch (NamingException ex)
+               {
+                  throw new IllegalStateException("Cannot create NamingServer", ex);
+               }
+            }
+            return namingServer;
+         }
+      };
+      return namingBean;
+   }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -28,6 +28,7 @@
 import org.jboss.osgi.common.log.LogServiceTracker;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.log.LogService;
 
 /**
@@ -42,6 +43,7 @@
    public static final String REMOTE_JNDI_RMI_PORT = "org.jboss.osgi.jndi.rmi.port";
    public static final String REMOTE_JNDI_PORT = "org.jboss.osgi.jndi.port";
 
+   private ServiceRegistration registration;
    private JNPServer jnpServer;
    private LogService log;
 
@@ -64,12 +66,19 @@
       jnpServer = new JNPServer(context, jndiHost, Integer.parseInt(jndiPort), Integer.parseInt(jndiRmiPort));
       jnpServer.start();
       
-      context.registerService(InitialContext.class.getName(), new InitialContextFactory(jndiHost, jndiPort), null);
+      InitialContextFactory serviceFactory = new InitialContextFactory(jndiHost, jndiPort);
+      registration = context.registerService(InitialContext.class.getName(), serviceFactory, null);
       log.log(LogService.LOG_DEBUG, "InitialContext registered");
    }
 
    public void stop(BundleContext context)
    {
+      if (registration != null)
+      {
+         registration.unregister();
+         registration = null;
+      }
+      
       if (jnpServer != null)
       {
          jnpServer.stop();

Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/pom.xml	2009-05-26 14:59:13 UTC (rev 89442)
@@ -24,7 +24,13 @@
 
   <!-- Properties -->
   <properties>
+    <surefire.husky.invoker>-Dorg.jboss.osgi.husky.Invoker=org.jboss.osgi.husky.internal.OSGiInvoker</surefire.husky.invoker>
+    <surefire.log4j.output.dir>-Dlog4j.output.dir=${project.build.directory}</surefire.log4j.output.dir>
+    <surefire.protocol.handlers>-Djava.protocol.handler.pkgs=org.jboss.net.protocol\|org.jboss.virtual.protocol</surefire.protocol.handlers>
+    <surefire.test.archive.dir>-Dtest.archive.directory=${project.build.directory}/test-libs</surefire.test.archive.dir>
     <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
+    <surefire.xerces.parser.config>-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeAwareParserConfiguration</surefire.xerces.parser.config>
+    <surefire.common.args>${surefire.husky.invoker} ${surefire.log4j.output.dir} ${surefire.protocol.handlers} ${surefire.test.archive.dir} ${surefire.xerces.parser.config}</surefire.common.args>
 
     <version.aqute.bnd>0.0.323</version.aqute.bnd>
     <version.equinox>3.4.2</version.equinox>
@@ -390,32 +396,7 @@
         <configuration>
           <redirectTestOutputToFile>false</redirectTestOutputToFile>
           <failIfNoTests>false</failIfNoTests>
-          <systemProperties>
-            <property>
-              <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
-              <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
-            </property>
-            <property>
-              <name>org.jboss.osgi.husky.Invoker</name>
-              <value>org.jboss.osgi.husky.internal.LocalInvoker</value>
-            </property>
-            <!--
-              Implement URLStreamHandlerService
-              https://jira.jboss.org/jira/browse/JBOSGI-75 
-            -->
-            <property>
-              <name>java.protocol.handler.pkgs</name>
-              <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
-            </property>
-            <property>
-              <name>test.archive.directory</name>
-              <value>${project.build.directory}/test-libs</value>
-            </property>
-            <property>
-              <name>log4j.output.dir</name>
-              <value>${basedir}/target</value>
-            </property>
-          </systemProperties>
+          <argLine>${surefire.common.args}</argLine>
         </configuration>
       </plugin>
     </plugins>

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -26,19 +26,15 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Enumeration;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Properties;
 
 import javax.management.MBeanServer;
 import javax.management.MBeanServerConnection;
 import javax.management.MBeanServerFactory;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
 import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.logging.ExportedPackageHelper;
 import org.jboss.osgi.spi.logging.LogEntryCache;
 import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
 import org.osgi.framework.Bundle;
@@ -148,16 +144,6 @@
       return server;
    }
 
-   @SuppressWarnings("unchecked")
-   public InitialContext getInitialContext() throws NamingException
-   {
-      Hashtable env = new Hashtable();
-      env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
-      env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
-      env.put("java.naming.provider.url", "jnp://" + getServerHost() + ":1199");
-      return new InitialContext(env);
-   }
-   
    public AbstractPackageAdmin getPackageAdmin()
    {
       BundleContext context = getBundleContext();

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -24,6 +24,9 @@
 import java.io.File;
 import java.net.URL;
 
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
 import org.jboss.logging.Logger;
 import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
 import org.jboss.virtual.VFS;
@@ -108,4 +111,19 @@
    {
       return helper.getTestArchiveFile(archive);
    }
+   
+   public InitialContext getInitialContext() throws NamingException
+   {
+      return helper.getInitialContext();
+   }
+
+   public Integer getJndiPort()
+   {
+      return helper.getJndiPort();
+   }
+
+   public String getServerHost()
+   {
+      return helper.getServerHost();
+   }
 }

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -24,7 +24,11 @@
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Hashtable;
 
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
 import org.jboss.osgi.spi.framework.OSGiBootstrap;
 import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
 
@@ -141,4 +145,25 @@
 
       throw new IllegalArgumentException("Cannot obtain '" + testArchiveDir + "/" + archive + "'.");
    }
+   
+   @SuppressWarnings("unchecked")
+   public InitialContext getInitialContext() throws NamingException
+   {
+      Hashtable env = new Hashtable();
+      env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+      env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
+      env.put("java.naming.provider.url", "jnp://" + getServerHost() + ":" + getJndiPort());
+      return new InitialContext(env);
+   }
+
+   public Integer getJndiPort()
+   {
+      String port = System.getProperty("jndi.server.port", "1099");
+      return new Integer(port);
+   }
+
+   public String getServerHost()
+   {
+      return System.getProperty("jboss.bind.address", "localhost");
+   }
 }

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -27,7 +27,6 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.JarInputStream;
@@ -213,17 +212,6 @@
       return mbeanServer;
    }
 
-   @SuppressWarnings("unchecked")
-   public InitialContext getInitialContext() throws NamingException
-   {
-      Hashtable env = new Hashtable();
-      String bindAddress = System.getProperty("jboss.bind.address", "localhost");
-      env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
-      env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
-      env.put("java.naming.provider.url", "jnp://" + bindAddress + ":1099");
-      return new InitialContext(env);
-   }
-
    public AbstractPackageAdmin getPackageAdmin()
    {
       return new RemotePackageAdmin(this);

Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -29,6 +29,8 @@
 import java.util.Map;
 
 import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 
 import org.jboss.logging.Logger;
 import org.jboss.osgi.spi.logging.LogEntryCache;
@@ -78,14 +80,16 @@
    {
       return logReaderService;
    }
-   
+
    public void addCapability(Capability capability) throws BundleException
    {
+      log.debug("Add capability : " + capability);
+
       for (String location : capability.getBundles())
       {
          AbstractBundle bundle = installBundle(location);
          bundle.start();
-         
+
          bundles.put(location, bundle);
       }
       capabilities.add(capability);
@@ -93,8 +97,10 @@
 
    public void removeCapability(Capability capability)
    {
+      log.debug("Remove capability : " + capability);
+
       capabilities.remove(capability);
-      
+
       List<String> bundleLocations = capability.getBundles();
       Collections.reverse(bundleLocations);
 
@@ -116,7 +122,7 @@
    {
       this.logEntryCache = logEntryCache;
    }
-   
+
    public void stopLogEntryTracking()
    {
       if (logReaderService != null && logEntryCache != null)
@@ -126,16 +132,20 @@
          logEntryCache = null;
       }
    }
-   
+
    public void shutdown()
    {
+      log.debug("Start Shutdown");
+
       stopLogEntryTracking();
-      
+
       while (capabilities.size() > 0)
       {
          Capability capability = capabilities.get(0);
          removeCapability(capability);
       }
+
+      log.debug("End Shutdown");
    }
 
    public void deploy(String location) throws Exception
@@ -161,8 +171,13 @@
       return MBeanProxy.get(mbeanInterface, objectName, getMBeanServer());
    }
 
+   public InitialContext getInitialContext() throws NamingException
+   {
+      return helper.getInitialContext();
+   }
+
    public String getServerHost()
    {
-      return System.getProperty("jboss.bind.address", "localhost");
+      return helper.getServerHost();
    }
 }

Modified: projects/jboss-osgi/trunk/testsuite/functional/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.project	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/testsuite/functional/.project	2009-05-26 14:59:13 UTC (rev 89442)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>jboss-osgi-testsuite</name>
+	<name>jboss-osgi-testsuite-functional</name>
 	<comment></comment>
 	<projects>
 	</projects>

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -49,7 +49,12 @@
       {
          AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-apache-xerces.jar");
          bundle.start();
+         assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
          
+         bundle.stop();
+         assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
+         
+         bundle.start();
          assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
       }
       finally
@@ -66,8 +71,13 @@
       {
          AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-jaxb.jar");
          bundle.start();
-
          assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+         
+         bundle.stop();
+         assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
+         
+         bundle.start();
+         assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
       }
       finally
       {
@@ -83,8 +93,14 @@
       {
          AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-apache-xerces.jar");
          bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
+         
          bundle.start();
+         assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
          
+         bundle.stop();
+         assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
+         
+         bundle.start();
          assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
       }
       finally
@@ -103,8 +119,14 @@
          bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
          bundle = runtime.installBundle("bundles/jboss-osgi-jaxb.jar");
          bundle = runtime.installBundle("bundles/jboss-osgi-xml-binding.jar");
+         
          bundle.start();
+         assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
          
+         bundle.stop();
+         assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
+         
+         bundle.start();
          assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
       }
       finally
@@ -121,8 +143,14 @@
       {
          AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
          bundle = runtime.installBundle("bundles/jboss-osgi-jndi.jar");
+         
          bundle.start();
+         assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
          
+         bundle.stop();
+         assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
+         
+         bundle.start();
          assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
       }
       finally
@@ -140,8 +168,14 @@
          AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
          bundle = runtime.installBundle("bundles/jboss-osgi-jndi.jar");
          bundle = runtime.installBundle("bundles/jboss-osgi-jmx.jar");
+         
          bundle.start();
+         assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
          
+         bundle.stop();
+         assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
+         
+         bundle.start();
          assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
       }
       finally

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -0,0 +1,74 @@
+/*
+ * 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.service.jmx;
+
+//$Id$
+
+import static org.junit.Assert.assertNotNull;
+
+import javax.management.MBeanServerConnection;
+import javax.naming.InitialContext;
+
+import org.jboss.osgi.spi.testing.JMXCapability;
+import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * A test that verifies that JMX/JNDI startup and shutdown cleanly.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class JMXServiceTestCase extends OSGiTest
+{
+   @Test
+   @Ignore
+   public void testJMXService() throws Exception
+   {
+      OSGiRuntime runtime = new OSGiTestHelper().getDefaultRuntime();
+      runtime.addCapability(new JNDICapability());
+      runtime.addCapability(new JMXCapability());
+
+      // Lookup the MBeanServerConnection
+      InitialContext iniCtx = runtime.getInitialContext();
+      MBeanServerConnection rmiAdaptor = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+      assertNotNull("RMIAdaptor not null", rmiAdaptor);
+
+      runtime.shutdown();
+
+      // Do the second run
+      runtime = new OSGiTestHelper().getDefaultRuntime();
+      runtime.addCapability(new JNDICapability());
+      runtime.addCapability(new JMXCapability());
+
+      // Lookup the MBeanServerConnection
+      iniCtx = runtime.getInitialContext();
+      rmiAdaptor = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+      assertNotNull("RMIAdaptor not null", rmiAdaptor);
+
+      runtime.shutdown();
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -0,0 +1,85 @@
+/*
+ * 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.service.jndi;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+
+import javax.naming.InitialContext;
+
+import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * A test that verifies that JNDI startup and shutdown cleanly.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class JNDIServiceTestCase extends OSGiTest
+{
+   @Test
+   @Ignore
+   public void testJNDIService() throws Exception
+   {
+      JNDICapability jndiCap = new JNDICapability();
+      
+      OSGiRuntime runtime = new OSGiTestHelper().getDefaultRuntime();
+      runtime.addCapability(jndiCap);
+
+      InitialContext iniCtx = runtime.getInitialContext();
+      iniCtx.bind("foo", new String("bar"));
+      assertEquals("bar", iniCtx.lookup("foo"));
+      iniCtx.unbind("foo");
+      
+      runtime.removeCapability(jndiCap);
+
+      /*
+      try
+      {
+         iniCtx = runtime.getInitialContext();
+         assertEquals("bar", iniCtx.lookup("foo"));
+         fail("NamingException expected");
+      }
+      catch (NamingException ex)
+      {
+         // expected
+      }
+      */
+
+      // Do the second run
+      runtime = new OSGiTestHelper().getDefaultRuntime();
+      runtime.addCapability(jndiCap);
+
+      iniCtx = runtime.getInitialContext();
+      iniCtx.bind("foo", new String("bar"));
+      assertEquals("bar", iniCtx.lookup("foo"));
+
+      iniCtx.unbind("foo");
+      runtime.shutdown();
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNPServerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNPServerTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNPServerTestCase.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -0,0 +1,121 @@
+/*
+ * 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.service.jndi;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.UnknownHostException;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jnp.interfaces.Naming;
+import org.jnp.server.Main;
+import org.jnp.server.NamingBean;
+import org.jnp.server.NamingServer;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Test JNP server start/stop
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class JNPServerTestCase extends OSGiTest
+{
+   private Naming namingServer;
+   private Integer jndiPort;
+   private Integer rmiPort;
+   
+   @Before
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      jndiPort = getJndiPort();
+      rmiPort = jndiPort - 1;
+   }
+   
+   @Test
+   @Ignore
+   public void testJNPServer() throws Exception
+   {
+      Main namingMain = getNaming();
+      namingMain.start();
+      
+      InitialContext iniCtx = getInitialContext();
+      iniCtx.bind("foo", new String("bar"));
+      assertEquals("bar", iniCtx.lookup("foo"));
+      
+      iniCtx.unbind("foo");
+      namingMain.stop();
+      
+      // Restart the JNPServer
+      namingMain = getNaming();
+      namingMain.start();
+      
+      iniCtx = getInitialContext();
+      iniCtx.bind("foo", new String("bar"));
+      assertEquals("bar", iniCtx.lookup("foo"));
+      
+      iniCtx.unbind("foo");
+      namingMain.stop();
+   }
+
+   private Main getNaming() throws UnknownHostException
+   {
+      String host = getServerHost();
+      
+      NamingBean namingBean = new NamingBean()
+      {
+         public Naming getNamingInstance()
+         {
+            if (namingServer == null)
+            {
+               try
+               {
+                  namingServer = new NamingServer();
+               }
+               catch (NamingException ex)
+               {
+                  throw new IllegalStateException("Cannot create NamingServer", ex);
+               }
+            }
+            return namingServer;
+         }
+      };
+
+      Main namingMain = new Main();
+      namingMain.setNamingInfo(namingBean);
+      
+      namingMain.setBindAddress(host);
+      namingMain.setPort(jndiPort);
+      
+      namingMain.setRmiBindAddress(host);
+      namingMain.setRmiPort(rmiPort);
+      return namingMain;
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNPServerTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/RMIRegistryTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/RMIRegistryTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/RMIRegistryTestCase.java	2009-05-26 14:59:13 UTC (rev 89442)
@@ -0,0 +1,85 @@
+/*
+ * 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.service.jndi;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.net.InetAddress;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.net.sockets.DefaultSocketFactory;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Test that the RMI registry can be created and shutdown
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class RMIRegistryTestCase extends OSGiTest
+{
+   @Test
+   @Ignore
+   public void testRMIRegistry() throws Exception
+   {
+      String host = getServerHost();
+      int rmiPort = getJndiPort() - 1;
+
+      // Check to see if registry already created
+      Registry rmiRegistry = LocateRegistry.getRegistry(host, rmiPort);
+      try
+      {
+         rmiRegistry.list();
+         fail("No RMI registry expected");
+      }
+      catch (RemoteException ex)
+      {
+         // expected
+      }
+
+      // Create RMI registry
+      rmiRegistry = LocateRegistry.createRegistry(rmiPort, null, new DefaultSocketFactory(InetAddress.getByName(host)));
+      List<String> list = Arrays.asList(rmiRegistry.list());
+      assertEquals("No RMI objects", 0, list.size());
+
+      // Unexport the RMI registry
+      UnicastRemoteObject.unexportObject(rmiRegistry, true);
+
+      // Recreate RMI registry
+      rmiRegistry = LocateRegistry.createRegistry(rmiPort, null, new DefaultSocketFactory(InetAddress.getByName(host)));
+      list = Arrays.asList(rmiRegistry.list());
+      assertEquals("No RMI objects", 0, list.size());
+
+      // Unexport the RMI registry
+      UnicastRemoteObject.unexportObject(rmiRegistry, true);
+   }
+}
\ No newline at end of file


Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/RMIRegistryTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml	2009-05-26 14:56:39 UTC (rev 89441)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml	2009-05-26 14:59:13 UTC (rev 89442)
@@ -20,6 +20,13 @@
     <module>functional</module>
   </modules>
 
+  <!-- Properties -->
+  <properties>
+    <surefire.runtime.equinox>-Djboss.osgi.framework.config=jboss-osgi-equinox.properties</surefire.runtime.equinox>
+    <surefire.runtime.felix>-Djboss.osgi.framework.config=jboss-osgi-felix.properties</surefire.runtime.felix>
+    <surefire.runtime.knopflerfish>-Djboss.osgi.framework.config=jboss-osgi-knopflerfish.properties</surefire.runtime.knopflerfish>
+  </properties>
+  
   <!-- Dependencies -->
   <dependencies>
     <dependency>
@@ -119,6 +126,14 @@
         <filtering>true</filtering>
       </testResource>
     </testResources>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <argLine>-Djndi.server.port=1199</argLine>
+        </configuration>
+      </plugin>
+    </plugins>
   </build>
 
   <!-- Profiles -->
@@ -135,6 +150,9 @@
           <name>!framework</name>
         </property>
       </activation>
+      <properties>
+        <surefire.framework.profile.args>${surefire.common.args} ${surefire.runtime.felix}</surefire.framework.profile.args>
+      </properties>
       <dependencies>
         <dependency>
           <groupId>org.jboss.osgi</groupId>
@@ -146,36 +164,7 @@
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <systemProperties>
-                <!--
-                  Implement URLStreamHandlerService
-                  https://jira.jboss.org/jira/browse/JBOSGI-75 
-                -->
-                <property>
-                  <name>java.protocol.handler.pkgs</name>
-                  <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
-                </property>
-                <property>
-                  <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
-                  <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
-                </property>
-                <property>
-                  <name>org.jboss.osgi.husky.Invoker</name>
-                  <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
-                </property>
-                <property>
-                  <name>log4j.output.dir</name>
-                  <value>${project.build.directory}</value>
-                </property>
-                <property>
-                  <name>test.archive.directory</name>
-                  <value>${project.build.directory}/test-libs</value>
-                </property>
-                <property>
-                  <name>jboss.osgi.framework.config</name>
-                  <value>jboss-osgi-felix.properties</value>
-                </property>
-              </systemProperties>
+              <argLine>${surefire.framework.profile.args}</argLine>
             </configuration>
           </plugin>
         </plugins>
@@ -194,6 +183,9 @@
           <value>felix</value>
         </property>
       </activation>
+      <properties>
+        <surefire.framework.profile.args>${surefire.common.args} ${surefire.runtime.felix}</surefire.framework.profile.args>
+      </properties>
       <dependencies>
         <dependency>
           <groupId>org.jboss.osgi</groupId>
@@ -205,36 +197,7 @@
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <systemProperties>
-                <!--
-                  Implement URLStreamHandlerService
-                  https://jira.jboss.org/jira/browse/JBOSGI-75 
-                -->
-                <property>
-                  <name>java.protocol.handler.pkgs</name>
-                  <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
-                </property>
-                <property>
-                  <name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
-                  <value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
-                </property>
-                <property>
-                  <name>org.jboss.osgi.husky.Invoker</name>
-                  <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
-                </property>
-                <property>
-                  <name>log4j.output.dir</name>
-                  <value>${project.build.directory}</value>
-                </property>
-                <property>
-                  <name>test.archive.directory</name>
-                  <value>${project.build.directory}/test-libs</value>
-                </property>
-                <property>
-                  <name>jboss.osgi.framework.config</name>
-                  <value>jboss-osgi-felix.properties</value>
-                </property>
-              </systemProperties>
+              <argLine>${surefire.framework.profile.args}</argLine>
             </configuration>
           </plugin>
         </plugins>
@@ -253,6 +216,9 @@
           <value>equinox</value>
         </property>
       </activation>
+      <properties>
+        <surefire.framework.profile.args>${surefire.common.args} ${surefire.runtime.equinox}</surefire.framework.profile.args>
+      </properties>
       <dependencies>
         <dependency>
           <groupId>org.jboss.osgi</groupId>
@@ -264,20 +230,7 @@
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <systemProperties>
-                <property>
-                  <name>log4j.output.dir</name>
-                  <value>${basedir}/target</value>
-                </property>
-                <property>
-                  <name>test.archive.directory</name>
-                  <value>${project.build.directory}/test-libs</value>
-                </property>
-                <property>
-                  <name>jboss.osgi.framework.config</name>
-                  <value>jboss-osgi-equinox.properties</value>
-                </property>
-              </systemProperties>
+              <argLine>${surefire.framework.profile.args}</argLine>
               <includes>
                 <!-- Minimal bootstrap testing -->
                 <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
@@ -300,6 +253,9 @@
           <value>knopflerfish</value>
         </property>
       </activation>
+      <properties>
+        <surefire.framework.profile.args>${surefire.common.args} ${surefire.runtime.knopflerfish}</surefire.framework.profile.args>
+      </properties>
       <dependencies>
         <dependency>
           <groupId>org.jboss.osgi</groupId>
@@ -311,20 +267,7 @@
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <systemProperties>
-                <property>
-                  <name>log4j.output.dir</name>
-                  <value>${basedir}/target</value>
-                </property>
-                <property>
-                  <name>test.archive.directory</name>
-                  <value>${project.build.directory}/test-libs</value>
-                </property>
-                <property>
-                  <name>jboss.osgi.framework.config</name>
-                  <value>jboss-osgi-knopflerfish.properties</value>
-                </property>
-              </systemProperties>
+              <argLine>${surefire.framework.profile.args}</argLine>
               <includes>
                 <!-- Minimal bootstrap testing -->
                 <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
@@ -351,6 +294,7 @@
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
+              <argLine>${surefire.framework.profile.args} -Djndi.server.port=1199</argLine>
               <excludes>
                 <!-- Exclude tests that require remote access -->
                 <exclude>org/jboss/test/osgi/jbossas/**</exclude>




More information about the jboss-osgi-commits mailing list