JBoss-OSGI SVN: r89665 - projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 09:00:39 -0400 (Tue, 02 Jun 2009)
New Revision: 89665
Modified:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
Log:
Add spi.logging
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-02 12:55:10 UTC (rev 89664)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-02 13:00:39 UTC (rev 89665)
@@ -19,6 +19,7 @@
org.jboss.logging, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
+ org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
15 years, 4 months
JBoss-OSGI SVN: r89664 - in projects/jboss-osgi/trunk: bundles/common/src/main/java/org/jboss/osgi/common/service and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 08:55:10 -0400 (Tue, 02 Jun 2009)
New Revision: 89664
Added:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeServiceActivator.java
Removed:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java
Modified:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.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/internal/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.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/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBean.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBeanMBean.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd
Log:
Provide a propper MC service example
Modified: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/AbstractCommonServicesActivator.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -32,6 +32,7 @@
import org.jboss.osgi.common.service.DeployerServiceDelegate;
import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogReaderService;
import org.osgi.util.tracker.ServiceTracker;
@@ -60,21 +61,23 @@
logTracker.open();
}
- protected DeployerServiceDelegate registerDeployerServices(BundleContext context)
+ protected DeployerService registerDeployerServices(BundleContext context)
{
// Register the SystemDeployerService
Properties props = new Properties();
- props.setProperty("provider", "system");
- SystemDeployerService service = new SystemDeployerService(context);
- context.registerService(DeployerService.class.getName(), service, props);
+ props.put("provider", "system");
+ SystemDeployerService systemDeployer = new SystemDeployerService(context);
+ context.registerService(DeployerService.class.getName(), systemDeployer, props);
// Register the DeployerServiceDelegate
- DeployerServiceDelegate delegate = new DeployerServiceDelegate(context);
- context.registerService(DeployerServiceDelegate.class.getName(), delegate, null);
- return delegate;
+ props = new Properties();
+ props.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE);
+ DeployerService deployerDelegate = new DeployerServiceDelegate(context);
+ context.registerService(DeployerService.class.getName(), deployerDelegate, props);
+ return deployerDelegate;
}
- protected void registerDeployerServiceMBean(MBeanServer mbeanServer, DeployerServiceDelegate delegate)
+ protected void registerDeployerServiceMBean(MBeanServer mbeanServer, DeployerService delegate)
{
try
{
Modified: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -27,7 +27,7 @@
import javax.management.MBeanServer;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.DeployerServiceDelegate;
+import org.jboss.osgi.spi.service.DeployerService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -58,13 +58,13 @@
trackLogReaderService(context);
// Register the system SystemDeployerService and DeployerServiceDelegate
- DeployerServiceDelegate delegate = registerDeployerServices(context);
+ DeployerService deployer = registerDeployerServices(context);
// Track the MBeanServer and register the DeployerServiceDelegate
- trackMBeanServer(context, delegate);
+ trackMBeanServer(context, deployer);
}
- private void trackMBeanServer(BundleContext context, final DeployerServiceDelegate delegate)
+ private void trackMBeanServer(BundleContext context, final DeployerService deployer)
{
ServiceTracker jmxTracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
{
@@ -72,7 +72,7 @@
public Object addingService(ServiceReference reference)
{
MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
- registerDeployerServiceMBean(mbeanServer, delegate);
+ registerDeployerServiceMBean(mbeanServer, deployer);
return mbeanServer;
}
Modified: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerServiceDelegate.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -99,7 +99,6 @@
private DeployerService getMicrocontainerDeployerService()
{
DeployerService service = null;
-
try
{
String filter = "(provider=microcontainer)";
@@ -112,18 +111,27 @@
{
throw new IllegalArgumentException(ex);
}
-
return service;
}
private DeployerService getSystemDeployerService()
{
- String serviceName = DeployerService.class.getName();
- ServiceReference sref = context.getServiceReference(serviceName);
- if (sref == null)
+ DeployerService service = null;
+ try
+ {
+ String filter = "(provider=system)";
+ String serviceName = DeployerService.class.getName();
+ ServiceReference[] srefs = context.getServiceReferences(serviceName, filter);
+ if (srefs != null)
+ service = (DeployerService)context.getService(srefs[0]);
+ }
+ catch (InvalidSyntaxException ex)
+ {
+ throw new IllegalArgumentException(ex);
+ }
+
+ if (service == null)
throw new IllegalStateException("Cannot obtain system DeployerService");
-
- return (DeployerService)context.getService(sref);
+ return service;
}
-
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -35,9 +35,9 @@
import java.util.jar.Manifest;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.DeployerServiceDelegate;
import org.jboss.osgi.service.hotdeploy.DeploymentScannerService;
import org.jboss.osgi.spi.service.BundleInfo;
+import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.BundleInfo.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -60,7 +60,7 @@
private File scanLocation;
private long scanCount;
- private DeployerServiceDelegate delegate;
+ private DeployerService deployer;
private ScannerThread scannerThread;
private List<BundleInfo> lastScan = new ArrayList<BundleInfo>();
private boolean traceBundles = false;
@@ -71,8 +71,8 @@
this.context = context;
// Get the DeployerServiceDelegate
- ServiceReference sref = context.getServiceReference(DeployerServiceDelegate.class.getName());
- delegate = (DeployerServiceDelegate)context.getService(sref);
+ ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
+ deployer = (DeployerService)context.getService(sref);
initScanner(context);
}
@@ -136,7 +136,7 @@
try
{
BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
- delegate.undeploy(infoArr);
+ deployer.undeploy(infoArr);
}
catch (Exception ex)
{
@@ -162,7 +162,7 @@
try
{
BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
- delegate.deploy(infoArr);
+ deployer.deploy(infoArr);
}
catch (Exception ex)
{
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-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -46,7 +46,7 @@
// Provide logging
final Logger log = Logger.getLogger(OSGiTest.class);
- private OSGiTestHelper helper = new OSGiTestHelper();
+ private OSGiTestHelper helper;
protected OSGiTest()
{
@@ -55,6 +55,20 @@
}
/**
+ * Get the test helper used by this test
+ *
+ * Overwrite if you need to supply another helper
+ * i.e. one that you have statically setup
+ */
+ protected OSGiTestHelper getTestHelper()
+ {
+ if (helper == null)
+ helper = new OSGiTestHelper();
+
+ return helper;
+ }
+
+ /**
* Writes a a debug start messge
*/
@Before
@@ -95,7 +109,7 @@
*/
protected OSGiRuntime getDefaultRuntime()
{
- return helper.getDefaultRuntime();
+ return getTestHelper().getDefaultRuntime();
}
/**
@@ -103,7 +117,7 @@
*/
protected OSGiRuntime getEmbeddedRuntime()
{
- return helper.getEmbeddedRuntime();
+ return getTestHelper().getEmbeddedRuntime();
}
/**
@@ -111,7 +125,7 @@
*/
public OSGiRuntime getRemoteRuntime()
{
- return helper.getRemoteRuntime();
+ return getTestHelper().getRemoteRuntime();
}
/**
@@ -119,7 +133,7 @@
*/
protected URL getResourceURL(String resource)
{
- return helper.getResourceURL(resource);
+ return getTestHelper().getResourceURL(resource);
}
/**
@@ -127,7 +141,7 @@
*/
protected File getResourceFile(String resource)
{
- return helper.getResourceFile(resource);
+ return getTestHelper().getResourceFile(resource);
}
/**
@@ -135,7 +149,7 @@
*/
protected URL getTestArchiveURL(String archive)
{
- return helper.getTestArchiveURL(archive);
+ return getTestHelper().getTestArchiveURL(archive);
}
/**
@@ -143,7 +157,7 @@
*/
protected File getTestArchiveFile(String archive)
{
- return helper.getTestArchiveFile(archive);
+ return getTestHelper().getTestArchiveFile(archive);
}
/**
@@ -151,7 +165,7 @@
*/
public InitialContext getInitialContext() throws NamingException
{
- return helper.getInitialContext();
+ return getTestHelper().getInitialContext();
}
/**
@@ -159,7 +173,7 @@
*/
public Integer getJndiPort()
{
- return helper.getJndiPort();
+ return getTestHelper().getJndiPort();
}
/**
@@ -167,6 +181,6 @@
*/
public String getServerHost()
{
- return helper.getServerHost();
+ return getTestHelper().getServerHost();
}
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -37,6 +37,7 @@
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
import org.jboss.osgi.spi.testing.OSGiRuntime;
@@ -66,9 +67,15 @@
public OSGiBundle installBundle(String location) throws BundleException
{
+ String symbolicName = getSymbolicName(location);
+
URL bundleURL = getTestHelper().getTestArchiveURL(location);
- Bundle bundle = getBundleContext().installBundle(bundleURL.toExternalForm());
- return new EmbeddedBundle(bundle);
+ ServiceReference sref = getBundleContext().getServiceReference(DeployerService.class.getName());
+ DeployerService service = (DeployerService)getBundleContext().getService(sref);
+ service.deploy(bundleURL);
+
+ OSGiBundle bundle = getBundle(symbolicName, null);
+ return bundle;
}
public OSGiBundle[] getBundles()
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-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -231,21 +231,22 @@
protected String getSymbolicName(String location)
{
- String symbolicName = null;
+ Manifest manifest;
try
{
File archiveFile = getTestHelper().getTestArchiveFile(location);
JarFile jarFile = new JarFile(archiveFile);
- Manifest manifest = jarFile.getManifest();
+ manifest = jarFile.getManifest();
jarFile.close();
-
- Attributes attribs = manifest.getMainAttributes();
- symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
}
catch (IOException ex)
{
+ throw new IllegalStateException("Cannot get manifest from: " + location);
}
+
+ Attributes attribs = manifest.getMainAttributes();
+ String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
if (symbolicName == null)
throw new IllegalArgumentException("Cannot obtain Bundle-SymbolicName for: " + location);
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-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -25,9 +25,7 @@
import static org.junit.Assert.assertEquals;
-import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
-import javax.naming.InitialContext;
import org.jboss.osgi.spi.capability.JMXCapability;
import org.jboss.osgi.spi.capability.JNDICapability;
@@ -77,17 +75,4 @@
FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, oname, runtime.getMBeanServer());
assertEquals("hello", foo.echo("hello"));
}
-
- @Test
- public void testRMIAdaptor() throws Exception
- {
- // Lookup the MBeanServerConnection
- InitialContext iniCtx = runtime.getInitialContext();
- MBeanServerConnection rmiAdaptor = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
-
- // Access the MBean through the MBeanServerConnection
- ObjectName oname = new ObjectName("jboss.osgi:service=mbean-test-service");
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, oname, rmiAdaptor);
- assertEquals("hello", foo.echo("hello"));
- }
}
\ No newline at end of file
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-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -23,29 +23,17 @@
//$Id$
-import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
-import static org.jboss.osgi.spi.service.DeployerService.MBEAN_DEPLOYER_SERVICE;
-import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_KERNEL;
-import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_MBEAN_SERVER;
-import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-import static org.jboss.osgi.spi.service.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.jboss.test.osgi.example.microcontainer.bundleB.SomeBeanMBean.MBEAN_NAME;
+import static org.junit.Assert.assertEquals;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
import org.jboss.osgi.spi.capability.JNDICapability;
import org.jboss.osgi.spi.capability.MicrocontainerCapability;
import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.osgi.spi.service.DeployerService;
-import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
+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.test.osgi.example.microcontainer.bundleB.SomeBeanMBean;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -58,7 +46,9 @@
*/
public class MicrocontainerTestCase extends OSGiTest
{
- private static OSGiRuntime runtime;
+ static OSGiRuntime runtime;
+ static OSGiBundle bundleA;
+ static OSGiBundle bundleB;
@BeforeClass
public static void setUpClass() throws Exception
@@ -66,60 +56,31 @@
runtime = new OSGiTestHelper().getDefaultRuntime();
runtime.addCapability(new JNDICapability());
runtime.addCapability(new MicrocontainerCapability());
+
+ bundleA = runtime.installBundle("example-mcservice-bundleA.jar");
+ bundleB = runtime.installBundle("example-mcservice-bundleB.jar");
+
+ bundleA.start();
}
@AfterClass
public static void tearDownClass() throws Exception
{
+ if (bundleA != null)
+ bundleA.uninstall();
+
+ if (bundleB != null)
+ bundleB.uninstall();
+
runtime.shutdown();
}
@Test
- public void testServiceAccess() throws Exception
- {
- MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
- List<String> registeredBeans = mcService.getRegisteredBeans();
- assertTrue("BundleContext registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
- assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
- assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
- }
-
- /**
- * Test whether the bundle can be deployed through the MicrocontainerServiceMBean
- */
- @Test
- public void testBundleDeployment() throws Exception
- {
- DeployerService deployer = MBeanProxy.get(DeployerService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
- deployer.deploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
-
- ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
- Set<ObjectName> bundles = frameworkMBean.getBundles();
- assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleA") > 0);
-
- deployer.undeploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
- }
-
- @Test
public void testBeansDeployment() throws Exception
{
- MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
- DeployerService deployer = MBeanProxy.get(DeployerService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
-
- deployer.deploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
-
- ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
- Set<ObjectName> bundles = frameworkMBean.getBundles();
- assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleB") > 0);
-
- // Check whether the bean is registered
- List<String> registeredBeans = mcService.getRegisteredBeans();
- assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
-
- deployer.undeploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
-
- // Check whether the bean is unregistered
- registeredBeans = mcService.getRegisteredBeans();
- assertFalse("SomeBean unregistered", registeredBeans.contains("SomeBean"));
+ // Access the bean through JMX
+ SomeBeanMBean someBean = MBeanProxy.get(SomeBeanMBean.class, MBEAN_NAME, runtime.getMBeanServer());
+ assertEquals("hello", someBean.echo("hello"));
+ assertEquals("hello", someBean.callSomeService("hello"));
}
}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.example.microcontainer.bundleA;
-
-//$Id$
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * A Service Activator
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Apr-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- public void start(BundleContext context)
- {
- SomeService service = new SomeService(context);
- context.registerService(SomeService.class.getName(), service, null);
- }
-
- 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/microcontainer/bundleA/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -23,9 +23,8 @@
//$Id$
-import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-
import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.test.osgi.example.microcontainer.bundleB.SomeBean;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -42,25 +41,15 @@
public SomeService(BundleContext context)
{
this.context = context;
-
- MicrocontainerService mcService = getMicrocontainerService();
- BundleContext bundleContext = (BundleContext)mcService.getRegisteredBean(BEAN_SYSTEM_BUNDLE_CONTEXT);
- if (bundleContext == null)
- throw new IllegalStateException("No BundleContext as MC Bean");
}
-// public String callSomeBean(String msg)
-// {
-// MicrocontainerService mcService = getMicrocontainerService();
-// SomeBean bean = (SomeBean)mcService.getRegisteredBean(SomeBean.class.getName());
-// return bean.echo(msg);
-// }
-
- public String echo(String msg)
+ public String callSomeBean(String msg)
{
- return msg;
+ MicrocontainerService mcService = getMicrocontainerService();
+ SomeBean bean = (SomeBean)mcService.getRegisteredBean("SomeBean");
+ return bean.echo(msg);
}
-
+
private MicrocontainerService getMicrocontainerService()
{
ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeServiceActivator.java (from rev 89649, projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeServiceActivator.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -0,0 +1,46 @@
+/*
+ * 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.example.microcontainer.bundleA;
+
+//$Id$
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SomeServiceActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ SomeService service = new SomeService(context);
+ context.registerService(SomeService.class.getName(), service, null);
+ }
+
+ 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/microcontainer/bundleB/SomeBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBean.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBean.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -26,6 +26,10 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
+import org.jboss.test.osgi.example.microcontainer.bundleA.SomeService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
/**
* An MC bean that accesses some OSGi service
*
@@ -34,6 +38,7 @@
*/
public class SomeBean implements SomeBeanMBean
{
+ private BundleContext bundleContext;
private MBeanServer mbeanServer;
public void setMbeanServer(MBeanServer server)
@@ -41,6 +46,23 @@
this.mbeanServer = server;
}
+ public void setBundleContext(BundleContext systemContext)
+ {
+ this.bundleContext = systemContext;
+ }
+
+ public String echo(String msg)
+ {
+ return msg;
+ }
+
+ public String callSomeService(String msg)
+ {
+ ServiceReference sref = bundleContext.getServiceReference(SomeService.class.getName());
+ SomeService service = (SomeService)bundleContext.getService(sref);
+ return service.callSomeBean(msg);
+ }
+
public void create() throws Exception
{
mbeanServer.registerMBean(this, new ObjectName("jboss.osgi:bean=SomeBean"));
@@ -50,9 +72,4 @@
{
mbeanServer.unregisterMBean(new ObjectName("jboss.osgi:bean=SomeBean"));
}
-
- public String echo(String msg)
- {
- return msg;
- }
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBeanMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBeanMBean.java 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBeanMBean.java 2009-06-02 12:55:10 UTC (rev 89664)
@@ -21,9 +21,17 @@
*/
package org.jboss.test.osgi.example.microcontainer.bundleB;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+
//$Id$
public interface SomeBeanMBean
{
+ ObjectName MBEAN_NAME = ObjectNameFactory.create("jboss.osgi:bean=SomeBean");
+
+ String callSomeService(String msg);
+
String echo(String msg);
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml 2009-06-02 12:55:10 UTC (rev 89664)
@@ -1,6 +1,7 @@
<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
<bean name="SomeBean" class="org.jboss.test.osgi.example.microcontainer.bundleB.SomeBean">
+ <property name="bundleContext"><inject bean="jboss.osgi:service=BundleContext"/></property>
<property name="mbeanServer"><inject bean="jboss.osgi:service=MBeanServer"/></property>
</bean>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-06-02 12:55:10 UTC (rev 89664)
@@ -2,8 +2,8 @@
Bundle-SymbolicName: example-mcservice-bundleA
-Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundleA.ServiceActivator
+Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundleA.SomeServiceActivator
Export-Package: org.jboss.test.osgi.example.microcontainer.bundleA
-Import-Package: org.jboss.osgi.spi.service, org.osgi.framework
+Import-Package: org.jboss.test.osgi.example.microcontainer.bundleB, org.jboss.osgi.spi.service, org.osgi.framework
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd 2009-06-02 11:32:13 UTC (rev 89663)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd 2009-06-02 12:55:10 UTC (rev 89664)
@@ -4,7 +4,7 @@
Export-Package: org.jboss.test.osgi.example.microcontainer.bundleB
-Import-Package: javax.management
+Import-Package: javax.management, org.jboss.osgi.spi.management, org.jboss.test.osgi.example.microcontainer.bundleA, org.osgi.framework
Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
-removeheaders: Include-Resource
15 years, 4 months
JBoss-OSGI SVN: r89663 - in projects/jboss-osgi/trunk/testsuite/functional/src/test: java/org/jboss/test/osgi/service/microcontainer/bundleA and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 07:32:13 -0400 (Tue, 02 Jun 2009)
New Revision: 89663
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/bundleA/SomeService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd
Log:
Add JMX access to 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-06-02 11:19:21 UTC (rev 89662)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-06-02 11:32:13 UTC (rev 89663)
@@ -29,6 +29,8 @@
import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_MBEAN_SERVER;
import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
import static org.jboss.osgi.spi.service.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+import static org.jboss.test.osgi.service.microcontainer.bundleB.SomeBeanMBean.MBEAN_NAME;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -42,10 +44,12 @@
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.service.MicrocontainerService;
import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.test.osgi.service.microcontainer.bundleB.SomeBeanMBean;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -119,6 +123,10 @@
List<String> registeredBeans = mcService.getRegisteredBeans();
assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
+ // Access the bean through JMX
+ SomeBeanMBean someBean = MBeanProxy.get(SomeBeanMBean.class, MBEAN_NAME, runtime.getMBeanServer());
+ assertEquals("hello", someBean.echo("hello"));
+
deployer.undeploy(getTestArchiveURL("service/mcservice-bundleB.jar"));
// Check whether the bean is unregistered
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/SomeService.java 2009-06-02 11:19:21 UTC (rev 89662)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/SomeService.java 2009-06-02 11:32:13 UTC (rev 89663)
@@ -30,7 +30,7 @@
import org.osgi.framework.ServiceReference;
/**
- * A service that accesses the MicrocontainerService
+ * A service that accesses the {@link MicrocontainerService}
*
* @author thomas.diesler(a)jboss.com
* @since 24-Apr-2009
@@ -49,13 +49,6 @@
throw new IllegalStateException("No BundleContext as MC Bean");
}
-// public String callSomeBean(String msg)
-// {
-// MicrocontainerService mcService = getMicrocontainerService();
-// SomeBean bean = (SomeBean)mcService.getRegisteredBean(SomeBean.class.getName());
-// return bean.echo(msg);
-// }
-
public String echo(String msg)
{
return msg;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.java 2009-06-02 11:19:21 UTC (rev 89662)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.java 2009-06-02 11:32:13 UTC (rev 89663)
@@ -24,8 +24,8 @@
//$Id$
import javax.management.MBeanServer;
-import javax.management.ObjectName;
+
/**
* An MC bean that accesses some OSGi service
*
@@ -43,12 +43,12 @@
public void create() throws Exception
{
- mbeanServer.registerMBean(this, new ObjectName("jboss.osgi:bean=SomeBean"));
+ mbeanServer.registerMBean(this, MBEAN_NAME);
}
public void destroy() throws Exception
{
- mbeanServer.unregisterMBean(new ObjectName("jboss.osgi:bean=SomeBean"));
+ mbeanServer.unregisterMBean(MBEAN_NAME);
}
public String echo(String msg)
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java 2009-06-02 11:19:21 UTC (rev 89662)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java 2009-06-02 11:32:13 UTC (rev 89663)
@@ -23,7 +23,13 @@
//$Id$
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+
public interface SomeBeanMBean
{
+ ObjectName MBEAN_NAME = ObjectNameFactory.create("jboss.osgi:bean=SomeBean");
+
String echo(String msg);
}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd 2009-06-02 11:19:21 UTC (rev 89662)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd 2009-06-02 11:32:13 UTC (rev 89663)
@@ -4,7 +4,7 @@
Export-Package: org.jboss.test.osgi.service.microcontainer.bundleB
-Import-Package: javax.management
+Import-Package: javax.management, org.jboss.osgi.spi.management
Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
-removeheaders: Include-Resource
15 years, 4 months
JBoss-OSGI SVN: r89662 - in projects/jboss-osgi/trunk/testsuite/functional: src/test/java/org/jboss/test/osgi/service and 8 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 07:19:21 -0400 (Tue, 02 Jun 2009)
New Revision: 89662
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/
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/bundleA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/SomeService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/META-INF/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/META-INF/mcservice-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/startlevel.bnd
Removed:
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd
Modified:
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
Log:
Add MCService functional test
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-06-02 11:03:01 UTC (rev 89661)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-06-02 11:19:21 UTC (rev 89662)
@@ -78,9 +78,13 @@
<!-- jbosgi41 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
- <!-- service-startlevel -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/service-startlevel.jar" files="${tests.resources.dir}/service/startlevel/service-startlevel.bnd" />
+ <!-- startlevel -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/startlevel.jar" files="${tests.resources.dir}/service/startlevel/startlevel.bnd" />
+ <!-- mcservice -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/mcservice-bundleA.jar" files="${tests.resources.dir}/service/mcservice/mcservice-bundleA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/mcservice-bundleB.jar" files="${tests.resources.dir}/service/mcservice/mcservice-bundleB.bnd" />
+
<!-- Please add alphabetically -->
</target>
Added: 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 (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.java 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,128 @@
+/*
+ * 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.microcontainer;
+
+//$Id$
+
+import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
+import static org.jboss.osgi.spi.service.DeployerService.MBEAN_DEPLOYER_SERVICE;
+import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_KERNEL;
+import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_MBEAN_SERVER;
+import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static org.jboss.osgi.spi.service.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.capability.JNDICapability;
+import org.jboss.osgi.spi.capability.MicrocontainerCapability;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.spi.service.DeployerService;
+import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * A test that checks {@link MicrocontainerService} functionality
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Feb-2009
+ */
+public class MicrocontainerServiceTestCase extends OSGiTest
+{
+ private static OSGiRuntime runtime;
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new JNDICapability());
+ runtime.addCapability(new MicrocontainerCapability());
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ runtime.shutdown();
+ }
+
+ @Test
+ public void testServiceAccess() throws Exception
+ {
+ MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
+ List<String> registeredBeans = mcService.getRegisteredBeans();
+ assertTrue("BundleContext registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
+ assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
+ assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
+ }
+
+ /**
+ * Test whether a bundle can be deployed through the {@link DeployerService}
+ */
+ @Test
+ public void testBundleDeployment() throws Exception
+ {
+ DeployerService deployer = MBeanProxy.get(DeployerService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
+ deployer.deploy(getTestArchiveURL("service/mcservice-bundleA.jar"));
+
+ ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
+ Set<ObjectName> bundles = frameworkMBean.getBundles();
+ assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=mcservice-bundleA") > 0);
+
+ deployer.undeploy(getTestArchiveURL("service/mcservice-bundleA.jar"));
+ }
+
+ /**
+ * Test whether a bundle that contains beans can be deployed through the {@link DeployerService}
+ */
+ @Test
+ public void testBeansDeployment() throws Exception
+ {
+ MicrocontainerServiceMBean mcService = MBeanProxy.get(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE, runtime.getMBeanServer());
+ DeployerService deployer = MBeanProxy.get(DeployerService.class, MBEAN_DEPLOYER_SERVICE, runtime.getMBeanServer());
+
+ deployer.deploy(getTestArchiveURL("service/mcservice-bundleB.jar"));
+
+ ManagedFrameworkMBean frameworkMBean = MBeanProxy.get(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK, runtime.getMBeanServer());
+ Set<ObjectName> bundles = frameworkMBean.getBundles();
+ assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=mcservice-bundleB") > 0);
+
+ // Check whether the bean is registered
+ List<String> registeredBeans = mcService.getRegisteredBeans();
+ assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
+
+ deployer.undeploy(getTestArchiveURL("service/mcservice-bundleB.jar"));
+
+ // Check whether the bean is unregistered
+ registeredBeans = mcService.getRegisteredBeans();
+ assertFalse("SomeBean unregistered", registeredBeans.contains("SomeBean"));
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/MicrocontainerServiceTestCase.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/microcontainer/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/ServiceActivator.java 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,46 @@
+/*
+ * 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.microcontainer.bundleA;
+
+//$Id$
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ SomeService service = new SomeService(context);
+ context.registerService(SomeService.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/ServiceActivator.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/microcontainer/bundleA/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/SomeService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/SomeService.java 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,73 @@
+/*
+ * 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.microcontainer.bundleA;
+
+//$Id$
+
+import static org.jboss.osgi.spi.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A service that accesses the MicrocontainerService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SomeService
+{
+ private BundleContext context;
+
+ public SomeService(BundleContext context)
+ {
+ this.context = context;
+
+ MicrocontainerService mcService = getMicrocontainerService();
+ BundleContext bundleContext = (BundleContext)mcService.getRegisteredBean(BEAN_SYSTEM_BUNDLE_CONTEXT);
+ if (bundleContext == null)
+ throw new IllegalStateException("No BundleContext as MC Bean");
+ }
+
+// public String callSomeBean(String msg)
+// {
+// MicrocontainerService mcService = getMicrocontainerService();
+// SomeBean bean = (SomeBean)mcService.getRegisteredBean(SomeBean.class.getName());
+// return bean.echo(msg);
+// }
+
+ public String echo(String msg)
+ {
+ return msg;
+ }
+
+ private MicrocontainerService getMicrocontainerService()
+ {
+ ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
+ MicrocontainerService service = (MicrocontainerService)context.getService(sref);
+ if (service == null)
+ throw new IllegalStateException("No MicrocontainerService");
+
+ return service;
+ }
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleA/SomeService.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/microcontainer/bundleB/SomeBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.java 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,58 @@
+/*
+ * 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.microcontainer.bundleB;
+
+//$Id$
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+/**
+ * An MC bean that accesses some OSGi service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SomeBean implements SomeBeanMBean
+{
+ private MBeanServer mbeanServer;
+
+ public void setMbeanServer(MBeanServer server)
+ {
+ this.mbeanServer = server;
+ }
+
+ public void create() throws Exception
+ {
+ mbeanServer.registerMBean(this, new ObjectName("jboss.osgi:bean=SomeBean"));
+ }
+
+ public void destroy() throws Exception
+ {
+ mbeanServer.unregisterMBean(new ObjectName("jboss.osgi:bean=SomeBean"));
+ }
+
+ public String echo(String msg)
+ {
+ return msg;
+ }
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBean.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/microcontainer/bundleB/SomeBeanMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,29 @@
+/*
+ * 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.microcontainer.bundleB;
+
+//$Id$
+
+public interface SomeBeanMBean
+{
+ String echo(String msg);
+}
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/microcontainer/bundleB/SomeBeanMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2009-06-02 11:03:01 UTC (rev 89661)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2009-06-02 11:19:21 UTC (rev 89662)
@@ -45,7 +45,7 @@
OSGiRuntime runtime = getDefaultRuntime();
try
{
- OSGiBundle bundle = runtime.installBundle("service/service-startlevel.jar");
+ OSGiBundle bundle = runtime.installBundle("service/startlevel.jar");
bundle.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundle.getState());
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/META-INF/mcservice-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/META-INF/mcservice-jboss-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/META-INF/mcservice-jboss-beans.xml 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,8 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="SomeBean" class="org.jboss.test.osgi.service.microcontainer.bundleB.SomeBean">
+ <property name="mbeanServer"><inject bean="jboss.osgi:service=MBeanServer"/></property>
+ </bean>
+
+</deployment>
+
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/META-INF/mcservice-jboss-beans.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleA.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleA.bnd 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,9 @@
+# bnd build -classpath target/test-classes -output target/test-libs/mcservice-bundleA.jar src/test/resources/mcservice/mcservice-bundleA.bnd
+
+Bundle-SymbolicName: mcservice-bundleA
+
+Bundle-Activator: org.jboss.test.osgi.service.microcontainer.bundleA.ServiceActivator
+
+Export-Package: org.jboss.test.osgi.service.microcontainer.bundleA
+
+Import-Package: org.jboss.osgi.spi.service, org.osgi.framework
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/mcservice/mcservice-bundleB.bnd 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,10 @@
+# bnd build -classpath target/test-classes -output target/test-libs/mcservice-bundleB.jar src/test/resources/mcservice/mcservice-bundleB.bnd
+
+Bundle-SymbolicName: mcservice-bundleB
+
+Export-Package: org.jboss.test.osgi.service.microcontainer.bundleB
+
+Import-Package: javax.management
+
+Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
+-removeheaders: Include-Resource
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd 2009-06-02 11:03:01 UTC (rev 89661)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd 2009-06-02 11:19:21 UTC (rev 89662)
@@ -1,5 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/service/service-startlevel.jar src/test/resources/service/startlevel/service-startlevel.bnd
-
-Bundle-SymbolicName: service-startlevel
-Bundle-Activator: org.jboss.test.osgi.service.startlevel.bundle.ServiceActivator
-Export-Package: org.jboss.test.osgi.service.startlevel.bundle
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/startlevel.bnd (from rev 89649, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/startlevel.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/startlevel.bnd 2009-06-02 11:19:21 UTC (rev 89662)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/service/startlevel.jar src/test/resources/service/startlevel/startlevel.bnd
+
+Bundle-SymbolicName: service-startlevel
+Bundle-Activator: org.jboss.test.osgi.service.startlevel.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.service.startlevel.bundle
15 years, 4 months
JBoss-OSGI SVN: r89661 - in projects/jboss-osgi/trunk/hudson: hudson-home/jobs and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 07:03:01 -0400 (Tue, 02 Jun 2009)
New Revision: 89661
Added:
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/config.xml
Modified:
projects/jboss-osgi/trunk/hudson/build.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml
projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml
Log:
Add short matrix
Modified: projects/jboss-osgi/trunk/hudson/build.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/build.xml 2009-06-02 10:59:10 UTC (rev 89660)
+++ projects/jboss-osgi/trunk/hudson/build.xml 2009-06-02 11:03:01 UTC (rev 89661)
@@ -28,6 +28,7 @@
<copyjob index="3" prefix="${hudson.job.prefix}" job="jbossosgi-jdk15"/>
<copyjob index="4" prefix="${hudson.job.prefix}" job="jbossosgi-jdk16"/>
<copyjob index="5" prefix="${hudson.job.prefix}" job="jbossosgi-matrix"/>
+ <copyjob index="6" prefix="${hudson.job.prefix}" job="jbossosgi-short-matrix"/>
</sequential>
</macrodef>
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml 2009-06-02 10:59:10 UTC (rev 89660)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml 2009-06-02 11:03:01 UTC (rev 89661)
@@ -18,7 +18,7 @@
<hudson.model.StringParameterDefinition>
<name>CONTAINER</name>
<optional>false</optional>
- <defaultValue>jboss501</defaultValue>
+ <defaultValue>runtime</defaultValue>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml 2009-06-02 10:59:10 UTC (rev 89660)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml 2009-06-02 11:03:01 UTC (rev 89661)
@@ -18,7 +18,7 @@
<hudson.model.StringParameterDefinition>
<name>CONTAINER</name>
<optional>false</optional>
- <defaultValue>jboss501</defaultValue>
+ <defaultValue>runtime</defaultValue>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
Modified: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml 2009-06-02 10:59:10 UTC (rev 89660)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml 2009-06-02 11:03:01 UTC (rev 89661)
@@ -42,11 +42,11 @@
<axis>
<name>container</name>
<values>
+ <string>runtime</string>
<string>jboss501</string>
<string>jboss510</string>
<string>jboss520</string>
<string>jboss600</string>
- <string>runtime</string>
</values>
</axis>
<axis>
Added: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/config.xml
===================================================================
--- projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/config.xml (rev 0)
+++ projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/config.xml 2009-06-02 11:03:01 UTC (rev 89661)
@@ -0,0 +1,89 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<matrix-project>
+ <actions class="java.util.concurrent.CopyOnWriteArrayList"/>
+ <description>Build and test the JBossOSGi @version.id@ Matrix</description>
+ <logRotator>
+ <daysToKeep>60</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <hudson.security.AuthorizationMatrixProperty/>
+ </properties>
+ <scm class="hudson.scm.SubversionSCM">
+ <locations>
+ <hudson.scm.SubversionSCM_-ModuleLocation>
+ <remote>@hudson.osgi.url@</remote>
+ <local>jboss-osgi</local>
+ </hudson.scm.SubversionSCM_-ModuleLocation>
+ </locations>
+ <useUpdate>true</useUpdate>
+ <browser class="hudson.scm.browsers.FishEyeSVN">
+ <url>http://fisheye.jboss.com/browse/JBossOSGi</url>
+ <rootModule></rootModule>
+ </browser>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <triggers class="vector">
+ <hudson.triggers.TimerTrigger>
+ <spec>0 20 * * *</spec>
+ </hudson.triggers.TimerTrigger>
+ </triggers>
+ <axes>
+ <axis>
+ <name>framework</name>
+ <values>
+ <string>felix</string>
+ <string>equinox</string>
+ <string>knopflerfish</string>
+ </values>
+ </axis>
+ <axis>
+ <name>container</name>
+ <values>
+ <string>runtime</string>
+ <string>jboss501</string>
+ </values>
+ </axis>
+ <axis>
+ <name>jdk</name>
+ <values>
+ <string>jdk1.5</string>
+ <string>jdk1.6</string>
+ </values>
+ </axis>
+ </axes>
+ <builders>
+ <hudson.tasks.Shell>
+ <command>
+OSGIDIR=$WORKSPACE/jboss-osgi
+HUDSONDIR=$OSGIDIR/hudson
+
+export FRAMEWORK=$framework
+export CONTAINER=$container
+
+export JBOSS_BINDADDR=(a)jboss.bind.address@
+
+# copy the maven profile
+cp @hudson.maven.profile@ $OSGIDIR/profiles.xml
+
+#
+# call command.sh
+#
+/bin/sh $HUDSONDIR/hudson-home/command.sh
+ </command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers class="vector">
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>jboss-osgi/**/target/surefire-reports/TEST-*.xml</testResults>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.tasks.Mailer>
+ <recipients>@hudson.mail.recipients@</recipients>
+ <dontNotifyEveryUnstableBuild>true</dontNotifyEveryUnstableBuild>
+ <sendToIndividuals>true</sendToIndividuals>
+ </hudson.tasks.Mailer>
+ </publishers>
+ <buildWrappers/>
+</matrix-project>
Property changes on: projects/jboss-osgi/trunk/hudson/hudson-home/jobs/jbossosgi-short-matrix/config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 4 months
JBoss-OSGI SVN: r89660 - in projects/jboss-osgi/trunk: blueprint/testsuite/src/test/resources and 20 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 06:59:10 -0400 (Tue, 02 Jun 2009)
New Revision: 89660
Added:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/BlueprintCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/Capability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HttpCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HuskyCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JAXBCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JMXCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JNDICapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/RemoteLogCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLBindingCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLParserCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/package.html
Removed:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java
Modified:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties
projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.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/internal/EmbeddedRuntime.java
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/RemoteRuntime.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/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
Log:
Move capabilities to separate package
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -28,9 +28,9 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.spi.testing.BlueprintCapability;
-import org.jboss.osgi.spi.testing.HuskyCapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
+import org.jboss.osgi.spi.capability.BlueprintCapability;
+import org.jboss.osgi.spi.capability.HuskyCapability;
+import org.jboss.osgi.spi.capability.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-06-02 10:59:10 UTC (rev 89660)
@@ -7,6 +7,7 @@
Import-Package: \
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
+ org.jboss.osgi.spi.capability, \
org.jboss.osgi.spi.testing, \
org.junit, \
org.osgi.framework, \
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-02 10:59:10 UTC (rev 89660)
@@ -18,10 +18,10 @@
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
- org.jboss.osgi.spi.testing.capability;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties 2009-06-02 10:59:10 UTC (rev 89660)
@@ -74,6 +74,7 @@
org.jboss.logging, \
org.jboss.net.protocol, \
org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-06-02 10:59:10 UTC (rev 89660)
@@ -43,6 +43,7 @@
org.jboss.logging, \
org.jboss.net.protocol, \
org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties 2009-06-02 10:59:10 UTC (rev 89660)
@@ -70,6 +70,7 @@
org.osgi.service.packageadmin;version=1.2, \
org.osgi.service.startlevel;version=1.1, \
org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -27,8 +27,8 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.spi.testing.HuskyCapability;
-import org.jboss.osgi.spi.testing.JMXCapability;
+import org.jboss.osgi.spi.capability.HuskyCapability;
+import org.jboss.osgi.spi.capability.JMXCapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd 2009-06-02 10:59:10 UTC (rev 89660)
@@ -7,6 +7,7 @@
Import-Package: \
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
+ org.jboss.osgi.spi.capability, \
org.jboss.osgi.spi.testing, \
org.junit, \
org.osgi.framework
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-06-02 10:59:10 UTC (rev 89660)
@@ -22,10 +22,10 @@
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
- org.jboss.osgi.spi.testing.capability;version=1.0, \
org.osgi.framework;version=1.4
# Bundles that need to be installed with the Framework automatically
Modified: projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/runtime/equinox/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-02 10:59:10 UTC (rev 89660)
@@ -33,6 +33,7 @@
<!-- jboss-osgi -->
org.jboss.osgi.spi;version=1.0,
+ org.jboss.osgi.spi.capability;version=1.0,
org.jboss.osgi.spi.logging;version=1.0,
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-02 10:59:10 UTC (rev 89660)
@@ -30,6 +30,7 @@
<!-- jboss-osgi -->
org.jboss.osgi.spi;version=1.0,
+ org.jboss.osgi.spi.capability;version=1.0,
org.jboss.osgi.spi.logging;version=1.0,
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/src/main/resources/osgi-deployers-jboss-beans.xml 2009-06-02 10:59:10 UTC (rev 89660)
@@ -32,6 +32,7 @@
<!-- jboss-osgi -->
org.jboss.osgi.spi;version=1.0,
+ org.jboss.osgi.spi.capability;version=1.0,
org.jboss.osgi.spi.logging;version=1.0,
org.jboss.osgi.spi.management;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/BlueprintCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/BlueprintCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/BlueprintCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,48 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import org.jboss.osgi.spi.service.BlueprintService;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the Blueprint capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link BlueprintService} is already registered.
+ *
+ * Installed bundles: jboss-osgi-blueprint.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class BlueprintCapability extends Capability
+{
+ public BlueprintCapability()
+ {
+ super (BlueprintService.class.getName());
+
+ addBundle("bundles/jboss-osgi-blueprint.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/Capability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/Capability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/Capability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,103 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * An abstract OSGi capability that can be installed in an
+ * {@link OSGiRuntime}.
+ *
+ * The capability is only installed if the service name given in the constructor
+ * is not already registered with the OSGi framework.
+ *
+ * It maintains an ordered set of dependent capabilities and bundles that
+ * must be installed to provide the functionality advertised by this capability.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public abstract class Capability
+{
+ private String serviceName;
+ private Properties props = new Properties();
+
+ private Set<Capability> dependencies = new LinkedHashSet<Capability>();
+ private Set<String> bundles = new LinkedHashSet<String>();
+
+ /**
+ * Construct a capability that is identified by the given service name.
+ * If the service name is already registered with the {@link OSGiRuntime}
+ * adding this capability does nothing.
+ */
+ public Capability(String serviceName)
+ {
+ this.serviceName = serviceName;
+ }
+
+ /**
+ * Get the service name associated with this capability.
+ */
+ public String getServiceName()
+ {
+ return serviceName;
+ }
+
+ /**
+ * Get system properties provided by this capability.
+ *
+ * Adding this capability will set the associated system properties
+ * if a propperty is not set already.
+ */
+ public Properties getProperties()
+ {
+ return props;
+ }
+
+ public List<Capability> getDependencies()
+ {
+ return new ArrayList<Capability>(dependencies);
+ }
+
+ public List<String> getBundles()
+ {
+ return new ArrayList<String>(bundles);
+ }
+
+ protected void addBundle(String bundle)
+ {
+ bundles.add(bundle);
+ }
+
+ protected void addDependency(Capability dependency)
+ {
+ dependencies.add(dependency);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java (from rev 89649, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,48 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+/**
+ * Adds the OSGi compedium ConfigAdmin capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link ConfigurationAdmin} is already registered.
+ *
+ * Installed bundles: org.apache.felix.metatype.jar, org.apache.felix.configadmin.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class ConfigAdminCapability extends Capability
+{
+ public ConfigAdminCapability()
+ {
+ super(ConfigurationAdmin.class.getName());
+ addBundle("bundles/org.apache.felix.metatype.jar");
+ addBundle("bundles/org.apache.felix.configadmin.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HttpCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HttpCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HttpCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,60 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import java.util.Properties;
+
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.osgi.service.http.HttpService;
+
+/**
+ * Adds the {@link HttpService} capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link HttpService} is already registered.
+ *
+ * Installed bundles: org.apache.felix.http.jetty.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.osgi.service.http.port</td><td>8090</td></tr>
+ * </table>
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class HttpCapability extends Capability
+{
+ public HttpCapability()
+ {
+ super(HttpService.class.getName());
+
+ Properties props = getProperties();
+ props.setProperty("org.osgi.service.http.port", "8090");
+
+ addBundle("bundles/org.apache.felix.http.jetty.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HuskyCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HuskyCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/HuskyCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,52 @@
+/*
+ * 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.capability;
+
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+
+//$Id$
+
+
+/**
+ * Adds the Husky testing capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if a Husky connector is already registered.
+ *
+ * Dependent capabilities: {@link JMXCapability}.
+ *
+ * Installed bundles: jboss-osgi-husky.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class HuskyCapability extends Capability
+{
+ public HuskyCapability()
+ {
+ super("org.jboss.osgi.husky.runtime.Connector");
+
+ addDependency(new JMXCapability());
+ addBundle("bundles/jboss-osgi-husky.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JAXBCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JAXBCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JAXBCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.capability;
+
+//$Id$
+
+import org.jboss.osgi.spi.service.JAXBService;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the JAXB capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link JAXBService} is already registered.
+ *
+ * Dependent capabilities: {@link XMLParserCapability}.
+ *
+ * Installed bundles: jboss-osgi-jaxb.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class JAXBCapability extends Capability
+{
+ public JAXBCapability()
+ {
+ super(JAXBService.class.getName());
+
+ addDependency(new XMLParserCapability());
+ addBundle("bundles/jboss-osgi-jaxb.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JMXCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JMXCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JMXCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,63 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the JMX capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link MBeanServer} is already registered.
+ *
+ * Installed bundles: jboss-osgi-jmx.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.jboss.osgi.jmx.host</td><td>${jboss.bind.address}</td></tr>
+ * <tr><td>org.jboss.osgi.jmx.rmi.port</td><td>1198</td></tr>
+ * </table>
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class JMXCapability extends Capability
+{
+ public JMXCapability()
+ {
+ super(MBeanServer.class.getName());
+
+ Properties props = getProperties();
+ props.setProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
+ props.setProperty("org.jboss.osgi.jmx.rmi.port", "1198");
+
+ addBundle("bundles/jboss-osgi-jmx.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JNDICapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JNDICapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/JNDICapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,66 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import java.util.Properties;
+
+import javax.naming.InitialContext;
+
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the JNDI capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link InitialContext} is already registered.
+ *
+ * Installed bundles: jboss-osgi-common-core.jar, jboss-osgi-jndi.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.jboss.osgi.jndi.host</td><td>${jboss.bind.address}</td></tr>
+ * <tr><td>org.jboss.osgi.jndi.rmi.port</td><td>1198</td></tr>
+ * <tr><td>org.jboss.osgi.jndi.port</td><td>1199</td></tr>
+ * </table>
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class JNDICapability extends Capability
+{
+ public JNDICapability()
+ {
+ super(InitialContext.class.getName());
+
+ Properties props = getProperties();
+ props.setProperty("org.jboss.osgi.jndi.host", System.getProperty("jboss.bind.address", "localhost"));
+ props.setProperty("org.jboss.osgi.jndi.rmi.port", "1198");
+ props.setProperty("org.jboss.osgi.jndi.port", "1199");
+
+ addBundle("bundles/jboss-osgi-common-core.jar");
+ addBundle("bundles/jboss-osgi-jndi.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,52 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the Microcontainer capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link MicrocontainerService} is already registered.
+ *
+ * Dependent capabilities: {@link JMXCapability}, {@link XMLBindingCapability}.
+ *
+ * Installed bundles: jboss-osgi-microcontainer.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class MicrocontainerCapability extends Capability
+{
+ public MicrocontainerCapability()
+ {
+ super(MicrocontainerService.class.getName());
+
+ addDependency(new JMXCapability());
+ addDependency(new XMLBindingCapability());
+ addBundle("bundles/jboss-osgi-microcontainer.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/RemoteLogCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/RemoteLogCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/RemoteLogCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,65 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import java.util.Properties;
+
+import org.jboss.osgi.spi.service.RemoteLogService;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the RemoteLog capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link RemoteLogService} is already registered.
+ *
+ * Installed bundles: jboss-osgi-remotelog.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.jboss.osgi.service.remote.log.reader</td><td>true</td></tr>
+ * <tr><td>org.jboss.osgi.service.remote.log.host</td><td>${jboss.bind.address}</td></tr>
+ * <tr><td>org.jboss.osgi.service.remote.log.port</td><td>5400</td></tr>
+ * </table>
+ *
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class RemoteLogCapability extends Capability
+{
+ public RemoteLogCapability()
+ {
+ super(RemoteLogService.class.getName());
+
+ Properties props = getProperties();
+ props.setProperty("org.jboss.osgi.service.remote.log.reader", "true");
+ props.setProperty("org.jboss.osgi.service.remote.log.host", System.getProperty("jboss.bind.address", "localhost"));
+ props.setProperty("org.jboss.osgi.service.remote.log.port", "5400");
+
+ addBundle("bundles/jboss-osgi-remotelog.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLBindingCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLBindingCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLBindingCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,52 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import org.jboss.osgi.spi.service.XMLBindingService;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the JBossXB capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link XMLBindingService} is already registered.
+ *
+ * Dependent capabilities: {@link JAXBCapability}.
+ *
+ * Installed bundles: jboss-osgi-common-core.jar, jboss-osgi-xml-binding.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class XMLBindingCapability extends Capability
+{
+ public XMLBindingCapability()
+ {
+ super (XMLBindingService.class.getName());
+
+ addDependency(new JAXBCapability());
+ addBundle("bundles/jboss-osgi-common-core.jar");
+ addBundle("bundles/jboss-osgi-xml-binding.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLParserCapability.java (from rev 89656, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLParserCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/capability/XMLParserCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,49 @@
+/*
+ * 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.capability;
+
+//$Id$
+
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the XML parser capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link SAXParserFactory} is already registered.
+ *
+ * Installed bundles: jboss-osgi-apache-xerces.jar
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class XMLParserCapability extends Capability
+{
+ public XMLParserCapability()
+ {
+ super(SAXParserFactory.class.getName());
+
+ addBundle("bundles/jboss-osgi-apache-xerces.jar");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/package.html 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,5 @@
+<html>
+<body>
+A collection of SPI provided services.
+</body>
+</html>
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,47 +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.testing;
-
-//$Id$
-
-import org.jboss.osgi.spi.service.BlueprintService;
-
-/**
- * Adds the Blueprint capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link BlueprintService} is already registered.
- *
- * Installed bundles: jboss-osgi-blueprint.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class BlueprintCapability extends Capability
-{
- public BlueprintCapability()
- {
- super (BlueprintService.class.getName());
-
- addBundle("bundles/jboss-osgi-blueprint.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -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.spi.testing;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-/**
- * An abstract OSGi capability that can be installed in an
- * {@link OSGiRuntime}.
- *
- * The capability is only installed if the service name given in the constructor
- * is not already registered with the OSGi framework.
- *
- * It maintains an ordered set of dependent capabilities and bundles that
- * must be installed to provide the functionality advertised by this capability.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public abstract class Capability
-{
- private String serviceName;
- private Properties props = new Properties();
-
- private Set<Capability> dependencies = new LinkedHashSet<Capability>();
- private Set<String> bundles = new LinkedHashSet<String>();
-
- /**
- * Construct a capability that is identified by the given service name.
- * If the service name is already registered with the {@link OSGiRuntime}
- * adding this capability does nothing.
- */
- public Capability(String serviceName)
- {
- this.serviceName = serviceName;
- }
-
- /**
- * Get the service name associated with this capability.
- */
- public String getServiceName()
- {
- return serviceName;
- }
-
- /**
- * Get system properties provided by this capability.
- *
- * Adding this capability will set the associated system properties
- * if a propperty is not set already.
- */
- public Properties getProperties()
- {
- return props;
- }
-
- public List<Capability> getDependencies()
- {
- return new ArrayList<Capability>(dependencies);
- }
-
- public List<String> getBundles()
- {
- return new ArrayList<String>(bundles);
- }
-
- protected void addBundle(String bundle)
- {
- bundles.add(bundle);
- }
-
- protected void addDependency(Capability dependency)
- {
- dependencies.add(dependency);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,47 +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.testing;
-
-//$Id$
-
-import org.osgi.service.cm.ConfigurationAdmin;
-
-/**
- * Adds the OSGi compedium ConfigAdmin capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link ConfigurationAdmin} is already registered.
- *
- * Installed bundles: org.apache.felix.metatype.jar, org.apache.felix.configadmin.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class ConfigAdminCapability extends Capability
-{
- public ConfigAdminCapability()
- {
- super(ConfigurationAdmin.class.getName());
- addBundle("bundles/org.apache.felix.metatype.jar");
- addBundle("bundles/org.apache.felix.configadmin.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,59 +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.testing;
-
-//$Id$
-
-import java.util.Properties;
-
-import org.osgi.service.http.HttpService;
-
-/**
- * Adds the {@link HttpService} capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link HttpService} is already registered.
- *
- * Installed bundles: org.apache.felix.http.jetty.jar
- *
- * Default properties set by this capability
- *
- * <table>
- * <tr><th>Property</th><th>Value</th></tr>
- * <tr><td>org.osgi.service.http.port</td><td>8090</td></tr>
- * </table>
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class HttpCapability extends Capability
-{
- public HttpCapability()
- {
- super(HttpService.class.getName());
-
- Properties props = getProperties();
- props.setProperty("org.osgi.service.http.port", "8090");
-
- addBundle("bundles/org.apache.felix.http.jetty.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,50 +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.testing;
-
-
-//$Id$
-
-
-/**
- * Adds the Husky testing capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if a Husky connector is already registered.
- *
- * Dependent capabilities: {@link JMXCapability}.
- *
- * Installed bundles: jboss-osgi-husky.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class HuskyCapability extends Capability
-{
- public HuskyCapability()
- {
- super("org.jboss.osgi.husky.runtime.Connector");
-
- addDependency(new JMXCapability());
- addBundle("bundles/jboss-osgi-husky.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,50 +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.testing;
-
-//$Id$
-
-import org.jboss.osgi.spi.service.JAXBService;
-
-/**
- * Adds the JAXB capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link JAXBService} is already registered.
- *
- * Dependent capabilities: {@link XMLParserCapability}.
- *
- * Installed bundles: jboss-osgi-jaxb.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class JAXBCapability extends Capability
-{
- public JAXBCapability()
- {
- super(JAXBService.class.getName());
-
- addDependency(new XMLParserCapability());
- addBundle("bundles/jboss-osgi-jaxb.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,61 +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.testing;
-
-//$Id$
-
-import java.util.Properties;
-
-import javax.management.MBeanServer;
-
-/**
- * Adds the JMX capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link MBeanServer} is already registered.
- *
- * Installed bundles: jboss-osgi-jmx.jar
- *
- * Default properties set by this capability
- *
- * <table>
- * <tr><th>Property</th><th>Value</th></tr>
- * <tr><td>org.jboss.osgi.jmx.host</td><td>${jboss.bind.address}</td></tr>
- * <tr><td>org.jboss.osgi.jmx.rmi.port</td><td>1198</td></tr>
- * </table>
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class JMXCapability extends Capability
-{
- public JMXCapability()
- {
- super(MBeanServer.class.getName());
-
- Properties props = getProperties();
- props.setProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
- props.setProperty("org.jboss.osgi.jmx.rmi.port", "1198");
-
- addBundle("bundles/jboss-osgi-jmx.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,64 +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.testing;
-
-//$Id$
-
-import java.util.Properties;
-
-import javax.naming.InitialContext;
-
-/**
- * Adds the JNDI capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link InitialContext} is already registered.
- *
- * Installed bundles: jboss-osgi-common-core.jar, jboss-osgi-jndi.jar
- *
- * Default properties set by this capability
- *
- * <table>
- * <tr><th>Property</th><th>Value</th></tr>
- * <tr><td>org.jboss.osgi.jndi.host</td><td>${jboss.bind.address}</td></tr>
- * <tr><td>org.jboss.osgi.jndi.rmi.port</td><td>1198</td></tr>
- * <tr><td>org.jboss.osgi.jndi.port</td><td>1199</td></tr>
- * </table>
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class JNDICapability extends Capability
-{
- public JNDICapability()
- {
- super(InitialContext.class.getName());
-
- Properties props = getProperties();
- props.setProperty("org.jboss.osgi.jndi.host", System.getProperty("jboss.bind.address", "localhost"));
- props.setProperty("org.jboss.osgi.jndi.rmi.port", "1198");
- props.setProperty("org.jboss.osgi.jndi.port", "1199");
-
- addBundle("bundles/jboss-osgi-common-core.jar");
- addBundle("bundles/jboss-osgi-jndi.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,51 +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.testing;
-
-//$Id$
-
-import org.jboss.osgi.spi.service.MicrocontainerService;
-
-/**
- * Adds the Microcontainer capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link MicrocontainerService} is already registered.
- *
- * Dependent capabilities: {@link JMXCapability}, {@link XMLBindingCapability}.
- *
- * Installed bundles: jboss-osgi-microcontainer.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class MicrocontainerCapability extends Capability
-{
- public MicrocontainerCapability()
- {
- super(MicrocontainerService.class.getName());
-
- addDependency(new JMXCapability());
- addDependency(new XMLBindingCapability());
- addBundle("bundles/jboss-osgi-microcontainer.jar");
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -25,6 +25,8 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.spi.capability.RemoteLogCapability;
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
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-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -35,7 +35,7 @@
/**
* An abstract OSGi Test.
*
- * This is a convenience wrapper for the functionality provided
+ * {@link OSGiTest} is a convenience wrapper for the functionality provided
* by {@link OSGiTestHelper}.
*
* @author Thomas.Diesler(a)jboss.org
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,64 +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.testing;
-
-//$Id$
-
-import java.util.Properties;
-
-import org.jboss.osgi.spi.service.RemoteLogService;
-
-/**
- * Adds the RemoteLog capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link RemoteLogService} is already registered.
- *
- * Installed bundles: jboss-osgi-remotelog.jar
- *
- * Default properties set by this capability
- *
- * <table>
- * <tr><th>Property</th><th>Value</th></tr>
- * <tr><td>org.jboss.osgi.service.remote.log.reader</td><td>true</td></tr>
- * <tr><td>org.jboss.osgi.service.remote.log.host</td><td>${jboss.bind.address}</td></tr>
- * <tr><td>org.jboss.osgi.service.remote.log.port</td><td>5400</td></tr>
- * </table>
- *
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class RemoteLogCapability extends Capability
-{
- public RemoteLogCapability()
- {
- super(RemoteLogService.class.getName());
-
- Properties props = getProperties();
- props.setProperty("org.jboss.osgi.service.remote.log.reader", "true");
- props.setProperty("org.jboss.osgi.service.remote.log.host", System.getProperty("jboss.bind.address", "localhost"));
- props.setProperty("org.jboss.osgi.service.remote.log.port", "5400");
-
- addBundle("bundles/jboss-osgi-remotelog.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,51 +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.testing;
-
-//$Id$
-
-import org.jboss.osgi.spi.service.XMLBindingService;
-
-/**
- * Adds the JBossXB capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link XMLBindingService} is already registered.
- *
- * Dependent capabilities: {@link JAXBCapability}.
- *
- * Installed bundles: jboss-osgi-common-core.jar, jboss-osgi-xml-binding.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class XMLBindingCapability extends Capability
-{
- public XMLBindingCapability()
- {
- super (XMLBindingService.class.getName());
-
- addDependency(new JAXBCapability());
- addBundle("bundles/jboss-osgi-common-core.jar");
- addBundle("bundles/jboss-osgi-xml-binding.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -1,47 +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.testing;
-
-//$Id$
-
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * Adds the XML parser capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link SAXParserFactory} is already registered.
- *
- * Installed bundles: jboss-osgi-apache-xerces.jar
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class XMLParserCapability extends Capability
-{
- public XMLParserCapability()
- {
- super(SAXParserFactory.class.getName());
-
- addBundle("bundles/jboss-osgi-apache-xerces.jar");
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -33,10 +33,10 @@
import javax.management.MBeanServerConnection;
import javax.management.MBeanServerFactory;
+import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.testing.Capability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
import org.jboss.osgi.spi.testing.OSGiRuntime;
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-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -38,8 +38,8 @@
import javax.naming.NamingException;
import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.testing.Capability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -31,6 +31,7 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.osgi.spi.capability.RemoteLogCapability;
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.jboss.osgi.spi.management.MBeanProxy;
@@ -43,7 +44,6 @@
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.osgi.spi.testing.RemoteLogCapability;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/package.html
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/package.html (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/package.html 2009-06-02 10:59:10 UTC (rev 89660)
@@ -0,0 +1,5 @@
+<html>
+<body>
+OSGi test support classes and interfaces.
+</body>
+</html>
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-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -29,8 +29,8 @@
import java.io.InputStreamReader;
import java.net.URL;
-import org.jboss.osgi.spi.testing.ConfigAdminCapability;
-import org.jboss.osgi.spi.testing.HttpCapability;
+import org.jboss.osgi.spi.capability.ConfigAdminCapability;
+import org.jboss.osgi.spi.capability.HttpCapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
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-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -29,9 +29,9 @@
import javax.management.ObjectName;
import javax.naming.InitialContext;
+import org.jboss.osgi.spi.capability.JMXCapability;
+import org.jboss.osgi.spi.capability.JNDICapability;
import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
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-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -29,7 +29,7 @@
import javax.naming.InitialContext;
import javax.naming.NameNotFoundException;
-import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.capability.JNDICapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
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-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -37,12 +37,12 @@
import javax.management.ObjectName;
+import org.jboss.osgi.spi.capability.JNDICapability;
+import org.jboss.osgi.spi.capability.MicrocontainerCapability;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -33,17 +33,17 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParserFactory;
+import org.jboss.osgi.spi.capability.JAXBCapability;
+import org.jboss.osgi.spi.capability.JMXCapability;
+import org.jboss.osgi.spi.capability.JNDICapability;
+import org.jboss.osgi.spi.capability.XMLBindingCapability;
+import org.jboss.osgi.spi.capability.XMLParserCapability;
import org.jboss.osgi.spi.service.JAXBService;
import org.jboss.osgi.spi.service.XMLBindingService;
-import org.jboss.osgi.spi.testing.JAXBCapability;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTest;
-import org.jboss.osgi.spi.testing.XMLBindingCapability;
-import org.jboss.osgi.spi.testing.XMLParserCapability;
import org.junit.Test;
import org.osgi.framework.BundleException;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -31,7 +31,7 @@
import java.io.File;
import java.io.FileReader;
-import org.jboss.osgi.spi.testing.ConfigAdminCapability;
+import org.jboss.osgi.spi.capability.ConfigAdminCapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
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-06-02 10:19:12 UTC (rev 89659)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-06-02 10:59:10 UTC (rev 89660)
@@ -26,11 +26,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+import org.jboss.osgi.spi.capability.JMXCapability;
+import org.jboss.osgi.spi.capability.JNDICapability;
+import org.jboss.osgi.spi.capability.MicrocontainerCapability;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
15 years, 4 months
JBoss-OSGI SVN: r89659 - projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 06:19:12 -0400 (Tue, 02 Jun 2009)
New Revision: 89659
Modified:
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
Log:
Fix the BND bundle activator declarations
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd 2009-06-02 10:12:02 UTC (rev 89658)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd 2009-06-02 10:19:12 UTC (rev 89659)
@@ -1,7 +1,7 @@
# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-payment-creditcard.jar src/test/resources/trailblazer/payment-creditcard.bnd
Bundle-SymbolicName: trailblazer-payment-creditcard
-Bundle-Activator: org.jboss.test.osgi.trailblazer.pay.creditcard.ServiceActivator
+Bundle-Activator: org.jboss.test.osgi.trailblazer.pay.creditcard.CreditCardServiceActivator
Private-Package: org.jboss.test.osgi.trailblazer.pay.creditcard
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd 2009-06-02 10:12:02 UTC (rev 89658)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd 2009-06-02 10:19:12 UTC (rev 89659)
@@ -1,7 +1,7 @@
# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-payment-paypal.jar src/test/resources/trailblazer/payment-paypal.bnd
Bundle-SymbolicName: trailblazer-payment-paypal
-Bundle-Activator: org.jboss.test.osgi.trailblazer.pay.paypal.ServiceActivator
+Bundle-Activator: org.jboss.test.osgi.trailblazer.pay.paypal.PayPalServiceActivator
Private-Package: org.jboss.test.osgi.trailblazer.pay.paypal
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd 2009-06-02 10:12:02 UTC (rev 89658)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd 2009-06-02 10:19:12 UTC (rev 89659)
@@ -1,7 +1,7 @@
# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-shop-pets.jar src/test/resources/trailblazer/shop-pets.bnd
Bundle-SymbolicName: trailblazer-shop-pets
-Bundle-Activator: org.jboss.test.osgi.trailblazer.shop.pets.ServiceActivator
+Bundle-Activator: org.jboss.test.osgi.trailblazer.shop.pets.PetStoreActivator
Private-Package: org.jboss.test.osgi.trailblazer.shop.pets
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd 2009-06-02 10:12:02 UTC (rev 89658)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd 2009-06-02 10:19:12 UTC (rev 89659)
@@ -1,7 +1,7 @@
# bnd build -classpath target/test-classes -output target/test-libs/trailblazer-shop-sports.jar src/test/resources/trailblazer/shop-sports.bnd
Bundle-SymbolicName: trailblazer-shop-sports
-Bundle-Activator: org.jboss.test.osgi.trailblazer.shop.sports.ServiceActivator
+Bundle-Activator: org.jboss.test.osgi.trailblazer.shop.sports.ClimbingStoreActivator
Private-Package: org.jboss.test.osgi.trailblazer.shop.sports
15 years, 4 months
JBoss-OSGI SVN: r89657 - in projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer: audit and 5 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 06:03:01 -0400 (Tue, 02 Jun 2009)
New Revision: 89657
Added:
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStoreActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStoreActivator.java
Removed:
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
Modified:
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Product.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/audit/AuditServiceMBean.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardService.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalService.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java
Log:
Add javadoc
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/PaymentService.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -3,12 +3,23 @@
import java.util.Collection;
/**
- * [TODO]
+ * A payment service used by the various {@link Shop}s.
+ *
+ * A shop can define specific requirements on a payment service
+ * i.e. must support VISA
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
*/
public interface PaymentService
{
+ /**
+ * The type of the payment service. (type=[credit|paypal])
+ */
+ String SERVICE_PROPERTY_TYPE = "type";
+
+ /**
+ * Returns the list of supported payment types
+ */
Collection<String> listPaymentTypes();
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Product.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Product.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/Product.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -21,14 +21,12 @@
*/
package org.jboss.test.osgi.trailblazer;
-import java.io.Serializable;
-
-
//$Id$
+import java.io.Serializable;
/**
- * [TODO]
+ * A product sold by the various {@link Shop}s.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/ShoppingMall.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -1,10 +1,11 @@
package org.jboss.test.osgi.trailblazer;
+// $Id$
+
import java.util.Collection;
-
/**
- * [TODO]
+ * the trailblazer shopping mall.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/audit/AuditServiceMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/audit/AuditServiceMBean.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/audit/AuditServiceMBean.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -1,9 +1,32 @@
+/*
+ * 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.trailblazer.audit;
+//$Id$
+import org.jboss.test.osgi.trailblazer.AuditService;
/**
- * [TODO]
+ * The management interface for the {@link AuditService}.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/RequestHandler.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -37,7 +37,7 @@
import org.jboss.test.osgi.trailblazer.ShoppingMall;
/**
- * [TODO]
+ * An HTML request handler.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardService.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardService.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -7,7 +7,7 @@
/**
- * [TODO]
+ * A {@link PaymentService} that supports credit cards.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceActivator.java (from rev 89649, projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/CreditCardServiceActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -0,0 +1,69 @@
+/*
+ * 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.trailblazer.pay.creditcard;
+
+//$Id$
+
+import static org.jboss.test.osgi.trailblazer.PaymentService.SERVICE_PROPERTY_TYPE;
+
+import java.util.Hashtable;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.PaymentService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
+
+/**
+ * The activator for the {@link CreditCardService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 10-May-2009
+ */
+public class CreditCardServiceActivator implements BundleActivator
+{
+ private LogService log;
+ private ServiceRegistration serviceReg;
+
+ @SuppressWarnings("unchecked")
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ Hashtable props = new Hashtable();
+ props.put(SERVICE_PROPERTY_TYPE, "credit");
+
+ serviceReg = context.registerService(PaymentService.class.getName(), new CreditCardService(), props);
+ log.log(LogService.LOG_INFO, "Register the CreditCardService");
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (serviceReg != null)
+ {
+ log.log(LogService.LOG_INFO, "Unregister the CreditCardService");
+ serviceReg.unregister();
+ serviceReg = null;
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.trailblazer.pay.creditcard;
-
-//$Id$
-
-import java.util.Hashtable;
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.test.osgi.trailblazer.PaymentService;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 10-May-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- private LogService log;
- private ServiceRegistration serviceReg;
-
- @SuppressWarnings("unchecked")
- public void start(BundleContext context)
- {
- this.log = new LogServiceTracker(context);
-
- Hashtable props = new Hashtable();
- props.put("type", "credit");
-
- serviceReg = context.registerService(PaymentService.class.getName(), new CreditCardService(), props);
- log.log(LogService.LOG_INFO, "Register the CreditCardService");
- }
-
- public void stop(BundleContext context)
- {
- if (serviceReg != null)
- {
- log.log(LogService.LOG_INFO, "Unregister the CreditCardService");
- serviceReg.unregister();
- serviceReg = null;
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalService.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalService.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -1,13 +1,35 @@
+/*
+ * 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.trailblazer.pay.paypal;
+// $Id$
+
import java.util.ArrayList;
import java.util.Collection;
import org.jboss.test.osgi.trailblazer.PaymentService;
-
/**
- * [TODO]
+ * A {@link PaymentService} that supports paypal.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalServiceActivator.java (from rev 89649, projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/PayPalServiceActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -0,0 +1,69 @@
+/*
+ * 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.trailblazer.pay.paypal;
+
+//$Id$
+
+import static org.jboss.test.osgi.trailblazer.PaymentService.SERVICE_PROPERTY_TYPE;
+
+import java.util.Hashtable;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.PaymentService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
+
+/**
+ * The activator for the {@link PayPalService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 10-May-2009
+ */
+public class PayPalServiceActivator implements BundleActivator
+{
+ private LogService log;
+ private ServiceRegistration serviceReg;
+
+ @SuppressWarnings("unchecked")
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ Hashtable props = new Hashtable();
+ props.put(SERVICE_PROPERTY_TYPE, "paypal");
+
+ serviceReg = context.registerService(PaymentService.class.getName(), new PayPalService(), props);
+ log.log(LogService.LOG_INFO, "Register the PayPalService");
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (serviceReg != null)
+ {
+ log.log(LogService.LOG_INFO, "Unregister the PayPalService");
+ serviceReg.unregister();
+ serviceReg = null;
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.trailblazer.pay.paypal;
-
-//$Id$
-
-import java.util.Hashtable;
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.test.osgi.trailblazer.PaymentService;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 10-May-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- private LogService log;
- private ServiceRegistration serviceReg;
-
- @SuppressWarnings("unchecked")
- public void start(BundleContext context)
- {
- this.log = new LogServiceTracker(context);
-
- Hashtable props = new Hashtable();
- props.put("type", "paypal");
-
- serviceReg = context.registerService(PaymentService.class.getName(), new PayPalService(), props);
- log.log(LogService.LOG_INFO, "Register the PayPalService");
- }
-
- public void stop(BundleContext context)
- {
- if (serviceReg != null)
- {
- log.log(LogService.LOG_INFO, "Unregister the PayPalService");
- serviceReg.unregister();
- serviceReg = null;
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStore.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -36,7 +36,7 @@
import org.osgi.framework.ServiceReference;
/**
- * [TODO]
+ * The pet store requires a {@link PaymentService} that supports PayPal.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStoreActivator.java (from rev 89649, projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStoreActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/PetStoreActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.trailblazer.shop.pets;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+
+/**
+ * Activates the {@link PetStore}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 10-May-2009
+ */
+public class PetStoreActivator implements BundleActivator
+{
+ private LogService log;
+
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ log.log(LogService.LOG_INFO, "Register the PetStore");
+ context.registerService(Shop.class.getName(), new PetStore(context), null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.trailblazer.shop.pets;
-
-//$Id$
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.test.osgi.trailblazer.Shop;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 10-May-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- private LogService log;
- private ServiceRegistration serviceReg;
-
- public void start(BundleContext context)
- {
- this.log = new LogServiceTracker(context);
-
- log.log(LogService.LOG_INFO, "Register the PetStore");
- serviceReg = context.registerService(Shop.class.getName(), new PetStore(context), null);
- }
-
- public void stop(BundleContext context)
- {
- if (serviceReg != null)
- {
- log.log(LogService.LOG_INFO, "Unregister the PetStore");
- serviceReg.unregister();
- serviceReg = null;
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStore.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -40,8 +40,10 @@
import org.osgi.framework.ServiceReference;
/**
- * this climbing store uses JNDI to bind product information.
+ * The climbing store uses JNDI to bind product information.
*
+ * It requires a {@link PaymentService} that supports credit cards.
+ *
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
*/
Copied: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStoreActivator.java (from rev 89649, projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStoreActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ClimbingStoreActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.trailblazer.shop.sports;
+
+//$Id$
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.trailblazer.Shop;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+
+/**
+ * The {@link ClimbingStore} bundle activator.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 10-May-2009
+ */
+public class ClimbingStoreActivator implements BundleActivator
+{
+ private LogService log;
+
+ public void start(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+
+ log.log(LogService.LOG_INFO, "Register the ClimbingStore");
+ context.registerService(Shop.class.getName(), new ClimbingStore(context), null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java 2009-06-02 09:45:09 UTC (rev 89656)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java 2009-06-02 10:03:01 UTC (rev 89657)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.trailblazer.shop.sports;
-
-//$Id$
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.test.osgi.trailblazer.Shop;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 10-May-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- private LogService log;
- private ServiceRegistration serviceReg;
-
- public void start(BundleContext context)
- {
- this.log = new LogServiceTracker(context);
-
- log.log(LogService.LOG_INFO, "Register the ClimbingStore");
- serviceReg = context.registerService(Shop.class.getName(), new ClimbingStore(context), null);
- }
-
- public void stop(BundleContext context)
- {
- if (serviceReg != null)
- {
- log.log(LogService.LOG_INFO, "Unregister the ClimbingStore");
- serviceReg.unregister();
- serviceReg = null;
- }
- }
-}
\ No newline at end of file
15 years, 4 months
JBoss-OSGI SVN: r89656 - in projects/jboss-osgi/trunk: bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 05:45:09 -0400 (Tue, 02 Jun 2009)
New Revision: 89656
Modified:
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java
projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java
projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogServiceActivator.java
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/integration/deployers/src/main/java/org/jboss/osgi/deployer/helpers/DeploymentProvidedDeploymentUnitFilter.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.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/RemoteLogCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java
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/RemotePackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java
Log:
Add javadoc
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -23,6 +23,8 @@
//$Id$
+import static org.osgi.framework.Constants.OBJECTCLASS;
+
import java.net.URL;
import java.util.Arrays;
import java.util.List;
@@ -40,7 +42,6 @@
import org.jboss.osgi.spi.service.XMLBindingService;
import org.jboss.virtual.VFS;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
@@ -103,8 +104,8 @@
Filter filter;
try
{
- String jmxService = "(" + Constants.OBJECTCLASS + "=" + MBeanServer.class.getName() + ")";
- String xmlService = "(" + Constants.OBJECTCLASS + "=" + XMLBindingService.class.getName() + ")";
+ String jmxService = "(" + OBJECTCLASS + "=" + MBeanServer.class.getName() + ")";
+ String xmlService = "(" + OBJECTCLASS + "=" + XMLBindingService.class.getName() + ")";
filter = context.createFilter("(|" + jmxService + xmlService + ")");
}
catch (InvalidSyntaxException ex)
@@ -123,7 +124,7 @@
{
Object service = super.addingService(sref);
- List<String> classList = Arrays.asList((String[])sref.getProperty(Constants.OBJECTCLASS));
+ List<String> classList = Arrays.asList((String[])sref.getProperty(OBJECTCLASS));
if (classList.contains(MBeanServer.class.getName()))
mbeanServer = (MBeanServer)service;
Modified: projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -35,7 +35,7 @@
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.service.remotelog.internal.RemoteLogEntry;
-import org.jboss.osgi.service.remotelog.internal.RemoteLogServiceActivator;
+import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogEntry;
@@ -45,7 +45,8 @@
import org.osgi.util.tracker.ServiceTracker;
/**
- * [TODO]
+ * A server side {@link LogListener} that sends {@link LogEntry} objects
+ * via a socket connection
*
* @author thomas.diesler(a)jboss.com
* @since 12-Apr-2009
@@ -64,8 +65,8 @@
this.log = new LogServiceTracker(context);
this.context = context;
- this.host = props.getProperty(RemoteLogServiceActivator.REMOTE_LOG_HOST);
- this.port = new Integer(props.getProperty(RemoteLogServiceActivator.REMOTE_LOG_PORT));
+ this.host = props.getProperty(RemoteLogReaderService.REMOTE_LOG_HOST);
+ this.port = new Integer(props.getProperty(RemoteLogReaderService.REMOTE_LOG_PORT));
log.log(LogService.LOG_DEBUG, "RemoteLogListener: [host=" + host + ",port=" + port + "]");
}
Modified: projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -43,7 +43,7 @@
import org.osgi.service.log.LogService;
/**
- * [TODO]
+ * An implementation of the {@link RemoteLogReaderService}
*
* @author thomas.diesler(a)jboss.com
* @since 12-Apr-2009
@@ -61,8 +61,8 @@
public RemoteLogReaderServiceImpl(BundleContext context, Properties props)
{
this.log = new LogServiceTracker(context);
- this.host = props.getProperty(RemoteLogServiceActivator.REMOTE_LOG_HOST);
- this.port = new Integer(props.getProperty(RemoteLogServiceActivator.REMOTE_LOG_PORT));
+ this.host = props.getProperty(REMOTE_LOG_HOST);
+ this.port = new Integer(props.getProperty(REMOTE_LOG_PORT));
}
public void addLogListener(LogListener listener)
Modified: projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogServiceActivator.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/bundles/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogServiceActivator.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -23,6 +23,11 @@
//$Id$
+import static org.jboss.osgi.spi.logging.RemoteLogReaderService.REMOTE_LOG_HOST;
+import static org.jboss.osgi.spi.logging.RemoteLogReaderService.REMOTE_LOG_PORT;
+import static org.jboss.osgi.spi.logging.RemoteLogReaderService.REMOTE_LOG_READER;
+import static org.jboss.osgi.spi.logging.RemoteLogReaderService.REMOTE_LOG_SENDER;
+
import java.util.Properties;
import org.jboss.osgi.service.remotelog.RemoteLogListener;
@@ -32,18 +37,13 @@
import org.osgi.framework.BundleContext;
/**
- * [TODO]
+ * Activates the {@link RemoteLogReaderService}
*
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
public class RemoteLogServiceActivator implements BundleActivator
{
- public static final String REMOTE_LOG_SENDER = "org.jboss.osgi.service.remote.log.sender";
- public static final String REMOTE_LOG_READER = "org.jboss.osgi.service.remote.log.reader";
- public static final String REMOTE_LOG_HOST = "org.jboss.osgi.service.remote.log.host";
- public static final String REMOTE_LOG_PORT = "org.jboss.osgi.service.remote.log.port";
-
private Boolean isReader = Boolean.FALSE;
private Boolean isSender = Boolean.FALSE;
private RemoteLogReaderServiceImpl readerService;
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-06-02 09:45:09 UTC (rev 89656)
@@ -268,7 +268,7 @@
<description>Integration with an existing JBossAS instance</description>
- <!-- deployers -->
+ <!-- https://jira.jboss.org/jira/browse/JBOSGI-94 -->
<fileset condition="isJBoss501" dir="@{deploy.artifacts.dir}/etc/jboss501/server/deployers" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers" override="true">
<include name="metadata-deployer-jboss-beans.xml" />
</fileset>
Modified: projects/jboss-osgi/trunk/integration/deployers/src/main/java/org/jboss/osgi/deployer/helpers/DeploymentProvidedDeploymentUnitFilter.java
===================================================================
--- projects/jboss-osgi/trunk/integration/deployers/src/main/java/org/jboss/osgi/deployer/helpers/DeploymentProvidedDeploymentUnitFilter.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/integration/deployers/src/main/java/org/jboss/osgi/deployer/helpers/DeploymentProvidedDeploymentUnitFilter.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -34,7 +34,7 @@
* A Deployer can attach a DeploymentUnitFilter to a DeploymentUnit which controlls whether
* the DeploymentUnit is to be processed by following Deployers
*
- * [TODO] Remove this class when this functionallity is natively supported by all target containers
+ * [TODO] JBOSGI-94
*
* @author Thomas.Diesler(a)jboss.com
* @since 27-Feb-2009
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -23,14 +23,27 @@
//$Id$
+import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogReaderService;
/**
- * [TODO]
+ * An extension of the {@link LogReaderService} that can be setup
+ * to receive remote {@link LogEntry} objects.
*
* @author thomas.diesler(a)jboss.com
* @since 12-Apr-2009
*/
public interface RemoteLogReaderService extends LogReaderService
{
+ /** Property to set to 'true' on the sending side: 'org.jboss.osgi.service.remote.log.sender' */
+ String REMOTE_LOG_SENDER = "org.jboss.osgi.service.remote.log.sender";
+
+ /** Property to set to 'true' on the receiving side: 'org.jboss.osgi.service.remote.log.reader' */
+ String REMOTE_LOG_READER = "org.jboss.osgi.service.remote.log.reader";
+
+ /** Property to set the receiving host: 'org.jboss.osgi.service.remote.log.host' */
+ String REMOTE_LOG_HOST = "org.jboss.osgi.service.remote.log.host";
+
+ /** Property to set the receiving port: 'org.jboss.osgi.service.remote.log.port' */
+ String REMOTE_LOG_PORT = "org.jboss.osgi.service.remote.log.port";
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -115,7 +115,7 @@
for (String key : sref.getPropertyKeys())
props.put(key, sref.getProperty(key));
- manref = new ManagedServiceReference(clazz, props);
+ manref = new ManagedServiceReference(props);
}
return manref;
}
@@ -132,7 +132,7 @@
for (String key : sref.getPropertyKeys())
props.put(key, sref.getProperty(key));
- foundRefs.add(new ManagedServiceReference(clazz, props));
+ foundRefs.add(new ManagedServiceReference(props));
}
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedServiceReference.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -25,8 +25,10 @@
import java.util.Map;
import java.util.Set;
+import org.osgi.framework.ServiceReference;
+
/**
- * [TODO]
+ * The management view of an OSGi {@link ServiceReference}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
@@ -35,24 +37,27 @@
{
private static final long serialVersionUID = 1L;
- private String serviceInterface;
private Map<String, Object> props;
- public ManagedServiceReference(String className, Map<String, Object> props)
+ ManagedServiceReference(Map<String, Object> props)
{
- this.serviceInterface = className;
+ this.props = props;
}
- public String getServiceInterface()
- {
- return serviceInterface;
- }
-
+ /**
+ * Returns the property value to which the specified property key is mapped
+ * in the properties Dictionary object of the service referenced by this
+ * ServiceReference object.
+ */
public Object getProperty(String key)
{
return props.get(key);
}
+ /**
+ * Returns an array of the keys in the properties Dictionary
+ * object of the service referenced by this ServiceReference object.
+ */
public String[] getPropertyKeys()
{
Set<String> keySet = props.keySet();
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,10 +21,10 @@
*/
package org.jboss.osgi.spi.testing;
+//$Id$
+
import org.jboss.osgi.spi.service.BlueprintService;
-//$Id$
-
/**
* Adds the Blueprint capability to the {@link OSGiRuntime}
* under test.
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -50,21 +50,45 @@
private Set<Capability> dependencies = new LinkedHashSet<Capability>();
private Set<String> bundles = new LinkedHashSet<String>();
+ /**
+ * Construct a capability that is identified by the given service name.
+ * If the service name is already registered with the {@link OSGiRuntime}
+ * adding this capability does nothing.
+ */
public Capability(String serviceName)
{
this.serviceName = serviceName;
}
+ /**
+ * Get the service name associated with this capability.
+ */
public String getServiceName()
{
return serviceName;
}
+ /**
+ * Get system properties provided by this capability.
+ *
+ * Adding this capability will set the associated system properties
+ * if a propperty is not set already.
+ */
public Properties getProperties()
{
return props;
}
+ public List<Capability> getDependencies()
+ {
+ return new ArrayList<Capability>(dependencies);
+ }
+
+ public List<String> getBundles()
+ {
+ return new ArrayList<String>(bundles);
+ }
+
protected void addBundle(String bundle)
{
bundles.add(bundle);
@@ -74,14 +98,4 @@
{
dependencies.add(dependency);
}
-
- public List<Capability> getDependencies()
- {
- return new ArrayList<Capability>(dependencies);
- }
-
- public List<String> getBundles()
- {
- return new ArrayList<String>(bundles);
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,16 +21,27 @@
*/
package org.jboss.osgi.spi.testing;
+//$Id$
+
import java.util.Properties;
import org.osgi.service.http.HttpService;
-
-//$Id$
-
/**
- * [TODO]
+ * Adds the {@link HttpService} capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link HttpService} is already registered.
+ *
+ * Installed bundles: org.apache.felix.http.jetty.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.osgi.service.http.port</td><td>8090</td></tr>
+ * </table>
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,12 +21,20 @@
*/
package org.jboss.osgi.spi.testing;
+
//$Id$
/**
- * [TODO]
+ * Adds the Husky testing capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if a Husky connector is already registered.
+ *
+ * Dependent capabilities: {@link JMXCapability}.
+ *
+ * Installed bundles: jboss-osgi-husky.jar
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JAXBCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,14 +21,20 @@
*/
package org.jboss.osgi.spi.testing;
-import org.jboss.osgi.spi.service.JAXBService;
-
//$Id$
+import org.jboss.osgi.spi.service.JAXBService;
/**
- * [TODO]
+ * Adds the JAXB capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link JAXBService} is already registered.
+ *
+ * Dependent capabilities: {@link XMLParserCapability}.
+ *
+ * Installed bundles: jboss-osgi-jaxb.jar
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -28,8 +28,21 @@
import javax.management.MBeanServer;
/**
- * [TODO]
+ * Adds the JMX capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link MBeanServer} is already registered.
+ *
+ * Installed bundles: jboss-osgi-jmx.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.jboss.osgi.jmx.host</td><td>${jboss.bind.address}</td></tr>
+ * <tr><td>org.jboss.osgi.jmx.rmi.port</td><td>1198</td></tr>
+ * </table>
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -28,8 +28,22 @@
import javax.naming.InitialContext;
/**
- * [TODO]
+ * Adds the JNDI capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link InitialContext} is already registered.
+ *
+ * Installed bundles: jboss-osgi-common-core.jar, jboss-osgi-jndi.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.jboss.osgi.jndi.host</td><td>${jboss.bind.address}</td></tr>
+ * <tr><td>org.jboss.osgi.jndi.rmi.port</td><td>1198</td></tr>
+ * <tr><td>org.jboss.osgi.jndi.port</td><td>1199</td></tr>
+ * </table>
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -26,8 +26,15 @@
import org.jboss.osgi.spi.service.MicrocontainerService;
/**
- * [TODO]
+ * Adds the Microcontainer capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link MicrocontainerService} is already registered.
+ *
+ * Dependent capabilities: {@link JMXCapability}, {@link XMLBindingCapability}.
+ *
+ * Installed bundles: jboss-osgi-microcontainer.jar
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -23,35 +23,65 @@
import java.util.Dictionary;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
/**
- * An OSGi Test Case
+ * An abstraction of an OSGi {@link Bundle}.
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
public abstract class OSGiBundle
{
+ /**
+ * Returns this bundle's unique identifier.
+ */
public abstract long getBundleId();
+ /**
+ * Returns the symbolic name of this bundle as specified by its Bundle-SymbolicName manifest header.
+ */
public abstract String getSymbolicName();
+ /**
+ * Returns the version of this bundle as specified by its Bundle-Version manifest header.
+ */
public abstract String getVersion();
+ /**
+ * Returns this bundle's Manifest headers and values.
+ */
public abstract Dictionary<String, String> getHeaders();
+ /**
+ * Returns this bundle's current state.
+ */
public abstract int getState();
+ /**
+ * Returns the value of the specified property.
+ */
public abstract String getProperty(String key);
+ /**
+ * Starts this bundle.
+ */
public abstract void start() throws BundleException;
+ /**
+ * Stops this bundle.
+ */
public abstract void stop() throws BundleException;
+ /**
+ * Uninstalls this bundle.
+ */
public abstract void uninstall() throws BundleException;
- @Override
+ /**
+ * Return true if symbolic name and version are equal
+ */
public boolean equals(Object obj)
{
if ((obj instanceof OSGiBundle) == false)
@@ -64,12 +94,17 @@
return isEqual;
}
- @Override
+ /**
+ * Returns the hash code for this bundle.
+ */
public int hashCode()
{
return toString().hashCode();
}
+ /**
+ * Returns the string representation of this bundle
+ */
public String toString()
{
return "[" + getSymbolicName() + "," + getVersion() + "]";
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,14 +21,25 @@
*/
package org.jboss.osgi.spi.testing;
+//$Id$
+import org.osgi.service.packageadmin.PackageAdmin;
+
/**
- * [TODO]
+ * An abstraction of the OSGi {@link PackageAdmin} service.
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
public interface OSGiPackageAdmin
{
+ /**
+ * Forces the update (replacement) or removal of packages exported by the specified bundles.
+ *
+ * @see {@link PackageAdmin#refreshPackages(org.osgi.framework.Bundle[])}
+ *
+ * @param bundles The bundles whose exported packages are to be updated or removed,
+ * or null for all bundles updated or uninstalled since the last call to this method.
+ */
void refreshPackages(OSGiBundle[] bundles);
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -28,45 +28,109 @@
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.service.packageadmin.PackageAdmin;
/**
- * [TODO]
+ * An abstraction of an OSGi Runtime.
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
public interface OSGiRuntime
{
+ /**
+ * Add a {@link Capability} to the runtime.
+ *
+ * Adding a capability recursively adds the orderded set of dependent capabilities
+ * before it installs and starts the orderded set bundles.
+ */
void addCapability(Capability capability) throws BundleException;
+ /**
+ * Remove a {@link Capability} from the runtime.
+ *
+ * Removing a capability does the reverse of {@link #addCapability(Capability)}.
+ */
void removeCapability(Capability capability);
- void startLogEntryTracking(LogEntryCache logEntryCache);
-
- void stopLogEntryTracking();
-
+ /**
+ * Install an {@link OSGiBundle} from the given location.
+ */
OSGiBundle installBundle(String location) throws BundleException;
-
+
+ /**
+ * Get the array of installed {@link OSGiBundle}s
+ */
OSGiBundle[] getBundles();
+ /**
+ * Get the {@link OSGiBundle} for a given symbolic name and version
+ *
+ * In case the version is left unspecified, it returns the first bundle that
+ * matches the symbolic name.
+ *
+ * @param version may be null
+ * @return The bundle or null if there is none
+ */
OSGiBundle getBundle(String symbolicName, String version);
+ /**
+ * Get an abstraction of the {@link PackageAdmin}.
+ */
OSGiPackageAdmin getPackageAdmin();
+ /**
+ * Returns a ServiceReference object for a service that implements and was registered
+ * under the specified class.
+ *
+ * @return A ServiceReference object, or null if no services are registered which implement the named class.
+ */
OSGiServiceReference getServiceReference(String clazz);
+ /**
+ * Returns an array of ServiceReference objects.
+ * The returned array of ServiceReference objects contains services that were registered under the specified
+ * class and match the specified filter criteria.
+ */
OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
+ /**
+ * Start log entry tracking for this {@link OSGiRuntime}
+ * @see {@link RemoteLogCapability}
+ */
+ void startLogEntryTracking(LogEntryCache logEntryCache);
+
+ /**
+ * Stop log entry tracking for this {@link OSGiRuntime}
+ * @see {@link RemoteLogCapability}
+ */
+ void stopLogEntryTracking();
+
+ /**
+ * Get the initial naming context for this {@link OSGiRuntime}
+ */
InitialContext getInitialContext() throws NamingException;
+ /**
+ * Get the MBeanServerConnection for this {@link OSGiRuntime}
+ */
MBeanServerConnection getMBeanServer();
- void deploy(String location) throws Exception;
-
- void undeploy(String location) throws Exception;
-
+ /**
+ * Get the host name that this {@link OSGiRuntime} is running on.
+ *
+ * This is the value of the 'jboss.bind.address' system property.
+ */
String getServerHost();
+ /**
+ * Shutdown the {@link OSGiRuntime}.
+ *
+ * This will remove all added {@link Capability}.
+ *
+ * The installed bundles are currently NOT uninstalled automatically.
+ *
+ * [TODO] JBOSGI-93
+ */
void shutdown();
-
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiServiceReference.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,16 +21,27 @@
*/
package org.jboss.osgi.spi.testing;
+import org.osgi.framework.ServiceReference;
+
/**
- * [TODO]
+ * An abstraction of the OSGi {@link ServiceReference}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
public interface OSGiServiceReference
{
+ /**
+ * Returns the property value to which the specified property key is mapped
+ * in the properties Dictionary object of the service referenced by this
+ * ServiceReference object.
+ */
Object getProperty(String key);
+ /**
+ * Returns an array of the keys in the properties Dictionary
+ * object of the service referenced by this ServiceReference object.
+ */
String[] getPropertyKeys();
}
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-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -33,8 +33,11 @@
import org.junit.Before;
/**
- * An OSGi Test Case
+ * An abstract OSGi Test.
*
+ * This is a convenience wrapper for the functionality provided
+ * by {@link OSGiTestHelper}.
+ *
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
@@ -45,24 +48,33 @@
private OSGiTestHelper helper = new OSGiTestHelper();
- public OSGiTest()
+ protected OSGiTest()
{
// Prevent unknown protocol: vfsfile
VFS.init();
}
+ /**
+ * Writes a a debug start messge
+ */
@Before
public void setUp() throws Exception
{
log.debug("### START " + getLongName());
}
+ /**
+ * Writes a a debug stop messge
+ */
@After
public void tearDown() throws Exception
{
log.debug("### END " + getLongName());
}
+ /**
+ * Get the last token in the FQN of this test class.
+ */
protected String getShortName()
{
String shortName = getClass().getName();
@@ -70,56 +82,89 @@
return shortName;
}
+ /**
+ * Get the the FQN of this test class.
+ */
protected String getLongName()
{
return getClass().getName();
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getDefaultRuntime()}
+ */
protected OSGiRuntime getDefaultRuntime()
{
return helper.getDefaultRuntime();
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getEmbeddedRuntime()}
+ */
protected OSGiRuntime getEmbeddedRuntime()
{
return helper.getEmbeddedRuntime();
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getRemoteRuntime()}
+ */
public OSGiRuntime getRemoteRuntime()
{
return helper.getRemoteRuntime();
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getResourceURL(String)}
+ */
protected URL getResourceURL(String resource)
{
return helper.getResourceURL(resource);
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getResourceFile(String)}
+ */
protected File getResourceFile(String resource)
{
return helper.getResourceFile(resource);
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getTestArchiveURL(String)}
+ */
protected URL getTestArchiveURL(String archive)
{
return helper.getTestArchiveURL(archive);
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getTestArchiveFile(String)}
+ */
protected File getTestArchiveFile(String archive)
{
return helper.getTestArchiveFile(archive);
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getInitialContext()}
+ */
public InitialContext getInitialContext() throws NamingException
{
return helper.getInitialContext();
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getJndiPort()}
+ */
public Integer getJndiPort()
{
return helper.getJndiPort();
}
+ /**
+ * Delegates to {@link OSGiTestHelper#getServerHost()}
+ */
public String getServerHost()
{
return helper.getServerHost();
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -27,11 +27,24 @@
import org.jboss.osgi.spi.service.RemoteLogService;
-
-
/**
- * [TODO]
+ * Adds the RemoteLog capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link RemoteLogService} is already registered.
+ *
+ * Installed bundles: jboss-osgi-remotelog.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.jboss.osgi.service.remote.log.reader</td><td>true</td></tr>
+ * <tr><td>org.jboss.osgi.service.remote.log.host</td><td>${jboss.bind.address}</td></tr>
+ * <tr><td>org.jboss.osgi.service.remote.log.port</td><td>5400</td></tr>
+ * </table>
+ *
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLBindingCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,15 +21,20 @@
*/
package org.jboss.osgi.spi.testing;
-import org.jboss.osgi.spi.service.XMLBindingService;
-
-
//$Id$
+import org.jboss.osgi.spi.service.XMLBindingService;
/**
- * [TODO]
+ * Adds the JBossXB capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link XMLBindingService} is already registered.
+ *
+ * Dependent capabilities: {@link JAXBCapability}.
+ *
+ * Installed bundles: jboss-osgi-common-core.jar, jboss-osgi-xml-binding.jar
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/XMLParserCapability.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,16 +21,18 @@
*/
package org.jboss.osgi.spi.testing;
-import javax.xml.parsers.SAXParserFactory;
-
-
-
//$Id$
+import javax.xml.parsers.SAXParserFactory;
/**
- * [TODO]
+ * Adds the XML parser capability to the {@link OSGiRuntime}
+ * under test.
*
+ * It is ignored if the {@link SAXParserFactory} is already registered.
+ *
+ * Installed bundles: jboss-osgi-apache-xerces.jar
+ *
* @author thomas.diesler(a)jboss.com
* @since 05-May-2009
*/
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -27,7 +27,7 @@
import org.osgi.service.packageadmin.PackageAdmin;
/**
- * [TODO]
+ * An embedded implementation of the {@link OSGiPackageAdmin}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -39,6 +39,7 @@
import org.jboss.osgi.spi.testing.Capability;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.osgi.framework.Bundle;
@@ -51,7 +52,7 @@
import org.osgi.util.tracker.ServiceTracker;
/**
- * [TODO]
+ * An embedded implementation of the {@link OSGiRuntime}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedServiceReference.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -21,11 +21,13 @@
*/
package org.jboss.osgi.spi.testing.internal;
+// $Id$
+
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.osgi.framework.ServiceReference;
/**
- * [TODO]
+ * An embedded implementation of the {@link OSGiServiceReference}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
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-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -49,7 +49,7 @@
import org.osgi.service.log.LogReaderService;
/**
- * [TODO]
+ * An abstract implementation of the {@link OSGiRuntime}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
@@ -184,13 +184,13 @@
log.debug("End Shutdown");
}
- public void deploy(String location) throws Exception
+ protected void deploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
invokeDeployerService("deploy", archiveURL);
}
- public void undeploy(String location) throws Exception
+ protected void undeploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
invokeDeployerService("undeploy", archiveURL);
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -28,7 +28,7 @@
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
/**
- * [TODO]
+ * A remote implementation of the {@link OSGiPackageAdmin}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -40,6 +40,7 @@
import org.jboss.osgi.spi.management.ManagedServiceReference;
import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiServiceReference;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.RemoteLogCapability;
@@ -51,7 +52,7 @@
import org.osgi.util.tracker.ServiceTracker;
/**
- * [TODO]
+ * A remote implementation of the {@link OSGiRuntime}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
@@ -89,6 +90,18 @@
}
}
+ @Override
+ public void deploy(String location) throws Exception
+ {
+ super.deploy(location);
+ }
+
+ @Override
+ public void undeploy(String location) throws Exception
+ {
+ super.undeploy(location);
+ }
+
public OSGiBundle[] getBundles()
{
try
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteServiceReference.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -25,7 +25,7 @@
import org.jboss.osgi.spi.testing.OSGiServiceReference;
/**
- * [TODO]
+ * A remote implementation of the {@link OSGiServiceReference}
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
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-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -31,9 +31,11 @@
import org.jboss.osgi.spi.testing.JMXCapability;
import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.MicrocontainerCapability;
+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;
import org.jboss.test.osgi.jbossas.jbosgi36.mbean.FooMBean;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -50,6 +52,7 @@
public class OSGI36TestCase extends OSGiTest
{
static OSGiRuntime runtime;
+ static OSGiBundle bundle;
@BeforeClass
public static void setUpClass() throws Exception
@@ -59,15 +62,18 @@
runtime.addCapability(new JMXCapability());
runtime.addCapability(new MicrocontainerCapability());
- runtime.deploy("jbosgi36-bundle.jar");
- runtime.deploy("jbosgi36-mbean.jar");
+ bundle = runtime.installBundle("jbosgi36-bundle.jar");
+ ((RemoteRuntime)runtime).deploy("jbosgi36-mbean.jar");
}
@AfterClass
public static void tearDownClass() throws Exception
{
- runtime.undeploy("jbosgi36-mbean.jar");
- runtime.undeploy("jbosgi36-bundle.jar");
+ ((RemoteRuntime)runtime).undeploy("jbosgi36-mbean.jar");
+
+ if (bundle != null)
+ bundle.uninstall();
+
runtime.shutdown();
}
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java 2009-06-02 08:57:54 UTC (rev 89655)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/AuditService.java 2009-06-02 09:45:09 UTC (rev 89656)
@@ -1,7 +1,7 @@
package org.jboss.test.osgi.trailblazer;
/**
- * [TODO]
+ * An audit service interface.
*
* @author thomas.diesler(a)jboss.com
* @since 10-May-2009
15 years, 4 months
JBoss-OSGI SVN: r89654 - in projects/jboss-osgi/trunk: bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-06-02 03:55:22 -0400 (Tue, 02 Jun 2009)
New Revision: 89654
Modified:
projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
Log:
MC service tracks both jmx AND xml-binding
Modified: projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-06-02 07:16:24 UTC (rev 89653)
+++ projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-06-02 07:55:22 UTC (rev 89654)
@@ -71,6 +71,8 @@
{
throw new IllegalStateException("Cannot initialize SaxJBossXBParser", ex);
}
+
+ // Register the XMLBindingService
XMLBindingService service = new XMLBindingService(){};
context.registerService(XMLBindingService.class.getName(), service, null);
log.log(LogService.LOG_INFO, "XMLBindingService registered");
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-06-02 07:16:24 UTC (rev 89653)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-06-02 07:55:22 UTC (rev 89654)
@@ -24,6 +24,8 @@
//$Id$
import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
import java.util.Properties;
import javax.management.MBeanServer;
@@ -35,8 +37,12 @@
import org.jboss.osgi.spi.service.DeployerService;
import org.jboss.osgi.spi.service.MicrocontainerService;
import org.jboss.osgi.spi.service.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.service.XMLBindingService;
import org.jboss.virtual.VFS;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
@@ -93,34 +99,61 @@
installBean(controller, BEAN_KERNEL, kernel);
installBean(controller, BEAN_KERNEL_CONTROLLER, controller);
+ // Setup a filter to track both services
+ Filter filter;
+ try
+ {
+ String jmxService = "(" + Constants.OBJECTCLASS + "=" + MBeanServer.class.getName() + ")";
+ String xmlService = "(" + Constants.OBJECTCLASS + "=" + XMLBindingService.class.getName() + ")";
+ filter = context.createFilter("(|" + jmxService + xmlService + ")");
+ }
+ catch (InvalidSyntaxException ex)
+ {
+ throw new IllegalArgumentException("Invalid filter syntax");
+ }
+
// Register the MicrocontainerServiceMBean
- ServiceTracker tracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
+ ServiceTracker tracker = new ServiceTracker(context, filter, null)
{
+ XMLBindingService xmlService;
+ MBeanServer mbeanServer;
+
@Override
- public Object addingService(ServiceReference reference)
+ public Object addingService(ServiceReference sref)
{
- // Install the MBeanServer
- MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
- installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
+ Object service = super.addingService(sref);
+
+ List<String> classList = Arrays.asList((String[])sref.getProperty(Constants.OBJECTCLASS));
+ if (classList.contains(MBeanServer.class.getName()))
+ mbeanServer = (MBeanServer)service;
- // Deploy the deployer beans
- URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
- deployer.deploy(deployersURL);
+ if (classList.contains(XMLBindingService.class.getName()))
+ xmlService = (XMLBindingService)service;
- // Register the MicrocontainerService
- log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
- context.registerService(MicrocontainerService.class.getName(), mcServiceImpl, null);
+ if (mbeanServer != null && xmlService != null)
+ {
+ // Install the MBeanServer
+ installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
- // Register the DeployerService
- Properties props = new Properties();
- props.setProperty("provider", "microcontainer");
- log.log(LogService.LOG_DEBUG, "Register DeployerService");
- context.registerService(DeployerService.class.getName(), mcServiceImpl, props);
+ // Deploy the deployer beans
+ URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
+ deployer.deploy(deployersURL);
- // Register the MicrocontainerServiceMBean
- registerMicrocontainerServiceMBean(mbeanServer);
+ // Register the MicrocontainerService
+ log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
+ context.registerService(MicrocontainerService.class.getName(), mcServiceImpl, null);
- return mbeanServer;
+ // Register the DeployerService
+ Properties props = new Properties();
+ props.setProperty("provider", "microcontainer");
+ log.log(LogService.LOG_DEBUG, "Register DeployerService");
+ context.registerService(DeployerService.class.getName(), mcServiceImpl, props);
+
+ // Register the MicrocontainerServiceMBean
+ registerMicrocontainerServiceMBean(mbeanServer);
+ }
+
+ return service;
}
};
tracker.open();
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties 2009-06-02 07:16:24 UTC (rev 89653)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties 2009-06-02 07:55:22 UTC (rev 89654)
@@ -94,5 +94,4 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/server/minimal/bundles/org.apache.felix.log.jar \
file://${osgi.home}/server/minimal/bundles/jboss-osgi-common.jar \
- file://${osgi.home}/server/minimal/bundles/jboss-osgi-apache-xerces.jar \
file://${osgi.home}/server/minimal/bundles/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-06-02 07:16:24 UTC (rev 89653)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-06-02 07:55:22 UTC (rev 89654)
@@ -61,5 +61,4 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/server/minimal/bundles/org.apache.felix.log.jar \
file://${osgi.home}/server/minimal/bundles/jboss-osgi-common.jar \
- file://${osgi.home}/server/minimal/bundles/jboss-osgi-apache-xerces.jar \
file://${osgi.home}/server/minimal/bundles/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties 2009-06-02 07:16:24 UTC (rev 89653)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties 2009-06-02 07:55:22 UTC (rev 89654)
@@ -91,5 +91,4 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/server/minimal/bundles/org.apache.felix.log.jar \
file://${osgi.home}/server/minimal/bundles/jboss-osgi-common.jar \
- file://${osgi.home}/server/minimal/bundles/jboss-osgi-apache-xerces.jar \
file://${osgi.home}/server/minimal/bundles/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-06-02 07:16:24 UTC (rev 89653)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-06-02 07:55:22 UTC (rev 89654)
@@ -178,7 +178,6 @@
<!-- Server Minimal -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/bundles" override="true">
<include name="org.apache.felix.log.jar" />
- <include name="jboss-osgi-apache-xerces.jar" />
<include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-hotdeploy.jar" />
</fileset>
@@ -216,6 +215,7 @@
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.metatype.jar" />
<!-- all -->
+ <include name="jboss-osgi-apache-xerces.jar" />
<include name="jboss-osgi-jaxb.jar" />
<include name="jboss-osgi-microcontainer.jar" />
<include name="jboss-osgi-xml-binding.jar" />
15 years, 4 months