[jboss-osgi-commits] JBoss-OSGI SVN: r87401 - in projects/jboss-osgi/trunk: runtime/testing and 78 other directories.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Thu Apr 16 03:48:06 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-04-16 03:48:05 -0400 (Thu, 16 Apr 2009)
New Revision: 87401

Added:
   projects/jboss-osgi/trunk/runtime/testing/
   projects/jboss-osgi/trunk/runtime/testing/.classpath
   projects/jboss-osgi/trunk/runtime/testing/.project
   projects/jboss-osgi/trunk/runtime/testing/.settings/
   projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs
   projects/jboss-osgi/trunk/runtime/testing/pom.xml
   projects/jboss-osgi/trunk/runtime/testing/src/
   projects/jboss-osgi/trunk/runtime/testing/src/main/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/service/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/framework/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/internal/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/management/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/service/
   projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/service/microcontainer/
   projects/jboss-osgi/trunk/runtime/testing/src/test/
   projects/jboss-osgi/trunk/runtime/testing/src/test/java/
   projects/jboss-osgi/trunk/runtime/testing/src/test/resources/
   projects/jboss-osgi/trunk/testsuite/example/
   projects/jboss-osgi/trunk/testsuite/example/.classpath
   projects/jboss-osgi/trunk/testsuite/example/.project
   projects/jboss-osgi/trunk/testsuite/example/.settings/
   projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
   projects/jboss-osgi/trunk/testsuite/example/pom.xml
   projects/jboss-osgi/trunk/testsuite/example/scripts/
   projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
   projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
   projects/jboss-osgi/trunk/testsuite/example/src/
   projects/jboss-osgi/trunk/testsuite/example/src/test/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy
   projects/jboss-osgi/trunk/testsuite/functional/
   projects/jboss-osgi/trunk/testsuite/functional/.classpath
   projects/jboss-osgi/trunk/testsuite/functional/.project
   projects/jboss-osgi/trunk/testsuite/functional/.settings/
   projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs
   projects/jboss-osgi/trunk/testsuite/functional/pom.xml
   projects/jboss-osgi/trunk/testsuite/functional/scripts/
   projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
   projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java
   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/jbosgi38/bundleA/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/
   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/jbosgi39/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy
Removed:
   projects/jboss-osgi/trunk/testsuite/.classpath
   projects/jboss-osgi/trunk/testsuite/.project
   projects/jboss-osgi/trunk/testsuite/.settings/
   projects/jboss-osgi/trunk/testsuite/scripts/
   projects/jboss-osgi/trunk/testsuite/src/
Modified:
   projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Split testsuite in 'example' & 'functional'


Property changes on: projects/jboss-osgi/trunk/runtime/testing
___________________________________________________________________
Name: svn:ignore
   + target


Added: projects/jboss-osgi/trunk/runtime/testing/.classpath
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.classpath	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.classpath	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<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="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"/>
+</classpath>

Added: projects/jboss-osgi/trunk/runtime/testing/.project
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.project	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.project	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jboss-osgi-runtime-spi</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,12 @@
+#Tue Feb 17 14:10:42 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

Added: projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+#Tue Feb 17 14:09:34 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1

Added: projects/jboss-osgi/trunk/runtime/testing/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/pom.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/pom.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 Testing</name>
+  <description>JBossOSGi - Runtime Testing</description>
+
+  <groupId>org.jboss.osgi</groupId>
+  <artifactId>jboss-osgi-runtime-testing</artifactId>
+  <packaging>jar</packaging>
+
+  <!-- Parent -->
+  <parent>
+    <groupId>org.jboss.osgi</groupId>
+    <artifactId>jboss-osgi-runtime</artifactId>
+    <version>1.0.0.Beta1</version>
+  </parent>
+
+  <!-- Dependencies -->
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-spi</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-common</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-remotelog</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <quiet>true</quiet>
+          <excludePackageNames>*.internal</excludePackageNames>
+        </configuration>
+        <executions>
+          <execution>
+            <id>attach-javadocs</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>


Property changes on: projects/jboss-osgi/trunk/runtime/testing/pom.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.net.URL;
+
+/**
+ * An archive deployer 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 16-May-2006
+ */
+public interface ArchiveDeployer
+{
+   /** Deploy the given archive
+    */
+   void deploy(URL archive) throws Exception;
+
+   /** Undeploy the given archive
+    */
+   void undeploy(URL archive) throws Exception;
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.virtual.VFS;
+
+/**
+ * An archive deployer that deals with test deployment/undeployment, etc.
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 26-Feb-2009
+ */
+public class EmbeddedArchiveDeployer implements ArchiveDeployer
+{
+   private DeployerClient deployer;
+   private Map<String, VFSDeployment> deployments = new HashMap<String, VFSDeployment>();
+
+   public EmbeddedArchiveDeployer(DeployerClient deployer)
+   {
+      if (deployer == null)
+         throw new IllegalArgumentException("Cannot construct archive deployer with: " + deployer);
+      
+      this.deployer = deployer;
+   }
+
+   public void deploy(URL url) throws Exception
+   {
+      VFSDeploymentFactory factory = VFSDeploymentFactory.getInstance();
+      VFSDeployment deployment = factory.createVFSDeployment(VFS.getRoot(url));
+      deployer.deploy(deployment);
+      deployments.put(url.toExternalForm(), deployment);
+   }
+
+   public void undeploy(URL url) throws Exception
+   {
+      VFSDeployment deployment = deployments.remove(url.toExternalForm());
+      if (deployment != null)
+         deployer.undeploy(deployment);
+   }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+// $Id$
+
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.framework.RemoteFramework;
+
+/**
+ * An integration test case
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class IntegrationTest extends OSGiTest
+{
+   private IntegrationTestHelper delegate;
+
+   private IntegrationTestHelper getDelegate()
+   {
+      if (delegate == null)
+      {
+         delegate = new IntegrationTestHelper(getBootstrapProvider());
+      }
+      return delegate;
+   }
+
+   protected void startRemoteLogging(LogEntryCache entryCache) throws Exception
+   {
+      getDelegate().startRemoteLogging(entryCache);
+   }
+   
+   protected void stopRemoteLogging() throws Exception
+   {
+      getDelegate().stopRemoteLogging();
+   }
+   
+   protected boolean isRemoteIntegration()
+   {
+      return IntegrationTestHelper.isRemoteIntegration();
+   }
+
+   protected boolean isTargetJBoss50()
+   {
+      return getDelegate().isTargetJBoss50();
+   }
+
+   protected RemoteBundle deployBundle(String archive) throws Exception
+   {
+      return getDelegate().deployBundle(archive);
+   }
+   
+   protected void undeployBundle(String archive) throws Exception
+   {
+      getDelegate().undeployBundle(archive);
+   }
+
+   protected void deploy(String archive) throws Exception
+   {
+      getDelegate().deploy(archive);
+   }
+
+   protected void deploy(URL archive) throws Exception
+   {
+      getDelegate().deploy(archive);
+   }
+
+   protected void undeploy(String archive) throws Exception
+   {
+      getDelegate().undeploy(archive);
+   }
+
+   protected void undeploy(URL archive) throws Exception
+   {
+      getDelegate().undeploy(archive);
+   }
+
+   protected RemoteFramework getRemoteFramework() throws Exception
+   {
+      return getDelegate().getRemoteFramework();
+   }
+   
+   protected MBeanServerConnection getServer()
+   {
+      return getDelegate().getServer();
+   }
+
+   protected String getServerHost()
+   {
+      return getDelegate().getServerHost();
+   }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,261 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarInputStream;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.framework.RemoteFramework;
+import org.jboss.osgi.spi.framework.RemoteFrameworkException;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.osgi.spi.management.ManagedBundleMBean;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * An integration test helper that deals with test deployment/undeployment, etc.
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 14-Oct-2004
+ */
+public class IntegrationTestHelper extends OSGiTestHelper
+{
+   private static MBeanServerConnection server;
+   private ManagedFrameworkMBean managedFramework;
+   private String integrationTarget;
+
+   public IntegrationTestHelper(OSGiBootstrapProvider bootProvider)
+   {
+      setBootstrapProvider(bootProvider);
+   }
+
+   protected void startRemoteLogging(final LogEntryCache logEntryCache) throws Exception
+   {
+      // Bootstrap the Framework and get the system bundle
+      OSGiFramework framework = getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+      
+      // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
+      ServiceTracker tracker = new ServiceTracker(sysContext, RemoteLogReaderService.class.getName(), null)
+      {
+         @Override
+         public Object addingService(ServiceReference sref)
+         {
+            LogReaderService service = (LogReaderService)super.addingService(sref);
+            service.addLogListener(logEntryCache);
+            return service;
+         }
+      };
+      tracker.open();
+
+      // Install the RemoteLogReaderService in the local OSGiFramework.
+      // The 'org.jboss.osgi.service.remote.log.reader' property must be set to 'true'
+      installBundle(sysContext, "bundles/jboss-osgi-remotelog.jar", true);
+
+      // Deploy the RemoteLogListener to the remote OSGiFramework.
+      // The 'org.jboss.osgi.service.remote.log.sender' property must be set to 'true'
+      deployBundle("bundles/jboss-osgi-remotelog.jar");
+   }
+   
+   protected void stopRemoteLogging() throws Exception
+   {
+      // Undeploy the RemoteLogListener from the remote OSGiFramework.
+      undeployBundle("bundles/jboss-osgi-remotelog.jar");
+   }
+   
+   public void deploy(String archive) throws Exception
+   {
+      URL url = getTestArchiveFile(archive).toURI().toURL();
+      deploy(url);
+   }
+
+   public void deploy(URL archive) throws Exception
+   {
+      getDeployer().deploy(archive);
+   }
+
+   public void undeploy(String archive) throws Exception
+   {
+      URL url = getTestArchiveFile(archive).toURI().toURL();
+      undeploy(url);
+   }
+
+   public void undeploy(URL archive) throws Exception
+   {
+      getDeployer().undeploy(archive);
+   }
+
+   public boolean isTargetJBoss50()
+   {
+      String target = getIntegrationTarget();
+      return target.startsWith("jboss50");
+   }
+
+   private String getIntegrationTarget()
+   {
+      if (integrationTarget == null)
+      {
+         String jbossVersion;
+         try
+         {
+            ObjectName oname = new ObjectName("jboss.system:type=ServerConfig");
+            jbossVersion = (String)getServer().getAttribute(oname, "SpecificationVersion");
+         }
+         catch (Exception ex)
+         {
+            throw new IllegalStateException("Cannot obtain jboss version", ex);
+         }
+
+         if (jbossVersion.startsWith("5.0"))
+            integrationTarget = "jboss50";
+         else
+            throw new IllegalStateException("Unsupported jboss version: " + jbossVersion);
+      }
+      return integrationTarget;
+   }
+
+   @SuppressWarnings("unchecked")
+   public MBeanServerConnection getServer()
+   {
+      if (server == null)
+      {
+         Hashtable jndiEnv = null;
+         try
+         {
+            InitialContext iniCtx = new InitialContext();
+            jndiEnv = iniCtx.getEnvironment();
+            server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+         }
+         catch (NamingException ex)
+         {
+            throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
+         }
+      }
+      return server;
+   }
+
+   private ArchiveDeployer getDeployer()
+   {
+      if (isRemoteIntegration())
+      {
+         return new RemoteArchiveDeployer(getServer());
+      }
+      else
+      {
+         DeployerClient deployer = (DeployerClient)getBootstrapProvider().getInstance("MainDeployer");
+         return new EmbeddedArchiveDeployer(deployer);
+      }
+   }
+
+   public RemoteBundle deployBundle(String archive) throws Exception
+   {
+      File archiveFile = getTestArchiveFile(archive);
+      JarInputStream jarInputStream = new JarInputStream(new FileInputStream(archiveFile));
+      Attributes attribs = jarInputStream.getManifest().getMainAttributes();
+      String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
+      jarInputStream.close();
+      
+      if (symbolicName == null)
+         throw new IllegalArgumentException("Cannot obtain Bundle-SymbolicName for: " + archive);
+      
+      deploy(archive);
+      
+      return getRemoteFramework().getBundle(symbolicName);
+   }
+   
+   public void undeployBundle(String archive) throws Exception
+   {
+      undeploy(archive);
+   }
+
+   public RemoteFramework getRemoteFramework() throws Exception
+   {
+      if (managedFramework == null)
+         managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.OBJECT_NAME, getServer());
+      
+      return new RemoteFramework()
+      {
+         public RemoteBundle getBundle(String symbolicName)
+         {
+            ObjectName bundleOName = managedFramework.getBundle(symbolicName);
+            try
+            {
+               return MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getServer());
+            }
+            catch (MBeanProxyException ex)
+            {
+               throw new RemoteFrameworkException(ex);
+            }
+         }
+
+         public Set<RemoteBundle> getBundles()
+         {
+            Set<RemoteBundle> remBundles = new HashSet<RemoteBundle>();
+            for (ObjectName bundleOName : managedFramework.getBundles())
+            {
+               try
+               {
+                  RemoteBundle remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getServer());
+                  remBundles.add(remBundle);
+               }
+               catch (MBeanProxyException ex)
+               {
+                  throw new RemoteFrameworkException(ex);
+               }
+            }
+            return remBundles;
+         }
+      };
+   }
+   
+   public static boolean isRemoteIntegration()
+   {
+      return System.getProperty("jboss.bind.address") != null;
+   }
+
+   public String getServerHost()
+   {
+      return System.getProperty("jboss.bind.address", "localhost");
+   }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.management.MBeanServerConnection;
+
+/**
+ * A test setup that deploys/undeploys archives
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 14-Oct-2004
+ */
+public class IntegrationTestSetup extends OSGiTestSetup
+{
+   private IntegrationTestHelper delegate;
+   private String[] archives = new String[0];
+   private ClassLoader originalClassLoader;
+
+   public IntegrationTestSetup(Class<?> testClass, String archiveList)
+   {
+      super(testClass);
+      getArchiveArray(archiveList);
+   }
+
+   private IntegrationTestHelper getDelegate()
+   {
+      if (delegate == null)
+      {
+         delegate = new IntegrationTestHelper(getBootstrapProvider());
+      }
+      return delegate;
+   }
+
+   public File getArchiveFile(String archive)
+   {
+      return getDelegate().getTestArchiveFile(archive);
+   }
+
+   public URL getArchiveURL(String archive) throws MalformedURLException
+   {
+      return getDelegate().getTestArchiveFile(archive).toURI().toURL();
+   }
+
+   public boolean isRemoteIntegration()
+   {
+      return IntegrationTestHelper.isRemoteIntegration();
+   }
+
+   public boolean isTargetJBoss50()
+   {
+      return getDelegate().isTargetJBoss50();
+   }
+
+   public MBeanServerConnection getServer()
+   {
+      return getDelegate().getServer();
+   }
+
+   public String getServerHost()
+   {
+      return getDelegate().getServerHost();
+   }
+
+   private void getArchiveArray(String archiveList)
+   {
+      if (archiveList != null)
+      {
+         StringTokenizer st = new StringTokenizer(archiveList, ", ");
+         archives = new String[st.countTokens()];
+
+         for (int i = 0; i < archives.length; i++)
+            archives[i] = st.nextToken();
+      }
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+
+      List<URL> clientJars = new ArrayList<URL>();
+      for (int i = 0; i < archives.length; i++)
+      {
+         String archive = archives[i];
+         try
+         {
+            getDelegate().deploy(archive);
+         }
+         catch (Exception ex)
+         {
+            ex.printStackTrace();
+            getDelegate().undeploy(archive);
+         }
+
+         if (archive.endsWith("-client.jar"))
+         {
+            URL archiveURL = getArchiveURL(archive);
+            clientJars.add(archiveURL);
+         }
+      }
+
+      ClassLoader parent = Thread.currentThread().getContextClassLoader();
+      originalClassLoader = parent;
+
+      // add client jars to the class loader
+      if (!clientJars.isEmpty())
+      {
+         URL[] urls = new URL[clientJars.size()];
+         for (int i = 0; i < clientJars.size(); i++)
+         {
+            urls[i] = clientJars.get(i);
+         }
+         URLClassLoader cl = new URLClassLoader(urls, parent);
+         Thread.currentThread().setContextClassLoader(cl);
+      }
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      try
+      {
+         for (int i = 0; i < archives.length; i++)
+         {
+            String archive = archives[archives.length - i - 1];
+            getDelegate().undeploy(archive);
+         }
+      }
+      finally
+      {
+         Thread.currentThread().setContextClassLoader(originalClassLoader);
+      }
+      super.tearDown();
+   }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.virtual.VFS;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * An OSGi Test Case
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class OSGiTest extends TestCase
+{
+   // Provide logging
+   final Logger log = Logger.getLogger(OSGiTest.class);
+
+   private OSGiTestHelper delegate = new OSGiTestHelper();
+
+   public OSGiTest()
+   {
+      // Prevent unknown protocol: vfsfile
+      VFS.init();
+   }
+
+   protected OSGiBootstrapProvider createBootstrapProvider()
+   {
+      return delegate.createBootstrapProvider();
+   }
+
+   protected OSGiBootstrapProvider getBootstrapProvider()
+   {
+      return delegate.getBootstrapProvider();
+   }
+
+   protected void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
+   {
+      delegate.setBootstrapProvider(bootProvider);
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      log.debug("### START " + getLongName());
+      super.setUp();
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      super.tearDown();
+      log.debug("### END " + getLongName());
+   }
+
+   protected String getShortName()
+   {
+      String shortName = getClass().getName();
+      shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
+      return shortName;
+   }
+
+   protected String getLongName()
+   {
+      return getClass().getName() + "." + getName();
+   }
+
+   protected URL getResourceURL(String resource)
+   {
+      return delegate.getResourceURL(resource);
+   }
+
+   protected File getResourceFile(String resource)
+   {
+      return delegate.getResourceFile(resource);
+   }
+
+   protected File getTestArchiveFile(String archive)
+   {
+      return delegate.getTestArchiveFile(archive);
+   }
+
+   protected URL getTestArchiveURL(String archive) throws MalformedURLException
+   {
+      return delegate.getTestArchiveFile(archive).toURI().toURL();
+   }
+
+   protected Bundle installBundle(BundleContext sysContext, String bundlePath, boolean start) throws BundleException
+   {
+      return delegate.installBundle(sysContext, bundlePath, start);
+   }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * An OSGi Test Helper
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Sep-2008
+ */
+public class OSGiTestHelper
+{
+   private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+   private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
+
+   private OSGiBootstrapProvider bootProvider;
+   
+   private static String testResourcesDir;
+   private static String testArchiveDir;
+
+   public OSGiBootstrapProvider createBootstrapProvider()
+   {
+      return OSGiBootstrap.getBootstrapProvider();
+   }
+
+   public OSGiBootstrapProvider getBootstrapProvider()
+   {
+      if (bootProvider == null)
+      {
+         bootProvider = createBootstrapProvider();
+      }
+      return bootProvider;
+   }
+
+   public void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
+   {
+      this.bootProvider = bootProvider;
+   }
+
+   /** Try to discover the URL for the test resource */
+   public URL getResourceURL(String resource)
+   {
+      URL resURL = null;
+      try
+      {
+         File resourceFile = getResourceFile(resource);
+         resURL = resourceFile.toURI().toURL();
+      }
+      catch (MalformedURLException e)
+      {
+         // ignore
+      }
+      return resURL;
+   }
+
+   /** Try to discover the File for the test resource */
+   public File getResourceFile(String resource)
+   {
+      File file = new File(resource);
+      if (file.exists())
+         return file;
+
+      file = new File(getTestResourcesDir() + "/" + resource);
+      if (file.exists())
+         return file;
+
+      throw new IllegalArgumentException("Cannot obtain '" + getTestResourcesDir() + "/" + resource + "'");
+   }
+
+   public String getTestResourcesDir()
+   {
+      if (testResourcesDir == null)
+         testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-classes");
+
+      return testResourcesDir;
+   }
+
+   /** Try to discover the URL for the deployment archive */
+   public URL getTestArchiveURL(String archive)
+   {
+      try
+      {
+         return getTestArchiveFile(archive).toURI().toURL();
+      }
+      catch (MalformedURLException ex)
+      {
+         throw new IllegalStateException(ex);
+      }
+   }
+
+   /** Try to discover the File for the deployment archive */
+   public File getTestArchiveFile(String archive)
+   {
+      File file = new File(archive);
+      if (file.exists())
+         return file;
+
+      file = new File(getTestArchiveDir() + "/" + archive);
+      if (file.exists())
+         return file;
+
+      String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
+      throw new IllegalArgumentException("Cannot obtain '" + getTestArchiveDir() + "/" + archive + "'." + notSet);
+   }
+
+   public String getTestArchiveDir()
+   {
+      if (testArchiveDir == null)
+         testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
+
+      return testArchiveDir;
+   }
+
+   public Bundle installBundle(BundleContext sysContext, String bundlePath, boolean start) throws BundleException
+   {
+      Bundle bundle = sysContext.installBundle(getTestArchiveURL(bundlePath).toExternalForm());
+
+      if (start == true)
+         bundle.start();
+
+      return bundle;
+   }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.virtual.VFS;
+
+import junit.extensions.TestSetup;
+import junit.framework.TestSuite;
+
+/**
+ * An OSGi Test Setup
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Sep-2008
+ */
+public class OSGiTestSetup extends TestSetup
+{
+  // Provide logging
+  final Logger log = Logger.getLogger(OSGiTestSetup.class);
+
+  private OSGiTestHelper delegate = new OSGiTestHelper();
+  private OSGiBootstrapProvider bootProvider;
+  
+  public OSGiTestSetup(Class<?> testCase)
+  {
+    super(new TestSuite(testCase));
+    // Prevent unknown protocol: vfsfile
+    VFS.init();
+  }
+
+  public OSGiBootstrapProvider createBootstrapProvider()
+  {
+     return OSGiBootstrap.getBootstrapProvider();
+  }
+
+  public OSGiBootstrapProvider getBootstrapProvider()
+  {
+     if (bootProvider == null)
+     {
+        bootProvider = createBootstrapProvider();
+     }
+     return bootProvider;
+  }
+
+  public void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
+  {
+     this.bootProvider = bootProvider;
+  }
+
+  @Override
+  protected void setUp() throws Exception
+  {
+    log.debug("### START SETUP " + getTest());
+    super.setUp();
+  }
+
+  @Override
+  protected void tearDown() throws Exception
+  {
+    super.tearDown();
+    log.debug("### END SETUP " + getTest());
+  }
+
+  protected URL getResourceURL(String resource)
+  {
+    return delegate.getResourceURL(resource);
+  }
+
+  protected File getResourceFile(String resource)
+  {
+    return delegate.getResourceFile(resource);
+  }
+
+  public File getTestArchiveFile(String archive)
+  {
+    return delegate.getTestArchiveFile(archive);
+  }
+
+  public URL getTestArchiveURL(String archive) throws MalformedURLException
+  {
+    return delegate.getTestArchiveFile(archive).toURI().toURL();
+  }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.junit;
+
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+/**
+ * An archive deployer that deals with test deployment/undeployment, etc.
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 14-Oct-2004
+ */
+public class RemoteArchiveDeployer implements ArchiveDeployer
+{
+  private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
+
+  private MBeanServerConnection server;
+
+  public RemoteArchiveDeployer(MBeanServerConnection server)
+  {
+     if (server == null)
+        throw new IllegalArgumentException("Cannot construct archive deployer with: " + server);
+     
+    this.server = server;
+  }
+
+  public void deploy(URL url) throws Exception
+  {
+    invokeMainDeployer("deploy", url);
+  }
+
+  public void undeploy(URL url) throws Exception
+  {
+    invokeMainDeployer("undeploy", url);
+  }
+
+  private void invokeMainDeployer(String methodName, URL url) throws Exception
+  {
+    server.invoke(new ObjectName(MAIN_DEPLOYER), methodName, new Object[] { url }, new String[] { "java.net.URL" });
+  }
+}


Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+<html>
+<body>
+JUnit test integration.
+</body>
+</html>

Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html	                        (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+<html>
+<body>
+Common classes and interfaces.
+</body>
+</html>

Deleted: projects/jboss-osgi/trunk/testsuite/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/.classpath	2009-04-16 06:09:17 UTC (rev 87400)
+++ projects/jboss-osgi/trunk/testsuite/.classpath	2009-04-16 07:48:05 UTC (rev 87401)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
-	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
-	<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"/>
-</classpath>

Deleted: projects/jboss-osgi/trunk/testsuite/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/.project	2009-04-16 06:09:17 UTC (rev 87400)
+++ projects/jboss-osgi/trunk/testsuite/.project	2009-04-16 07:48:05 UTC (rev 87401)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>jboss-osgi-testsuite</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.maven.ide.eclipse.maven2Builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.maven.ide.eclipse.maven2Nature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>


Property changes on: projects/jboss-osgi/trunk/testsuite/example
___________________________________________________________________
Name: svn:ignore
   + target


Added: projects/jboss-osgi/trunk/testsuite/example/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.classpath	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.classpath	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
+	<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"/>
+</classpath>

Added: projects/jboss-osgi/trunk/testsuite/example/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.project	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.project	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jboss-osgi-testsuite</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+#Wed Feb 04 11:13:20 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Added: projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+#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

Added: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 - Testsuite Examples</name>
+  <description>JBossOSGi - Testsuite Examples</description>
+
+  <groupId>org.jboss.osgi</groupId>
+  <artifactId>jboss-osgi-testsuite-example</artifactId>
+  <packaging>jar</packaging>
+
+  <parent>
+    <groupId>org.jboss.osgi</groupId>
+    <artifactId>jboss-osgi-testsuite</artifactId>
+    <version>1.0.0.Beta1</version>
+  </parent>
+
+  <!-- Properties -->
+  <properties>
+    <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
+  </properties>
+
+  <!-- Dependencies -->
+  <dependencies>
+    <dependency>
+      <groupId>biz.aQute</groupId>
+      <artifactId>bnd</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-spi</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-deployer</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-testing</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-aop-mc-int</artifactId>
+    </dependency>
+
+    <!-- Provided Dependencies -->
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.log</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-common</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-logging</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-remotelog</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    
+    <!-- Test Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <!-- Build -->
+  <build>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
+    <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-example-jars.xml"/>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <profiles>
+
+    <!--
+	  Name: framework-default 
+      Descr: Setup for default framework integration testing
+    -->
+    <profile>
+      <id>framework-default</id>
+      <activation>
+        <property>
+          <name>!framework</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+    </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>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+    </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>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-equinox</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-equinox</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <skipTests>true</skipTests>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!--
+      Name: framework-knopflerfish
+      Descr: Setup for Equinox framework integration testing
+    -->
+    <profile>
+      <id>framework-knopflerfish</id>
+      <activation>
+        <property>
+          <name>!framework</name>
+          <value>knopflerfish</value>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <skipTests>true</skipTests>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!--
+	  Name: embedded-tesing 
+      Descr: Setup for embedded integration testing
+	-->
+    <profile>
+      <id>embedded-tesing</id>
+      <activation>
+        <property>
+          <name>!jboss.bind.address</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <!-- Exclude tests that require remote access -->
+                <exclude>org/jboss/test/osgi/deployer/**</exclude>
+                <exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!--
+	  Name: remote-tesing 
+      Descr: Setup for remote integration testing
+    -->
+    <profile>
+      <id>remote-tesing</id>
+      <activation>
+        <property>
+          <name>jboss.bind.address</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.jbossas</groupId>
+          <artifactId>jboss-as-client</artifactId>
+          <scope>test</scope>
+          <type>pom</type>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <!-- argLine>${surefire.security.args}</argLine -->
+              <excludes>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>

Added: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ============================================================ -->
+<!--  JBoss, the OpenSource J2EE webOS                            -->
+<!--  Distributable under LGPL license.                           -->
+<!--  See terms of license at http://www.gnu.org.                 -->
+<!-- ============================================================ -->
+
+<!-- $Id: antrun-example-jars.xml 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $ -->
+
+<project default="build-example-jars">
+
+  <description>OSGi test archive builder</description>
+
+  <!-- ================================================================== -->
+  <!-- Init                                                               -->
+  <!-- ================================================================== -->
+
+  <target name="init">
+
+    <!-- Property override when not called from maven -->
+    <property name="maven.runtime.classpath" value="/usr/java/bnd.jar" />
+    <property name="tests.output.dir" value="${basedir}/../target" />
+
+    <mkdir dir="${tests.output.dir}/test-libs/example" />
+    <property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
+    <property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
+
+    <taskdef resource="aQute/bnd/ant/taskdef.properties">
+      <classpath>
+        <pathelement path="${maven.runtime.classpath}" />
+      </classpath>
+    </taskdef>
+
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Building                                                           -->
+  <!-- ================================================================== -->
+
+  <target name="build-example-jars" depends="init" description="Build the test deployments">
+
+    <!-- Please add alphabetically -->
+
+    <!-- example/log -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-log.jar" files="${tests.resources.dir}/example/log/example-log.bnd" />
+  	
+    <!-- example/http -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-http.jar" files="${tests.resources.dir}/example/http/example-http.bnd" />
+
+    <!-- example/microcontainer -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-microcontainer.jar" files="${tests.resources.dir}/example/microcontainer/example-microcontainer.bnd" />
+  	
+    <!-- Please add alphabetically -->
+
+  </target>
+
+</project>

Added: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,29 @@
+<assembly 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/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+  <id>deploy-artifacts</id>
+  <formats>
+    <format>dir</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <!-- Dependency Sets -->
+  <dependencySets>
+  
+    <!-- bundle -->
+    <dependencySet>
+      <outputDirectory>bundles</outputDirectory>
+      <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+      <includes>
+        <include>*:org.apache.felix.log:jar</include>
+        <include>*:jboss-osgi-common:jar</include>
+        <include>*:jboss-osgi-logging:jar</include>
+        <include>*:jboss-osgi-remotelog:jar</include>
+      </includes>
+      <useStrictFiltering>true</useStrictFiltering>
+      <scope>provided</scope>
+      <unpack>false</unpack>
+    </dependencySet>
+    
+  </dependencySets>
+</assembly>

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.http;
+
+//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+
+/**
+ * A test that deployes a bundle that containes a HttpServlet which 
+ * is registered through the OSGi HttpService
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class HttpServiceRemoteTestCase extends IntegrationTest
+{
+  public static Test suite()
+  {
+    return new IntegrationTestSetup(HttpServiceRemoteTestCase.class, "example/example-http.jar");
+  }
+  
+  public void testServletAccess() throws Exception
+  {
+    URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=plain");
+    BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+    assertEquals("Hello from Servlet", br.readLine());
+  }
+  
+  public void testServletInitProps() throws Exception
+  {
+    URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=initProp");
+    BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+    assertEquals("initProp=SomeValue", br.readLine());
+  }
+  
+  public void testServletBundleContext() throws Exception
+  {
+    URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=context");
+    BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+    assertEquals("example-http", br.readLine());
+  }
+  
+  public void testServletStartLevel() throws Exception
+  {
+    URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=startLevel");
+    BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+    assertEquals("startLevel=1", br.readLine());
+  }
+  
+  public void testResourceAccess() throws Exception
+  {
+    URL url = new URL("http://" + getServerHost() + ":8090/file/message.txt");
+    BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+    assertEquals("Hello from Resource", br.readLine());
+  }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,99 @@
+/*
+ * 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.http.bundle;
+
+//$Id: EndpointService.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+import java.util.Properties;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpService;
+
+/**
+ * A service that creates an Http context through the HttpService
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class EndpointService implements ServiceListener
+{
+  private BundleContext context;
+
+  public EndpointService(BundleContext context)
+  {
+    this.context = context;
+    context.addServiceListener(this);
+  }
+  
+  private void registerService()
+  {
+    try
+    {
+      HttpService httpService = getHttpService();
+      
+      Properties initParams = new Properties();
+      initParams.setProperty("initProp", "SomeValue");
+      httpService.registerServlet("/servlet", new EndpointServlet(context), initParams, null);
+      httpService.registerResources("/file", "/res", null);
+    }
+    catch (Exception ex)
+    {
+      throw new RuntimeException("Cannot register context", ex);
+    }
+  }
+
+  private void unregisterService()
+  {
+    HttpService httpService = getHttpService();
+    httpService.unregister("/servlet");
+    httpService.unregister("/file");
+    context.removeServiceListener(this);
+  }
+
+  private HttpService getHttpService()
+  {
+    ServiceReference sref = context.getServiceReference(HttpService.class.getName());
+    if (sref == null)
+      throw new IllegalStateException("HttpService not registered");
+    
+    return (HttpService)context.getService(sref);
+  }
+
+  public void serviceChanged(ServiceEvent event)
+  {
+    Object service = context.getService(event.getServiceReference());
+    if (service == this)
+    {
+      if (event.getType() == ServiceEvent.REGISTERED)
+      {
+        registerService();
+      }
+      else if (event.getType() == ServiceEvent.UNREGISTERING)
+      {
+        unregisterService();
+      }
+    }
+  }
+}

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.http.bundle;
+
+//$Id: EndpointServlet.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.startlevel.StartLevel;
+import org.osgi.util.tracker.ServiceTracker;
+
+ at SuppressWarnings("serial")
+public class EndpointServlet extends HttpServlet
+{
+  private BundleContext context;
+
+  // This hides the default ctor and verifies that this instance is used 
+  public EndpointServlet(BundleContext context)
+  {
+    this.context = context;
+  }
+
+  @Override
+  protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+  {
+    PrintWriter out = res.getWriter();
+    
+    String testParam = req.getParameter("test");
+    if ("plain".equals(testParam))
+    {
+      out.println("Hello from Servlet");
+    }
+    else if ("initProp".equals(testParam))
+    {
+      String value = getInitParameter(testParam);
+      out.println(testParam + "=" + value);
+    }
+    else if ("context".equals(testParam))
+    {
+      out.println(context.getBundle().getSymbolicName());
+    }
+    else if ("startLevel".equals(testParam))
+    {
+      ServiceTracker tracker = new ServiceTracker(context, StartLevel.class.getName(), null);
+      tracker.open();
+      
+      StartLevel service = (StartLevel)tracker.getService();
+      out.println("startLevel=" + service.getStartLevel());
+    }
+    else
+    {
+      throw new IllegalArgumentException("Invalid 'test' parameter: " + testParam);
+    }
+    
+    out.close();
+  }
+}

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,61 @@
+/*
+ * 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.http.bundle;
+
+//$Id: ServiceActivator.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A Service Activator
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 04-Feb-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+  private ServiceRegistration registration;
+  
+  /*
+   * Implements BundleActivator.start(). 
+   * Registers an instance of a HttpEndpoint Service using the bundle context.
+   */
+  public void start(BundleContext context)
+  {
+    EndpointService service = new EndpointService(context);
+    registration = context.registerService(EndpointService.class.getName(), service, null);
+  }
+
+  /*
+   * Implements BundleActivator.stop(). 
+   */
+  public void stop(BundleContext context)
+  {
+    if (registration != null)
+    {
+      registration.unregister();
+      registration = null;
+    }
+  }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,79 @@
+/*
+ * 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.log;
+
+//$Id: LogServiceRemoteTestCase.java 87339 2009-04-15 12:23:20Z thomas.diesler at jboss.com $
+
+import java.util.List;
+
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.common.log.LogEntryFilter;
+import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogService;
+
+/**
+ * This example demonstrates the usage of the {@link RemoteLogReaderService}
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogServiceRemoteTestCase extends IntegrationTest
+{
+   private LogEntryCache logEntryCache;
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      
+      logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
+      startRemoteLogging(logEntryCache);
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      stopRemoteLogging();
+      super.tearDown();
+   }
+
+   public void testServiceA() throws Exception
+   {
+      // Deploy the test bundle
+      RemoteBundle bundleA = deployBundle("example/example-log.jar");
+      
+      // Verify that the bundle is active
+      assertEquals("Remote bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
+      
+      // Undeploy the test bundle
+      undeployBundle("example/example-log.jar");
+      
+      // Verify the received log entries
+      List<LogEntry> entries = logEntryCache.getLog();
+      assertEquals("Number of entries", 1, entries.size());
+      assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.log;
+
+//$Id: LogServiceTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
+
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.common.log.LogEntryFilter;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * This example demonstrates the usage of the {@link LogService}
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogServiceTestCase extends OSGiTest
+{
+   public void testLogEntryFilter() throws Exception
+   {
+      // Bootstrap the Framework and get the system bundle
+      OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+
+      // Setup the LogEntryCache
+      final LogEntryCache logEntryCache = new LogEntryCache();
+      logEntryCache.addFilter(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
+      
+      // Track the LogReaderService to add the LogEntryCache as LogListener
+      ServiceTracker tracker = new ServiceTracker(sysContext, LogReaderService.class.getName(), null)
+      {
+         @Override
+         public Object addingService(ServiceReference sref)
+         {
+            LogReaderService service = (LogReaderService)super.addingService(sref);
+            service.addLogListener(logEntryCache);
+            return service;
+         }
+      };
+      tracker.open();
+
+      // Install and start the 3rd party LogService. 
+      // This will register the LogReaderService that we track above.
+      URL testURL = getTestArchiveURL("bundles/org.apache.felix.log.jar");
+      Bundle logServiceBundle = sysContext.installBundle(testURL.toExternalForm());
+      logServiceBundle.start();
+
+      // Install and start JBossOSGi Common 
+      testURL = getTestArchiveURL("bundles/jboss-osgi-common.jar");
+      Bundle commonBundle = sysContext.installBundle(testURL.toExternalForm());
+      commonBundle.start();
+
+      // Install and start the test bundle
+      testURL = getTestArchiveURL("example/example-log.jar");
+      Bundle bundleA = sysContext.installBundle(testURL.toExternalForm());
+      bundleA.start();
+      
+      // Verify that the bundle is active
+      assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
+      
+      // Uninstall the test bundle
+      bundleA.uninstall();
+      
+      // Uninstall the 3rd party LogService
+      logServiceBundle.uninstall();
+
+      // Verify the received log entries
+      List<LogEntry> entries = logEntryCache.getLog();
+      assertEquals("Number of entries", 1, entries.size());
+      assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.test.osgi.example.log.bundle;
+
+//$Id: ServiceA.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+import static org.osgi.service.log.LogService.LOG_INFO;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * A service that logs some messages to the LogService
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 11-Apr-2009
+ */
+public class ServiceA 
+{
+   private LogService log;
+   
+   public ServiceA(BundleContext context)
+   {
+      log = new LogServiceTracker(context);
+      log.log(LOG_INFO, "[ServiceA] new Service");
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,42 @@
+/*
+ * 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.log.bundle;
+
+//$Id: ServiceActivator.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class ServiceActivator implements BundleActivator
+{
+   public void start(final BundleContext context)
+   {
+      ServiceA service = new ServiceA(context);
+      context.registerService(ServiceA.class.getName(), service, null);
+   }
+
+   public void stop(BundleContext context)
+   {
+      // Do Nothing. It is unnecessary to unregister services or Framework listeners
+      // because they must be clean up by the Framework anyway.
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.microcontainer;
+
+//$Id: MBeanServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler at jboss.com $
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.test.osgi.example.microcontainer.bundle.FooMBean;
+import org.jboss.test.osgi.example.microcontainer.bundle.MBeanTestService;
+
+/**
+ * A test that deployes a bundle that registeres an MBean
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class MBeanServiceRemoteTestCase extends IntegrationTest
+{
+   public static Test suite()
+   {
+      return new IntegrationTestSetup(MBeanServiceRemoteTestCase.class, "example/example-microcontainer.jar");
+   }
+
+   public void testMBeanAccess() throws Exception
+   {
+      FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBeanTestService.OBJECT_NAME, getServer());
+      assertEquals("hello", foo.echo("hello"));
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.example.microcontainer.bundle;
+
+
+
+//$Id: Foo.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+public class Foo implements FooMBean
+{
+	public String echo(String msg)
+	{
+		return msg;
+	}
+}

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.microcontainer.bundle;
+
+//$Id: FooMBean.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+public interface FooMBean 
+{
+	String echo(String msg);
+}

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.microcontainer.bundle;
+
+//$Id: MBeanTestService.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.jboss.osgi.spi.service.microcontainer.MicrocontainerService;
+import org.jboss.test.osgi.example.microcontainer.bundle.Foo;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A service that registers an MBean
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class MBeanTestService implements ServiceListener
+{
+  public static ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.osgi:service=mbean-test-service");
+  
+  private BundleContext context;
+  private MBeanServer mbeanServer;
+
+  public MBeanTestService(BundleContext context)
+  {
+    this.context = context;
+    context.addServiceListener(this);
+  }
+  
+  private void registerService()
+  {
+    try
+    {
+    	MicrocontainerService mcService = getMicrocontainerService();
+    	mbeanServer = mcService.getMbeanServer();
+      mbeanServer.registerMBean(new Foo(), OBJECT_NAME);
+    }
+    catch (Exception ex)
+    {
+      throw new RuntimeException("Cannot register mbean", ex);
+    }
+  }
+
+  private void unregisterService()
+  {
+    try
+    {
+      if (mbeanServer != null && mbeanServer.isRegistered(OBJECT_NAME))
+        mbeanServer.unregisterMBean(OBJECT_NAME);
+    }
+    catch (Exception ex)
+    {
+      throw new RuntimeException("Cannot unregister mbean", ex);
+    }
+  }
+
+  private MicrocontainerService getMicrocontainerService()
+  {
+    ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
+    if (sref == null)
+      throw new IllegalStateException("MicrocontainerService not registered");
+    
+    return (MicrocontainerService)context.getService(sref);
+  }
+
+  public void serviceChanged(ServiceEvent event)
+  {
+    Object service = context.getService(event.getServiceReference());
+    if (service == this)
+    {
+      if (event.getType() == ServiceEvent.REGISTERED)
+      {
+        registerService();
+      }
+      else if (event.getType() == ServiceEvent.UNREGISTERING)
+      {
+        unregisterService();
+      }
+    }
+  }
+}

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.microcontainer.bundle;
+
+//$Id: ServiceActivator.java 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A Service Activator
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 04-Feb-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+  private ServiceRegistration registration;
+  
+  public void start(BundleContext context)
+  {
+    MBeanTestService service = new MBeanTestService(context);
+    registration = context.registerService(MBeanTestService.class.getName(), service, null);
+  }
+
+  public void stop(BundleContext context)
+  {
+    if (registration != null)
+    {
+      registration.unregister();
+      registration = null;
+    }
+  }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example/example-http.jar src/test/resources/example/http/example-http.bnd
+
+Bundle-SymbolicName: example-http
+Bundle-Activator: org.jboss.test.osgi.example.http.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.http.bundle
+Include-Resource: res/message.txt=message.txt
+
+# For some reason this does not work
+# Include-Resource: src/test/resources/service/http/message.txt
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1 @@
+Hello from Resource
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example-log.jar src/test/resources/example/log/example-log.bnd
+
+Bundle-SymbolicName: example-log
+
+Bundle-Activator: org.jboss.test.osgi.example.log.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.log.bundle

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example/example-microcontainer.jar src/test/resources/example/microcontainer/example-microcontainer.bnd
+
+Bundle-SymbolicName: example-microcontainer
+Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.microcontainer.bundle 

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,111 @@
+<!--
+   The bootstrap of the server. This should only have the minimum
+   needed to bootstrap the mc kernel and profile service.
+   
+   $Id: jboss-osgi-bootstrap-beans.xml 86378 2009-03-26 12:02:32Z thomas.diesler at jboss.com $ 
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+      <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
+   </bean>
+
+   <!-- The ManagedDeploymentCreator implementation -->
+   <bean name="ManagedDeploymentCreator" class="org.jboss.deployers.plugins.managed.DefaultManagedDeploymentCreator" />
+
+   <!-- ModificationType structure processor -->
+   <bean name="ModificationTypeStructureProcessor" class="org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeStructureProcessor">
+     <incallback method="addMatcher"/>
+     <uncallback method="removeMatcher"/>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder">
+           <property name="structureProcessor"><inject bean="ModificationTypeStructureProcessor"/></property>
+         </bean>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- A declared structure descriptor deployer -->
+   <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"/>
+
+    <!-- JAR Structure -->
+    <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+       <property name="candidateStructureVisitorFactory">
+          <!-- Any file that is not an ordinary directory is a candidate -->
+          <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+             <!-- A filter to exclude some obvious non-subdeployments -->
+             <property name="filter">
+                <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+                   <constructor><parameter>
+                      <list elementClass="java.lang.String">
+                         <!-- Exclude class files as subdeployments -->
+                         <value>.class</value>
+                      </list>
+                   </parameter></constructor>
+                </bean>
+             </property>
+          </bean>
+       </property>
+    </bean>
+
+    <!-- File Structure -->
+    <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+       <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>-service.xml</value>
+                <value>-beans.xml</value>
+             </set>
+          </parameter>
+       </constructor>
+    </bean>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer"/>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer"/>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter class="org.jboss.kernel.Kernel"><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+   </bean>
+
+   <!-- VFS ClassLoader -->
+   <bean name="ClassLoaderSystem" class="org.jboss.classloader.spi.ClassLoaderSystem">
+      <constructor factoryClass="org.jboss.classloader.spi.ClassLoaderSystem" factoryMethod="getInstance"/>
+   </bean>
+   <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+      <incallback method="addModule" state="Configured"/>
+      <uncallback method="removeModule" state="Configured"/>
+   </bean>
+   <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+      <property name="defaultMetaData">
+         <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true"/>
+      </property>
+   </bean>
+   <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer"/>
+   <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+      <property name="classLoading"><inject bean="ClassLoading"/></property>
+   </bean>
+   <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+      <property name="classLoading"><inject bean="ClassLoading"/></property>
+      <property name="system"><inject bean="ClassLoaderSystem"/></property>
+   </bean>
+
+</deployment>

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://@jboss.bind.address@:1099

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+  <!-- ================================= -->
+  <!-- Preserve messages in a local file -->
+  <!-- ================================= -->
+
+  <appender name="FILE" class="org.apache.log4j.FileAppender">
+    <param name="File" value="${log4j.output.dir}/test.log"/>
+    <param name="Append" value="false"/>
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+    </layout>
+  </appender>
+  
+  <!-- ============================== -->
+  <!-- Append messages to the console -->
+  <!-- ============================== -->
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out" />
+    <param name="Threshold" value="INFO" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+    </layout>
+  </appender>
+
+  <!-- ================ -->
+  <!-- Limit categories -->
+  <!-- ================ -->
+
+  <category name="org.hibernate">
+    <priority value="INFO" />
+  </category>
+
+  <!-- hide optimistic locking failures
+  <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+    <priority value="FATAL" />
+  </category>
+  -->
+
+  <!-- hide proxy narrowing warns -->
+  <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
+    <priority value="ERROR" />
+  </category>
+
+  <!-- show SQL DML statements as they are executed -->
+  <category name="org.hibernate.SQL">
+    <priority value="DEBUG" />
+  </category>
+
+  <!-- show JDBC parameters
+  <category name="org.hibernate.type">
+    <priority value="TRACE" />
+  </category>
+  -->
+
+  <!-- hide httpclient wire dumps -->
+  <category name="httpclient.wire.header">
+    <priority value="INFO" />
+  </category>
+
+  <!-- ======================= -->
+  <!-- Setup the Root category -->
+  <!-- ======================= -->
+
+  <root>
+    <!--appender-ref ref="CONSOLE"/-->
+    <appender-ref ref="FILE"/>
+  </root>
+
+</log4j:configuration>

Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,4 @@
+grant {
+	permission java.security.AllPermission;
+};
+


Property changes on: projects/jboss-osgi/trunk/testsuite/functional
___________________________________________________________________
Name: svn:ignore
   + felix-cache

Name: svn:mergeinfo
   + 

Added: projects/jboss-osgi/trunk/testsuite/functional/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.classpath	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.classpath	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
+	<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"/>
+</classpath>

Added: projects/jboss-osgi/trunk/testsuite/functional/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.project	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.project	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jboss-osgi-testsuite</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+#Wed Feb 04 11:13:20 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5

Added: projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+#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

Added: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 - Testsuite Functional</name>
+  <description>JBossOSGi - Testsuite Functional</description>
+
+  <groupId>org.jboss.osgi</groupId>
+  <artifactId>jboss-osgi-testsuite-functional</artifactId>
+  <packaging>jar</packaging>
+
+  <parent>
+    <groupId>org.jboss.osgi</groupId>
+    <artifactId>jboss-osgi-testsuite</artifactId>
+    <version>1.0.0.Beta1</version>
+  </parent>
+
+  <!-- Properties -->
+  <properties>
+    <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
+  </properties>
+
+  <!-- Dependencies -->
+  <dependencies>
+    <dependency>
+      <groupId>biz.aQute</groupId>
+      <artifactId>bnd</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-spi</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-deployer</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-runtime-testing</artifactId>
+      <version>${version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-aop-mc-int</artifactId>
+    </dependency>
+
+    <!-- Provided Dependencies -->
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.log</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-common</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-logging</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.osgi</groupId>
+      <artifactId>jboss-osgi-remotelog</artifactId>
+      <version>${version}</version>
+      <scope>provided</scope>
+    </dependency>
+    
+    <!-- Test Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <!-- Build -->
+  <build>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
+    <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>
+
+    <!--
+	  Name: framework-default 
+      Descr: Setup for default framework integration testing
+    -->
+    <profile>
+      <id>framework-default</id>
+      <activation>
+        <property>
+          <name>!framework</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+    </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>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-felix</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+    </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>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-equinox</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-equinox</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <skipTests>true</skipTests>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!--
+      Name: framework-knopflerfish
+      Descr: Setup for Equinox framework integration testing
+    -->
+    <profile>
+      <id>framework-knopflerfish</id>
+      <activation>
+        <property>
+          <name>!framework</name>
+          <value>knopflerfish</value>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+          <version>${version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.jboss.osgi</groupId>
+          <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+          <version>${version}</version>
+          <classifier>config</classifier>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <skipTests>true</skipTests>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!--
+	  Name: embedded-tesing 
+      Descr: Setup for embedded integration testing
+	-->
+    <profile>
+      <id>embedded-tesing</id>
+      <activation>
+        <property>
+          <name>!jboss.bind.address</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <!-- Exclude tests that require remote access -->
+                <exclude>org/jboss/test/osgi/deployer/**</exclude>
+                <exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!--
+	  Name: remote-tesing 
+      Descr: Setup for remote integration testing
+    -->
+    <profile>
+      <id>remote-tesing</id>
+      <activation>
+        <property>
+          <name>jboss.bind.address</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.jboss.jbossas</groupId>
+          <artifactId>jboss-as-client</artifactId>
+          <scope>test</scope>
+          <type>pom</type>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <!-- argLine>${surefire.security.args}</argLine -->
+              <excludes>
+              </excludes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>

Added: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ============================================================ -->
+<!--  JBoss, the OpenSource J2EE webOS                            -->
+<!--  Distributable under LGPL license.                           -->
+<!--  See terms of license at http://www.gnu.org.                 -->
+<!-- ============================================================ -->
+
+<!-- $Id: antrun-test-jars.xml 87336 2009-04-15 11:31:26Z thomas.diesler at jboss.com $ -->
+
+<project default="build-test-jars">
+
+  <description>OSGi test archive builder</description>
+
+  <!-- ================================================================== -->
+  <!-- Init                                                               -->
+  <!-- ================================================================== -->
+
+  <target name="init">
+
+    <!-- Property override when not called from maven -->
+    <property name="maven.runtime.classpath" value="/usr/java/bnd.jar" />
+    <property name="tests.output.dir" value="${basedir}/../target" />
+
+    <mkdir dir="${tests.output.dir}/test-libs/example" />
+    <mkdir dir="${tests.output.dir}/test-libs/service" />
+    
+    <property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
+    <property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
+
+    <taskdef resource="aQute/bnd/ant/taskdef.properties">
+      <classpath>
+        <pathelement path="${maven.runtime.classpath}" />
+      </classpath>
+    </taskdef>
+
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Building                                                           -->
+  <!-- ================================================================== -->
+
+  <target name="build-test-jars" depends="init" description="Build the test deployments">
+
+    <!-- Please add alphabetically -->
+
+    <!-- jbosgi36 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/deployer/jbosgi36/jbosgi36.bnd" />
+    <jar jarfile="${tests.output.dir}/test-libs/jbosgi36-mbean.jar">
+      <fileset dir="${tests.classes.dir}">
+        <include name="org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.class" />
+        <include name="org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.class" />
+      </fileset>
+      <fileset dir="${tests.resources.dir}/deployer/jbosgi36">
+        <include name="META-INF/jbosgi36-jboss-beans.xml" />
+      </fileset>
+    </jar>
+
+    <!-- jbosgi37 -->
+    <jar jarfile="${tests.output.dir}/test-libs/jbosgi37-subB.jar">
+      <fileset dir="${tests.classes.dir}">
+        <include name="org/jboss/test/osgi/jbosgi37/subB/PojoB.class" />
+      </fileset>
+    </jar>
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-subA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-subA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleB.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleB.bnd" />
+  	
+    <!-- jbosgi38 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleA.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleA.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleB.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleB.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleX.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleX.bnd" />
+    
+    <!-- jbosgi39 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleB.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleB.bnd" />
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleX.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleX.bnd" />
+  	
+    <!-- jbosgi41 -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
+  	
+    <!-- startlevel-service -->
+    <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/service-startlevel.jar" files="${tests.resources.dir}/service/startlevel/service-startlevel.bnd" />
+
+    <!-- Please add alphabetically -->
+
+  </target>
+
+</project>

Added: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,29 @@
+<assembly 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/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+  <id>deploy-artifacts</id>
+  <formats>
+    <format>dir</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <!-- Dependency Sets -->
+  <dependencySets>
+  
+    <!-- bundle -->
+    <dependencySet>
+      <outputDirectory>bundles</outputDirectory>
+      <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+      <includes>
+        <include>*:org.apache.felix.log:jar</include>
+        <include>*:jboss-osgi-common:jar</include>
+        <include>*:jboss-osgi-logging:jar</include>
+        <include>*:jboss-osgi-remotelog:jar</include>
+      </includes>
+      <useStrictFiltering>true</useStrictFiltering>
+      <scope>provided</scope>
+      <unpack>false</unpack>
+    </dependencySet>
+    
+  </dependencySets>
+</assembly>

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,92 @@
+/*
+ * 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.bootstrap;
+
+//$Id: BootstrapTestCase.java 86588 2009-04-01 13:39:25Z thomas.diesler at jboss.com $
+
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * Test the embedded bootstrap of the framework
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 25-Feb-2009
+ */
+public class BootstrapTestCase extends OSGiTest
+{
+   public void testFrameworkBootstrap() throws Exception
+   {
+      OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+      OSGiFramework framework = bootProvider.getFramework();
+      assertNotNull("Framework not null", framework);
+
+      Bundle bundle = framework.getSystemBundle();
+
+      assertEquals("BundleId == 0", 0, bundle.getBundleId());
+      assertNotNull("SymbolicName not null", bundle.getSymbolicName());
+
+      MainDeployer mainDeployer = bootProvider.getInstance("MainDeployer", MainDeployer.class);
+      assertNotNull("MainDeployer not null", mainDeployer);
+   }
+
+   public void testGetBootstrapProvider() throws Exception
+   {
+      OSGiBootstrapProvider bp1 = OSGiBootstrap.getBootstrapProvider();
+      OSGiBootstrapProvider bp2 = OSGiBootstrap.getBootstrapProvider();
+      assertNotSame("Multiple provider instances", bp1, bp2);
+   }
+
+   public void testConfigureFromResource() throws Exception
+   {
+      OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+      bootProvider.configure("bootstrap/mock-bootstrap-beans.xml");
+
+      SomeBean bean = bootProvider.getInstance("SomeBean", SomeBean.class);
+      assertNotNull("Bean not null", bean);
+
+      OSGiFramework framework = bootProvider.getFramework();
+      assertNull("Framework null", framework);
+
+      bootProvider.configure("bootstrap/mock-osgi-beans.xml");
+      assertNotNull("Framework not null", bootProvider.getFramework());
+   }
+
+   public void testConfigureFromURL() throws Exception
+   {
+      OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+      bootProvider.configure(getResourceURL("bootstrap/mock-bootstrap-beans.xml"));
+
+      SomeBean bean = bootProvider.getInstance("SomeBean", SomeBean.class);
+      assertNotNull("Bean not null", bean);
+
+      OSGiFramework framework = bootProvider.getFramework();
+      assertNull("Framework null", framework);
+
+      bootProvider.configure(getResourceURL("bootstrap/mock-osgi-beans.xml"));
+      assertNotNull("Framework not null", bootProvider.getFramework());
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.test.osgi.bootstrap;
+
+//$Id: MockFramework.java 84917 2009-03-02 08:18:40Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A mock framework
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 25-Feb-2009
+ */
+public class MockFramework implements OSGiFramework
+{
+   public Bundle getSystemBundle()
+   {
+      return null;
+   }
+
+   public BundleContext getSystemBundleContext()
+   {
+      return null;
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.bootstrap;
+
+//$Id: SomeBean.java 84917 2009-03-02 08:18:40Z thomas.diesler at jboss.com $
+
+
+/**
+ * Some pojo
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 25-Feb-2009
+ */
+public class SomeBean
+{
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,88 @@
+/*
+ * 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.deployer.jbosgi36;
+
+//$Id: OSGI36TestCase.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.test.osgi.deployer.jbosgi36.mbean.FooMBean;
+
+/**
+ * [JBOSGI-36] Bundle classes leak into system classloader
+ * 
+ * https://jira.jboss.org/jira/browse/JBOSGI-36
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 25-Feb-2009
+ */
+public class OSGI36TestCase extends IntegrationTest
+{
+   static IntegrationTestSetup setup;
+
+   public static Test suite()
+   {
+      setup = new IntegrationTestSetup(OSGI36TestCase.class, "jbosgi36-bundle.jar, jbosgi36-mbean.jar");
+      return setup;
+   }
+
+   public void testAccessMBean() throws Exception
+   {
+      assertEquals("hello", getFooMBean().echo("hello"));
+   }
+
+   public void testAccessSomeService() throws Exception
+   {
+      try
+      {
+         String loaderName = getFooMBean().accessSomeService();
+         fail("Unexpected classloader: " + loaderName);
+      }
+      catch (ClassNotFoundException ex)
+      {
+         // expected
+      }
+   }
+
+   public void testAccessSomeInternal() throws Exception
+   {
+      try
+      {
+         String loaderName = getFooMBean().accessSomeInternal();
+         fail("Unexpected classloader: " + loaderName);
+      }
+      catch (ClassNotFoundException ex)
+      {
+         // expected
+      }
+   }
+
+   private FooMBean getFooMBean() throws MBeanProxyException
+   {
+      FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, getServer());
+      return foo;
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.deployer.jbosgi36.bundle;
+
+import org.jboss.test.osgi.deployer.jbosgi36.bundle.internal.SomeInternal;
+
+//$Id: SomeService.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+public class SomeService 
+{
+  public String doStuff()
+  {
+     return SomeInternal.class.getName();
+  }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.deployer.jbosgi36.bundle;
+
+//$Id: SomeServiceActivator.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A Service Activator
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 04-Feb-2009
+ */
+public class SomeServiceActivator implements BundleActivator
+{
+  private ServiceRegistration registration;
+  
+  public void start(BundleContext context)
+  {
+    SomeService service = new SomeService();
+    registration = context.registerService(SomeService.class.getName(), service, null);
+  }
+
+  public void stop(BundleContext context)
+  {
+    if (registration != null)
+    {
+      registration.unregister();
+      registration = null;
+    }
+  }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.deployer.jbosgi36.bundle.internal;
+
+//$Id: SomeInternal.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+public class SomeInternal 
+{
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.deployer.jbosgi36.mbean;
+
+//$Id: Foo.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
+
+ at JMX (exposedInterface = FooMBean.class, name = "jboss.osgi:test=jbosgi36", registerDirectly = true)
+public class Foo implements FooMBean
+{
+   public String echo(String msg)
+   {
+      return msg;
+   }
+
+   public String accessSomeService() throws ClassNotFoundException
+   {
+      ClassLoader loader = getClass().getClassLoader();
+      loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.SomeService");
+      return loader.toString();
+   }
+
+   public String accessSomeInternal() throws ClassNotFoundException
+   {
+      ClassLoader loader = getClass().getClassLoader();
+      loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.internal.SomeInternal");
+      return loader.toString();
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,39 @@
+/*
+ * 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.deployer.jbosgi36.mbean;
+
+// $Id: FooMBean.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+
+public interface FooMBean 
+{
+   ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.osgi:test=jbosgi36");
+
+   String echo(String msg);
+   
+   String accessSomeService() throws ClassNotFoundException;
+   
+   String accessSomeInternal() throws ClassNotFoundException;
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,72 @@
+/*
+ * 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.jbosgi37;
+
+//$Id: OSGI37TestCase.java 87351 2009-04-15 14:25:32Z thomas.diesler at jboss.com $
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * [JBOSGI-37] Prevent creation of deployment unit for nested jars
+ * 
+ * https://jira.jboss.org/jira/browse/JBOSGI-37
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 09-Apr-2009
+ */
+public class OSGI37TestCase extends OSGiTest
+{
+   private BundleContext sysContext;
+   
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      
+      OSGiFramework framework = getBootstrapProvider().getFramework();
+      sysContext = framework.getSystemBundleContext();
+   }
+
+   public void testNestedBundle() throws Exception
+   {
+      Bundle bundleA = installBundle(sysContext, "jbosgi37-bundleA.jar", true);
+      
+      assertEquals("Bundle started", Bundle.ACTIVE, bundleA.getState());
+      
+      List<String> relevant = new ArrayList<String>();
+      for (Bundle bundle : sysContext.getBundles())
+      {
+         String symbolicName = bundle.getSymbolicName();
+         if (symbolicName.startsWith("jbosgi37"))
+            relevant.add(symbolicName);
+      }
+
+      assertEquals("No Sub Bundle", 1, relevant.size());
+      assertEquals("jbosgi37-bundleA", relevant.get(0));
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,45 @@
+/*
+ * 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.jbosgi37.bundleA;
+
+//$Id: ServiceA.java 87351 2009-04-15 14:25:32Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.jbosgi37.subA.PojoA;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * ServiceA has a dependecy on PojoA
+ */
+public class ServiceA
+{
+   private LogService log;
+   
+   ServiceA(BundleContext context)
+   {
+      log = new LogServiceTracker(context);
+      
+      PojoA pojo = new PojoA(context.getBundle().getSymbolicName());
+      log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi37.bundleA;
+
+//$Id: ServiceActivator.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+   private ServiceRegistration registration;
+
+   public void start(BundleContext context)
+   {
+      ServiceA service = new ServiceA(context);
+      registration = context.registerService(ServiceA.class.getName(), service, null);
+   }
+
+   public void stop(BundleContext context)
+   {
+      if (registration != null)
+      {
+         registration.unregister();
+         registration = null;
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi37.bundleB;
+
+//$Id: ServiceActivator.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+   private ServiceRegistration registration;
+
+   public void start(BundleContext context)
+   {
+      ServiceB service = new ServiceB(context);
+      registration = context.registerService(ServiceB.class.getName(), service, null);
+   }
+
+   public void stop(BundleContext context)
+   {
+      if (registration != null)
+      {
+         registration.unregister();
+         registration = null;
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,45 @@
+/*
+ * 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.jbosgi37.bundleB;
+
+//$Id: ServiceB.java 87351 2009-04-15 14:25:32Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.jbosgi37.subB.PojoB;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * ServiceB has a dependecy on PojoB
+ */
+public class ServiceB
+{
+   private LogService log;
+   
+   ServiceB(BundleContext context)
+   {
+      log = new LogServiceTracker(context);
+      
+      PojoB pojo = new PojoB(context.getBundle().getSymbolicName());
+      log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbosgi37.subA;
+
+
+//$Id: PojoA.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
+
+public class PojoA
+{
+   private String message;
+   
+   public PojoA(String message)
+   {
+      this.message = message;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "[" + message + "]";
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbosgi37.subB;
+
+
+//$Id: PojoB.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
+
+public class PojoB
+{
+   private String message;
+   
+   public PojoB(String message)
+   {
+      this.message = message;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "[" + message + "]";
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,131 @@
+/*
+ * 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: OSGI38RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * [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 at jboss.com
+ * @since 02-Mar-2009
+ */
+public class OSGI38RemoteTestCase extends IntegrationTest
+{
+   /*
+    * Install/Start the common bundle
+    */
+   public void testInstallStartX() throws Exception
+   {
+      RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+      
+      undeployBundle("jbosgi38-bundleX.jar");
+   }
+
+   /*
+    * Install X, B
+    */
+   public void testInstallXBeforeB() throws Exception
+   {
+      RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+      RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+      
+      undeployBundle("jbosgi38-bundleB.jar");
+      undeployBundle("jbosgi38-bundleX.jar");
+   }
+
+   /*
+    * Install X, B, A
+    */
+   public void testInstallBBeforeA() throws Exception
+   {
+      RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+      RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+      RemoteBundle bundleA = deployBundle("jbosgi38-bundleA.jar");
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+      
+      undeployBundle("jbosgi38-bundleA.jar");
+      undeployBundle("jbosgi38-bundleB.jar");
+      undeployBundle("jbosgi38-bundleX.jar");
+   }
+
+   /*
+    * Install B, X
+    */
+   public void testInstallBBeforeX() throws Exception
+   {
+      RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+      
+      assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+      
+      RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+      
+      undeployBundle("jbosgi38-bundleB.jar");
+      undeployBundle("jbosgi38-bundleX.jar");
+   }
+
+   /*
+    * Install A, B, X
+    */
+   public void testInstallABeforeB() throws Exception
+   {
+      RemoteBundle bundleA = deployBundle("jbosgi38-bundleA.jar");
+      
+      assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+      
+      RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+      
+      assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+      
+      RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+      
+      undeployBundle("jbosgi38-bundleA.jar");
+      undeployBundle("jbosgi38-bundleB.jar");
+      undeployBundle("jbosgi38-bundleX.jar");
+   }
+}
\ No newline at end of file

Added: 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/jbosgi38/OSGI38TestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,228 @@
+/*
+ * 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 at jboss.com $
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+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 at jboss.com
+ * @since 02-Mar-2009
+ */
+public class OSGI38TestCase extends OSGiTest
+{
+   /*
+    * Install/Start the common bundle
+    */
+   public void testInstallStartX() throws Exception
+   {
+      OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+
+      Bundle bundleX = null;
+      try
+      {
+         bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+         bundleX.start();
+         assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+      }
+      finally
+      {
+         uninstall(bundleX);
+      }
+   }
+
+   /*
+    * Install X, B
+    */
+   public void testInstallXBeforeB() throws Exception
+   {
+      OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+
+      Bundle bundleB = null;
+      Bundle bundleX = null;
+      try
+      {
+         bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+         bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+         bundleB.start();
+         assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+      }
+      finally
+      {
+         uninstall(bundleB);
+         uninstall(bundleX);
+      }
+   }
+
+   /*
+    * Install X, B, A
+    */
+   public void testInstallBBeforeA() throws Exception
+   {
+      OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+
+      Bundle bundleA = null;
+      Bundle bundleB = null;
+      Bundle bundleX = null;
+      try
+      {
+         bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+         bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+         bundleA = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleA.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+
+         bundleA.start();
+         assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+      }
+      finally
+      {
+         uninstall(bundleA);
+         uninstall(bundleB);
+         uninstall(bundleX);
+      }
+   }
+
+   /*
+    * Install B, X
+    */
+   public void testInstallBBeforeX() throws Exception
+   {
+      OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+
+      Bundle bundleB = null;
+      Bundle bundleX = null;
+      try
+      {
+         bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+         try
+         {
+            bundleB.start();
+            fail("Unresolved constraint expected");
+         }
+         catch (BundleException ex)
+         {
+            // expected
+         }
+
+         bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+         bundleB.start();
+         assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+      }
+      finally
+      {
+         uninstall(bundleX);
+         uninstall(bundleB);
+      }
+   }
+
+   /*
+    * Install A, B, X
+    */
+   public void testInstallABeforeB() throws Exception
+   {
+      OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+
+      Bundle bundleA = null;
+      Bundle bundleB = null;
+      Bundle bundleX = null;
+      try
+      {
+         bundleA = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleA.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+
+         bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+         assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+         try
+         {
+            bundleB.start();
+            fail("Unresolved constraint expected");
+         }
+         catch (BundleException ex)
+         {
+            // expected
+         }
+
+         bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+         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());
+      }
+      finally
+      {
+         uninstall(bundleA);
+         uninstall(bundleB);
+         uninstall(bundleX);
+      }
+   }
+
+   private void uninstall(Bundle bnd)
+   {
+      try
+      {
+         if (bnd != null)
+            bnd.uninstall();
+      }
+      catch (BundleException ex)
+      {
+         System.err.println(ex.toString());
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi38.bundleA;
+
+//$Id: ServiceA.java 85293 2009-03-05 13:45:47Z thomas.diesler at 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 at 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();
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi38.bundleA;
+
+//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+   private ServiceRegistration registration;
+
+   public void start(BundleContext context)
+   {
+      ServiceA service = new ServiceA(context);
+      registration = context.registerService(ServiceA.class.getName(), service, null);
+   }
+
+   public void stop(BundleContext context)
+   {
+      if (registration != null)
+      {
+         registration.unregister();
+         registration = null;
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi38.bundleB;
+
+//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+   private ServiceRegistration registration;
+
+   public void start(BundleContext context)
+   {
+      ServiceB service = new ServiceB();
+      registration = context.registerService(ServiceB.class.getName(), service, null);
+   }
+
+   public void stop(BundleContext context)
+   {
+      if (registration != null)
+      {
+         registration.unregister();
+         registration = null;
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,40 @@
+/*
+ * 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 at 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 at jboss.com
+ * @since 02-Mar-2009
+ */
+public class ServiceB 
+{
+  public String doStuffInB(SomePojo obj)
+  {
+     return obj.toString();
+  }
+}

Added: 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/jbosgi38/bundleX/SomePojo.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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 at jboss.com $
+
+public class SomePojo
+{
+   private String message;
+   
+   public SomePojo(String message)
+   {
+      this.message = message;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "[" + message + "]";
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,104 @@
+/*
+ * 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.jbosgi39;
+
+//$Id: OSGI39RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * [JBOSGI-39] Bundle gets wired to an already uninstalled bundle
+ * 
+ * https://jira.jboss.org/jira/browse/JBOSGI-39
+ * 
+ * Bundle B depends on bundle X.
+ * 
+ * B ---> X 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 04-Mar-2009
+ */
+public class OSGI39RemoteTestCase extends IntegrationTest
+{
+   public void testVerifyUnresolved() throws Exception
+   {
+      RemoteBundle bundleB = deployBundle("jbosgi39-bundleB.jar");
+      
+      assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+      
+      try
+      {
+         bundleB.start();
+         fail("Unresolved constraint expected");
+      }
+      catch (BundleException ex)
+      {
+         // expected
+      }
+      
+      RemoteBundle bundleX = deployBundle("jbosgi39-bundleX.jar");
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+      
+      undeployBundle("jbosgi39-bundleB.jar");
+      undeployBundle("jbosgi39-bundleX.jar");
+   }
+
+   /*
+    * 4.3.11 Uninstalling Bundles
+    * 
+    * Once this method returns, the state of the OSGi Service Platform must be the same as if the bundle had never been installed, unless:
+    * 
+    * - The uninstalled bundle has exported any packages (via its Export-Package manifest header)
+    * - The uninstalled bundle was selected by the Framework as the exporter of these packages.
+    * 
+    * If none of the old exports are used, then the old exports must be removed. Otherwise, all old exports must remain available
+    * for existing bundles and future resolves until the refreshPackages method is called or the Framework is restarted.
+    */
+   public void testWiringToUninstalled() throws Exception
+   {
+      RemoteBundle bundleX = deployBundle("jbosgi39-bundleX.jar");
+      RemoteBundle bundleB = deployBundle("jbosgi39-bundleB.jar");
+      
+      bundleB.start();
+      
+      assertEquals("Bundle resolved", Bundle.ACTIVE, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+      // Undeploy X before B
+      undeployBundle("jbosgi39-bundleX.jar");
+      undeployBundle("jbosgi39-bundleB.jar");
+      
+      // Install B without X
+      bundleB = deployBundle("jbosgi39-bundleB.jar");
+      
+      bundleB.start();
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+      undeployBundle("jbosgi39-bundleB.jar");
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,160 @@
+/*
+ * 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.jbosgi39;
+
+//$Id: OSGI39TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * [JBOSGI-39] Bundle gets wired to an already uninstalled bundle
+ * 
+ * https://jira.jboss.org/jira/browse/JBOSGI-39
+ * 
+ * Bundle B depends on bundle X.
+ * 
+ * B ---> X 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 04-Mar-2009
+ */
+public class OSGI39TestCase extends OSGiTest
+{
+   public void testVerifyUnresolved() throws Exception
+   {
+      OSGiFramework framework = getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+      
+      Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+      assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+      
+      try
+      {
+         bundleB.start();
+         fail("Unresolved constraint expected");
+      }
+      catch (BundleException ex)
+      {
+         // expected
+      }
+      
+      Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+      
+      bundleB.start();
+      
+      assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+      bundleB.uninstall();
+      bundleX.uninstall();
+   }
+
+   /*
+    * 4.3.11 Uninstalling Bundles
+    * 
+    * Once this method returns, the state of the OSGi Service Platform must be the same as if the bundle had never been installed, unless:
+    * 
+    * - The uninstalled bundle has exported any packages (via its Export-Package manifest header)
+    * - The uninstalled bundle was selected by the Framework as the exporter of these packages.
+    * 
+    * If none of the old exports are used, then the old exports must be removed. Otherwise, all old exports must remain available
+    * for existing bundles and future resolves until the refreshPackages method is called or the Framework is restarted.
+    */
+   public void testWiringToUninstalled() throws Exception
+   {
+      OSGiFramework framework = getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+      
+      Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+      Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+      
+      bundleB.start();
+      
+      assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+      // Uninstall X before B
+      bundleX.uninstall();
+      bundleB.uninstall();
+      
+      // Install B without X
+      bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+      
+      bundleB.start();
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+      bundleB.uninstall();
+   }
+
+   public void testWiringToUninstalledPackageAdmin() throws Exception
+   {
+      OSGiFramework framework = getBootstrapProvider().getFramework();
+      BundleContext sysContext = framework.getSystemBundleContext();
+      
+      Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+      Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+      
+      bundleB.start();
+      
+      assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+      // Uninstall X before B
+      bundleX.uninstall();
+      bundleB.uninstall();
+      
+      // Forces the update (replacement) or removal of packages exported by the specified bundles. 
+      ServiceReference sref = sysContext.getServiceReference(PackageAdmin.class.getName());
+      PackageAdmin packAdmin = (PackageAdmin)sysContext.getService(sref);
+      packAdmin.refreshPackages(null);
+      
+      // Install B without X
+      bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+      
+      try
+      {
+         bundleB.start();
+         fail("Unresolved constraint expected");
+      }
+      catch (BundleException ex)
+      {
+         // expected
+      }
+      
+      bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+      
+      bundleB.start();
+      
+      assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+      bundleB.uninstall();
+      bundleX.uninstall();
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi39.bundleB;
+
+//$Id: ServiceActivator.java 87064 2009-04-09 11:08:56Z thomas.diesler at jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+   private ServiceRegistration registration;
+
+   public void start(BundleContext context)
+   {
+      ServiceB service = new ServiceB();
+      registration = context.registerService(ServiceB.class.getName(), service, null);
+   }
+
+   public void stop(BundleContext context)
+   {
+      if (registration != null)
+      {
+         registration.unregister();
+         registration = null;
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,40 @@
+/*
+ * 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.jbosgi39.bundleB;
+
+//$Id: ServiceB.java 87064 2009-04-09 11:08:56Z thomas.diesler at jboss.com $
+
+import org.jboss.test.osgi.jbosgi39.bundleX.SomePojo;
+
+/**
+ * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 02-Mar-2009
+ */
+public class ServiceB 
+{
+  public String doStuffInB(SomePojo obj)
+  {
+     return obj.toString();
+  }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbosgi39.bundleX;
+
+
+//$Id: SomePojo.java 87064 2009-04-09 11:08:56Z thomas.diesler at jboss.com $
+
+public class SomePojo
+{
+   private String message;
+   
+   public SomePojo(String message)
+   {
+      this.message = message;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "[" + message + "]";
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,67 @@
+/*
+ * 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.jbosgi41;
+
+//$Id: OSGI41RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * [JBOSGI-41] Verify persistent file storage
+ * 
+ * https://jira.jboss.org/jira/browse/JBOSGI-41
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-Mar-2009
+ */
+public class OSGI41RemoteTestCase extends IntegrationTest
+{
+   public void testFirstRun() throws Exception
+   {
+      RemoteBundle bundleA = deployBundle("jbosgi41-bundleA.jar");
+      assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+      
+      File dataFile = getBundleDataFile(bundleA, "config/jbosgi41.txt");
+      assertTrue("File exists: " + dataFile, dataFile.exists());
+      
+      BufferedReader br = new BufferedReader(new FileReader(dataFile));
+      String symbolicName = br.readLine();
+      assertEquals("jbosgi41-bundleA", symbolicName);
+      
+      undeployBundle("jbosgi41-bundleA.jar");
+   }
+
+   private File getBundleDataFile(RemoteBundle bundleA, String filename)
+   {
+      String storageRoot = bundleA.getProperty("org.osgi.framework.storage");
+      assertNotNull("Storage dir not null", storageRoot);
+      
+      File dataFile = new File(storageRoot + "/bundle" + bundleA.getBundleId() + "/data/" + filename);
+      return dataFile;
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi41.bundleA;
+
+//$Id: ServiceA.java 85288 2009-03-05 10:31:17Z thomas.diesler at jboss.com $
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * ServiceA writes a file
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-Mar-2009
+ */
+public class ServiceA
+{
+   ServiceA(BundleContext context)
+   {
+      context.getDataFile("config").mkdirs();
+      
+      File dataFile = context.getDataFile("config/jbosgi41.txt");
+      try
+      {
+         System.out.println("dataFile: " + dataFile);
+         OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(dataFile));
+         out.write(context.getBundle().getSymbolicName());
+         out.close();
+      }
+      catch (IOException ex)
+      {
+         ex.printStackTrace(System.err);
+      }
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.jbosgi41.bundleA;
+
+//$Id: ServiceActivator.java 85293 2009-03-05 13:45:47Z thomas.diesler at jboss.com $
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+   private ServiceRegistration regA, regB;
+
+   public void start(BundleContext context)
+   {
+      ServiceA serviceA = new ServiceA(context);
+      regA = context.registerService(ServiceA.class.getName(), serviceA, null);
+      
+      Dictionary<String, String> props = new Hashtable<String, String>();
+      props.put("service.pid", ServiceB.class.getName());
+      
+      ServiceB serviceB = new ServiceB(context);
+      regB = context.registerService(ServiceB.class.getName(), serviceB, props);
+      
+      serviceB.updateConfig("xxx", "yyy");
+      serviceB.updateConfig("xxx", "zzz");
+   }
+
+   public void stop(BundleContext context)
+   {
+      if (regA != null)
+      {
+         regA.unregister();
+         regA = null;
+      }
+      if (regB != null)
+      {
+         regB.unregister();
+         regB = null;
+      }
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,98 @@
+/*
+ * 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.jbosgi41.bundleA;
+
+//$Id: ServiceB.java 85293 2009-03-05 13:45:47Z thomas.diesler at jboss.com $
+
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * ServiceB is a ManagedService
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-Mar-2009
+ */
+public class ServiceB implements ManagedService
+{
+   private ConfigurationAdmin configAdmin;
+
+   ServiceB(BundleContext context)
+   {
+      System.out.println("ServiceB");
+      
+      ServiceTracker tracker = new ServiceTracker(context, ConfigurationAdmin.class.getName(), null)
+      {
+         @Override
+         public Object addingService(ServiceReference sref)
+         {
+            System.out.println("addingService");
+            configAdmin = (ConfigurationAdmin)super.addingService(sref);
+            return configAdmin;
+         }
+      };
+      tracker.open();
+   }
+
+   @SuppressWarnings("unchecked")
+   public void updateConfig(String key, String value)
+   {
+      System.out.println("updateConfig");
+      if (configAdmin != null)
+      {
+         try
+         {
+            Configuration config = configAdmin.getConfiguration(ServiceB.class.getName());
+            Dictionary props = config.getProperties();
+            
+            if (props == null)
+               props = new Hashtable<String, String>();
+            
+            props.put(key, value);
+            
+            config.update(props);
+            
+            Configuration[] configs = configAdmin.listConfigurations(null);
+            System.out.println(Arrays.asList(configs));
+         }
+         catch (Exception ex)
+         {
+            throw new RuntimeException("Cannot access ConfigurationAdmin", ex);
+         }
+      }
+   }
+
+   @SuppressWarnings("unchecked")
+   public void updated(Dictionary props) throws ConfigurationException
+   {
+      System.out.println("updated: " + props);
+   }
+}

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.service.startlevel;
+
+//$Id: StartLevelRemoteTestCase.java 87336 2009-04-15 11:31:26Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * Deploy a bundle that accesses the StartLevel service
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 04-Mar-2009
+ */
+public class StartLevelRemoteTestCase extends IntegrationTest
+{
+   public void testStartLevel() throws Exception
+   {
+      RemoteBundle bundle = deployBundle("service/service-startlevel.jar");
+      
+      assertEquals("Bundle active", Bundle.ACTIVE, bundle.getState());
+      
+      undeployBundle("service/service-startlevel.jar");
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.service.startlevel.bundle;
+
+//$Id: ServiceActivator.java 87336 2009-04-15 11:31:26Z thomas.diesler at jboss.com $
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+import org.osgi.service.startlevel.StartLevel;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * Try to access the StartLevel service 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 04-Feb-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+   public void start(BundleContext context)
+   {
+      LogService log = new LogServiceTracker(context);
+      
+      ServiceTracker tracker = new ServiceTracker(context, StartLevel.class.getName(), null);
+      tracker.open();
+      
+      StartLevel service = (StartLevel)tracker.getService();
+      if (service == null)
+         log.log(LogService.LOG_ERROR, "Cannot get StartLevel. Loaded with: " + StartLevel.class.getClassLoader());
+      
+      int level = service.getStartLevel();
+      log.log(LogService.LOG_INFO, "StartLevel: " + level);
+   }
+
+   /*
+    * Implements BundleActivator.stop().
+    */
+   public void stop(BundleContext context)
+   {
+   }
+}
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,8 @@
+<!--
+  $Id: mock-bootstrap-beans.xml 84917 2009-03-02 08:18:40Z thomas.diesler at jboss.com $ 
+-->
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="SomeBean" class="org.jboss.test.osgi.bootstrap.SomeBean"/>
+
+</deployment>

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,10 @@
+<!--
+  $Id: mock-osgi-beans.xml 84917 2009-03-02 08:18:40Z thomas.diesler at jboss.com $ 
+-->
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="jboss.osgi:service=Framework" class="org.jboss.test.osgi.bootstrap.MockFramework"/>
+ 
+ <bean name="jboss.osgi:service=SomeOtherFramework" class="org.jboss.test.osgi.bootstrap.MockFramework"/>
+ 
+</deployment>

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Foo" class="org.jboss.test.osgi.deployer.jbosgi36.mbean.Foo"/>
+
+</deployment>
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,7 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi36-bundle.jar src/test/resources/jbosgi36/jbosgi36.bnd
+
+Bundle-SymbolicName: jbosgi36
+Bundle-Activator: org.jboss.test.osgi.deployer.jbosgi36.bundle.SomeServiceActivator
+Export-Package: org.jboss.test.osgi.deployer.jbosgi36.bundle
+Private-Package: org.jboss.test.osgi.deployer.jbosgi36.bundle.internal
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,10 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi37-bundleA.jar src/test/resources/jbosgi37/jbosgi37-bundleA.bnd
+
+Bundle-SymbolicName: jbosgi37-bundleA
+Bundle-Activator: org.jboss.test.osgi.jbosgi37.bundleA.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi37.bundleA
+
+Include-Resource: ../../../target/test-libs/jbosgi37-subA.jar
+Bundle-ClassPath: .,jbosgi37-subA.jar
+
+-removeheaders: Include-Resource
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,10 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi37-bundleB.jar src/test/resources/jbosgi37/jbosgi37-bundleB.bnd
+
+Bundle-SymbolicName: jbosgi37-bundleB
+Bundle-Activator: org.jboss.test.osgi.jbosgi37.bundleB.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi37.bundleB
+
+Include-Resource: ../../../target/test-libs/jbosgi37-subB.jar
+Bundle-ClassPath: .,jbosgi37-subB.jar
+
+-removeheaders: Include-Resource
\ No newline at end of file

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi37-subA.jar src/test/resources/jbosgi37/jbosgi37-subA.bnd
+
+Bundle-SymbolicName: jbosgi37-subA
+Export-Package: org.jboss.test.osgi.jbosgi37.subA
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# 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
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# 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
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# 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
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi39-bundleB.jar src/test/resources/jbosgi39/bundleB.bnd
+
+Bundle-SymbolicName: jbosgi39-bundleB
+Bundle-Activator: org.jboss.test.osgi.jbosgi39.bundleB.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi39.bundleB
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi39-bundleX.jar src/test/resources/jbosgi39/bundleX.bnd
+
+Bundle-SymbolicName: jbosgi39-bundleX
+Export-Package: org.jboss.test.osgi.jbosgi39.bundleX
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi41-bundleA.jar src/test/resources/jbosgi41/jbosgi41-bundleA.bnd
+
+Bundle-SymbolicName: jbosgi41-bundleA
+Bundle-Activator: org.jboss.test.osgi.jbosgi41.bundleA.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi41.bundleA
+

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,111 @@
+<!--
+   The bootstrap of the server. This should only have the minimum
+   needed to bootstrap the mc kernel and profile service.
+   
+   $Id: jboss-osgi-bootstrap-beans.xml 86378 2009-03-26 12:02:32Z thomas.diesler at jboss.com $ 
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+      <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
+   </bean>
+
+   <!-- The ManagedDeploymentCreator implementation -->
+   <bean name="ManagedDeploymentCreator" class="org.jboss.deployers.plugins.managed.DefaultManagedDeploymentCreator" />
+
+   <!-- ModificationType structure processor -->
+   <bean name="ModificationTypeStructureProcessor" class="org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeStructureProcessor">
+     <incallback method="addMatcher"/>
+     <uncallback method="removeMatcher"/>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder">
+           <property name="structureProcessor"><inject bean="ModificationTypeStructureProcessor"/></property>
+         </bean>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- A declared structure descriptor deployer -->
+   <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"/>
+
+    <!-- JAR Structure -->
+    <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+       <property name="candidateStructureVisitorFactory">
+          <!-- Any file that is not an ordinary directory is a candidate -->
+          <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+             <!-- A filter to exclude some obvious non-subdeployments -->
+             <property name="filter">
+                <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+                   <constructor><parameter>
+                      <list elementClass="java.lang.String">
+                         <!-- Exclude class files as subdeployments -->
+                         <value>.class</value>
+                      </list>
+                   </parameter></constructor>
+                </bean>
+             </property>
+          </bean>
+       </property>
+    </bean>
+
+    <!-- File Structure -->
+    <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+       <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>-service.xml</value>
+                <value>-beans.xml</value>
+             </set>
+          </parameter>
+       </constructor>
+    </bean>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer"/>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer"/>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter class="org.jboss.kernel.Kernel"><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+   </bean>
+
+   <!-- VFS ClassLoader -->
+   <bean name="ClassLoaderSystem" class="org.jboss.classloader.spi.ClassLoaderSystem">
+      <constructor factoryClass="org.jboss.classloader.spi.ClassLoaderSystem" factoryMethod="getInstance"/>
+   </bean>
+   <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+      <incallback method="addModule" state="Configured"/>
+      <uncallback method="removeModule" state="Configured"/>
+   </bean>
+   <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+      <property name="defaultMetaData">
+         <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true"/>
+      </property>
+   </bean>
+   <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer"/>
+   <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+      <property name="classLoading"><inject bean="ClassLoading"/></property>
+   </bean>
+   <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+      <property name="classLoading"><inject bean="ClassLoading"/></property>
+      <property name="system"><inject bean="ClassLoaderSystem"/></property>
+   </bean>
+
+</deployment>

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://@jboss.bind.address@:1099

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+  <!-- ================================= -->
+  <!-- Preserve messages in a local file -->
+  <!-- ================================= -->
+
+  <appender name="FILE" class="org.apache.log4j.FileAppender">
+    <param name="File" value="${log4j.output.dir}/test.log"/>
+    <param name="Append" value="false"/>
+    <layout class="org.apache.log4j.PatternLayout">
+      <!-- The default pattern: Date Priority [Category] Message\n -->
+      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+    </layout>
+  </appender>
+  
+  <!-- ============================== -->
+  <!-- Append messages to the console -->
+  <!-- ============================== -->
+
+  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out" />
+    <param name="Threshold" value="INFO" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+    </layout>
+  </appender>
+
+  <!-- ================ -->
+  <!-- Limit categories -->
+  <!-- ================ -->
+
+  <category name="org.hibernate">
+    <priority value="INFO" />
+  </category>
+
+  <!-- hide optimistic locking failures
+  <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+    <priority value="FATAL" />
+  </category>
+  -->
+
+  <!-- hide proxy narrowing warns -->
+  <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
+    <priority value="ERROR" />
+  </category>
+
+  <!-- show SQL DML statements as they are executed -->
+  <category name="org.hibernate.SQL">
+    <priority value="DEBUG" />
+  </category>
+
+  <!-- show JDBC parameters
+  <category name="org.hibernate.type">
+    <priority value="TRACE" />
+  </category>
+  -->
+
+  <!-- hide httpclient wire dumps -->
+  <category name="httpclient.wire.header">
+    <priority value="INFO" />
+  </category>
+
+  <!-- ======================= -->
+  <!-- Setup the Root category -->
+  <!-- ======================= -->
+
+  <root>
+    <!--appender-ref ref="CONSOLE"/-->
+    <appender-ref ref="FILE"/>
+  </root>
+
+</log4j:configuration>

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/service/service-startlevel.jar src/test/resources/service/startlevel/service-startlevel.bnd
+
+Bundle-SymbolicName: service-startlevel
+Bundle-Activator: org.jboss.test.osgi.service.startlevel.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.service.startlevel.bundle

Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy	                        (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy	2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,4 @@
+grant {
+	permission java.security.AllPermission;
+};
+

Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml	2009-04-16 06:09:17 UTC (rev 87400)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml	2009-04-16 07:48:05 UTC (rev 87401)
@@ -7,7 +7,7 @@
 
   <groupId>org.jboss.osgi</groupId>
   <artifactId>jboss-osgi-testsuite</artifactId>
-  <packaging>jar</packaging>
+  <packaging>pom</packaging>
 
   <parent>
     <groupId>org.jboss.osgi</groupId>
@@ -15,315 +15,9 @@
     <version>1.0.0.Beta1</version>
   </parent>
 
-  <!-- Properties -->
-  <properties>
-    <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
-  </properties>
-
-  <!-- Dependencies -->
-  <dependencies>
-    <dependency>
-      <groupId>biz.aQute</groupId>
-      <artifactId>bnd</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.osgi</groupId>
-      <artifactId>jboss-osgi-runtime-deployer</artifactId>
-      <version>${version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.microcontainer</groupId>
-      <artifactId>jboss-aop-mc-int</artifactId>
-    </dependency>
-
-    <!-- Provided Dependencies -->
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.log</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.osgi</groupId>
-      <artifactId>jboss-osgi-common</artifactId>
-      <version>${version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.osgi</groupId>
-      <artifactId>jboss-osgi-logging</artifactId>
-      <version>${version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.osgi</groupId>
-      <artifactId>jboss-osgi-remotelog</artifactId>
-      <version>${version}</version>
-      <scope>provided</scope>
-    </dependency>
-    
-    <!-- Test Dependencies -->
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <!-- Build -->
-  <build>
-    <testResources>
-      <testResource>
-        <directory>src/test/resources</directory>
-        <filtering>true</filtering>
-      </testResource>
-    </testResources>
-    <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-example-jars.xml"/>
-                <ant antfile="scripts/antrun-test-jars.xml"/>
-              </tasks>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
-  <profiles>
-
-    <!--
-	  Name: framework-default 
-      Descr: Setup for default framework integration testing
-    -->
-    <profile>
-      <id>framework-default</id>
-      <activation>
-        <property>
-          <name>!framework</name>
-        </property>
-      </activation>
-      <dependencies>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-felix</artifactId>
-          <version>${version}</version>
-        </dependency>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-felix</artifactId>
-          <version>${version}</version>
-          <classifier>config</classifier>
-        </dependency>
-      </dependencies>
-    </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>
-      <dependencies>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-felix</artifactId>
-          <version>${version}</version>
-        </dependency>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-felix</artifactId>
-          <version>${version}</version>
-          <classifier>config</classifier>
-        </dependency>
-      </dependencies>
-    </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>
-      <dependencies>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-equinox</artifactId>
-          <version>${version}</version>
-        </dependency>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-equinox</artifactId>
-          <version>${version}</version>
-          <classifier>config</classifier>
-        </dependency>
-      </dependencies>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <skipTests>true</skipTests>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <!--
-      Name: framework-knopflerfish
-      Descr: Setup for Equinox framework integration testing
-    -->
-    <profile>
-      <id>framework-knopflerfish</id>
-      <activation>
-        <property>
-          <name>!framework</name>
-          <value>knopflerfish</value>
-        </property>
-      </activation>
-      <dependencies>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
-          <version>${version}</version>
-        </dependency>
-        <dependency>
-          <groupId>org.jboss.osgi</groupId>
-          <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
-          <version>${version}</version>
-          <classifier>config</classifier>
-        </dependency>
-      </dependencies>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <skipTests>true</skipTests>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <!--
-	  Name: embedded-tesing 
-      Descr: Setup for embedded integration testing
-	-->
-    <profile>
-      <id>embedded-tesing</id>
-      <activation>
-        <property>
-          <name>!jboss.bind.address</name>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <excludes>
-                <!-- Exclude tests that require remote access -->
-                <exclude>org/jboss/test/osgi/deployer/**</exclude>
-                <exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
-              </excludes>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <!--
-	  Name: remote-tesing 
-      Descr: Setup for remote integration testing
-    -->
-    <profile>
-      <id>remote-tesing</id>
-      <activation>
-        <property>
-          <name>jboss.bind.address</name>
-        </property>
-      </activation>
-      <dependencies>
-        <dependency>
-          <groupId>org.jboss.jbossas</groupId>
-          <artifactId>jboss-as-client</artifactId>
-          <scope>test</scope>
-          <type>pom</type>
-        </dependency>
-      </dependencies>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <!-- argLine>${surefire.security.args}</argLine -->
-              <excludes>
-              </excludes>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
+  <modules>
+    <module>example</module>
+    <module>functional</module>
+  </modules>
+  
 </project>




More information about the jboss-osgi-commits mailing list