JBoss-OSGI SVN: r92947 - projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-08-28 07:48:52 -0400 (Fri, 28 Aug 2009)
New Revision: 92947
Modified:
projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
Log:
Add archive children to the classpath
Modified: projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java 2009-08-28 11:46:15 UTC (rev 92946)
+++ projects/jboss-osgi/projects/runtime/deployers/trunk/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java 2009-08-28 11:48:52 UTC (rev 92947)
@@ -83,6 +83,13 @@
// The classpath is the root
addClassPath(structureContext, file, true, true, context);
+ // Add archive children to the classpath
+ for (VirtualFile child : root.getChildren())
+ {
+ if (child.isArchive())
+ addClassPath(structureContext, child, true, true, context);
+ }
+
// We don't process children as potential subdeployments
return true;
16 years, 3 months
JBoss-OSGI SVN: r92945 - in projects/jboss-osgi/trunk/testsuite: example and 15 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-08-28 07:46:00 -0400 (Fri, 28 Aug 2009)
New Revision: 92945
Added:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd
Removed:
projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI38TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/SomePojo.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleX.bnd
Modified:
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
[JBOSGI-142] Investigate if exporter can load classes from importer
Deleted: projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,9 +0,0 @@
-#Tue Feb 17 14:09:40 CET 2009
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-08-28 11:46:00 UTC (rev 92945)
@@ -143,6 +143,84 @@
<!-- Profiles -->
<profiles>
+
+ <!--
+ Name: framework-equinox
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-equinox</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>equinox</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/jboss/test/osgi/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: framework-felix
+ Descr: Setup for Felix framework integration testing
+ -->
+ <profile>
+ <id>framework-felix</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>felix</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: framework-jbossmc
+ Descr: Setup for JBossMC framework integration testing
+ -->
+ <profile>
+ <id>framework-jbossmc</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>jbossmc</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
</profiles>
</project>
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/simple/SimpleFrameworkLaunchTestCase.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,83 @@
+/*
+ * 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.simple;
+
+//$Id: SimpleTestCase.java 91196 2009-07-14 09:41:15Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.test.osgi.example.simple.bundle.SimpleService;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * A test that deployes a bundle and verifies its state
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 28-Aug-2009
+ */
+public class SimpleFrameworkLaunchTestCase extends OSGiTest
+{
+ @Test
+ public void testSimpleBundle() throws Exception
+ {
+ OSGiBootstrapProvider bootstrapProvider = OSGiBootstrap.getBootstrapProvider();
+ Framework framework = bootstrapProvider.getFramework();
+ framework.start();
+
+ BundleContext sysContext = framework.getBundleContext();
+
+ Bundle bundle = sysContext.installBundle(getBundleLocation("example-simple.jar"));
+ assertEquals("example-simple", bundle.getSymbolicName());
+
+ bundle.start();
+ assertEquals("Bundle state", Bundle.ACTIVE, bundle.getState());
+
+ BundleContext bndContext = bundle.getBundleContext();
+ assertNotNull("BundleContext not null", bndContext);
+
+ // getServiceReference from bundle context
+ ServiceReference sref = bndContext.getServiceReference(SimpleService.class.getName());
+ assertNotNull("ServiceReference not null", sref);
+
+ // getServiceReference from system context
+ sref = sysContext.getServiceReference(SimpleService.class.getName());
+ assertNotNull("ServiceReference not null", sref);
+
+ bundle.uninstall();
+ assertEquals("Bundle state", Bundle.UNINSTALLED, bundle.getState());
+
+ framework.stop();
+ framework.waitForStop(5000);
+ }
+ private String getBundleLocation(String jarname)
+ {
+ return getTestArchiveURL(jarname).toExternalForm();
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-08-28 11:46:00 UTC (rev 92945)
@@ -14,27 +14,23 @@
<map keyClass="java.lang.String" valueClass="java.lang.String">
<entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
+ <entry><key>org.osgi.framework.system.packages.extra</key><value>
+ org.jboss.logging;version=2.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
+ </value></entry>
</map>
</property>
<incallback method="addPlugin" />
<uncallback method="removePlugin" />
</bean>
- <bean name="OSGiSystemPackages" class="org.jboss.osgi.plugins.facade.plugins.SystemPackagesPluginImpl">
+ <bean name="OSGiAutoInstallPlugin" class="org.jboss.osgi.plugins.facade.plugins.AutoInstallPluginImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
- <property name="extraPackages">
- <list elementClass="java.lang.String">
- <value>org.jboss.logging;version=2.0</value>
- <value>org.jboss.osgi.spi.logging;version=1.0</value>
- <value>org.jboss.osgi.spi.management;version=1.0</value>
- <value>org.jboss.osgi.spi.service;version=1.0</value>
- <value>org.jboss.osgi.spi.util;version=1.0</value>
- </list>
- </property>
- </bean>
-
- <bean name="jboss.osgi:plugin=AutoInstall" class="org.jboss.osgi.plugins.facade.plugins.AutoInstallPluginImpl">
- <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
<property name="autoInstall">
<list elementClass="java.net.URL">
<!-- [JBOSGI-136] Cannot resolve dependency against unstarted bundle
@@ -49,10 +45,15 @@
</list>
</property>
</bean>
-
+ <bean name="OSGiFrameworkEventsPlugin" class="org.jboss.osgi.plugins.facade.plugins.FrameworkEventsPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
<bean name="OSGiStoragePlugin" class="org.jboss.osgi.plugins.facade.plugins.BundleStoragePluginImpl">
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
+ <bean name="OSGiSystemPackages" class="org.jboss.osgi.plugins.facade.plugins.SystemPackagesPluginImpl">
+ <constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
+ </bean>
<!--
********************************
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,3 +1,3 @@
-org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider # The MC Facade bootstrap provider
+org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider # The MC Framework bootstrap provider
org.jboss.osgi.equinox.EquinoxBootstrapProvider # The Equinox bootstrap provider
org.jboss.osgi.felix.FelixBootstrapProvider # The Felix bootstrap provider
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-08-28 11:46:00 UTC (rev 92945)
@@ -21,6 +21,7 @@
org.jboss.osgi.common.log;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
+ org.jboss.osgi.spi.framework;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/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-08-28 11:46:00 UTC (rev 92945)
@@ -109,6 +109,81 @@
</profile>
<!--
+ Name: framework-equinox
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-equinox</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>equinox</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>${target.container.excludes}</exclude>
+ <exclude>org/jboss/test/osgi/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: framework-felix
+ Descr: Setup for Felix framework integration testing
+ -->
+ <profile>
+ <id>framework-felix</id>
+ <activation>
+ <property>
+ <name>framework</name>
+ <value>felix</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>${target.container.excludes}</exclude>
+ <exclude>org/jboss/test/osgi/jbosgi142/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>framework-default</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>${target.container.excludes}</exclude>
+ <exclude>org/jboss/test/osgi/jbosgi142/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
Name: framework-jbossmc
Descr: Setup for JBossMC framework integration testing
-->
@@ -126,13 +201,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <exclude>org/jboss/test/osgi/jbossas/**</exclude>
- <exclude>org/jboss/test/osgi/jbosgi38/**</exclude>
- <exclude>org/jboss/test/osgi/jbosgi39/**</exclude>
- <exclude>org/jboss/test/osgi/jbosgi41/**</exclude>
- <exclude>org/jboss/test/osgi/jbosgi108/**</exclude>
- <exclude>org/jboss/test/osgi/jbosgi112/**</exclude>
- <exclude>org/jboss/test/osgi/service/startlevel/**</exclude>
+ <exclude>${target.container.excludes}</exclude>
+ <exclude>org/jboss/test/osgi/**</exclude>
</excludes>
</configuration>
</plugin>
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-08-28 11:46:00 UTC (rev 92945)
@@ -8,6 +8,21 @@
<!-- $Id: antrun-test-jars.xml 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $ -->
+<!--
+
+ [JBOSGI-36] Bundle classes leak into system classloader
+ [JBOSGI-37] Prevent creation of deployment unit for nested jars
+ [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
+ [JBOSGI-39] Bundle gets wired to an already uninstalled bundle
+ [JBOSGI-41] Verify persistent file storage
+ [JBOSGI-92] Class.forName issue with XMLParserActivator
+ [JBOSGI-99] No explicit control over bundle.start()
+ [JBOSGI-108] Investigate statics on PackageAdmin.refresh
+ [JBOSGI-112] Investigate Exception in SynchronousBundleListener
+ [JBOSGI-142] Investigate classloading space
+
+-->
+
<project default="build-test-jars">
<description>OSGi test archive builder</description>
@@ -78,12 +93,12 @@
<!-- jbosgi41 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
+ <!-- jbosgi92 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi92-bundleA.jar" files="${tests.resources.dir}/jbosgi92/jbosgi92-bundleA.bnd" />
+
<!-- jbosgi99 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi99-bundleA.jar" files="${tests.resources.dir}/jbosgi99/jbosgi99-bundleA.bnd" />
- <!-- jbosgi92 -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi92-bundleA.jar" files="${tests.resources.dir}/jbosgi92/jbosgi92-bundleA.bnd" />
-
<!-- jbosgi108 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleA.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleA.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi108-bundleB.jar" files="${tests.resources.dir}/jbosgi108/jbosgi108-bundleB.bnd" />
@@ -91,6 +106,11 @@
<!-- jbosgi112 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleA.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleA.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi112-bundleB.jar" files="${tests.resources.dir}/jbosgi112/jbosgi112-bundleB.bnd" />
+
+ <!-- jbosgi142 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleA.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleB.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleB.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi142-bundleX.jar" files="${tests.resources.dir}/jbosgi142/jbosgi142-bundleX.bnd" />
<!-- startlevel -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/startlevel.jar" files="${tests.resources.dir}/service/startlevel/startlevel.bnd" />
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142 (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38)
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI142TestCase.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,120 @@
+/*
+ * 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.jbosgi142;
+
+//$Id: OSGI142TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.test.osgi.jbosgi142.bundleA.BeanA;
+import org.jboss.test.osgi.jbosgi142.bundleB.BeanB;
+import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+
+/**
+ * [JBOSGI-142] Investigate classloading space
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-142
+ *
+ * A imports X
+ * B imports X
+ *
+ * Can X load a class from A or B?
+ * Can A load a class from B and vice versa?
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 28-Aug-2009
+ */
+public class OSGI142TestCase extends OSGiTest
+{
+ @Test
+ public void testLoadClass() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ Framework framework = bootProvider.getFramework();
+ framework.start();
+
+ BundleContext sysContext = framework.getBundleContext();
+ Bundle bundleX = sysContext.installBundle(getBundleLocation("jbosgi142-bundleX.jar"));
+ bundleX.start();
+
+ assertBundleLoadClass(bundleX, BeanX.class, true);
+
+ Bundle bundleA = sysContext.installBundle(getBundleLocation("jbosgi142-bundleA.jar"));
+ bundleA.start();
+
+ assertBundleLoadClass(bundleA, BeanA.class, true);
+
+ Bundle bundleB = sysContext.installBundle(getBundleLocation("jbosgi142-bundleB.jar"));
+ bundleB.start();
+
+ assertBundleLoadClass(bundleB, BeanB.class, true);
+
+ assertBundleLoadClass(bundleA, BeanX.class, true);
+ assertBundleLoadClass(bundleB, BeanX.class, true);
+
+ assertBundleLoadClass(bundleX, BeanA.class, false);
+ assertBundleLoadClass(bundleX, BeanB.class, false);
+
+ assertBundleLoadClass(bundleA, BeanB.class, false);
+ assertBundleLoadClass(bundleB, BeanA.class, false);
+
+ framework.stop();
+ framework.waitForStop(1000);
+ }
+
+ private void assertBundleLoadClass(Bundle bundle, Class<?> expClazz, boolean success)
+ {
+ String message = bundle.getSymbolicName() + " loads " + expClazz.getName();
+
+ Class<?> wasClass;
+ try
+ {
+ wasClass = bundle.loadClass(expClazz.getName());
+ if (success)
+ {
+ assertEquals(message, expClazz.getName(), wasClass.getName());
+ }
+ else
+ fail("ClassNotFoundException expected for: " + message);
+
+ }
+ catch (ClassNotFoundException ex)
+ {
+ if (success)
+ fail("Unexpected ClassNotFoundException for: " + message);
+ }
+ }
+
+ private String getBundleLocation(String jarname)
+ {
+ return new OSGiTestHelper().getTestArchiveURL(jarname).toExternalForm();
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/OSGI38TestCase.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,212 +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.jbosgi38;
-
-//$Id: OSGI38TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.jboss.osgi.spi.testing.OSGiBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-/**
- * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
- *
- * https://jira.jboss.org/jira/browse/JBOSGI-38
- *
- * Bundle A depends on bundle B, both share bundle X.
- *
- * A ---> B
- * A ---> X <--- B
- *
- * @author thomas.diesler(a)jboss.com
- * @since 02-Mar-2009
- */
-public class OSGI38TestCase extends OSGiTest
-{
- /*
- * Install/Start the common bundle
- */
- @Test
- public void testInstallStartX() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
- bundleX.start();
- assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
-
- bundleX.uninstall();
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- /*
- * Install X, B
- */
- @Test
- public void testInstallXBeforeB() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
- OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
- bundleB.start();
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- bundleB.uninstall();
- bundleX.uninstall();
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- /*
- * Install X, B, A
- */
- @Test
- public void testInstallBBeforeA() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
- OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
- OSGiBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
-
- bundleA.start();
- assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-
- bundleA.uninstall();
- bundleB.uninstall();
- bundleX.uninstall();
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- /*
- * Install B, X
- */
- @Test
- public void testInstallBBeforeX() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
- try
- {
- bundleB.start();
- fail("Unresolved constraint expected");
- }
- catch (BundleException ex)
- {
- // expected
- }
-
- OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
- bundleB.start();
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- bundleB.uninstall();
- bundleX.uninstall();
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- /*
- * Install A, B, X
- */
- @Test
- public void testInstallABeforeB() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- OSGiBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
-
- OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
-
- try
- {
- bundleB.start();
- fail("Unresolved constraint expected");
- }
- catch (BundleException ex)
- {
- // expected
- }
-
- OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
- assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
-
- bundleB.start();
- assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
-
- bundleA.start();
- assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
-
- bundleA.uninstall();
- bundleB.uninstall();
- bundleX.uninstall();
- }
- finally
- {
- runtime.shutdown();
- }
- }
-}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/BeanA.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,34 @@
+/*
+ * 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.jbosgi142.bundleA;
+
+//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler(a)jboss.com $
+
+import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
+
+public class BeanA
+{
+ public BeanA(BeanX bean)
+ {
+ }
+
+}
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceA.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,54 +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.jbosgi38.bundleA;
-
-//$Id: ServiceA.java 85293 2009-03-05 13:45:47Z thomas.diesler(a)jboss.com $
-
-import org.jboss.test.osgi.jbosgi38.bundleB.ServiceB;
-import org.jboss.test.osgi.jbosgi38.bundleX.SomePojo;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
- *
- * @author thomas.diesler(a)jboss.com
- * @since 02-Mar-2009
- */
-public class ServiceA
-{
- ServiceA(BundleContext context)
- {
- ServiceTracker tracker = new ServiceTracker(context, ServiceB.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- ServiceB serviceB = (ServiceB)super.addingService(sref);
- serviceB.doStuffInB(new SomePojo("hello"));
- return serviceB;
- }
- };
- tracker.open();
- }
-}
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleA/ServiceActivator.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,40 +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.jbosgi38.bundleA;
-
-//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler(a)jboss.com $
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class ServiceActivator implements BundleActivator
-{
- public void start(BundleContext context)
- {
- ServiceA service = new ServiceA(context);
- context.registerService(ServiceA.class.getName(), service, null);
- }
-
- public void stop(BundleContext context)
- {
- }
-}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/BeanB.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,34 @@
+/*
+ * 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.jbosgi142.bundleB;
+
+//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler(a)jboss.com $
+
+import org.jboss.test.osgi.jbosgi142.bundleX.BeanX;
+
+public class BeanB
+{
+ public BeanB(BeanX bean)
+ {
+ }
+
+}
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceActivator.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,40 +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.jbosgi38.bundleB;
-
-//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler(a)jboss.com $
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class ServiceActivator implements BundleActivator
-{
- public void start(BundleContext context)
- {
- ServiceB service = new ServiceB();
- context.registerService(ServiceB.class.getName(), service, null);
- }
-
- public void stop(BundleContext context)
- {
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleB/ServiceB.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,40 +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.jbosgi38.bundleB;
-
-//$Id: ServiceB.java 85016 2009-03-02 12:12:31Z thomas.diesler(a)jboss.com $
-
-import org.jboss.test.osgi.jbosgi38.bundleX.SomePojo;
-
-/**
- * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
- *
- * @author thomas.diesler(a)jboss.com
- * @since 02-Mar-2009
- */
-public class ServiceB
-{
- public String doStuffInB(SomePojo obj)
- {
- return obj.toString();
- }
-}
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/BeanX.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,28 @@
+/*
+ * 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.jbosgi142.bundleX;
+
+//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler(a)jboss.com $
+
+public class BeanX
+{
+}
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/SomePojo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi142/bundleX/SomePojo.java 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,41 +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.jbosgi38.bundleX;
-
-
-//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler(a)jboss.com $
-
-public class SomePojo
-{
- private String message;
-
- public SomePojo(String message)
- {
- this.message = message;
- }
-
- @Override
- public String toString()
- {
- return "[" + message + "]";
- }
-}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/services/org.jboss.osgi.spi.framework.OSGiBootstrapProvider 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,4 +1,3 @@
-org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider # The MC Facade bootstrap provider
-org.jboss.osgi.jbossmc.framework.launch.FrameworkBootstrapProvider # The legacy MC based framework bootstrap provider
+org.jboss.osgi.plugins.facade.launch.OSGiFrameworkBootstrapProvider # The MC Framework bootstrap provider
org.jboss.osgi.equinox.EquinoxBootstrapProvider # The Equinox bootstrap provider
org.jboss.osgi.felix.FelixBootstrapProvider # The Felix bootstrap provider
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142 (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38)
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleA.bnd 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi142-bundleA.jar src/test/resources/jbosgi142/bundleA.bnd
+
+Bundle-SymbolicName: jbosgi142-bundleA
+Export-Package: org.jboss.test.osgi.jbosgi142.bundleA
+
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleB.bnd 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi142-bundleB.jar src/test/resources/jbosgi142/bundleB.bnd
+
+Bundle-SymbolicName: jbosgi142-bundleB
+Export-Package: org.jboss.test.osgi.jbosgi142.bundleB
+
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd (from rev 92829, projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi142-bundleX.bnd 2009-08-28 11:46:00 UTC (rev 92945)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi142-bundleX.jar src/test/resources/jbosgi142/bundleX.bnd
+
+Bundle-SymbolicName: jbosgi142-bundleX
+Export-Package: org.jboss.test.osgi.jbosgi142.bundleX
+
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleA.bnd 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleA.jar src/test/resources/jbosgi38/bundleA.bnd
-
-Bundle-SymbolicName: jbosgi38-bundleA
-Bundle-Activator: org.jboss.test.osgi.jbosgi38.bundleA.ServiceActivator
-Export-Package: org.jboss.test.osgi.jbosgi38.bundleA
-
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleB.bnd 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleB.jar src/test/resources/jbosgi38/bundleB.bnd
-
-Bundle-SymbolicName: jbosgi38-bundleB
-Bundle-Activator: org.jboss.test.osgi.jbosgi38.bundleB.ServiceActivator
-Export-Package: org.jboss.test.osgi.jbosgi38.bundleB
-
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleX.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd 2009-08-26 11:18:35 UTC (rev 92829)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi142/jbosgi38-bundleX.bnd 2009-08-28 11:46:00 UTC (rev 92945)
@@ -1,5 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleX.jar src/test/resources/jbosgi38/bundleX.bnd
-
-Bundle-SymbolicName: jbosgi38-bundleX
-Export-Package: org.jboss.test.osgi.jbosgi38.bundleX
-
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-08-28 11:45:37 UTC (rev 92944)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-08-28 11:46:00 UTC (rev 92945)
@@ -202,67 +202,54 @@
</profile>
<!--
- Name: framework-felix
- Descr: Setup for Felix framework integration testing
+ Name: framework-equinox
+ Descr: Setup for Equinox framework integration testing
-->
<profile>
- <id>framework-felix</id>
+ <id>framework-equinox</id>
<activation>
<property>
<name>framework</name>
- <value>felix</value>
+ <value>equinox</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version.jboss.osgi.runtime.felix}</version>
+ <artifactId>jboss-osgi-runtime-equinox</artifactId>
+ <version>${version.jboss.osgi.runtime.equinox}</version>
<scope>provided</scope>
</dependency>
+ <!-- equinox-3.5 does not contain package org.osgi.util.xml -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</profile>
<!--
- Name: framework-equinox
- Descr: Setup for Equinox framework integration testing
+ Name: framework-felix
+ Descr: Setup for Felix framework integration testing
-->
<profile>
- <id>framework-equinox</id>
+ <id>framework-felix</id>
<activation>
<property>
<name>framework</name>
- <value>equinox</value>
+ <value>felix</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-equinox</artifactId>
- <version>${version.jboss.osgi.runtime.equinox}</version>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version.jboss.osgi.runtime.felix}</version>
<scope>provided</scope>
</dependency>
- <!-- equinox-3.5 does not contain package org.osgi.util.xml -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <!-- Minimal bootstrap testing -->
- <include>org/jboss/test/osgi/bootstrap/BootstrapTestCase.*</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
</profile>
<!--
@@ -298,19 +285,9 @@
<name>!target.container</name>
</property>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- Exclude tests that require remote access -->
- <exclude>org/jboss/test/osgi/jbossas/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <properties>
+ <target.container.excludes>org/jboss/test/osgi/jbossas/**</target.container.excludes>
+ </properties>
</profile>
<!--
@@ -325,19 +302,9 @@
<value>runtime</value>
</property>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- Exclude tests that require jboss access -->
- <exclude>org/jboss/test/osgi/jbossas/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <properties>
+ <target.container.excludes>org/jboss/test/osgi/jbossas/**</target.container.excludes>
+ </properties>
</profile>
<!--
@@ -352,6 +319,9 @@
<value>jboss501</value>
</property>
</activation>
+ <properties>
+ <target.container.excludes>org/jboss/test/osgi/nothing-to-exclude</target.container.excludes>
+ </properties>
<dependencies>
<dependency>
<groupId>org.jboss.jbossas</groupId>
@@ -375,6 +345,9 @@
<value>jboss510</value>
</property>
</activation>
+ <properties>
+ <target.container.excludes>org/jboss/test/osgi/nothing-to-exclude</target.container.excludes>
+ </properties>
<dependencies>
<dependency>
<groupId>org.jboss.jbossas</groupId>
@@ -398,6 +371,9 @@
<value>jboss600</value>
</property>
</activation>
+ <properties>
+ <target.container.excludes>org/jboss/test/osgi/nothing-to-exclude</target.container.excludes>
+ </properties>
<dependencies>
<dependency>
<groupId>org.jboss.jbossas</groupId>
16 years, 3 months
JBoss-OSGI SVN: r92941 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-08-28 07:32:53 -0400 (Fri, 28 Aug 2009)
New Revision: 92941
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java
Log:
Re-use bundle manager.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java 2009-08-28 11:26:15 UTC (rev 92940)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiSystemState.java 2009-08-28 11:32:53 UTC (rev 92941)
@@ -108,7 +108,7 @@
public void stop(int options) throws BundleException
{
final OSGiBundleManager bundleManager = getBundleManager();
- getBundleManager().getExecutor().execute(new Runnable()
+ bundleManager.getExecutor().execute(new Runnable()
{
public void run()
{
@@ -121,7 +121,7 @@
public void update() throws BundleException
{
final OSGiBundleManager bundleManager = getBundleManager();
- getBundleManager().getExecutor().execute(new Runnable()
+ bundleManager.getExecutor().execute(new Runnable()
{
public void run()
{
16 years, 3 months
JBoss-OSGI SVN: r92908 - in projects/jboss-osgi/projects/runtime/microcontainer/trunk/src: main/java/org/jboss/osgi/plugins/facade/plugins and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-08-28 02:45:37 -0400 (Fri, 28 Aug 2009)
New Revision: 92908
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleContextUnitTestCase.java
Log:
Fix addServiceListener - different filter replaces the listener.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-08-28 06:02:10 UTC (rev 92907)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/AbstractBundleState.java 2009-08-28 06:45:37 UTC (rev 92908)
@@ -40,7 +40,6 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.plugins.facade.api.BundleStoragePlugin;
import org.jboss.osgi.plugins.facade.api.FrameworkEventsPlugin;
-import org.jboss.osgi.plugins.filter.NoFilter;
import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.osgi.spi.metadata.OSGiMetaData;
import org.jboss.osgi.spi.util.ConstantsHelper;
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java 2009-08-28 06:02:10 UTC (rev 92907)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleState.java 2009-08-28 06:45:37 UTC (rev 92908)
@@ -37,7 +37,6 @@
import org.jboss.osgi.spi.metadata.OSGiMetaData;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.AdminPermission;
-import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-08-28 06:02:10 UTC (rev 92907)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-08-28 06:45:37 UTC (rev 92908)
@@ -411,7 +411,7 @@
return false;
ServiceListenerRegistration other = (ServiceListenerRegistration)obj;
- return other.listener.equals(listener);
+ return other.listener.equals(listener) && other.filter.equals(filter);
}
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleContextUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleContextUnitTestCase.java 2009-08-28 06:02:10 UTC (rev 92907)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/test/java/org/jboss/test/osgi/bundle/test/BundleContextUnitTestCase.java 2009-08-28 06:45:37 UTC (rev 92908)
@@ -296,9 +296,7 @@
bundleContext.addServiceListener(this, "(c=d)");
bundleContext.addServiceListener(this, "(a=b)");
- // [TODO]
- System.out.println("FIXME: assertServiceLifecycle");
- // assertServiceLifecycle(bundle, bundleContext, properties, true);
+ assertServiceLifecycle(bundle, bundleContext, properties, true);
bundleContext.removeServiceListener(this);
}
finally
@@ -318,6 +316,7 @@
ServiceRegistration registration = bundleContext.registerService(BundleContext.class.getName(), bundleContext, properties);
ServiceReference reference = registration.getReference();
+
if (events)
assertServiceEvent(ServiceEvent.REGISTERED, reference);
else
16 years, 3 months
JBoss-OSGI SVN: r92903 - projects/jboss-osgi/trunk/distribution.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-08-28 01:59:30 -0400 (Fri, 28 Aug 2009)
New Revision: 92903
Modified:
projects/jboss-osgi/trunk/distribution/pom.xml
Log:
Fix distribution build
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-08-28 05:58:20 UTC (rev 92902)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-08-28 05:59:30 UTC (rev 92903)
@@ -57,35 +57,6 @@
<!-- jboss.osgi -->
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-deployers</artifactId>
- <version>${version.jboss.osgi.runtime.deployers}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-deployers</artifactId>
- <version>${version.jboss.osgi.runtime.deployers}</version>
- <classifier>sources</classifier>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-jbossas</artifactId>
- <version>${version.jboss.osgi.runtime.jbossas}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-jbossas</artifactId>
- <version>${version.jboss.osgi.runtime.jbossas}</version>
- <classifier>config</classifier>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-jbossas</artifactId>
- <version>${version.jboss.osgi.runtime.jbossas}</version>
- <classifier>sources</classifier>
- </dependency>
- <!-- jboss-osgi-runtime-jbossas: no javadoc -->
- <dependency>
- <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-spi</artifactId>
<version>${version.jboss.osgi.spi}</version>
</dependency>
@@ -304,6 +275,37 @@
<classifier>javadoc</classifier>
</dependency>
+ <!-- jboss.osgi.runtime -->
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-deployers</artifactId>
+ <version>${version.jboss.osgi.runtime.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-deployers</artifactId>
+ <version>${version.jboss.osgi.runtime.deployers}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossas</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossas}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossas</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossas}</version>
+ <classifier>config</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-jbossas</artifactId>
+ <version>${version.jboss.osgi.runtime.jbossas}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ <!-- jboss-osgi-runtime-jbossas: no javadoc -->
+
<!-- Equinox Dependencies -->
<dependency>
<groupId>org.jboss.osgi.runtime</groupId>
16 years, 3 months
JBoss-OSGI SVN: r92895 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-08-27 17:10:49 -0400 (Thu, 27 Aug 2009)
New Revision: 92895
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java
Log:
Duplicate service is null check.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java 2009-08-27 21:05:31 UTC (rev 92894)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java 2009-08-27 21:10:49 UTC (rev 92895)
@@ -108,12 +108,9 @@
}
if (service == null)
throw new IllegalArgumentException("Null service");
+
this.bundleState = bundleState;
this.clazzes = clazzes;
- if (service == null)
- {
- throw new IllegalArgumentException("Null service");
- }
if (service instanceof ServiceFactory)
{
this.serviceFactory = (ServiceFactory) service;
16 years, 3 months
JBoss-OSGI SVN: r92893 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-08-27 16:59:20 -0400 (Thu, 27 Aug 2009)
New Revision: 92893
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java
Log:
Simple refactoring, javadocs.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java 2009-08-27 19:49:40 UTC (rev 92892)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiServiceState.java 2009-08-27 20:59:20 UTC (rev 92893)
@@ -104,7 +104,7 @@
for (String clazz : clazzes)
{
if (clazz == null)
- throw new IllegalArgumentException("Null class in: " + clazzes);
+ throw new IllegalArgumentException("Null class in: " + Arrays.toString(clazzes));
}
if (service == null)
throw new IllegalArgumentException("Null service");
@@ -147,7 +147,7 @@
{
Object ranking = getProperty(Constants.SERVICE_RANKING);
if (ranking != null && ranking instanceof Integer)
- return ((Integer) ranking).intValue();
+ return (Integer)ranking;
return 0;
}
@@ -351,8 +351,8 @@
ClassLoader otherLoader = otherSource.getClassLoader();
ClassLoader sourceLoader = source.getClassLoader();
StringBuffer buffer = new StringBuffer("Cannot assign [" + className + "] comming from different exporters");
- buffer.append("\n " + sourceLoader.toString());
- buffer.append("\n " + otherLoader);
+ buffer.append("\n ").append(sourceLoader.toString());
+ buffer.append("\n ").append(otherLoader);
log.warn(buffer.toString());
}
return equals;
@@ -382,7 +382,8 @@
/**
* Match the class
- *
+ *
+ * @param other the other bundle state
* @param className the class name
* @return true when the class name matches
*/
@@ -452,7 +453,7 @@
if (obj == null)
return false;
- OSGiServiceState other = null;
+ OSGiServiceState other;
if (obj instanceof OSGiServiceState)
other = (OSGiServiceState) obj;
else if (obj instanceof OSGiServiceReferenceWrapper)
@@ -604,7 +605,8 @@
/**
* Check whether the caller has permission
- *
+ *
+ * @param accessControlContext access control context
* @param action the action to check
* @param all whether all permissions are required
*/
@@ -656,7 +658,7 @@
/**
* Check whether the caller has permission to this object
*
- * @param accessControlContext
+ * @param accessControlContext access control context
* @return true when the caller has permission
*/
public boolean hasPermission(AccessControlContext accessControlContext)
16 years, 3 months
JBoss-OSGI SVN: r92891 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-08-27 15:43:41 -0400 (Thu, 27 Aug 2009)
New Revision: 92891
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
Log:
Remove JDK6 @Override code.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-08-27 19:33:38 UTC (rev 92890)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/plugins/FrameworkEventsPluginImpl.java 2009-08-27 19:43:41 UTC (rev 92891)
@@ -59,20 +59,19 @@
final Logger log = Logger.getLogger(FrameworkEventsPluginImpl.class);
/** The bundle listeners */
- private Map<Bundle, List<BundleListener>> bundleListeners = new ConcurrentHashMap<Bundle, List<BundleListener>>();
+ private final Map<Bundle, List<BundleListener>> bundleListeners = new ConcurrentHashMap<Bundle, List<BundleListener>>();
/** The framework listeners */
- private Map<Bundle, List<FrameworkListener>> frameworkListeners = new ConcurrentHashMap<Bundle, List<FrameworkListener>>();
+ private final Map<Bundle, List<FrameworkListener>> frameworkListeners = new ConcurrentHashMap<Bundle, List<FrameworkListener>>();
/** The service listeners */
- private Map<Bundle, List<ServiceListenerRegistration>> serviceListeners = new ConcurrentHashMap<Bundle, List<ServiceListenerRegistration>>();
+ private final Map<Bundle, List<ServiceListenerRegistration>> serviceListeners = new ConcurrentHashMap<Bundle, List<ServiceListenerRegistration>>();
public FrameworkEventsPluginImpl(OSGiBundleManager bundleManager)
{
super(bundleManager);
}
- @Override
public void addBundleListener(Bundle bundle, BundleListener listener)
{
if (listener == null)
@@ -93,7 +92,6 @@
}
}
- @Override
public void removeBundleListener(Bundle bundle, BundleListener listener)
{
if (listener == null)
@@ -114,7 +112,6 @@
}
}
- @Override
public void removeBundleListeners(Bundle bundle)
{
synchronized (bundleListeners)
@@ -124,7 +121,6 @@
}
}
- @Override
public void addFrameworkListener(Bundle bundle, FrameworkListener listener)
{
if (listener == null)
@@ -145,7 +141,6 @@
}
}
- @Override
public void removeFrameworkListener(Bundle bundle, FrameworkListener listener)
{
if (listener == null)
@@ -166,7 +161,6 @@
}
}
- @Override
public void removeFrameworkListeners(Bundle bundle)
{
synchronized (frameworkListeners)
@@ -176,7 +170,6 @@
}
}
- @Override
public void addServiceListener(Bundle bundle, ServiceListener listener, Filter filter)
{
if (listener == null)
@@ -199,7 +192,6 @@
}
}
- @Override
public void removeServiceListener(Bundle bundle, ServiceListener listener)
{
if (listener == null)
@@ -220,7 +212,6 @@
}
}
- @Override
public void removeServiceListeners(Bundle bundle)
{
synchronized (serviceListeners)
@@ -230,7 +221,6 @@
}
}
- @Override
public void fireBundleEvent(Bundle bundle, int type)
{
synchronized (bundleListeners)
@@ -286,7 +276,6 @@
}
}
- @Override
public void fireFrameworkEvent(Bundle bundle, int type, Throwable throwable)
{
synchronized (frameworkListeners)
@@ -321,7 +310,6 @@
}
}
- @Override
public void fireServiceEvent(Bundle bundle, int type, OSGiServiceState service)
{
synchronized (serviceListeners)
@@ -391,7 +379,8 @@
/**
* Create a new ServiceListenerRegistration.
- *
+ *
+ * @param listener service listener
* @param filter the filter
*/
public ServiceListenerRegistration(ServiceListener listener, Filter filter)
16 years, 3 months
JBoss-OSGI SVN: r92889 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-08-27 15:25:29 -0400 (Thu, 27 Aug 2009)
New Revision: 92889
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
Log:
Use duplicated code + few javadocs.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-08-27 19:15:26 UTC (rev 92888)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/facade/bundle/OSGiBundleManager.java 2009-08-27 19:25:29 UTC (rev 92889)
@@ -21,6 +21,7 @@
*/
package org.jboss.osgi.plugins.facade.bundle;
+import java.io.IOException;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -36,8 +37,8 @@
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.jar.Attributes;
-import java.util.jar.Manifest;
import java.util.jar.Attributes.Name;
+import java.util.jar.Manifest;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.spi.DeploymentException;
@@ -231,6 +232,9 @@
/**
* Set a property.
* This is used at the frame work init state.
+ *
+ * @param key the prperty key
+ * @param value the property value
*/
public void setProperty(String key, String value)
{
@@ -330,23 +334,9 @@
try
{
VirtualFile root = VFS.getRoot(url);
- VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(root);
- deployerClient.deploy(deployment);
- try
- {
- DeploymentUnit unit = deployerStructure.getDeploymentUnit(deployment.getName());
- AbstractBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
- if (bundleState == null)
- throw new IllegalStateException("Unable to determine bundle state for " + deployment.getName());
- return bundleState;
- }
- catch (Exception e)
- {
- deployerClient.undeploy(deployment);
- throw e;
- }
+ return install(root);
}
- catch (Exception e)
+ catch (IOException e)
{
throw new BundleException("Error installing bundle from location=" + url, e);
}
@@ -525,6 +515,7 @@
{
if (bundleState == null)
throw new IllegalArgumentException("Null bundle state");
+
bundleState.uninstallInternal();
bundleState.setBundleManager(null);
long id = bundleState.getBundleId();
@@ -954,6 +945,8 @@
/**
* Fire a framework error
*
+ * @param bundleState the bundle state
+ * @param context the msg context
* @param t the throwable
*/
void fireError(Bundle bundle, String context, Throwable t)
@@ -969,7 +962,9 @@
/**
* Fire a framework error
- *
+ *
+ * @param bundleState the bundle state
+ * @param context the msg context
* @param t the throwable
*/
void fireWarning(Bundle bundle, String context, Throwable t)
16 years, 3 months
JBoss-OSGI SVN: r92886 - projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle.
by jboss-osgi-commits@lists.jboss.org
Author: alesj
Date: 2009-08-27 14:59:18 -0400 (Thu, 27 Aug 2009)
New Revision: 92886
Modified:
projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java
Log:
Simple refactoring.
Modified: projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java 2009-08-27 18:04:38 UTC (rev 92885)
+++ projects/jboss-osgi/projects/runtime/microcontainer/trunk/src/main/java/org/jboss/osgi/plugins/deployers/bundle/OSGiManifestParsingDeployer.java 2009-08-27 18:59:18 UTC (rev 92886)
@@ -54,7 +54,7 @@
// To be a true OSGi bundle it must have a bundle symbolic name in the manfiest
if (manifest.getMainAttributes().get(new Name(Constants.BUNDLE_SYMBOLICNAME)) == null)
return null;
- OSGiMetaData result = new AbstractOSGiMetaData(manifest);
- return result;
+
+ return new AbstractOSGiMetaData(manifest);
}
}
16 years, 3 months