[jboss-osgi-commits] JBoss-OSGI SVN: r91789 - in projects/jboss-osgi: projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework and 28 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Wed Jul 29 16:49:05 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-07-29 16:49:03 -0400 (Wed, 29 Jul 2009)
New Revision: 91789
Added:
projects/jboss-osgi/projects/runtime/felix/trunk/bootstrap/
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties
Removed:
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/felix/
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.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/resources/bootstrap/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
projects/jboss-osgi/trunk/reactor/pom.xml
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/.classpath
projects/jboss-osgi/trunk/reactor/runtime/jbossmc/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Add initial MC facade
Copied: projects/jboss-osgi/projects/runtime/felix/trunk/bootstrap (from rev 91756, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap)
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/OSGiBootstrap.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -208,7 +208,7 @@
{
try
{
- return file.toURI().toURL();
+ return file.toURL();
}
catch (MalformedURLException e)
{
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -288,7 +288,8 @@
String value = props.getProperty(key);
// Replace property variables
- propMap.put(key, StringPropertyReplacer.replaceProperties(value));
+ value = StringPropertyReplacer.replaceProperties(value);
+ propMap.put(key, value);
if (key.endsWith(".instance"))
{
@@ -306,7 +307,7 @@
}
// Merge optional extra properties
- String extraPropsValue = props.getProperty(PROP_OSGI_FRAMEWORK_EXTRA);
+ String extraPropsValue = (String)propMap.get(PROP_OSGI_FRAMEWORK_EXTRA);
if (extraPropsValue != null)
{
URL extraPropsURL = null;
@@ -323,7 +324,7 @@
File propsFile = new File(extraPropsValue);
try
{
- extraPropsURL = propsFile.toURI().toURL();
+ extraPropsURL = propsFile.toURL();
}
catch (MalformedURLException e)
{
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/logging/ExportedPackageHelper.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -50,17 +50,18 @@
public ExportedPackageHelper(BundleContext context)
{
ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
- packageAdmin = (PackageAdmin)context.getService(sref);
+ if (sref != null)
+ packageAdmin = (PackageAdmin)context.getService(sref);
}
public boolean resolveBundle(Bundle bundle)
{
- return packageAdmin.resolveBundles(new Bundle[] { bundle });
+ return packageAdmin != null ? packageAdmin.resolveBundles(new Bundle[] { bundle }) : false;
}
public boolean resolveBundles(Bundle[] bundles)
{
- return packageAdmin.resolveBundles(bundles);
+ return packageAdmin != null ? packageAdmin.resolveBundles(bundles) : false;
}
/*
@@ -68,18 +69,21 @@
*/
public void logExportedPackages(Bundle bundle)
{
- log.debug("Exported-Packages: " + bundle.getSymbolicName());
-
- ExportedPackage[] exportedPackages = packageAdmin.getExportedPackages(bundle);
- if (exportedPackages != null)
+ if (packageAdmin != null)
{
- List<String> packages = new ArrayList<String>();
- for (ExportedPackage exp : exportedPackages)
- packages.add(" " + exp.getName() + ";version=" + exp.getVersion());
+ log.debug("Exported-Packages: " + bundle.getSymbolicName());
- Collections.sort(packages);
- for (String exp : packages)
- log.debug(exp);
+ ExportedPackage[] exportedPackages = packageAdmin.getExportedPackages(bundle);
+ if (exportedPackages != null)
+ {
+ List<String> packages = new ArrayList<String>();
+ for (ExportedPackage exp : exportedPackages)
+ packages.add(" " + exp.getName() + ";version=" + exp.getVersion());
+
+ Collections.sort(packages);
+ for (String exp : packages)
+ log.debug(exp);
+ }
}
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -98,7 +98,7 @@
try
{
File resourceFile = getResourceFile(resource);
- resURL = resourceFile.toURI().toURL();
+ resURL = resourceFile.toURL();
}
catch (MalformedURLException e)
{
@@ -112,7 +112,7 @@
{
try
{
- return getTestArchiveFile(archive).toURI().toURL();
+ return getTestArchiveFile(archive).toURL();
}
catch (MalformedURLException ex)
{
Modified: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-equinox.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -4,9 +4,6 @@
# $Id$
#
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.equinox.framework.EquinoxIntegration
-
# Properties to configure the Framework
org.osgi.framework.storage=${osgi.server.home}/data/osgi-store
org.osgi.framework.storage.clean=onFirstInit
Modified: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-felix.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -4,9 +4,6 @@
# $Id: $
#
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.felix.framework.FelixIntegration
-
# Extra server specific properties
org.jboss.osgi.spi.framework.extra=${osgi.server.home}/conf/jboss-osgi-extra.properties
Copied: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties (from rev 91756, projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties)
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties (rev 0)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-jbossmc.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,10 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${osgi.server.home}/data/osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/runtime/conf/jboss-osgi-knopflerfish.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,96 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.knopflerfish.framework.KnopflerfishIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${osgi.server.home}/data/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# Hot Deployement
-org.jboss.osgi.hotdeploy.scandir=${osgi.server.home}/deploy
-
-# HTTP Service Port
-org.osgi.service.http.port=8090
-
-# Config Admin Service
-felix.cm.dir=${osgi.server.home}/data/osgi-configadmin
-
-# JMX bundle properties
-org.jboss.osgi.jmx.host=${jboss.bind.address}
-org.jboss.osgi.jmx.rmi.port=1098
-
-# JNDI bundle properties
-org.jboss.osgi.jndi.host=${jboss.bind.address}
-org.jboss.osgi.jndi.rmi.port=1098
-org.jboss.osgi.jndi.port=1099
-
-# Remote Logging
-org.jboss.osgi.service.remote.log.sender=true
-org.jboss.osgi.service.remote.log.host=${jboss.bind.address}
-org.jboss.osgi.service.remote.log.port=5400
-
-# Husky socket connector properties
-org.jboss.osgi.husky.runtime.connector.host=${jboss.bind.address}
-org.jboss.osgi.husky.runtime.connector.port=5401
-
-# System Packages
-org.osgi.framework.system.packages=\
- javax.imageio, \
- javax.imageio.stream, \
- javax.management, \
- javax.management.remote, \
- javax.naming, \
- javax.naming.event, \
- javax.naming.spi, \
- javax.net, \
- javax.net.ssl, \
- javax.xml.datatype, \
- javax.xml.namespace, \
- javax.xml.parsers, \
- javax.xml.transform, \
- javax.xml.transform.dom, \
- javax.xml.transform.sax, \
- javax.xml.transform.stream, \
- javax.xml.validation, \
- org.w3c.dom, \
- org.w3c.dom.events, \
- org.w3c.dom.ls, \
- org.w3c.dom.ranges, \
- org.w3c.dom.traversal, \
- org.w3c.dom.views, \
- org.xml.sax, \
- org.xml.sax.ext, \
- org.xml.sax.helpers, \
- org.osgi.framework;version=1.4, \
- 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, \
- org.jboss.osgi.spi.testing;version=1.0, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- sun.reflect
-
-# Bundles that need to be installed with the Framework automatically
-org.jboss.osgi.spi.framework.autoInstall=\
- file://${osgi.home}/server/minimal/deploy/org.osgi.compendium.jar
-
-# Bundles that need to be started automatically
-org.jboss.osgi.spi.framework.autoStart=\
- file://${osgi.home}/server/minimal/deploy/org.apache.felix.log.jar \
- file://${osgi.home}/server/minimal/deploy/jboss-osgi-common.jar \
- file://${osgi.home}/server/minimal/deploy/jboss-osgi-hotdeploy.jar
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/scripts/assembly-deploy-artifacts.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -25,11 +25,8 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<useStrictFiltering>true</useStrictFiltering>
<excludes>
- <!--
- Distribute the Apache Felix compendium jar
- [JBOSGI-92] Class.forName issue with XMLParserActivator
- -->
- <exclude>org.osgi:org.osgi.compendium:jar</exclude>
+ <exclude>org.apache.felix:org.osgi.compendium:jar</exclude>
+ <exclude>org.apache.felix:org.osgi.core:jar</exclude>
</excludes>
<scope>compile</scope>
<unpack>false</unpack>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/install-definition.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -52,9 +52,9 @@
<name>frameworkSelection</name>
<value>equinox</value>
</condition>
- <condition type="variable" id="isKnopflerfish">
+ <condition type="variable" id="isJBossMC">
<name>frameworkSelection</name>
- <value>knopflerfish</value>
+ <value>jbossmc</value>
</condition>
<condition type="variable" id="isJBoss501">
<name>jbossSelection</name>
@@ -134,7 +134,7 @@
<include name="jboss-osgi-runtime-equinox-sources.jar" />
<include name="jboss-osgi-runtime-felix-sources.jar" />
<include name="jboss-osgi-runtime-jbossas-sources.jar" />
- <include name="jboss-osgi-runtime-knopflerfish-sources.jar" />
+ <include name="jboss-osgi-runtime-jbossmc-sources.jar" />
<include name="jboss-osgi-spi-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
<include name="jboss-osgi-xml-binding-sources.jar" />
@@ -251,14 +251,14 @@
<include name="org.eclipse.osgi.services.jar" />
</fileset>
- <!-- Knopflerfish Integration -->
+ <!-- JBossMC Integration -->
- <singlefile condition="isKnopflerfish" src="@{runtime.dir}/conf/jboss-osgi-knopflerfish.properties" target="$INSTALL_PATH/runtime/conf/jboss-osgi-framework.properties" override="true"/>
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
- <include name="jboss-osgi-runtime-knopflerfish.jar" />
- <include name="org.knopflerfish.framework.jar" />
+ <singlefile condition="isJBossMC" src="@{runtime.dir}/conf/jboss-osgi-jbossmc.properties" target="$INSTALL_PATH/runtime/conf/jboss-osgi-framework.properties" override="true"/>
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/lib" override="true">
+ <include name="jboss-osgi-runtime-jbossmc.jar" />
+ <include name="org.osgi.core.jar" />
</fileset>
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/minimal/deploy" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
@@ -326,15 +326,17 @@
<include name="org.eclipse.osgi.services.jar" />
</fileset>
- <!-- Knopflerfish Integration -->
+ <!-- JBossMC Integration -->
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
- <include name="jboss-osgi-runtime-knopflerfish.jar" />
- <include name="org.knopflerfish.framework.jar" />
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
+ <include name="jboss-osgi-runtime-jbossmc.jar" />
+ <include name="org.jbossmc.framework.jar" />
</fileset>
- <singlefile condition="isKnopflerfish" src="@{deploy.artifacts.dir}/resources/jbossas-config/jboss-beans-knopflerfish.xml"
+ <!--
+ <singlefile condition="isJBossMC" src="@{deploy.artifacts.dir}/resources/jbossas-config/jboss-beans-jbossmc.xml"
target="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer/META-INF/jboss-osgi-jboss-beans.xml" override="true"/>
- <fileset condition="isKnopflerfish" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
+ -->
+ <fileset condition="isJBossMC" dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/osgi" override="true">
<include name="org.osgi.compendium.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -5,7 +5,7 @@
<spec>
<choice txt="Felix" value="felix" set="true"/>
<choice txt="Equinox" value="equinox"/>
- <choice txt="Knopflerfish" value="knopflerfish"/>
+ <choice txt="Microcontainer" value="jbossmc"/>
</spec>
</field>
</panel>
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -354,16 +354,16 @@
<scope>provided</scope>
</dependency>
- <!-- Knopflerfish Dependencies -->
+ <!-- JBossMC Dependencies -->
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version.jboss.osgi.runtime.knopflerfish}</version>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossmc}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version.jboss.osgi.runtime.knopflerfish}</version>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossmc}</version>
<classifier>sources</classifier>
</dependency>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- Modules -->
@@ -56,7 +56,7 @@
<version.jboss.osgi.runtime.equinox>3.5-SNAPSHOT</version.jboss.osgi.runtime.equinox>
<version.jboss.osgi.runtime.felix>1.9.0-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.runtime.jbossas>1.0.0</version.jboss.osgi.runtime.jbossas>
- <version.jboss.osgi.runtime.knopflerfish>1.0.0</version.jboss.osgi.runtime.knopflerfish>
+ <version.jboss.osgi.runtime.jbossmc>1.0.0-SNAPSHOT</version.jboss.osgi.runtime.jbossmc>
<version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webconsole>1.0.0</version.jboss.osgi.webconsole>
<version.jboss.osgi.xml.binding>2.0.1</version.jboss.osgi.xml.binding>
Modified: projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/reactor/blueprint/testsuite/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -162,15 +162,15 @@
</profile>
<!--
- Name: framework-knopflerfish
- Descr: Setup for Knopflerfish framework integration testing
+ Name: framework-jbossmc
+ Descr: Setup for JBossMC framework integration testing
-->
<profile>
- <id>framework-knopflerfish</id>
+ <id>framework-jbossmc</id>
<activation>
<property>
<name>framework</name>
- <value>knopflerfish</value>
+ <value>jbossmc</value>
</property>
</activation>
<build>
Modified: projects/jboss-osgi/trunk/reactor/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/reactor/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -76,6 +76,7 @@
<module>spi</module>
<module>runtime/equinox</module>
<module>runtime/felix</module>
+ <module>runtime/jbossmc</module>
<module>bundles/common</module>
<module>blueprint</module>
</modules>
Copied: projects/jboss-osgi/trunk/reactor/runtime/jbossmc (from rev 91756, projects/jboss-osgi/projects/runtime/felix/trunk)
Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/.classpath 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/.classpath 2009-07-29 20:49:03 UTC (rev 91789)
@@ -3,6 +3,7 @@
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/pom.xml 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -14,13 +14,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBossOSGi Runtime - Felix</name>
+ <name>JBossOSGi Runtime - JBossMC</name>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
<packaging>jar</packaging>
- <version>1.9.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -30,8 +30,8 @@
</parent>
<properties>
- <version.felix.framework>1.9.0-SNAPSHOT</version.felix.framework>
<version.jboss.osgi.spi>1.0.1-SNAPSHOT</version.jboss.osgi.spi>
+ <version.osgi>r4v42-20090728</version.osgi>
</properties>
<!-- Dependencies -->
@@ -42,10 +42,15 @@
<version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.framework</artifactId>
- <version>${version.felix.framework}</version>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
</dependencies>
<!-- Build -->
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,179 @@
+/*
+ * 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.jbossmc.framework;
+
+//$Id$
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Dictionary;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * An implementation of an OSGi BundleContext
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 29-Jul-2009
+ */
+public class BundleContextImpl implements BundleContext
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(BundleContextImpl.class);
+
+ private BundleContext sysContext;
+ private Bundle bundle;
+
+ public BundleContextImpl(BundleContext sysContext, Bundle bundle)
+ {
+ this.sysContext = sysContext;
+ this.bundle = bundle;
+ }
+
+ BundleContext getSystemContext()
+ {
+ return sysContext;
+ }
+
+ public void addBundleListener(BundleListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addFrameworkListener(FrameworkListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addServiceListener(ServiceListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Filter createFilter(String filter) throws InvalidSyntaxException
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Bundle getBundle()
+ {
+ return bundle;
+ }
+
+ public Bundle getBundle(long id)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Bundle[] getBundles()
+ {
+ throw new NotImplementedException();
+ }
+
+ public File getDataFile(String filename)
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getProperty(String key)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Object getService(ServiceReference reference)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference getServiceReference(String clazz)
+ {
+ // [TODO] getServiceReference
+ return null;
+ }
+
+ public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ {
+ // [TODO] getServiceReferences
+ return null;
+ }
+
+ public Bundle installBundle(String location) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Bundle installBundle(String location, InputStream input) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceRegistration registerService(String[] clazzes, Object service, Dictionary properties)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceRegistration registerService(String clazz, Object service, Dictionary properties)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void removeBundleListener(BundleListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void removeFrameworkListener(FrameworkListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void removeServiceListener(ServiceListener listener)
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean ungetService(ServiceReference reference)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleContextImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,190 @@
+/*
+ * 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.jbossmc.framework;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.NotImplementedException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+
+/**
+ * An implementation of an OSGi Bundle
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 29-Jul-2009
+ */
+public class BundleImpl implements Bundle
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(BundleImpl.class);
+
+ private int state;
+ private BundleContext bndContext;
+
+ public long getBundleId()
+ {
+ throw new NotImplementedException();
+ }
+
+ public int getState()
+ {
+ return state;
+ }
+
+ public void setState(int state)
+ {
+ this.state = state;
+ }
+
+ public String getLocation()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getSymbolicName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void start() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void start(int options) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void stop() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void stop(int options) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void uninstall() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void update() throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public void update(InputStream in) throws BundleException
+ {
+ throw new NotImplementedException();
+ }
+
+ public Enumeration findEntries(String path, String filePattern, boolean recurse)
+ {
+ throw new NotImplementedException();
+ }
+
+ public BundleContext getBundleContext()
+ {
+ return bndContext;
+ }
+
+ public URL getEntry(String path)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Enumeration getEntryPaths(String path)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Dictionary getHeaders()
+ {
+ throw new NotImplementedException();
+ }
+
+ public Dictionary getHeaders(String locale)
+ {
+ throw new NotImplementedException();
+ }
+
+ public long getLastModified()
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference[] getRegisteredServices()
+ {
+ throw new NotImplementedException();
+ }
+
+ public URL getResource(String name)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Enumeration getResources(String name) throws IOException
+ {
+ throw new NotImplementedException();
+ }
+
+ public ServiceReference[] getServicesInUse()
+ {
+ throw new NotImplementedException();
+
+ }
+
+ public Map getSignerCertificates(int signersType)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Version getVersion()
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean hasPermission(Object permission)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Class loadClass(String name) throws ClassNotFoundException
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/BundleImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,47 @@
+/*
+ * 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.jbossmc.framework;
+
+//$Id$
+
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * An implementation of an OSGi FrameworkFactory
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 29-Jul-2009
+ */
+public class FrameworkFactoryImpl implements FrameworkFactory
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(FrameworkFactoryImpl.class);
+
+ public Framework newFramework(Map configuration)
+ {
+ return new FrameworkImpl(configuration);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java (from rev 91756, projects/jboss-osgi/projects/runtime/felix/trunk/src/main/java/org/jboss/osgi/felix/FelixIntegration.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/FrameworkImpl.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,241 @@
+/*
+ * 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.jbossmc.framework;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkEvent;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * An impementation of an OSGi Framework
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 29-Jul-2009
+ */
+public class FrameworkImpl extends BundleImpl implements Framework
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(FrameworkImpl.class);
+
+ private Map configuration;
+ private SystemBundleContext sysContext;
+ private int startLevel;
+
+ public FrameworkImpl(Map configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Returns the Framework unique identifier. This Framework is assigned the unique identifier zero (0) since this Framework is also a System Bundle.
+ */
+ @Override
+ public long getBundleId()
+ {
+ return 0;
+ }
+
+ /**
+ * Returns the symbolic name of this Framework.
+ */
+ @Override
+ public String getSymbolicName()
+ {
+ return "org.jboss.osgi.jbossmc";
+ }
+
+ /**
+ * Returns the Framework location identifier. This Framework is assigned the unique location "<code>System Bundle</code>" since this Framework is also a
+ * System Bundle.
+ */
+ @Override
+ public String getLocation()
+ {
+ return "System Bundle";
+ }
+
+ int getStartLevel()
+ {
+ return startLevel;
+ }
+
+ void setStartLevel(int startLevel)
+ {
+ this.startLevel = startLevel;
+ }
+
+ @Override
+ public BundleContext getBundleContext()
+ {
+ return sysContext;
+ }
+
+ public void init() throws BundleException
+ {
+ initInternal();
+ }
+
+ @Override
+ public void start() throws BundleException
+ {
+ startInternal();
+ }
+
+ @Override
+ public void start(int options) throws BundleException
+ {
+ startInternal();
+ }
+
+ @Override
+ public void stop() throws BundleException
+ {
+ // [TODO] The method returns immediately to the caller after initiating the following steps
+
+ stopInternal();
+ }
+
+ @Override
+ public void stop(int options) throws BundleException
+ {
+ // [TODO] The method returns immediately to the caller after initiating the following steps
+
+ stopInternal();
+ }
+
+ @Override
+ public void update() throws BundleException
+ {
+ updateInternal();
+ }
+
+ /**
+ * Calling this method is the same as calling {@link #update()} except that any provided InputStream is immediately closed.
+ */
+ @Override
+ public void update(InputStream in) throws BundleException
+ {
+ if (in != null)
+ {
+ try
+ {
+ in.close();
+ }
+ catch (IOException ex)
+ {
+ // ignore
+ }
+ }
+
+ // [TODO] The method returns immediately to the caller after initiating the following steps
+
+ updateInternal();
+ }
+
+ /**
+ * The Framework cannot be uninstalled.
+ * <p>
+ * This method always throws a BundleException.
+ */
+ @Override
+ public void uninstall() throws BundleException
+ {
+ throw new BundleException("The system bundle cannot be uninstalled");
+ }
+
+ private void initInternal()
+ {
+ // This method does nothing if called when this Framework is in the
+ // STARTING, ACTIVE or STOPPING state
+ if (getState() == STARTING || getState() == ACTIVE || getState() == STOPPING)
+ return;
+
+ // Put into the STARTING state
+ setState(STARTING);
+
+ // Have a valid Bundle Context
+ sysContext = new SystemBundleContext(this);
+
+ // Be at start level 0
+ setStartLevel(0);
+
+ // [TODO] Have event handling enabled
+
+ // [TODO] Have reified Bundle objects for all installed bundles
+
+ // [TODO] Have registered any framework services
+ }
+
+ private void startInternal()
+ {
+ // If this Framework is not in the STARTING state, initialize this Framework
+ if (getState() != STARTING)
+ initInternal();
+
+ // [TODO] All installed bundles must be started
+
+ // [TODO] This Framework's state is set to ACTIVE
+ setState(ACTIVE);
+
+ // [TODO] A framework event of type STARTED is fired
+ }
+
+ private void stopInternal()
+ {
+ // [TODO] This Framework's state is set to STOPPING
+
+ // [TODO] All installed bundles must be stopped
+
+ // [TODO] Unregister all services registered by this Framework
+
+ // [TODO] Event handling is disabled
+
+ // [TODO] This Framework's state is set to RESOLVED
+
+ // [TODO] All resources held by this Framework are released.
+
+ // [TODO] Notify all threads that are waiting at waitForStop(long)
+ }
+
+ private void updateInternal()
+ {
+ stopInternal();
+
+ startInternal();
+ }
+
+ public FrameworkEvent waitForStop(long timeout) throws InterruptedException
+ {
+ // [TODO] Wait until this Framework has completely stopped.
+
+ // [TODO] A Framework Event indicating the reason this method returned
+ return new FrameworkEvent(FrameworkEvent.STOPPED, this, null);
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -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.jbossmc.framework;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * An implementation of the OSGi system BundleContext
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 29-Jul-2009
+ */
+public class SystemBundleContext extends BundleContextImpl
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(SystemBundleContext.class);
+
+ public SystemBundleContext(Framework framework)
+ {
+ super(null, framework);
+ }
+
+ @Override
+ BundleContext getSystemContext()
+ {
+ return this;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/java/org/jboss/osgi/jbossmc/framework/SystemBundleContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1 @@
+org.jboss.osgi.jbossmc.framework.FrameworkFactoryImpl
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,48 +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.felix;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.osgi.spi.framework.FrameworkLoader;
-import org.junit.Test;
-import org.osgi.framework.launch.Framework;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler at jboss.com
- * @since 27-Jul-2009
- */
-public class FrameworkLaunchTestCase
-{
- @Test
- public void testFrameworkLaunch()
- {
- Framework framework = FrameworkLoader.newFramework(null);
-
- assertEquals("BundleId == 0", 0, framework.getBundleId());
- assertEquals("SymbolicName", "org.apache.felix.framework", framework.getSymbolicName());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 02:40:06 UTC (rev 91756)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,53 +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.felix;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.osgi.felix.FelixIntegration;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public class SystemBundleTestCase extends OSGiTest
-{
- @Test
- public void testFelixIntegration()
- {
- FelixIntegration framework = new FelixIntegration();
- framework.create();
- framework.start();
-
- Bundle bundle = framework.getBundle();
-
- assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java (from rev 91756, projects/jboss-osgi/projects/runtime/felix/trunk/src/test/java/org/jboss/test/osgi/felix/FrameworkLaunchTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/reactor/runtime/jbossmc/src/test/java/org/jboss/test/osgi/jbossmc/FrameworkLaunchTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,50 @@
+/*
+ * 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.jbossmc;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.osgi.spi.util.ServiceLoader;
+import org.junit.Test;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * Test OSGi System bundle access
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 27-Jul-2009
+ */
+public class FrameworkLaunchTestCase
+{
+ @Test
+ public void testFrameworkLaunch()
+ {
+ FrameworkFactory factory = ServiceLoader.loadService(FrameworkFactory.class);
+ Framework framework = factory.newFramework(null);
+
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ assertEquals("SymbolicName", "org.jboss.osgi.jbossmc", framework.getSymbolicName());
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -48,53 +48,64 @@
</dependency>
</dependencies>
- <!-- Build -->
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>bundles</id>
- <phase>test-compile</phase>
- <goals>
- <goal>directory-single</goal>
- </goals>
- <configuration>
- <finalName>test-libs</finalName>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>scripts/assembly-bundles.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>build-test-jars</id>
- <phase>test-compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
- <property name="tests.output.dir" value="${project.build.directory}" />
- <ant antfile="scripts/antrun-test-jars.xml" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
<!-- Profiles -->
<profiles>
+
+ <!--
+ Name: noprepare
+ Descr: Skip building the test bundles
+ -->
+ <profile>
+ <id>noprepare</id>
+ <activation>
+ <property>
+ <name>!noprepare</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>bundles</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>directory-single</goal>
+ </goals>
+ <configuration>
+ <finalName>test-libs</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-bundles.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-jars</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Deleted: 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-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,166 +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.
- */
-
-
-//$Id$
-package org.jboss.test.osgi.bootstrap;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import javax.management.MBeanServer;
-import javax.naming.InitialContext;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.jboss.osgi.jaxb.JAXBCapability;
-import org.jboss.osgi.jaxb.JAXBService;
-import org.jboss.osgi.jbossxb.XMLBindingCapability;
-import org.jboss.osgi.jbossxb.XMLBindingService;
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.jndi.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.xml.XMLParserCapability;
-import org.junit.Test;
-import org.osgi.framework.BundleException;
-
-/**
- * Test OSGi runtime capabilities
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public class CapabilityTestCase extends OSGiTest
-{
- @Test
- public void testXMLParserCapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new XMLParserCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(SAXParserFactory.class.getName());
- assertNotNull("SAXParserFactory registered", saxRef);
- assertEquals("namespaceAware", Boolean.TRUE, saxRef.getProperty("parser.namespaceAware"));
- assertEquals("validating", Boolean.TRUE, saxRef.getProperty("parser.validating"));
- assertEquals("xincludeAware", Boolean.TRUE, saxRef.getProperty("parser.xincludeAware"));
-
- OSGiServiceReference domRef = runtime.getServiceReference(DocumentBuilderFactory.class.getName());
- assertNotNull("DocumentBuilderFactory registered", domRef);
- assertEquals("namespaceAware", Boolean.TRUE, domRef.getProperty("parser.namespaceAware"));
- assertEquals("validating", Boolean.TRUE, domRef.getProperty("parser.validating"));
- assertEquals("xincludeAware", Boolean.TRUE, domRef.getProperty("parser.xincludeAware"));
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJAXBCapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new JAXBCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(JAXBService.class.getName());
- assertNotNull("JAXBService registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testXMLBindingCapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new XMLBindingCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(XMLBindingService.class.getName());
- assertNotNull("XMLBindingService registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJNDICapability() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new JNDICapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(InitialContext.class.getName());
- assertNotNull("InitialContext registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJMXCapability() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
- assertNull("Test bundle null", bundle);
-
- runtime.addCapability(new JMXCapability());
-
- OSGiServiceReference saxRef = runtime.getServiceReference(MBeanServer.class.getName());
- assertNotNull("MBeanServer registered", saxRef);
- }
- finally
- {
- runtime.shutdown();
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java (from rev 91756, 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/capabilities/CapabilityTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/capabilities/CapabilityTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,166 @@
+/*
+ * 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.
+ */
+
+
+//$Id$
+package org.jboss.test.osgi.capabilities;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import javax.management.MBeanServer;
+import javax.naming.InitialContext;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.osgi.jaxb.JAXBCapability;
+import org.jboss.osgi.jaxb.JAXBService;
+import org.jboss.osgi.jbossxb.XMLBindingCapability;
+import org.jboss.osgi.jbossxb.XMLBindingService;
+import org.jboss.osgi.jmx.JMXCapability;
+import org.jboss.osgi.jndi.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.xml.XMLParserCapability;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
+
+/**
+ * Test OSGi runtime capabilities
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class CapabilityTestCase extends OSGiTest
+{
+ @Test
+ public void testXMLParserCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new XMLParserCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(SAXParserFactory.class.getName());
+ assertNotNull("SAXParserFactory registered", saxRef);
+ assertEquals("namespaceAware", Boolean.TRUE, saxRef.getProperty("parser.namespaceAware"));
+ assertEquals("validating", Boolean.TRUE, saxRef.getProperty("parser.validating"));
+ assertEquals("xincludeAware", Boolean.TRUE, saxRef.getProperty("parser.xincludeAware"));
+
+ OSGiServiceReference domRef = runtime.getServiceReference(DocumentBuilderFactory.class.getName());
+ assertNotNull("DocumentBuilderFactory registered", domRef);
+ assertEquals("namespaceAware", Boolean.TRUE, domRef.getProperty("parser.namespaceAware"));
+ assertEquals("validating", Boolean.TRUE, domRef.getProperty("parser.validating"));
+ assertEquals("xincludeAware", Boolean.TRUE, domRef.getProperty("parser.xincludeAware"));
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJAXBCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JAXBCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(JAXBService.class.getName());
+ assertNotNull("JAXBService registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testXMLBindingCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new XMLBindingCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(XMLBindingService.class.getName());
+ assertNotNull("XMLBindingService registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJNDICapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JNDICapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(InitialContext.class.getName());
+ assertNotNull("InitialContext registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJMXCapability() throws Exception
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JMXCapability());
+
+ OSGiServiceReference saxRef = runtime.getServiceReference(MBeanServer.class.getName());
+ assertNotNull("MBeanServer registered", saxRef);
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,192 @@
+/*
+ * 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.framework;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * Test the Framework functionality
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 29-Jul-2009
+ */
+public class FrameworkTestCase
+{
+ public static Framework framework;
+
+ @BeforeClass
+ public static void beforeClass() throws BundleException
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ framework = bootProvider.getFramework();
+ framework.start();
+ }
+
+ @Test
+ public void testGetBundleId()
+ {
+ assertEquals("BundleId == 0", 0, framework.getBundleId());
+ }
+
+ @Test
+ public void testGetSymbolicName()
+ {
+ assertNotNull("SymbolicName not null", framework.getSymbolicName());
+ }
+
+ @Test
+ public void testGetLocation()
+ {
+ assertEquals("System Bundle", framework.getLocation());
+ }
+
+ @Test
+ public void testUninstall()
+ {
+ try
+ {
+ framework.uninstall();
+ fail("BundleException expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+ }
+
+ @Test
+ @Ignore
+ public void testFindEntries()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetBundleContext()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetEntry()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetEntryPaths()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetHeaders()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetLastModified()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetRegisteredServices()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetResource()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetResources()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetServicesInUse()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetSignerCertificates()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetState()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testGetVersion()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testHasPermission()
+ {
+
+ }
+
+ @Test
+ @Ignore
+ public void testLoadClass()
+ {
+
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/framework/FrameworkTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties (from rev 91756, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-jbossmc.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -0,0 +1,10 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${basedir}/target/osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-knopflerfish.properties 2009-07-29 20:49:03 UTC (rev 91789)
@@ -1,45 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.knopflerfish.framework.KnopflerfishIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${basedir}/target/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# Extra System Packages
-org.osgi.framework.system.packages=\
- javax.management, \
- org.apache.log4j, \
- 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, \
- org.jboss.osgi.spi.util;version=1.0, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- org.jboss.util, \
- org.jboss.util.id, \
- org.jboss.util.threadpool, \
- org.jboss.util.propertyeditor, \
- org.osgi.framework;version\=1.4, \
- org.osgi.service.startlevel;version\=1.1
-
-# Bundles that need to be installed with the Framework automatically
-# org.jboss.osgi.spi.framework.autoInstall=\
-# file://${test.archive.directory}/bundles/org.osgi.compendium.jar
-
-# Bundles that need to be started automatically
-# org.jboss.osgi.spi.framework.autoStart=\
-# file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
-# file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 20:46:27 UTC (rev 91788)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-07-29 20:49:03 UTC (rev 91789)
@@ -46,16 +46,21 @@
<groupId>biz.aQute</groupId>
<artifactId>bnd</artifactId>
</dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>${version.javax.servlet}</version>
- </dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.javax.servlet}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
<version>${version.jboss.naming}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
+ </dependency>
<!-- Bundle Dependencies -->
<dependency>
@@ -170,6 +175,7 @@
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-runtime-felix</artifactId>
<version>${version.jboss.osgi.runtime.felix}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -197,6 +203,7 @@
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-runtime-equinox</artifactId>
<version>${version.jboss.osgi.runtime.equinox}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
<build>
@@ -215,22 +222,23 @@
</profile>
<!--
- Name: framework-knopflerfish
+ Name: framework-jbossmc
Descr: Setup for Knopflerfish framework integration testing
-->
<profile>
- <id>framework-knopflerfish</id>
+ <id>framework-jbossmc</id>
<activation>
<property>
<name>framework</name>
- <value>knopflerfish</value>
+ <value>jbossmc</value>
</property>
</activation>
<dependencies>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version.jboss.osgi.runtime.knopflerfish}</version>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossmc</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossmc}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
<build>
@@ -240,7 +248,7 @@
<configuration>
<includes>
<!-- Minimal bootstrap testing -->
- <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
+ <include>org/jboss/test/osgi/framework/**</include>
</includes>
</configuration>
</plugin>
More information about the jboss-osgi-commits
mailing list