[jboss-cvs] JBossAS SVN: r95389 - in projects/jboss-osgi: projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix and 20 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 22 06:03:18 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-10-22 06:03:18 -0400 (Thu, 22 Oct 2009)
New Revision: 95389
Added:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegrationBean.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentActivator.java
Removed:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServices.java
Modified:
projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxBootstrapProvider.java
projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java
projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGI92TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Add system services to framework AS integration.
Unget the bootstrap provider
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxBootstrapProvider.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxBootstrapProvider.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.deployment.DeploymentServices;
+import org.jboss.osgi.deployment.DeploymentActivator;
import org.jboss.osgi.spi.framework.PropertiesBootstrapProvider;
import org.osgi.framework.BundleContext;
@@ -35,19 +35,19 @@
*/
public class EquinoxBootstrapProvider extends PropertiesBootstrapProvider
{
- private DeploymentServices deploymentServices;
+ private DeploymentActivator deploymentActivator;
@Override
protected void registerSystemServices(BundleContext context)
{
- deploymentServices = new DeploymentServices();
- deploymentServices.start(context);
+ deploymentActivator = new DeploymentActivator();
+ deploymentActivator.start(context);
}
@Override
protected void unregisterSystemServices(BundleContext context)
{
- if (deploymentServices != null)
- deploymentServices.stop(context);
+ if (deploymentActivator != null)
+ deploymentActivator.stop(context);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java
===================================================================
--- projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/runtime/equinox/trunk/src/main/java/org/jboss/osgi/equinox/EquinoxIntegration.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -25,8 +25,10 @@
import java.util.Map;
-import org.jboss.osgi.spi.framework.FrameworkIntegration;
+import org.jboss.osgi.deployment.DeploymentActivator;
+import org.jboss.osgi.spi.framework.FrameworkIntegrationBean;
import org.jboss.osgi.spi.util.ServiceLoader;
+import org.osgi.framework.BundleContext;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
import org.slf4j.Logger;
@@ -38,10 +40,12 @@
* @author thomas.diesler at jboss.com
* @since 23-Jan-2009
*/
-public class EquinoxIntegration extends FrameworkIntegration
+public class EquinoxIntegration extends FrameworkIntegrationBean
{
// Provide logging
final Logger log = LoggerFactory.getLogger(EquinoxIntegration.class);
+
+ private DeploymentActivator deploymentActivator;
@Override
protected Framework createFramework(Map<String, Object> properties)
@@ -55,4 +59,18 @@
FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
return factory.newFramework(properties);
}
+
+ @Override
+ protected void registerSystemServices(BundleContext context)
+ {
+ deploymentActivator = new DeploymentActivator();
+ deploymentActivator.start(context);
+ }
+
+ @Override
+ protected void unregisterSystemServices(BundleContext context)
+ {
+ if (deploymentActivator != null)
+ deploymentActivator.stop(context);
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBootstrapProvider.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -23,9 +23,10 @@
//$Id$
-import org.jboss.osgi.deployment.DeploymentServices;
+import org.jboss.osgi.deployment.DeploymentActivator;
import org.jboss.osgi.spi.framework.PropertiesBootstrapProvider;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
/**
* A bootstrap provider for Felix.
@@ -35,19 +36,26 @@
*/
public class FelixBootstrapProvider extends PropertiesBootstrapProvider
{
- private DeploymentServices deploymentServices;
+ private DeploymentActivator deploymentActivator;
@Override
+ public Framework getFramework()
+ {
+ Framework framework = super.getFramework();
+ return new FelixFrameworkWrapper(framework);
+ }
+
+ @Override
protected void registerSystemServices(BundleContext context)
{
- deploymentServices = new DeploymentServices();
- deploymentServices.start(context);
+ deploymentActivator = new DeploymentActivator();
+ deploymentActivator.start(context);
}
@Override
protected void unregisterSystemServices(BundleContext context)
{
- if (deploymentServices != null)
- deploymentServices.stop(context);
+ if (deploymentActivator != null)
+ deploymentActivator.stop(context);
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixBundleContextWrapper.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -38,7 +38,7 @@
import org.slf4j.LoggerFactory;
/**
- * The FelixBundleContextWrapper wrapps the BundleContext provided by the Felix implemenation.
+ * Wraps the BundleContext provided by the Felix implementation.
*
* It provides additional functionality on bundle install.
*
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixFrameworkWrapper.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -26,8 +26,6 @@
import org.jboss.osgi.spi.framework.FrameworkWrapper;
import org.osgi.framework.BundleContext;
import org.osgi.framework.launch.Framework;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Wraps the Framework provided by the Felix implementation.
@@ -37,9 +35,6 @@
*/
class FelixFrameworkWrapper extends FrameworkWrapper
{
- // Provide logging
- final Logger log = LoggerFactory.getLogger(FelixFrameworkWrapper.class);
-
FelixFrameworkWrapper(Framework framework)
{
super(framework);
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -25,8 +25,10 @@
import java.util.Map;
-import org.jboss.osgi.spi.framework.FrameworkIntegration;
+import org.jboss.osgi.deployment.DeploymentActivator;
+import org.jboss.osgi.spi.framework.FrameworkIntegrationBean;
import org.jboss.osgi.spi.util.ServiceLoader;
+import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
@@ -39,11 +41,13 @@
* @author thomas.diesler at jboss.com
* @since 23-Jan-2009
*/
-public class FelixIntegration extends FrameworkIntegration
+public class FelixIntegration extends FrameworkIntegrationBean
{
// Provide logging
final Logger log = LoggerFactory.getLogger(FelixIntegration.class);
+ private DeploymentActivator deploymentActivator;
+
@Override
protected Framework createFramework(Map<String, Object> properties)
{
@@ -64,11 +68,28 @@
return factory.newFramework(properties);
}
+ @Override
+ protected void registerSystemServices(BundleContext context)
+ {
+ deploymentActivator = new DeploymentActivator();
+ deploymentActivator.start(context);
+ }
+
+ @Override
+ protected void unregisterSystemServices(BundleContext context)
+ {
+ if (deploymentActivator != null)
+ deploymentActivator.stop(context);
+ }
+
public void stop()
{
final Framework framework = getFramework();
if (framework != null)
{
+ // Unregister system services
+ unregisterSystemServices(getBundleContext());
+
// Running the Felix shutdown in a separate thread that gets
// interrupted after a 10sec timeout. This is a workaround for
//
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -1,225 +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.osgi.spi.framework;
-
-//$Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.osgi.spi.FrameworkException;
-import org.jboss.osgi.spi.logging.ExportedPackageHelper;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.launch.Framework;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * An abstraction of an OSGi Framework.
- *
- * In addition to the standard {@link Framework} this implementation also
- * supports properties and initial bundle provisioning.
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public abstract class FrameworkIntegration
-{
- // Provide logging
- final Logger log = LoggerFactory.getLogger(FrameworkIntegration.class);
-
- private Map<String, Object> properties = new HashMap<String, Object>();
- private List<URL> autoInstall = new ArrayList<URL>();
- private List<URL> autoStart = new ArrayList<URL>();
-
- private Framework framework;
-
- public Map<String, Object> getProperties()
- {
- return properties;
- }
-
- public void setProperties(Map<String, Object> props)
- {
- this.properties = props;
- }
-
- public List<URL> getAutoInstall()
- {
- return autoInstall;
- }
-
- public void setAutoInstall(List<URL> autoInstall)
- {
- this.autoInstall = autoInstall;
- }
-
- public List<URL> getAutoStart()
- {
- return autoStart;
- }
-
- public void setAutoStart(List<URL> autoStart)
- {
- this.autoStart = autoStart;
- }
-
- public Bundle getBundle()
- {
- assertFrameworkStart();
- return getFramework();
- }
-
- public BundleContext getBundleContext()
- {
- assertFrameworkStart();
- return getFramework().getBundleContext();
- }
-
- public Framework getFramework()
- {
- if (framework == null)
- framework = createFramework(properties);
-
- return framework;
- }
-
- public void create()
- {
- if (framework == null)
- framework = createFramework(properties);
- }
-
- /** Overwrite to create the framework */
- protected abstract Framework createFramework(Map<String, Object> properties);
-
- public void start()
- {
- // Create the Framework instance
- assertFrameworkCreate();
-
- // Start the System Bundle
- try
- {
- getFramework().start();
- }
- catch (BundleException ex)
- {
- throw new FrameworkException("Cannot start system bundle", ex);
- }
-
- // Get system bundle context
- BundleContext context = getFramework().getBundleContext();
- if (context == null)
- throw new FrameworkException("Cannot obtain system context");
-
- // Log the the framework packages
- ExportedPackageHelper packageHelper = new ExportedPackageHelper(context);
- packageHelper.logExportedPackages(getBundle());
-
- Map<URL, Bundle> autoBundles = new HashMap<URL, Bundle>();
-
- // Add the autoStart bundles to autoInstall
- for (URL bundleURL : autoStart)
- {
- autoInstall.add(bundleURL);
- }
-
- // Install autoInstall bundles
- for (URL bundleURL : autoInstall)
- {
- try
- {
- Bundle bundle = context.installBundle(bundleURL.toString());
- long bundleId = bundle.getBundleId();
- log.info("Installed bundle [" + bundleId + "]: " + bundle.getSymbolicName());
- autoBundles.put(bundleURL, bundle);
- }
- catch (BundleException ex)
- {
- stop();
- throw new IllegalStateException("Cannot install bundle: " + bundleURL, ex);
- }
- }
-
- // Start autoStart bundles
- for (URL bundleURL : autoStart)
- {
- try
- {
- Bundle bundle = autoBundles.get(bundleURL);
- if (bundle != null)
- {
- bundle.start();
- packageHelper.logExportedPackages(bundle);
- log.info("Started bundle: " + bundle.getSymbolicName());
- }
- }
- catch (BundleException ex)
- {
- stop();
- throw new IllegalStateException("Cannot start bundle: " + bundleURL, ex);
- }
- }
- }
-
- public void stop()
- {
- Framework framework = getFramework();
- if (framework != null)
- {
- try
- {
- framework.stop();
- framework.waitForStop(5000);
- framework = null;
- log.debug("SystemBundle STOPPED");
- }
- catch (BundleException ex)
- {
- log.error("Cannot stop Framework", ex);
- }
- catch (InterruptedException ex)
- {
- log.error("Cannot stop Framework", ex);
- }
- }
- }
-
- private void assertFrameworkCreate()
- {
- if (getFramework() == null)
- create();
- }
-
- private void assertFrameworkStart()
- {
- assertFrameworkCreate();
- if ((getFramework().getState() & Bundle.ACTIVE) == 0)
- start();
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegrationBean.java (from rev 95382, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegration.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegrationBean.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/FrameworkIntegrationBean.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -0,0 +1,247 @@
+/*
+ * 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.framework;
+
+//$Id$
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.osgi.spi.FrameworkException;
+import org.jboss.osgi.spi.logging.ExportedPackageHelper;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An abstraction of an OSGi Framework.
+ *
+ * In addition to the standard {@link Framework} this implementation also
+ * supports properties and initial bundle provisioning.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public abstract class FrameworkIntegrationBean
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(FrameworkIntegrationBean.class);
+
+ private Map<String, Object> properties = new HashMap<String, Object>();
+ private List<URL> autoInstall = new ArrayList<URL>();
+ private List<URL> autoStart = new ArrayList<URL>();
+
+ private Framework framework;
+
+ public Map<String, Object> getProperties()
+ {
+ return properties;
+ }
+
+ public void setProperties(Map<String, Object> props)
+ {
+ this.properties = props;
+ }
+
+ public List<URL> getAutoInstall()
+ {
+ return autoInstall;
+ }
+
+ public void setAutoInstall(List<URL> autoInstall)
+ {
+ this.autoInstall = autoInstall;
+ }
+
+ public List<URL> getAutoStart()
+ {
+ return autoStart;
+ }
+
+ public void setAutoStart(List<URL> autoStart)
+ {
+ this.autoStart = autoStart;
+ }
+
+ public Bundle getBundle()
+ {
+ assertFrameworkStart();
+ return getFramework();
+ }
+
+ public BundleContext getBundleContext()
+ {
+ assertFrameworkStart();
+ return getFramework().getBundleContext();
+ }
+
+ public Framework getFramework()
+ {
+ if (framework == null)
+ framework = createFramework(properties);
+
+ return framework;
+ }
+
+ public void create()
+ {
+ if (framework == null)
+ framework = createFramework(properties);
+ }
+
+ /** Overwrite to create the framework */
+ protected abstract Framework createFramework(Map<String, Object> properties);
+
+ public void start()
+ {
+ // Create the Framework instance
+ assertFrameworkCreate();
+
+ // Start the System Bundle
+ try
+ {
+ getFramework().start();
+ }
+ catch (BundleException ex)
+ {
+ throw new FrameworkException("Cannot start system bundle", ex);
+ }
+
+ // Get system bundle context
+ BundleContext context = getFramework().getBundleContext();
+ if (context == null)
+ throw new FrameworkException("Cannot obtain system context");
+
+ // Log the the framework packages
+ ExportedPackageHelper packageHelper = new ExportedPackageHelper(context);
+ packageHelper.logExportedPackages(getBundle());
+
+ Map<URL, Bundle> autoBundles = new HashMap<URL, Bundle>();
+
+ // Add the autoStart bundles to autoInstall
+ for (URL bundleURL : autoStart)
+ {
+ autoInstall.add(bundleURL);
+ }
+
+ // Register system services
+ registerSystemServices(context);
+
+ // Install autoInstall bundles
+ for (URL bundleURL : autoInstall)
+ {
+ try
+ {
+ Bundle bundle = context.installBundle(bundleURL.toString());
+ long bundleId = bundle.getBundleId();
+ log.info("Installed bundle [" + bundleId + "]: " + bundle.getSymbolicName());
+ autoBundles.put(bundleURL, bundle);
+ }
+ catch (BundleException ex)
+ {
+ stop();
+ throw new IllegalStateException("Cannot install bundle: " + bundleURL, ex);
+ }
+ }
+
+ // Start autoStart bundles
+ for (URL bundleURL : autoStart)
+ {
+ try
+ {
+ Bundle bundle = autoBundles.get(bundleURL);
+ if (bundle != null)
+ {
+ bundle.start();
+ packageHelper.logExportedPackages(bundle);
+ log.info("Started bundle: " + bundle.getSymbolicName());
+ }
+ }
+ catch (BundleException ex)
+ {
+ stop();
+ throw new IllegalStateException("Cannot start bundle: " + bundleURL, ex);
+ }
+ }
+ }
+
+ public void stop()
+ {
+ Framework framework = getFramework();
+ if (framework != null)
+ {
+ // Unregister system services
+ unregisterSystemServices(getBundleContext());
+
+ try
+ {
+ framework.stop();
+ framework.waitForStop(5000);
+ framework = null;
+ log.debug("SystemBundle STOPPED");
+ }
+ catch (BundleException ex)
+ {
+ log.error("Cannot stop Framework", ex);
+ }
+ catch (InterruptedException ex)
+ {
+ log.error("Cannot stop Framework", ex);
+ }
+ }
+ }
+
+ /**
+ * Overwrite to register system services before bundles get installed.
+ */
+ protected void registerSystemServices(BundleContext context)
+ {
+ // no default system services
+ }
+
+ /**
+ * Overwrite to unregister system services before bundles get installed.
+ */
+ protected void unregisterSystemServices(BundleContext context)
+ {
+ // no default system services
+ }
+
+ private void assertFrameworkCreate()
+ {
+ if (getFramework() == null)
+ create();
+ }
+
+ private void assertFrameworkStart()
+ {
+ assertFrameworkCreate();
+ if ((getFramework().getState() & Bundle.ACTIVE) == 0)
+ start();
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -27,6 +27,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.osgi.spi.testing.internal.EmbeddedRuntime;
+import org.jboss.osgi.spi.testing.internal.RemoteRuntime;
import org.jboss.virtual.VFS;
import org.junit.After;
import org.junit.Before;
@@ -116,7 +118,7 @@
/**
* Delegates to {@link OSGiTestHelper#getEmbeddedRuntime()}
*/
- protected OSGiRuntime getEmbeddedRuntime()
+ protected EmbeddedRuntime getEmbeddedRuntime()
{
return getTestHelper().getEmbeddedRuntime();
}
@@ -124,7 +126,7 @@
/**
* Delegates to {@link OSGiTestHelper#getRemoteRuntime()}
*/
- public OSGiRuntime getRemoteRuntime()
+ public RemoteRuntime getRemoteRuntime()
{
return getTestHelper().getRemoteRuntime();
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -75,6 +75,11 @@
return bootProvider;
}
+ public void ungetBootstrapProvider()
+ {
+ bootProvider = null;
+ }
+
public OSGiRuntime getDefaultRuntime()
{
OSGiRuntime runtime;
@@ -91,12 +96,12 @@
return runtime;
}
- public OSGiRuntime getEmbeddedRuntime()
+ public EmbeddedRuntime getEmbeddedRuntime()
{
return new EmbeddedRuntime(this);
}
- public OSGiRuntime getRemoteRuntime()
+ public RemoteRuntime getRemoteRuntime()
{
return new RemoteRuntime(this);
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -151,6 +151,7 @@
{
log.error("Cannot stop the framework", ex);
}
+ getTestHelper().ungetBootstrapProvider();
}
}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -210,6 +210,7 @@
{
super.shutdown();
getPackageAdmin().refreshPackages(null);
+ getTestHelper().ungetBootstrapProvider();
}
}
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-22 10:03:18 UTC (rev 95389)
@@ -72,6 +72,10 @@
<version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
<version.ops4j.pax.web>0.7.1</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
+
+ <surefire.memory.args>-Xmx512m</surefire.memory.args>
+ <surefire.jpda.args></surefire.jpda.args>
+ <surefire.profiler.args></surefire.profiler.args>
</properties>
<!-- DependencyManagement -->
@@ -283,6 +287,14 @@
<enabled>true</enabled>
</snapshots>
</repository>
+ <repository>
+ <id>ops4j.snapshots</id>
+ <name>The OPS4J Snapshot Repository</name>
+ <url>http://repository.ops4j.org/mvn-snapshots/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
</repositories>
<!-- Profiles -->
@@ -320,19 +332,28 @@
<name>jpda</name>
</property>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <properties>
+ <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
+ </properties>
</profile>
<!--
+ Name: yourkit
+ Descr: Enable YourKit remote profiling
+ -->
+ <profile>
+ <id>yourkit</id>
+ <activation>
+ <property>
+ <name>yourkit</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.profiler.args>-agentlib:yjpagent=onexit=memory</surefire.profiler.args>
+ </properties>
+ </profile>
+
+ <!--
Name: embedded-testing
Descr: Setup for embedded integration testing
-->
Copied: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentActivator.java (from rev 95382, projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServices.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentActivator.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -0,0 +1,101 @@
+/*
+ * 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.deployment;
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+
+import org.jboss.osgi.deployment.deployer.DeployerService;
+import org.jboss.osgi.deployment.deployer.DeploymentRegistryService;
+import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
+import org.jboss.osgi.deployment.internal.DeploymentRegistryServiceImpl;
+import org.jboss.osgi.deployment.internal.LifecycleInterceptorServiceImpl;
+import org.jboss.osgi.deployment.internal.SystemDeployerService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The deployers activator
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 15-Oct-2009
+ */
+public class DeploymentActivator
+{
+ public void start(BundleContext context)
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null BundleContext");
+
+ // Register the DeploymentRegistryService
+ DeploymentRegistryService registry = new DeploymentRegistryServiceImpl(context);
+ context.registerService(DeploymentRegistryService.class.getName(), registry, null);
+
+ // Register the SystemDeployerService
+ Properties props = new Properties();
+ props.put("provider", "system");
+ final SystemDeployerService deployerService = new SystemDeployerService(context);
+ context.registerService(DeployerService.class.getName(), deployerService, props);
+
+ // Register the lifecycle interceptor related services
+ LifecycleInterceptorService service = new LifecycleInterceptorServiceImpl(context);
+ context.registerService(LifecycleInterceptorService.class.getName(), service, null);
+
+ // Track other DeployerService implementations and register as MBean
+ ServiceTracker serviceTracker = new ServiceTracker(context, DeployerService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ DeployerService service = (DeployerService)super.addingService(reference);
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
+ {
+ MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+ deployerService.registerDeployerServiceMBean(context, mbeanServer);
+ }
+ return service;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
+ {
+ MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+ deployerService.unregisterDeployerServiceMBean(mbeanServer);
+ }
+ super.removedService(reference, service);
+ }
+ };
+ serviceTracker.open();
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServices.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServices.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/DeploymentServices.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -1,101 +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.osgi.deployment;
-
-//$Id$
-
-import java.util.Properties;
-
-import javax.management.MBeanServer;
-
-import org.jboss.osgi.deployment.deployer.DeployerService;
-import org.jboss.osgi.deployment.deployer.DeploymentRegistryService;
-import org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService;
-import org.jboss.osgi.deployment.internal.DeploymentRegistryServiceImpl;
-import org.jboss.osgi.deployment.internal.LifecycleInterceptorServiceImpl;
-import org.jboss.osgi.deployment.internal.SystemDeployerService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * The deployers activator
- *
- * @author thomas.diesler at jboss.com
- * @since 15-Oct-2009
- */
-public class DeploymentServices
-{
- public void start(BundleContext context)
- {
- if (context == null)
- throw new IllegalArgumentException("Null BundleContext");
-
- // Register the DeploymentRegistryService
- DeploymentRegistryService registry = new DeploymentRegistryServiceImpl(context);
- context.registerService(DeploymentRegistryService.class.getName(), registry, null);
-
- // Register the SystemDeployerService
- Properties props = new Properties();
- props.put("provider", "system");
- final SystemDeployerService deployerService = new SystemDeployerService(context);
- context.registerService(DeployerService.class.getName(), deployerService, props);
-
- // Register the lifecycle interceptor related services
- LifecycleInterceptorService service = new LifecycleInterceptorServiceImpl(context);
- context.registerService(LifecycleInterceptorService.class.getName(), service, null);
-
- // Track other DeployerService implementations and register as MBean
- ServiceTracker serviceTracker = new ServiceTracker(context, DeployerService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- DeployerService service = (DeployerService)super.addingService(reference);
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref != null)
- {
- MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- deployerService.registerDeployerServiceMBean(context, mbeanServer);
- }
- return service;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref != null)
- {
- MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- deployerService.unregisterDeployerServiceMBean(mbeanServer);
- }
- super.removedService(reference, service);
- }
- };
- serviceTracker.open();
- }
-
- public void stop(BundleContext context)
- {
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/blueprint/BlueprintTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -30,7 +30,6 @@
import javax.management.MBeanServer;
import org.jboss.osgi.blueprint.BlueprintCapability;
-import org.jboss.osgi.husky.Bridge;
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.HuskyCapability;
import org.jboss.osgi.husky.annotation.ProvideContext;
@@ -58,9 +57,7 @@
{
@ProvideContext
public static BundleContext context;
-
private static OSGiRuntime runtime;
- private static Bridge huskyBridge;
@BeforeClass
public static void beforeClass() throws Exception
@@ -71,8 +68,6 @@
runtime.addCapability(new HuskyCapability());
runtime.addCapability(new BlueprintCapability());
- huskyBridge = BridgeFactory.getBridge();
-
OSGiBundle bundle = runtime.installBundle("example-blueprint.jar");
bundle.start();
}
@@ -82,14 +77,18 @@
public static void afterClass() throws Exception
{
if (context == null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
+ context = null;
}
@Test
public void testBlueprintBundleInstall() throws Exception
{
if (context == null)
- huskyBridge.run();
+ BridgeFactory.getBridge().run();
assumeNotNull(context);
@@ -101,7 +100,7 @@
public void testBlueprintContainerAvailable() throws Exception
{
if (context == null)
- huskyBridge.run();
+ BridgeFactory.getBridge().run();
assumeNotNull(context);
@@ -113,7 +112,7 @@
public void testServiceA() throws Exception
{
if (context == null)
- huskyBridge.run();
+ BridgeFactory.getBridge().run();
assumeNotNull(context);
@@ -129,7 +128,7 @@
public void testServiceB() throws Exception
{
if (context == null)
- huskyBridge.run();
+ BridgeFactory.getBridge().run();
assumeNotNull(context);
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -75,6 +75,7 @@
public static void tearDownClass() throws Exception
{
runtime.shutdown();
+ runtime = null;
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -59,7 +59,10 @@
public static void tearDownClass() throws Exception
{
if (runtime != null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -58,7 +58,10 @@
public static void tearDownClass() throws Exception
{
if (runtime != null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -66,7 +66,10 @@
public static void tearDownClass() throws Exception
{
if (runtime != null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/webapp/WebAppTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -65,6 +65,7 @@
public static void tearDownClass() throws Exception
{
runtime.shutdown();
+ runtime = null;
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/jaxb/JAXBTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -80,7 +80,11 @@
{
// Only do this if we are not within the OSGi Runtime
if (context == null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
+ context = null;
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/DOMParserTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -84,7 +84,11 @@
{
// Only do this if we are not within the OSGi Runtime
if (context == null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
+ context = null;
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/xml/parser/SAXParserTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -82,7 +82,11 @@
{
// Only do this if we are not within the OSGi Runtime
if (context == null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
+ context = null;
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-10-22 10:03:18 UTC (rev 95389)
@@ -12,7 +12,7 @@
felix.log.logger.instance=org.jboss.osgi.felix.FelixLogger
# Framework bootdelegation
-# org.osgi.framework.bootdelegation=org.osgi.service.log
+org.osgi.framework.bootdelegation=com.yourkit.runtime
# Extra System Packages
org.osgi.framework.system.packages.extra=\
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGI108TestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -63,7 +63,10 @@
public static void afterClass() throws BundleException
{
if (runtime != null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
}
@Before
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi112/OSGI112TestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -57,7 +57,10 @@
public static void afterClass() throws BundleException
{
if (runtime != null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
}
/**
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGI92TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGI92TestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi92/OSGI92TestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -61,7 +61,10 @@
public static void afterClass() throws BundleException
{
if (runtime != null)
+ {
runtime.shutdown();
+ runtime = null;
+ }
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -31,8 +31,6 @@
import org.jboss.osgi.microcontainer.MicrocontainerCapability;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.internal.RemoteRuntime;
@@ -51,8 +49,7 @@
*/
public class OSGI36TestCase extends OSGiTest
{
- static OSGiRuntime runtime;
- static OSGiBundle bundle;
+ private static RemoteRuntime runtime;
@BeforeClass
public static void setUpClass() throws Exception
@@ -62,16 +59,19 @@
runtime.addCapability(new JMXCapability());
runtime.addCapability(new MicrocontainerCapability());
- bundle = runtime.installBundle("jbosgi36-bundle.jar");
- ((RemoteRuntime)runtime).deploy("jbosgi36-mbean.jar");
+ runtime.installBundle("jbosgi36-bundle.jar");
+ runtime.deploy("jbosgi36-mbean.jar");
}
@AfterClass
public static void tearDownClass() throws Exception
{
- ((RemoteRuntime)runtime).undeploy("jbosgi36-mbean.jar");
-
- runtime.shutdown();
+ if (runtime != null)
+ {
+ runtime.undeploy("jbosgi36-mbean.jar");
+ runtime.shutdown();
+ runtime = null;
+ }
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-10-22 10:03:18 UTC (rev 95389)
@@ -78,7 +78,11 @@
@AfterClass
public static void tearDownClass() throws Exception
{
- runtime.shutdown();
+ if (runtime != null)
+ {
+ runtime.shutdown();
+ runtime = null;
+ }
}
@Test
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-22 09:55:48 UTC (rev 95388)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-10-22 10:03:18 UTC (rev 95389)
@@ -37,6 +37,7 @@
<!-- Properties -->
<properties>
+ <surefire.system.args>${surefire.memory.args} ${surefire.jpda.args} ${surefire.profiler.args}</surefire.system.args>
<version.jmx.invoker.adaptor.client>5.0.1.GA</version.jmx.invoker.adaptor.client>
<version.jnp.client>5.0.1.GA</version.jnp.client>
</properties>
@@ -132,7 +133,7 @@
<artifactId>jboss-osgi-webapp</artifactId>
<scope>provided</scope>
</dependency>
-
+
<!-- OPS4J -->
<dependency>
<groupId>org.ops4j.pax.web</groupId>
@@ -168,6 +169,14 @@
<filtering>true</filtering>
</testResource>
</testResources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${surefire.system.args}</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
<!-- Profiles -->
@@ -202,16 +211,6 @@
<scope>provided</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Xmx512m</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
</profile>
<!--
@@ -236,16 +235,6 @@
<scope>provided</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Xmx512m</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
</profile>
<!--
@@ -272,16 +261,6 @@
<scope>provided</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-Xmx512m</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
</profile>
<profile>
<id>framework-default</id>
@@ -302,18 +281,6 @@
<scope>provided</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- YourKit Profiling
- <argLine>-agentlib:yjpagent=onexit=memory</argLine>
- -->
- </configuration>
- </plugin>
- </plugins>
- </build>
</profile>
<!--
More information about the jboss-cvs-commits
mailing list