Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.virgo.kernel.test')
-rw-r--r--org.eclipse.virgo.kernel.test/.classpath25
-rw-r--r--org.eclipse.virgo.kernel.test/.project41
-rw-r--r--org.eclipse.virgo.kernel.test/.settings/com.springsource.server.ide.bundlor.core.prefs3
-rw-r--r--org.eclipse.virgo.kernel.test/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--org.eclipse.virgo.kernel.test/.settings/org.eclipse.wst.common.project.facet.core.xml4
-rw-r--r--org.eclipse.virgo.kernel.test/.springBeans13
-rw-r--r--org.eclipse.virgo.kernel.test/build.xml8
-rw-r--r--org.eclipse.virgo.kernel.test/ivy.xml46
-rw-r--r--org.eclipse.virgo.kernel.test/src/main/java/.gitignore0
-rw-r--r--org.eclipse.virgo.kernel.test/src/main/resources/.gitignore0
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/concurrent/test/ApplicationContextDependencyMonitorIntegrationTests.java111
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/dm/test/ModuleBeanFactoryPostProcessorTests.java79
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/ffdc/test/FFDCServiceAspectTests.java53
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkIntegrationTests.java298
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkStateDumpIntegrationTests.java160
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/RegionTests.java45
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/AbstractKernelIntegrationTest.java61
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/ManifestUtils.java94
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterSignallingTests.java297
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterTests.java79
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardKernelIntegrationTests.java30
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/TestSignal.java56
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/META-INF/MANIFEST.MF26
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/META-INF/test.config.properties60
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/QuickConsumer.jarbin0 -> 1304 bytes
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/SlowService.jarbin0 -> 1864 bytes
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties5
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties80
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.medic.properties6
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.repository.properties14
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/config/serviceability.xml55
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/initial-artifact-plan/com.springsource.kernel.test.userregion.springdm.plan10
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/MANIFEST.MF6
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/spring/delay-context.xml15
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/delay/Bean.classbin0 -> 317 bytes
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/spring/context.xml11
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/nondm/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/spring/context.xml11
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/spring/context.xml19
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleexporter.jarbin0 -> 571 bytes
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleimporter.jarbin0 -> 571 bytes
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties9
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/sit-config/repository.properties13
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/sit-config/serviceability.xml55
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/one/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/subsystem-1.0.0.xml4
-rw-r--r--org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/two/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.virgo.kernel.test/template.mf20
51 files changed, 1955 insertions, 0 deletions
diff --git a/org.eclipse.virgo.kernel.test/.classpath b/org.eclipse.virgo.kernel.test/.classpath
new file mode 100644
index 00000000..d64af965
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/.classpath
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.5.1.R35x_v20091005/org.eclipse.osgi-3.5.1.R35x_v20091005.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.5.1.R35x_v20091005/org.eclipse.osgi-sources-3.5.1.R35x_v20091005.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/KERNEL_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.deployer"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.osgi"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.test/org.eclipse.virgo.test.framework/2.1.0.D-20100420091951/org.eclipse.virgo.test.framework-2.1.0.D-20100420091951.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.test/org.eclipse.virgo.test.framework/2.1.0.D-20100420091951/org.eclipse.virgo.test.framework-sources-2.1.0.D-20100420091951.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.kernel.core"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/2.1.0.D-20100420091708/org.eclipse.virgo.util.io-2.1.0.D-20100420091708.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/2.1.0.D-20100420091708/org.eclipse.virgo.util.io-sources-2.1.0.D-20100420091708.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/2.1.0.D-20100420091708/org.eclipse.virgo.util.osgi-2.1.0.D-20100420091708.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/2.1.0.D-20100420091708/org.eclipse.virgo.util.osgi-sources-2.1.0.D-20100420091708.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework.osgi/org.springframework.osgi.core/1.2.1/org.springframework.osgi.core-1.2.1.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework.osgi/org.springframework.osgi.core/1.2.1/org.springframework.osgi.core-sources-1.2.1.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-3.0.0.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-sources-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework/org.springframework.core/3.0.0.RELEASE/org.springframework.core-3.0.0.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework/org.springframework.core/3.0.0.RELEASE/org.springframework.core-sources-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.osgi/org.eclipse.virgo.osgi.launcher/2.1.0.D-20100420091535/org.eclipse.virgo.osgi.launcher-2.1.0.D-20100420091535.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.springframework/org.springframework.beans/3.0.0.RELEASE/org.springframework.beans-3.0.0.RELEASE.jar" sourcepath="/KERNEL_IVY_CACHE/org.springframework/org.springframework.beans/3.0.0.RELEASE/org.springframework.beans-sources-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.osgi/org.osgi.compendium/4.1.0/org.osgi.compendium-4.1.0.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.parser.manifest/2.1.0.D-20100420091708/org.eclipse.virgo.util.parser.manifest-2.1.0.D-20100420091708.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.parser.manifest/2.1.0.D-20100420091708/org.eclipse.virgo.util.parser.manifest-sources-2.1.0.D-20100420091708.jar"/>
+ <classpathentry kind="var" path="KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic/1.0.1.D-20100420092100/org.eclipse.virgo.medic-1.0.1.D-20100420092100.jar" sourcepath="/KERNEL_IVY_CACHE/org.eclipse.virgo.medic/org.eclipse.virgo.medic/1.0.0.CI-B20/org.eclipse.virgo.medic-sources-1.0.0.CI-B20.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.virgo.kernel.test/.project b/org.eclipse.virgo.kernel.test/.project
new file mode 100644
index 00000000..257d0c04
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/.project
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.virgo.kernel.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.springsource.server.dev.eclipse.serverdevelopmentbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.springframework.ide.eclipse.core.springbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.springsource.server.ide.bundlor.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.springsource.server.ide.facet.core.bundlenature</nature>
+ <nature>org.springframework.ide.eclipse.core.springnature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>com.springsource.server.dev.eclipse.serverdevelopmentnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.virgo.kernel.test/.settings/com.springsource.server.ide.bundlor.core.prefs b/org.eclipse.virgo.kernel.test/.settings/com.springsource.server.ide.bundlor.core.prefs
new file mode 100644
index 00000000..cc9dd054
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/.settings/com.springsource.server.ide.bundlor.core.prefs
@@ -0,0 +1,3 @@
+#Mon Jul 06 09:05:07 BST 2009
+com.springsource.server.ide.bundlor.core.template.properties.files=../build.versions
+eclipse.preferences.version=1
diff --git a/org.eclipse.virgo.kernel.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.virgo.kernel.test/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..03ec7489
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Wed Nov 26 11:04:45 GMT 2008
+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
diff --git a/org.eclipse.virgo.kernel.test/.settings/org.eclipse.wst.common.project.facet.core.xml b/org.eclipse.virgo.kernel.test/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 00000000..801f856c
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="com.springsource.server.bundle" version="1.0"/>
+</faceted-project>
diff --git a/org.eclipse.virgo.kernel.test/.springBeans b/org.eclipse.virgo.kernel.test/.springBeans
new file mode 100644
index 00000000..d079ca1b
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/.springBeans
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beansProjectDescription>
+ <version>1</version>
+ <pluginVersion><![CDATA[2.2.4.RELEASE]]></pluginVersion>
+ <configSuffixes>
+ <configSuffix><![CDATA[xml]]></configSuffix>
+ </configSuffixes>
+ <enableImports><![CDATA[false]]></enableImports>
+ <configs>
+ </configs>
+ <configSets>
+ </configSets>
+</beansProjectDescription>
diff --git a/org.eclipse.virgo.kernel.test/build.xml b/org.eclipse.virgo.kernel.test/build.xml
new file mode 100644
index 00000000..dba457dc
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/build.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="org.eclipse.virgo.kernel.test">
+
+ <property file="${basedir}/../build.properties"/>
+ <property file="${basedir}/../build.versions"/>
+ <import file="${basedir}/../virgo-build/standard/default.xml"/>
+
+</project>
diff --git a/org.eclipse.virgo.kernel.test/ivy.xml b/org.eclipse.virgo.kernel.test/ivy.xml
new file mode 100644
index 00000000..e52d58ed
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/ivy.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="http://ivyrep.jayasoft.org/ivy-doc.xsl"?>
+<ivy-module
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd"
+ version="1.3">
+
+ <info organisation="org.eclipse.virgo.kernel" module="${ant.project.name}"/>
+
+ <configurations>
+ <include file="${virgo.build.dir}/common/default-ivy-configurations.xml"/>
+ </configurations>
+
+ <publications>
+ <artifact name="${ant.project.name}"/>
+ <artifact name="${ant.project.name}-sources" type="src" ext="jar"/>
+ </publications>
+
+ <dependencies>
+ <dependency org="org.junit" name="com.springsource.org.junit" rev="${org.junit}" conf="test->runtime"/>
+ <dependency org="org.easymock" name="com.springsource.org.easymock" rev="${org.easymock}" conf="test->runtime"/>
+
+ <dependency org="org.eclipse.virgo.kernel" name="org.eclipse.virgo.kernel.dm" rev="latest.integration" conf="test->compile"/>
+ <dependency org="org.eclipse.virgo.kernel" name="org.eclipse.virgo.kernel.core" rev="latest.integration" conf="test->compile"/>
+
+ <dependency org="org.apache.felix" name="org.apache.felix.configadmin" rev="${org.apache.felix}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.test" name="org.eclipse.virgo.test.framework" rev="${org.eclipse.virgo.test}" conf="test->runtime"/>
+ <dependency org="org.springframework.osgi" name="org.springframework.osgi.core" rev="${org.springframework.osgi}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.osgi" name="org.eclipse.virgo.osgi.launcher" rev="${org.eclipse.virgo.osgi}" conf="test->runtime"/>
+ <dependency org="org.eclipse.virgo.osgi" name="org.eclipse.virgo.osgi.extensions.equinox" rev="${org.eclipse.virgo.osgi}" conf="test->runtime"/>
+ <dependency org="org.slf4j" name="com.springsource.slf4j.nop" rev="${org.slf4j}" conf="test->runtime"/>
+ <dependency org="org.slf4j" name="com.springsource.slf4j.org.apache.commons.logging" rev="${org.slf4j}" conf="test->runtime"/>
+ <dependency org="org.eclipse.virgo.medic" name="org.eclipse.virgo.medic.core" rev="${org.eclipse.virgo.medic}" conf="test->runtime"/>
+ <dependency org="org.eclipse.virgo.repository" name="org.eclipse.virgo.repository" rev="${org.eclipse.virgo.repository}" conf="test->runtime"/>
+
+ <!-- Prevent Xerces from being on the classpath to work around Java bug 6723276 during integration testing -->
+ <exclude org="org.apache.xerces"/>
+
+ <override org="org.springframework" rev="${org.springframework}"/>
+ <override org="org.eclipse.virgo.osgi" rev="${org.eclipse.virgo.osgi}"/>
+ <override org="org.eclipse.virgo.util" rev="${org.eclipse.virgo.util}"/>
+ <override org="org.eclipse.osgi" module="org.eclipse.osgi" rev="${org.eclipse.osgi}"/>
+
+ </dependencies>
+
+</ivy-module>
diff --git a/org.eclipse.virgo.kernel.test/src/main/java/.gitignore b/org.eclipse.virgo.kernel.test/src/main/java/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/main/java/.gitignore
diff --git a/org.eclipse.virgo.kernel.test/src/main/resources/.gitignore b/org.eclipse.virgo.kernel.test/src/main/resources/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/main/resources/.gitignore
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/concurrent/test/ApplicationContextDependencyMonitorIntegrationTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/concurrent/test/ApplicationContextDependencyMonitorIntegrationTests.java
new file mode 100644
index 00000000..52dc0e77
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/concurrent/test/ApplicationContextDependencyMonitorIntegrationTests.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.concurrent.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+
+import org.eclipse.virgo.kernel.osgi.framework.OsgiFrameworkUtils;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFramework;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFrameworkFactory;
+import org.eclipse.virgo.kernel.test.AbstractKernelIntegrationTest;
+import org.eclipse.virgo.kernel.test.ManifestUtils;
+
+import org.eclipse.virgo.kernel.core.BundleStarter;
+import org.eclipse.virgo.kernel.core.Signal;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifestFactory;
+
+/**
+ */
+public class ApplicationContextDependencyMonitorIntegrationTests extends AbstractKernelIntegrationTest {
+
+ @Test public void testDependencyMonitoring() throws Exception {
+ QuasiFramework framework = OsgiFrameworkUtils.getService(this.context, QuasiFrameworkFactory.class).getService().create();
+ File file = new File("src/test/resources/QuickConsumer.jar");
+ Reader manifestReader = ManifestUtils.manifestReaderFromJar(file);
+ BundleManifest manifest = BundleManifestFactory.createBundleManifest(manifestReader);
+ manifestReader.close();
+ QuasiBundle quasiQuickConsumer = framework.install(file.toURI(), manifest);
+ framework.resolve();
+ framework.commit();
+
+ Bundle quickConsumer = quasiQuickConsumer.getBundle();
+
+ ServiceReference serviceReference = this.kernelContext.getServiceReference(BundleStarter.class.getName());
+ BundleStarter bundleStarter = (BundleStarter) this.kernelContext.getService(serviceReference);
+
+ final CountDownLatch latch = new CountDownLatch(1);
+
+ bundleStarter.start(quickConsumer, new Signal() {
+ public void signalFailure(Throwable cause) {
+ cause.printStackTrace();
+ }
+
+ public void signalSuccessfulCompletion() {
+ latch.countDown();
+ }
+ });
+
+ assertTrue(latch.await(20, TimeUnit.SECONDS));
+
+ // We need to sleep for a little while to give the
+ // log output sufficient time to make it out onto disk
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException _) {
+ // Ignore
+ }
+
+ File loggingOutput = new File("./target/serviceability/eventlog/eventlog.log");
+ Assert.assertTrue("The log file " + loggingOutput.getAbsolutePath() + " does not exist.", loggingOutput.exists());
+
+ BufferedReader reader = new BufferedReader(new FileReader(loggingOutput));
+
+ String line = reader.readLine();
+ List<String> logEntries = new ArrayList<String>();
+
+ while (line != null) {
+ logEntries.add(line);
+ line = reader.readLine();
+ }
+
+ List<String> expectedResults = new ArrayList<String>(10);
+ expectedResults.add("KE0100W");
+ expectedResults.add("KE0101I");
+
+ for (String er : expectedResults) {
+ boolean entryFound = false;
+ for (String logEntry : logEntries) {
+ if (logEntry.contains(er)) {
+ entryFound = true;
+ }
+ }
+ Assert.assertTrue("An entry containing " + er + " was not found in logging file " + loggingOutput.getAbsolutePath() + ".", entryFound);
+ }
+ }
+
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/dm/test/ModuleBeanFactoryPostProcessorTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/dm/test/ModuleBeanFactoryPostProcessorTests.java
new file mode 100644
index 00000000..c1bc24d9
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/dm/test/ModuleBeanFactoryPostProcessorTests.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.dm.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.virgo.kernel.core.BundleStarter;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
+import org.springframework.osgi.service.importer.support.ImportContextClassLoader;
+import org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean;
+
+import org.eclipse.virgo.kernel.osgi.framework.OsgiFrameworkUtils;
+import org.eclipse.virgo.kernel.osgi.framework.OsgiServiceHolder;
+import org.eclipse.virgo.kernel.test.AbstractKernelIntegrationTest;
+import org.eclipse.virgo.kernel.test.TestSignal;
+
+public class ModuleBeanFactoryPostProcessorTests extends AbstractKernelIntegrationTest {
+
+ private OsgiServiceHolder<BundleStarter> bundleStarter;
+
+ @Before
+ public void before() {
+ this.bundleStarter = OsgiFrameworkUtils.getService(kernelContext, BundleStarter.class);
+ }
+
+ @After
+ public void after() {
+ if(this.bundleStarter != null) {
+ this.kernelContext.ungetService(this.bundleStarter.getServiceReference());
+ }
+ }
+ @Test
+ public void testInbuiltPostProcessors() throws Exception {
+ Bundle bundle = this.context.installBundle(new File("src/test/resources/post-processors/inbuilt").toURI().toString());
+ TestSignal signal = new TestSignal();
+
+ this.bundleStarter.getService().start(bundle, signal);
+
+ signal.assertSuccessfulCompletionSignalled(5000);
+
+ ServiceReference[] serviceReferences = this.context.getServiceReferences(ApplicationContext.class.getName(), "(Bundle-SymbolicName=org.eclipse.virgo.kernel.dmfragment.test.inbuilt)");
+ assertNotNull(serviceReferences);
+ assertEquals(1, serviceReferences.length);
+
+ OsgiBundleXmlApplicationContext applicationContext = (OsgiBundleXmlApplicationContext) this.context.getService(serviceReferences[0]);
+
+ Object ltwBean = applicationContext.getBean(ConfigurableApplicationContext.LOAD_TIME_WEAVER_BEAN_NAME);
+ assertNotNull(ltwBean);
+ assertTrue(ltwBean.getClass().getName().startsWith("org.eclipse.virgo.kernel.dm")); // don't want direct class references because I want to avoid an import-package
+
+ Object mbeanExporterBean = applicationContext.getBean("mbeanExporter");
+ assertNotNull(mbeanExporterBean);
+ assertTrue(mbeanExporterBean.getClass().getName().startsWith("org.eclipse.virgo.kernel.dm")); // don't want direct class references because I want to avoid an import-package
+
+ OsgiServiceProxyFactoryBean referenceBean = (OsgiServiceProxyFactoryBean) applicationContext.getBean("&reference");
+ assertNotNull(referenceBean);
+ assertEquals(ImportContextClassLoader.UNMANAGED, referenceBean.getContextClassLoader());
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/ffdc/test/FFDCServiceAspectTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/ffdc/test/FFDCServiceAspectTests.java
new file mode 100644
index 00000000..00cff35c
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/ffdc/test/FFDCServiceAspectTests.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.ffdc.test;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+
+import org.eclipse.virgo.kernel.test.AbstractKernelIntegrationTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+/**
+ */
+public class FFDCServiceAspectTests extends AbstractKernelIntegrationTest {
+
+ @Ignore("Cannot weave test projects in Ant yet")
+ @Test
+ //
+ public void ffdcAspectTriggersDump() {
+ int countBefore = dumpFileCount();
+ try {
+ new Foo().dodgy();
+ } catch (RuntimeException e) {
+ // ignore
+ }
+ int countAfter = dumpFileCount();
+ assertEquals(countBefore + 1, countAfter);
+ }
+
+ private int dumpFileCount() {
+ File dumpDir = new File("target/dumpfiles");
+ String[] list = dumpDir.list();
+ return (list == null ? 0 : list.length);
+ }
+
+ private static class Foo {
+
+ public void dodgy() {
+ throw new RuntimeException();
+ }
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkIntegrationTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkIntegrationTests.java
new file mode 100644
index 00000000..5b1b4bbc
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkIntegrationTests.java
@@ -0,0 +1,298 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.osgi.test;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Version;
+
+import org.eclipse.virgo.kernel.osgi.framework.OsgiFrameworkUtils;
+import org.eclipse.virgo.kernel.osgi.framework.OsgiServiceHolder;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiExportPackage;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFramework;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFrameworkFactory;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiImportPackage;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiPackageResolutionFailure;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiRequiredBundle;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiResolutionFailure;
+import org.eclipse.virgo.kernel.test.AbstractKernelIntegrationTest;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifestFactory;
+import org.eclipse.virgo.util.osgi.manifest.RequireBundle;
+
+/**
+ */
+public class QuasiFrameworkIntegrationTests extends AbstractKernelIntegrationTest {
+
+ private static final String EXPORTER_BSN = "exporter";
+
+ private static final String IMPORTER_BSN = "importer";
+
+ private static final String REQUIRING_BSN = "requirer";
+
+ private static final String IMPORTER_JAR_PATH = "src/test/resources/quasi/simpleimporter.jar";
+
+ private static final String EXPORTER_JAR_PATH = "src/test/resources/quasi/simpleexporter.jar";
+
+ private static final String QUASI_TEST_PACKAGE = "quasi.test";
+
+ private static final Version BUNDLE_VERSION = new Version("2.3");
+
+ private QuasiFrameworkFactory quasiFrameworkFactory;
+
+ private QuasiFramework quasiFramework;
+
+ @Before
+ public void setUp() {
+ BundleContext bundleContext = this.framework.getBundleContext();
+ OsgiServiceHolder<QuasiFrameworkFactory> holder = OsgiFrameworkUtils.getService(bundleContext, QuasiFrameworkFactory.class);
+ this.quasiFrameworkFactory = holder.getService();
+ Assert.assertNotNull(this.quasiFrameworkFactory);
+ this.quasiFramework = this.quasiFrameworkFactory.create();
+ Assert.assertNotNull(this.quasiFramework);
+ }
+
+ @Test
+ public void testInstall() throws Exception {
+ BundleManifest bundleManifest = getBundleManifest("test", BUNDLE_VERSION);
+
+ QuasiBundle quasiBundle = this.quasiFramework.install(new URI("test"), bundleManifest);
+ Assert.assertEquals("test", quasiBundle.getSymbolicName());
+ Assert.assertEquals(BUNDLE_VERSION, quasiBundle.getVersion());
+ Assert.assertFalse(quasiBundle.isResolved());
+ Assert.assertNull(quasiBundle.getBundle());
+
+ long bundleId = quasiBundle.getBundleId();
+ Assert.assertFalse(bundleId == 0);
+ Assert.assertEquals(quasiBundle, this.quasiFramework.getBundle(bundleId));
+ }
+
+ @Test
+ public void testBasicResolve() throws Exception {
+ QuasiBundle exporterQuasiBundle = installExporterBundle();
+
+ List<QuasiResolutionFailure> resolutionFailures = this.quasiFramework.resolve();
+ Assert.assertNotNull(resolutionFailures);
+ Assert.assertEquals(0, resolutionFailures.size());
+ Assert.assertTrue(exporterQuasiBundle.isResolved());
+ }
+
+ @Test
+ public void testWiringResolve() throws Exception {
+ QuasiBundle importerQuasiBundle = installImporterBundle();
+ QuasiBundle exporterQuasiBundle = installExporterBundle();
+
+ List<QuasiResolutionFailure> resolutionFailures = this.quasiFramework.resolve();
+ Assert.assertNotNull(resolutionFailures);
+ Assert.assertEquals(0, resolutionFailures.size());
+ Assert.assertTrue(importerQuasiBundle.isResolved());
+ Assert.assertTrue(exporterQuasiBundle.isResolved());
+ }
+
+ @Test
+ public void testFailedResolve() throws Exception {
+ QuasiBundle importerQuasiBundle = installImporterBundle();
+
+ List<QuasiResolutionFailure> resolutionFailures = this.quasiFramework.resolve();
+ Assert.assertNotNull(resolutionFailures);
+ Assert.assertEquals(1, resolutionFailures.size());
+ QuasiResolutionFailure failure = resolutionFailures.get(0);
+ Assert.assertTrue(failure instanceof QuasiPackageResolutionFailure);
+ QuasiPackageResolutionFailure qprFailure = (QuasiPackageResolutionFailure) failure;
+ Assert.assertEquals(QUASI_TEST_PACKAGE, qprFailure.getPackage());
+ Assert.assertFalse(importerQuasiBundle.isResolved());
+ }
+
+ @Test
+ public void testPackageWiringExploration() throws Exception {
+ QuasiBundle importerQuasiBundle = installImporterBundle();
+ QuasiBundle exporterQuasiBundle = installExporterBundle();
+
+ List<QuasiResolutionFailure> resolutionFailures = this.quasiFramework.resolve();
+ Assert.assertNotNull(resolutionFailures);
+ Assert.assertEquals(0, resolutionFailures.size());
+ Assert.assertTrue(importerQuasiBundle.isResolved());
+ Assert.assertTrue(exporterQuasiBundle.isResolved());
+
+ checkGetBundles(importerQuasiBundle, exporterQuasiBundle);
+
+ checkDependents(importerQuasiBundle, exporterQuasiBundle);
+
+ QuasiImportPackage qip = checkImportPackages(importerQuasiBundle, exporterQuasiBundle);
+
+ QuasiExportPackage qep = checkExportPackages(importerQuasiBundle, exporterQuasiBundle);
+
+ checkConsumers(qep, qip);
+
+ checkProvider(qip, qep);
+ }
+
+ @Test
+ public void testRequiredBundleExploration() throws Exception {
+ QuasiBundle requiringQuasiBundle = installRequiringBundle();
+ QuasiBundle exporterQuasiBundle = installExporterBundle();
+
+ List<QuasiResolutionFailure> resolutionFailures = this.quasiFramework.resolve();
+ Assert.assertNotNull(resolutionFailures);
+ Assert.assertEquals(0, resolutionFailures.size());
+ Assert.assertTrue(requiringQuasiBundle.isResolved());
+ Assert.assertTrue(exporterQuasiBundle.isResolved());
+
+ checkGetBundles(requiringQuasiBundle, exporterQuasiBundle);
+
+ List<QuasiRequiredBundle> requiredBundles = requiringQuasiBundle.getRequiredBundles();
+ Assert.assertEquals(1, requiredBundles.size());
+ QuasiRequiredBundle quasiRequiredBundle = requiredBundles.get(0);
+ QuasiBundle provider = quasiRequiredBundle.getProvider();
+ Assert.assertEquals(exporterQuasiBundle, provider);
+
+ }
+
+ private void checkProvider(QuasiImportPackage qip, QuasiExportPackage qep) {
+ QuasiExportPackage provider = qip.getProvider();
+ Assert.assertEquals(qep, provider);
+ }
+
+ private void checkConsumers(QuasiExportPackage qep, QuasiImportPackage qip) {
+ List<QuasiImportPackage> consumers = qep.getConsumers();
+ Assert.assertEquals(1, consumers.size());
+ QuasiImportPackage consumer = consumers.get(0);
+ Assert.assertEquals(qip, consumer);
+ }
+
+ private QuasiImportPackage checkImportPackages(QuasiBundle importerQuasiBundle, QuasiBundle exporterQuasiBundle) {
+ List<QuasiImportPackage> exporterImportPackages = exporterQuasiBundle.getImportPackages();
+ Assert.assertEquals(0, exporterImportPackages.size());
+
+ List<QuasiImportPackage> importPackages = importerQuasiBundle.getImportPackages();
+ Assert.assertEquals(1, importPackages.size());
+ QuasiImportPackage qip = importPackages.get(0);
+ Assert.assertEquals("quasi.test", qip.getPackageName());
+ return qip;
+ }
+
+ private QuasiExportPackage checkExportPackages(QuasiBundle importerQuasiBundle, QuasiBundle exporterQuasiBundle) {
+ Assert.assertEquals(0, importerQuasiBundle.getExportPackages().size());
+
+ List<QuasiExportPackage> exportPackages = exporterQuasiBundle.getExportPackages();
+ Assert.assertEquals(1, exportPackages.size());
+ QuasiExportPackage qep = exportPackages.get(0);
+ Assert.assertEquals("quasi.test", qep.getPackageName());
+ return qep;
+ }
+
+ private void checkDependents(QuasiBundle importerQuasiBundle, QuasiBundle exporterQuasiBundle) {
+ List<QuasiBundle> dependents = exporterQuasiBundle.getDependents();
+ Assert.assertEquals(1, dependents.size());
+ Assert.assertEquals(importerQuasiBundle, dependents.get(0));
+ }
+
+ private void checkGetBundles(QuasiBundle importerQuasiBundle, QuasiBundle exporterQuasiBundle) {
+ List<QuasiBundle> quasiBundles = this.quasiFramework.getBundles();
+
+ boolean foundImporter = false;
+ boolean foundExporter = false;
+
+ for (QuasiBundle quasiBundle : quasiBundles) {
+ if (quasiBundle.equals(importerQuasiBundle)) {
+ foundImporter = true;
+ }
+ if (quasiBundle.equals(exporterQuasiBundle)) {
+ foundExporter = true;
+ }
+
+ }
+
+ Assert.assertTrue(foundImporter);
+ Assert.assertTrue(foundExporter);
+ }
+
+ @Test
+ public void testCommit() throws Exception {
+ QuasiBundle importerQuasiBundle = installImporterBundle();
+ QuasiBundle exporterQuasiBundle = installExporterBundle();
+
+ List<QuasiResolutionFailure> resolutionFailures = this.quasiFramework.resolve();
+ Assert.assertNotNull(resolutionFailures);
+ Assert.assertEquals(0, resolutionFailures.size());
+ this.quasiFramework.commit();
+
+ Assert.assertTrue(importerQuasiBundle.isResolved());
+ Bundle importerBundle = importerQuasiBundle.getBundle();
+ Assert.assertNotNull(importerBundle);
+ Assert.assertEquals(IMPORTER_BSN, importerBundle.getSymbolicName());
+
+ Assert.assertTrue(exporterQuasiBundle.isResolved());
+ Bundle exporterBundle = exporterQuasiBundle.getBundle();
+ Assert.assertNotNull(exporterBundle);
+ Assert.assertEquals(EXPORTER_BSN, exporterBundle.getSymbolicName());
+ }
+
+ private QuasiBundle installExporterBundle() throws BundleException, URISyntaxException {
+ QuasiBundle exporterQuasiBundle;
+ BundleManifest exporterBundleManifest = getBundleManifest(EXPORTER_BSN, BUNDLE_VERSION);
+ exporterBundleManifest.getExportPackage().addExportedPackage(QUASI_TEST_PACKAGE);
+
+ exporterQuasiBundle = this.quasiFramework.install(new URI(EXPORTER_JAR_PATH), exporterBundleManifest);
+ Assert.assertEquals(EXPORTER_BSN, exporterQuasiBundle.getSymbolicName());
+ Assert.assertEquals(BUNDLE_VERSION, exporterQuasiBundle.getVersion());
+ Assert.assertFalse(exporterQuasiBundle.isResolved());
+ Assert.assertNull(exporterQuasiBundle.getBundle());
+ return exporterQuasiBundle;
+ }
+
+ private QuasiBundle installImporterBundle() throws BundleException, URISyntaxException {
+ QuasiBundle importerQuasiBundle;
+ BundleManifest importerBundleManifest = getBundleManifest(IMPORTER_BSN, BUNDLE_VERSION);
+ importerBundleManifest.getImportPackage().addImportedPackage(QUASI_TEST_PACKAGE);
+
+ importerQuasiBundle = this.quasiFramework.install(new URI(IMPORTER_JAR_PATH), importerBundleManifest);
+ Assert.assertEquals(IMPORTER_BSN, importerQuasiBundle.getSymbolicName());
+ Assert.assertEquals(BUNDLE_VERSION, importerQuasiBundle.getVersion());
+ Assert.assertFalse(importerQuasiBundle.isResolved());
+ Assert.assertNull(importerQuasiBundle.getBundle());
+ return importerQuasiBundle;
+ }
+
+ private QuasiBundle installRequiringBundle() throws BundleException, URISyntaxException {
+ QuasiBundle requiringQuasiBundle;
+ BundleManifest requiringBundleManifest = getBundleManifest(REQUIRING_BSN, BUNDLE_VERSION);
+ RequireBundle requireBundle = requiringBundleManifest.getRequireBundle();
+ requireBundle.addRequiredBundle(EXPORTER_BSN);
+
+ requiringQuasiBundle = this.quasiFramework.install(new URI(IMPORTER_JAR_PATH), requiringBundleManifest);
+ Assert.assertEquals(REQUIRING_BSN, requiringQuasiBundle.getSymbolicName());
+ Assert.assertEquals(BUNDLE_VERSION, requiringQuasiBundle.getVersion());
+ Assert.assertFalse(requiringQuasiBundle.isResolved());
+ Assert.assertNull(requiringQuasiBundle.getBundle());
+ return requiringQuasiBundle;
+ }
+
+ private BundleManifest getBundleManifest(String symbolicName, Version bundleVersion) {
+ BundleManifest bundleManifest;
+ bundleManifest = BundleManifestFactory.createBundleManifest();
+ bundleManifest.setBundleManifestVersion(2);
+ bundleManifest.getBundleSymbolicName().setSymbolicName(symbolicName);
+ bundleManifest.setBundleVersion(bundleVersion);
+ return bundleManifest;
+ }
+
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkStateDumpIntegrationTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkStateDumpIntegrationTests.java
new file mode 100644
index 00000000..c238c264
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/QuasiFrameworkStateDumpIntegrationTests.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.osgi.test;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.zip.ZipException;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Version;
+
+import org.eclipse.virgo.kernel.osgi.framework.OsgiFrameworkUtils;
+import org.eclipse.virgo.kernel.osgi.framework.OsgiServiceHolder;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiBundle;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFramework;
+import org.eclipse.virgo.kernel.osgi.quasi.QuasiFrameworkFactory;
+import org.eclipse.virgo.kernel.test.AbstractKernelIntegrationTest;
+import org.eclipse.virgo.util.io.PathReference;
+import org.eclipse.virgo.util.io.ZipUtils;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifestFactory;
+
+/**
+ */
+public class QuasiFrameworkStateDumpIntegrationTests extends AbstractKernelIntegrationTest {
+
+ private static final String IMPORTER_BSN = "importer";
+
+ private static final String IMPORTER_JAR_PATH = "src/test/resources/quasi/simpleimporter.jar";
+
+ private static final String QUASI_TEST_PACKAGE = "quasi.test";
+
+ private static final Version BUNDLE_VERSION = new Version("2.3");
+
+ private QuasiFrameworkFactory quasiFrameworkFactory;
+
+ private QuasiFramework quasiFramework;
+
+ private File dumpDir;
+
+ @Before
+ public void setUp() {
+ BundleContext bundleContext = this.framework.getBundleContext();
+ OsgiServiceHolder<QuasiFrameworkFactory> holder = OsgiFrameworkUtils.getService(bundleContext, QuasiFrameworkFactory.class);
+ this.quasiFrameworkFactory = holder.getService();
+ Assert.assertNotNull(this.quasiFrameworkFactory);
+ this.quasiFramework = this.quasiFrameworkFactory.create();
+ Assert.assertNotNull(this.quasiFramework);
+ this.dumpDir = new File("target/serviceability/dump/");
+ }
+
+ @Test
+ public void testStateDump() throws Exception {
+
+ Set<File> oldFileSet = getDumpFiles();
+
+ installImporterBundle();
+ this.quasiFramework.resolve();
+
+ Set<File> newFileSet = getDumpFiles();
+ newFileSet.removeAll(oldFileSet);
+ Assert.assertEquals(1, newFileSet.size());
+
+ File dump = newFileSet.iterator().next();
+
+ QuasiFramework stateDump = this.quasiFrameworkFactory.create(getStateDump(dump));
+ List<QuasiBundle> bundles = stateDump.getBundles();
+ boolean found = false;
+ for (QuasiBundle quasiBundle : bundles) {
+ if (IMPORTER_BSN.equals(quasiBundle.getSymbolicName())) {
+ found = true;
+ }
+ }
+ Assert.assertTrue(found);
+
+ }
+
+ private File getStateDump(File dump) throws ZipException, IOException {
+ File stateDump;
+ Assert.assertFalse(dump == null);
+ File[] stateDumpZipFiles = dump.listFiles(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ return name.equals("osgi.zip");
+ }
+ });
+ Assert.assertEquals(1, stateDumpZipFiles.length);
+ File stateDumpZipFile = stateDumpZipFiles[0];
+
+ stateDump = unzip(stateDumpZipFile);
+ return stateDump;
+ }
+
+ private File unzip(File stateDumpZipFile) throws IOException {
+ PathReference zipFile = new PathReference(stateDumpZipFile);
+ String stateDumpFileName = getTmpDir();
+ PathReference dest = new PathReference(stateDumpFileName);
+ ZipUtils.unzipTo(zipFile, dest);
+ return dest.newChild("state").toFile();
+ }
+
+ private static String getTmpDir() {
+ return System.getProperty("java.io.tmpdir") + File.separator + QuasiFrameworkStateDumpIntegrationTests.class.getSimpleName()
+ + System.currentTimeMillis();
+ }
+
+ private Set<File> getDumpFiles() {
+ Set<File> oldFileSet = null;
+ {
+ File[] oldFiles = this.dumpDir.listFiles();
+ oldFileSet = new HashSet<File>();
+ for (File oldFile : oldFiles) {
+ oldFileSet.add(oldFile);
+ }
+ }
+ return oldFileSet;
+ }
+
+ private QuasiBundle installImporterBundle() throws BundleException, URISyntaxException {
+ QuasiBundle importerQuasiBundle;
+ BundleManifest importerBundleManifest = getBundleManifest(IMPORTER_BSN, BUNDLE_VERSION);
+ importerBundleManifest.getImportPackage().addImportedPackage(QUASI_TEST_PACKAGE);
+
+ importerQuasiBundle = this.quasiFramework.install(new URI(IMPORTER_JAR_PATH), importerBundleManifest);
+ Assert.assertEquals(IMPORTER_BSN, importerQuasiBundle.getSymbolicName());
+ Assert.assertEquals(BUNDLE_VERSION, importerQuasiBundle.getVersion());
+ Assert.assertFalse(importerQuasiBundle.isResolved());
+ Assert.assertNull(importerQuasiBundle.getBundle());
+ return importerQuasiBundle;
+ }
+
+ private BundleManifest getBundleManifest(String symbolicName, Version bundleVersion) {
+ BundleManifest bundleManifest;
+ bundleManifest = BundleManifestFactory.createBundleManifest();
+ bundleManifest.setBundleManifestVersion(2);
+ bundleManifest.getBundleSymbolicName().setSymbolicName(symbolicName);
+ bundleManifest.setBundleVersion(bundleVersion);
+ return bundleManifest;
+ }
+
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/RegionTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/RegionTests.java
new file mode 100644
index 00000000..777ffada
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/osgi/test/RegionTests.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.osgi.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+import org.eclipse.virgo.kernel.osgi.region.Region;
+import org.eclipse.virgo.kernel.test.AbstractKernelIntegrationTest;
+
+/**
+ */
+public class RegionTests extends AbstractKernelIntegrationTest {
+
+ @Test
+ public void testGetUserRegion() throws Exception {
+ ServiceReference[] serviceReferences = lookupRegionServices("org.eclipse.virgo.region.user");
+ assertRegion(serviceReferences);
+ }
+
+ private void assertRegion(ServiceReference[] serviceReferences) {
+ assertEquals(1, serviceReferences.length);
+
+ Region userRegion = (Region) this.kernelContext.getService(serviceReferences[0]);
+ assertNotNull(userRegion);
+ assertNotNull(userRegion.getBundleContext());
+ }
+
+ private ServiceReference[] lookupRegionServices(String name) throws InvalidSyntaxException {
+ return this.kernelContext.getServiceReferences(Region.class.getName(), String.format("(org.eclipse.virgo.kernel.region.name=%s)",name));
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/AbstractKernelIntegrationTest.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/AbstractKernelIntegrationTest.java
new file mode 100644
index 00000000..0c295d1c
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/AbstractKernelIntegrationTest.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.test;
+
+import java.lang.management.ManagementFactory;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.framework.SurrogateBundle;
+
+import org.eclipse.virgo.kernel.osgi.framework.OsgiFramework;
+import org.eclipse.virgo.test.framework.dmkernel.DmKernelTestRunner;
+
+@RunWith(DmKernelTestRunner.class)
+@SuppressWarnings("deprecation")
+public abstract class AbstractKernelIntegrationTest {
+
+ protected volatile BundleContext kernelContext;
+
+ protected volatile BundleContext context = FrameworkUtil.getBundle(AbstractKernelIntegrationTest.class).getBundleContext();
+
+ protected volatile OsgiFramework framework;
+
+ @Before
+ public void setup() {
+ ServiceReference serviceReference = this.context.getServiceReference(OsgiFramework.class.getName());
+ if (serviceReference != null) {
+ this.framework = (OsgiFramework) this.context.getService(serviceReference);
+ }
+
+ Bundle bundle = this.context.getBundle(1);
+ if (bundle instanceof SurrogateBundle) {
+ this.kernelContext = ((SurrogateBundle)bundle).getCompositeBundleContext();
+ }
+ }
+
+ @BeforeClass
+ public static void awaitKernelStartup() throws Exception {
+ MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
+ while (!"STARTED".equals(platformMBeanServer.getAttribute(new ObjectName("org.eclipse.virgo.kernel:type=KernelStatus"), "Status"))) {
+ Thread.sleep(50);
+ }
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/ManifestUtils.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/ManifestUtils.java
new file mode 100644
index 00000000..056950ba
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/ManifestUtils.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.test;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.eclipse.virgo.util.io.FileCopyUtils;
+
+/**
+ * Utility class for extracting a {@link Reader} for manifest data in a JAR file and in exploded JAR directories.
+ * <p/>
+ *
+ * <strong>Concurrent Semantics</strong><br />
+ *
+ * Threadsafe.
+ *
+ */
+public final class ManifestUtils {
+
+ private static final String MANIFEST_DIRECTORY_LOCATION = "META-INF" + File.separator + "MANIFEST.MF";
+
+ private static final String MANIFEST_ENTRY = "META-INF/MANIFEST.MF";
+
+ /**
+ * Creates a {@link Reader} for the manifest in the supplied exploded JAR directory.
+ *
+ * @param directory the exploded JAR directory.
+ * @return the <code>Reader</code> or <code>null</code> if the manifest cannot be found.
+ */
+ public static final Reader manifestReaderFromExplodedDirectory(File directory) {
+ if (directory == null || !directory.isDirectory()) {
+ throw new IllegalArgumentException("Must supply a valid directory");
+ }
+ try {
+ File manifestFile = new File(directory.getAbsolutePath() + File.separator + MANIFEST_DIRECTORY_LOCATION);
+ if (manifestFile.exists()) {
+ return new FileReader(manifestFile);
+ } else {
+ return null;
+ }
+ } catch (IOException e) {
+ throw new RuntimeException("Unable to read MANIFEST for exploded directory '" + directory.getAbsolutePath() + "'.", e);
+ }
+ }
+
+ /**
+ * Creates a {@link Reader} for the manifest in the supplied JAR file.
+ *
+ * @param file the JAR file.
+ * @return the <code>Reader</code> or <code>null</code> if the manifest cannot be found.
+ */
+ public static final Reader manifestReaderFromJar(File file) {
+ JarFile jar = null;
+ try {
+ jar = new JarFile(file);
+ JarEntry entry = jar.getJarEntry(MANIFEST_ENTRY);
+ if (entry != null) {
+ StringWriter writer = new StringWriter();
+ FileCopyUtils.copy(new InputStreamReader(jar.getInputStream(entry)), writer);
+ jar.close();
+ return new StringReader(writer.toString());
+ } else {
+ return null;
+ }
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot read MANIFEST.MF from jar '" + file.getAbsolutePath() + "'.", e);
+ } finally {
+ if (jar != null) {
+ try {
+ jar.close();
+ } catch (IOException ioe) {
+ throw new RuntimeException("Failed to close jar '" + file.getAbsolutePath() + "'.", ioe);
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterSignallingTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterSignallingTests.java
new file mode 100644
index 00000000..6d6fd16a
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterSignallingTests.java
@@ -0,0 +1,297 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.eclipse.virgo.kernel.core.BundleStarter;
+import org.eclipse.virgo.kernel.core.Signal;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+
+
+/**
+ */
+public class StandardBundleStarterSignallingTests extends AbstractKernelIntegrationTest {
+
+ private BundleStarter monitor;
+
+ @Before
+ public void before() {
+ ServiceReference serviceReference = this.kernelContext.getServiceReference(BundleStarter.class.getName());
+ this.monitor = (BundleStarter) this.kernelContext.getService(serviceReference);
+ assertNotNull(this.monitor);
+ }
+
+ @Test
+ public void signalSuccess() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/success"));
+ assertNotNull(bundle);
+ TestSignal ts = new TestSignal();
+ this.monitor.start(bundle, ts);
+ while (!ts.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts.getCause());
+ }
+
+ @Test
+ public void signalSuccessAwait() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/success"));
+ assertNotNull(bundle);
+ bundle.start();
+ TestSignal ts = new TestSignal();
+ this.monitor.start(bundle, ts);
+ while (!ts.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts.getCause());
+ }
+
+ @Test
+ public void signalFailure() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/failure"));
+ assertNotNull(bundle);
+ TestSignal ts = new TestSignal();
+ this.monitor.start(bundle, ts);
+ while (!ts.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNotNull(ts.getCause());
+ }
+
+ @Test
+ public void signalNonDm() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/nondm"));
+ assertNotNull(bundle);
+ TestSignal ts = new TestSignal();
+ this.monitor.start(bundle, ts);
+ waitForComplete(ts, 1000);
+ assertTrue(ts.isComplete());
+ assertNull(ts.getCause());
+ }
+
+ private void waitForComplete(TestSignal ts, long millisTotal) {
+ long countWaits = millisTotal/100;
+ if (countWaits > 0) {
+ while (!ts.isComplete()){
+ if (countWaits-- == 0) break;
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ continue;
+ }
+ }
+ }
+ }
+
+ @Test
+ public void signalSuccessMultiple() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/success"));
+ assertNotNull(bundle);
+ TestSignal ts1 = new TestSignal();
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ this.monitor.start(bundle, ts2);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts1.getCause());
+ assertNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalSuccessMultipleWithGap() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/success"));
+ assertNotNull(bundle);
+ TestSignal ts1 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts2);
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts1.getCause());
+ assertNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalSuccessAwaitMultiple() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/success"));
+ assertNotNull(bundle);
+ bundle.start();
+ TestSignal ts1 = new TestSignal();
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ this.monitor.start(bundle, ts2);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts1.getCause());
+ assertNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalFailureMultiple() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/failure"));
+ assertNotNull(bundle);
+ TestSignal ts1 = new TestSignal();
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ this.monitor.start(bundle, ts2);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNotNull(ts1.getCause());
+ assertNotNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalFailureMultipleWithGap() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/failure"));
+ assertNotNull(bundle);
+ TestSignal ts1 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts2);
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNotNull(ts1.getCause());
+ assertNotNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalNonDmMultiple() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/nondm"));
+ assertNotNull(bundle);
+ TestSignal ts1 = new TestSignal();
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ this.monitor.start(bundle, ts2);
+ while(!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts1.getCause());
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalDelayedSuccessMultiple() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/delay"));
+ assertNotNull(bundle);
+ TestSignal ts1 = new TestSignal();
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ this.monitor.start(bundle, ts2);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts1.getCause());
+ assertNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalDelayedSuccessMultipleWithGap() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/delay"));
+ assertNotNull(bundle);
+ TestSignal ts1 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts2);
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts1.getCause());
+ assertNull(ts2.getCause());
+ }
+
+ @Test
+ public void signalDelayedSuccessAwaitMultiple() throws Exception {
+ Bundle bundle = installBundle(new File("src/test/resources/monitor/delay"));
+ assertNotNull(bundle);
+ bundle.start();
+ TestSignal ts1 = new TestSignal();
+ TestSignal ts2 = new TestSignal();
+ this.monitor.start(bundle, ts1);
+ this.monitor.start(bundle, ts2);
+ while (!ts1.isComplete()) {
+ Thread.sleep(100);
+ }
+ while(!ts2.isComplete()) {
+ Thread.sleep(100);
+ }
+ assertNull(ts1.getCause());
+ assertNull(ts2.getCause());
+ }
+
+ private Bundle installBundle(File bundleFile) throws BundleException {
+ return this.context.installBundle(bundleFile.toURI().toString());
+ }
+
+ private static class TestSignal implements Signal {
+
+ private volatile boolean complete = false;
+
+ private volatile Throwable cause = null;
+
+ public void signalSuccessfulCompletion() {
+ this.complete = true;
+
+ }
+
+ public void signalFailure(Throwable t) {
+ this.complete = true;
+ this.cause = t;
+ }
+
+ public boolean isComplete() {
+ return this.complete;
+ }
+
+ public Throwable getCause() {
+ return this.cause;
+ }
+
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterTests.java
new file mode 100644
index 00000000..ac88ee96
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardBundleStarterTests.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.test;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+
+import org.eclipse.virgo.kernel.core.BundleStarter;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+
+
+/**
+ */
+public class StandardBundleStarterTests extends AbstractKernelIntegrationTest {
+
+ private BundleStarter monitor;
+
+ @Before
+ public void before() {
+ ServiceReference serviceReference = this.kernelContext.getServiceReference(BundleStarter.class.getName());
+ this.monitor = (BundleStarter) this.kernelContext.getService(serviceReference);
+ assertNotNull(this.monitor);
+ }
+
+ @Test
+ public void success() throws Exception {
+ Bundle bundle = this.context.installBundle(new File("src/test/resources/monitor/success").toURI().toString());
+
+ TestSignal signal = new TestSignal();
+
+ this.monitor.start(bundle, signal);
+
+ signal.assertSuccessfulCompletionSignalled(5000);
+ }
+
+ @Test
+ public void failure() throws Exception {
+ Bundle bundle = this.context.installBundle(new File("src/test/resources/monitor/failure").toURI().toString());
+
+ TestSignal signal = new TestSignal();
+
+ this.monitor.start(bundle, signal);
+
+ signal.assertFailureSignalled(5000);
+ }
+
+ @Test
+ public void nonDm() throws Exception {
+ Bundle bundle = this.context.installBundle(new File("src/test/resources/monitor/nondm").toURI().toString());
+ TestSignal signal = new TestSignal();
+
+ this.monitor.start(bundle, signal);
+
+ signal.assertSuccessfulCompletionSignalled(5000);
+ }
+
+ @Test
+ public void signalDelayedSuccess() throws Exception {
+ Bundle bundle = this.context.installBundle(new File("src/test/resources/monitor/delay").toURI().toString());
+ TestSignal signal = new TestSignal();
+ this.monitor.start(bundle, signal);
+
+ signal.assertSuccessfulCompletionSignalled(20000);
+
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardKernelIntegrationTests.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardKernelIntegrationTests.java
new file mode 100644
index 00000000..b17a824f
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/StandardKernelIntegrationTests.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.test;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.eclipse.virgo.kernel.deployer.core.ApplicationDeployer;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+
+/**
+ */
+public class StandardKernelIntegrationTests extends AbstractKernelIntegrationTest {
+
+ @Test
+ public void testRunKernelBundle() throws Exception {
+ ServiceReference serviceReference = context.getServiceReference(ApplicationDeployer.class.getName());
+ assertNotNull("Application deployer service was not present", serviceReference);
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/TestSignal.java b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/TestSignal.java
new file mode 100644
index 00000000..570e118e
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/java/org/eclipse/virgo/kernel/test/TestSignal.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ *******************************************************************************/
+
+package org.eclipse.virgo.kernel.test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.virgo.kernel.core.Signal;
+
+
+public final class TestSignal implements Signal {
+
+ private final AtomicReference<Throwable> causeReference = new AtomicReference<Throwable>(null);
+
+ private final CountDownLatch completionLatch = new CountDownLatch(1);
+
+ /**
+ * {@inheritDoc}
+ */
+ public void signalFailure(Throwable cause) {
+ causeReference.set(cause);
+ completionLatch.countDown();
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void signalSuccessfulCompletion() {
+ completionLatch.countDown();
+ }
+
+ public void assertSuccessfulCompletionSignalled(long msTimeout) throws InterruptedException {
+ assertTrue(completionLatch.await(msTimeout, TimeUnit.MILLISECONDS));
+ assertNull(causeReference.get());
+ }
+
+ public void assertFailureSignalled(long msTimeout) throws InterruptedException {
+ assertTrue(completionLatch.await(msTimeout, TimeUnit.MILLISECONDS));
+ assertNotNull(causeReference.get());
+ }
+}
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..2a443f17
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Export-Package: org.eclipse.virgo.kernel.osgi.test;version="2.1.0";uses:="org.eclipse.virgo.kernel.test,org.junit",
+ org.eclipse.virgo.kernel.concurrent.test;version="2.1.0";uses:="org.eclipse.virgo.kernel.core,org.eclipse.virgo.kernel.test,org.junit",
+ org.eclipse.virgo.kernel.dm.test;version="2.1.0";uses:="org.eclipse.virgo.kernel.test,org.junit",
+ org.eclipse.virgo.kernel.ffdc.test;version="2.1.0";uses:="org.eclipse.virgo.kernel.test,org.junit",
+ org.eclipse.virgo.kernel.test;version="2.1.0";uses:="org.eclipse.virgo.kernel.core,org.junit,org.junit.runner"
+Bundle-Version: 2.1.0
+Tool: Bundlor not used
+Bundle-Name: Virgo Kernel Test
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.virgo.kernel.test
+Import-Package: org.eclipse.virgo.kernel.osgi.framework;version="[2.1.0,2.2.0)",
+ org.eclipse.virgo.kernel.osgi.quasi;version="[2.1.0,2.2.0)",
+ org.eclipse.virgo.kernel.osgi.region;version="[2.1.0,2.2.0)",
+ javax.management;version=0,
+ org.eclipse.virgo.kernel.core;version="[2.1.0,2.2.0)",
+ org.eclipse.virgo.kernel.deployer.core;version="[2.1.0,2.2.0)",
+ org.eclipse.virgo.util.io;version="[2.1,2.2)",
+ org.eclipse.virgo.util.osgi.manifest;version="[2.1,2.2)",
+ org.junit;version="[4.5.0,5)",
+ org.junit.runner;version="[4.5.0,5)",
+ org.osgi.framework;version=0,
+ org.osgi.service.framework;version=0,
+ org.springframework.context;version="[2.5.6,3.1)",
+ org.springframework.osgi.context.support;version="[1.2.1,2)",
+ org.springframework.osgi.service.importer.support;version="[1.2.1,2)"
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/META-INF/test.config.properties b/org.eclipse.virgo.kernel.test/src/test/resources/META-INF/test.config.properties
new file mode 100644
index 00000000..fe9607b2
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/META-INF/test.config.properties
@@ -0,0 +1,60 @@
+launcher.bundles =\
+ file:../ivy-cache/repository/org.slf4j/com.springsource.slf4j.api/${org.slf4j}/com.springsource.slf4j.api-${org.slf4j}.jar@start,\
+ file:../ivy-cache/repository/org.slf4j/com.springsource.slf4j.org.apache.commons.logging/${org.slf4j}/com.springsource.slf4j.org.apache.commons.logging-${org.slf4j}.jar@start,\
+ file:../ivy-cache/repository/org.aspectj/com.springsource.org.aspectj.runtime/${org.aspectj}/com.springsource.org.aspectj.runtime-${org.aspectj}.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.medic/org.eclipse.virgo.medic/${org.eclipse.virgo.medic}/org.eclipse.virgo.medic-${org.eclipse.virgo.medic}.jar@start,\
+ file:../ivy-cache/repository/org.apache.felix/org.apache.felix.configadmin/${org.apache.felix}/org.apache.felix.configadmin-${org.apache.felix}.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.medic/org.eclipse.virgo.medic.core/${org.eclipse.virgo.medic}/org.eclipse.virgo.medic.core-${org.eclipse.virgo.medic}.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/${org.eclipse.virgo.util}/org.eclipse.virgo.util.osgi-${org.eclipse.virgo.util}.jar@start,\
+ file:../ivy-cache/repository/org.apache.felix/org.apache.felix.eventadmin/${org.apache.felix.eventadmin}/org.apache.felix.eventadmin-${org.apache.felix.eventadmin}.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.util/org.eclipse.virgo.util.common/${org.eclipse.virgo.util}/org.eclipse.virgo.util.common-${org.eclipse.virgo.util}.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.util/org.eclipse.virgo.util.io/${org.eclipse.virgo.util}/org.eclipse.virgo.util.io-${org.eclipse.virgo.util}.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.util/org.eclipse.virgo.util.jmx/${org.eclipse.virgo.util}/org.eclipse.virgo.util.jmx-${org.eclipse.virgo.util}.jar,\
+ file:../ivy-cache/repository/org.eclipse.virgo.util/org.eclipse.virgo.util.math/${org.eclipse.virgo.util}/org.eclipse.virgo.util.math-${org.eclipse.virgo.util}.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.util/org.eclipse.virgo.util.parser.manifest/${org.eclipse.virgo.util}/org.eclipse.virgo.util.parser.manifest-${org.eclipse.virgo.util}.jar@start,\
+ file:../ivy-cache/repository/org.apache.commons/com.springsource.org.apache.commons.codec/1.3.0/com.springsource.org.apache.commons.codec-1.3.0.jar@start,\
+ file:../ivy-cache/repository/org.apache.commons/com.springsource.org.apache.commons.httpclient/3.1.0/com.springsource.org.apache.commons.httpclient-3.1.0.jar@start,\
+ file:../ivy-cache/repository/org.eclipse.virgo.repository/org.eclipse.virgo.repository/${org.eclipse.virgo.repository}/org.eclipse.virgo.repository-${org.eclipse.virgo.repository}.jar@start,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.aop/3.0.0.RELEASE/org.springframework.aop-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.asm/3.0.0.RELEASE/org.springframework.asm-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.expression/3.0.0.RELEASE/org.springframework.expression-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.beans/3.0.0.RELEASE/org.springframework.beans-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.core/3.0.0.RELEASE/org.springframework.core-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-3.0.0.RELEASE.jar,\
+ file:../org.eclipse.virgo.kernel.core/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.agent.dm/target/classes@start,\
+ file:../ivy-cache/repository/org.springframework.osgi/org.springframework.osgi.core/1.2.1/org.springframework.osgi.core-1.2.1.jar,\
+ file:../ivy-cache/repository/org.springframework.osgi/org.springframework.osgi.extender/1.2.1/org.springframework.osgi.extender-1.2.1.jar@start,\
+ file:../ivy-cache/repository/org.springframework.osgi/org.springframework.osgi.io/1.2.1/org.springframework.osgi.io-1.2.1.jar,\
+ file:../ivy-cache/repository/org.aopalliance/com.springsource.org.aopalliance/1.0.0/com.springsource.org.aopalliance-1.0.0.jar,\
+ file:../org.eclipse.virgo.kernel.artifact/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.services/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.osgi/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.deployer/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.dm/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.model/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.kerneldmfragment/target/classes,\
+ file:../ivy-cache/repository/net.sourceforge.jline/com.springsource.jline/0.9.94.S2-A/com.springsource.jline-0.9.94.S2-A.jar@start,\
+ file:../org.eclipse.virgo.kernel.shell/target/classes@start
+
+org.eclipse.virgo.test.properties.include=file:../build.versions,file:../build.properties
+
+#Equinox Configuration
+osgi.parentClassloader=fwk
+osgi.context.bootdelegation=false
+osgi.compatibility.bootdelegation=false
+osgi.clean=true
+osgi.configuration.area=target
+
+org.apache.felix.eventadmin.Timeout=0
+
+osgi.java.profile=file:../build-kernel/lib/java6-server.profile
+osgi.java.profile.bootdelegation=override
+osgi.hook.configurators.include=org.eclipse.virgo.osgi.extensions.equinox.hooks.ExtensionsHookConfigurator
+
+org.eclipse.virgo.kernel.home=target
+org.eclipse.virgo.kernel.domain=org.eclipse.virgo.kernel
+# Paths are relative to the current working directory
+org.eclipse.virgo.kernel.config=src/test/resources/config
+
+org.eclipse.virgo.medic.log.config.path=src/test/resources/config/serviceability.xml
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/QuickConsumer.jar b/org.eclipse.virgo.kernel.test/src/test/resources/QuickConsumer.jar
new file mode 100644
index 00000000..5d207fcb
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/QuickConsumer.jar
Binary files differ
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/SlowService.jar b/org.eclipse.virgo.kernel.test/src/test/resources/SlowService.jar
new file mode 100644
index 00000000..4adb7a48
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/SlowService.jar
Binary files differ
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
new file mode 100644
index 00000000..60ece6be
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.properties
@@ -0,0 +1,5 @@
+deployer.timeout= 300
+deployer.pickupDirectory= pickup
+deployer.systemArtifacts=
+shell.enabled= true
+shell.port= 2403
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
new file mode 100644
index 00000000..5f928f33
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.kernel.userregion.properties
@@ -0,0 +1,80 @@
+baseBundles =\
+ file:../ivy-cache/repository/org.springframework/org.springframework.aop/3.0.0.RELEASE/org.springframework.aop-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.asm/3.0.0.RELEASE/org.springframework.asm-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.expression/3.0.0.RELEASE/org.springframework.expression-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.beans/3.0.0.RELEASE/org.springframework.beans-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.core/3.0.0.RELEASE/org.springframework.core-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-3.0.0.RELEASE.jar,\
+ file:../ivy-cache/repository/org.springframework.osgi/org.springframework.osgi.core/1.2.1/org.springframework.osgi.core-1.2.1.jar,\
+ file:../ivy-cache/repository/org.springframework.osgi/org.springframework.osgi.extender/1.2.1/org.springframework.osgi.extender-1.2.1.jar@start,\
+ file:../ivy-cache/repository/org.springframework.osgi/org.springframework.osgi.io/1.2.1/org.springframework.osgi.io-1.2.1.jar,\
+ file:../ivy-cache/repository/org.aopalliance/com.springsource.org.aopalliance/1.0.0/com.springsource.org.aopalliance-1.0.0.jar,\
+ file:../org.eclipse.virgo.kernel.agent.dm/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.deployer.dm/target/classes@start,\
+ file:../org.eclipse.virgo.kernel.dmfragment/target/classes,\
+ file:../org.eclipse.virgo.kernel.userregion/target/classes@start
+
+packageImports =\
+ org.eclipse.virgo.kernel.artifact.*;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.core;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.deployer.core;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.deployer.core.event;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.install.*;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.osgi.*;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.module;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.serviceability;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.serviceability.dump;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.serviceability.enforcement;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.services.work;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.kernel.shim.*;version="[2.1.0,2.1.1)",\
+ org.eclipse.virgo.medic.*;version="[1.0,2)",\
+ org.eclipse.virgo.repository;version="[2.0,3)",\
+ org.eclipse.virgo.util.*;version="[2.0,3)",\
+ org.apache.commons.logging;version="[1.0.0,2.0.0)",\
+ org.aspectj.*;version="[1.6.5.RELEASE,2.0.0)",\
+ org.junit;version="[4.7.0,5.0.0)",\
+ org.junit.runner;version="[4.7.0,5.0.0)",\
+ org.osgi.service.cm;version="0",\
+ org.osgi.service.event;version="0",\
+ org.slf4j;version="[1.5.10,2)",\
+ org.slf4j.spi;version="[1.5.10,2)"
+
+serviceImports =\
+ org.eclipse.virgo.kernel.deployer.core.ApplicationDeployer,\
+ org.eclipse.virgo.kernel.deployer.core.DeployUriNormaliser,\
+ org.eclipse.virgo.kernel.install.artifact.ScopeServiceRepository,\
+ org.eclipse.virgo.kernel.services.work.WorkArea,\
+ org.eclipse.virgo.repository.ArtifactBridge,\
+ org.eclipse.virgo.kernel.shell.state.StateService,\
+ org.eclipse.virgo.repository.RepositoryFactory,\
+ org.eclipse.virgo.medic.eventlog.EventLoggerFactory,\
+ org.eclipse.virgo.repository.Repository,\
+ org.eclipse.virgo.kernel.core.Shutdown,\
+ org.osgi.service.cm.ConfigurationAdmin,\
+ org.osgi.service.event.EventAdmin,\
+ org.eclipse.virgo.medic.dump.DumpGenerator,\
+ org.eclipse.virgo.kernel.shim.scope.ScopeFactory,\
+ org.eclipse.virgo.kernel.shim.serviceability.TracingService
+
+serviceExports =\
+ org.eclipse.virgo.kernel.install.artifact.InstallArtifactLifecycleListener,\
+ org.eclipse.virgo.kernel.install.artifact.ArtifactTypeDeterminer,\
+ org.eclipse.virgo.kernel.install.pipeline.stage.transform.Transformer,\
+ org.eclipse.virgo.kernel.module.ModuleContextAccessor,\
+ org.eclipse.virgo.medic.dump.DumpContributor,\
+ org.eclipse.virgo.kernel.osgi.quasi.QuasiFrameworkFactory,\
+ org.eclipse.virgo.kernel.osgi.framework.OsgiFramework,\
+ org.eclipse.virgo.kernel.osgi.framework.ImportExpander,\
+ org.eclipse.virgo.kernel.osgi.framework.PackageAdminUtil,\
+ org.osgi.service.event.EventHandler,\
+ org.osgi.service.cm.ConfigurationListener,\
+ org.osgi.service.cm.ManagedService,\
+ org.osgi.service.cm.ManagedServiceFactory
+
+inheritedFrameworkProperties =\
+ osgi.java.profile,\
+ osgi.parentClassloader,\
+ osgi.context.bootdelegation,\
+ osgi.compatibility.bootdelegation,\
+ osgi.java.profile.bootdelegation,\
+ osgi.hook.configurators.include
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.medic.properties b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.medic.properties
new file mode 100644
index 00000000..1eeacc3f
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.medic.properties
@@ -0,0 +1,6 @@
+dump.root.directory=target/serviceability/dump
+log.wrapSysOut=true
+log.wrapSysErr=true
+log.dump.level=DEBUG
+log.dump.bufferSize=10000
+log.dump.pattern=[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-28.28thread %-64.64logger{64} %X{medic.eventCode} %msg %ex%n
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.repository.properties b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.repository.properties
new file mode 100644
index 00000000..94451a74
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/config/org.eclipse.virgo.repository.properties
@@ -0,0 +1,14 @@
+bundles.type=external
+bundles.searchPattern=../{bundle}/target/classes
+
+ivy-cache-bundles.type=external
+ivy-cache-bundles.searchPattern=../${ivy.cache::ivy-cache}/repository/{org}/{name}/{version}/{bundle}.jar
+
+ivy-cache-libraries.type=external
+ivy-cache-libraries.searchPattern=../${ivy.cache::ivy-cache}/repository/{org}/{name}/{version}/{library}.libd
+
+src-test-resources.type=external
+src-test-resources.searchPattern=src/test/resources/*.jar
+
+
+chain=bundles,ivy-cache-bundles,ivy-cache-libraries,src-test-resources
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/config/serviceability.xml b/org.eclipse.virgo.kernel.test/src/test/resources/config/serviceability.xml
new file mode 100644
index 00000000..436dddf5
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/config/serviceability.xml
@@ -0,0 +1,55 @@
+<configuration>
+
+ <appender name="LOG_STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <appender name="LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>target/serviceability/log/log.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <FileNamePattern>target/serviceability/log/log_%i.log</FileNamePattern>
+ <MinIndex>1</MinIndex>
+ <MaxIndex>4</MaxIndex>
+ </rollingPolicy>
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <MaxFileSize>10MB</MaxFileSize>
+ </triggeringPolicy>
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <appender name="EVENT_LOG_STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread &lt;%X{medic.eventCode}&gt; %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <appender name="EVENT_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>target/serviceability/eventlog/eventlog.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <FileNamePattern>target/serviceability/eventlog/eventlog_%i.log</FileNamePattern>
+ <MinIndex>1</MinIndex>
+ <MaxIndex>4</MaxIndex>
+ </rollingPolicy>
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <MaxFileSize>10MB</MaxFileSize>
+ </triggeringPolicy>
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread &lt;%X{medic.eventCode}&gt; %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <logger level="INFO" name="org.eclipse.virgo.medic.eventlog.localized">
+ <appender-ref ref="EVENT_LOG_STDOUT" />
+ <appender-ref ref="EVENT_LOG_FILE" />
+ </logger>
+
+ <root level="DEBUG">
+ <!-- appender-ref ref="LOG_STDOUT" /-->
+ <appender-ref ref="LOG_FILE" />
+ </root>
+
+</configuration>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/initial-artifact-plan/com.springsource.kernel.test.userregion.springdm.plan b/org.eclipse.virgo.kernel.test/src/test/resources/initial-artifact-plan/com.springsource.kernel.test.userregion.springdm.plan
new file mode 100644
index 00000000..7e9dbbc7
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/initial-artifact-plan/com.springsource.kernel.test.userregion.springdm.plan
@@ -0,0 +1,10 @@
+<plan name="org.eclipse.virgo.kernel.test.userregion.springdm" version="2.1" scoped="false" atomic="false"
+ xmlns="http://www.springsource.org/schema/dm-server/plan"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springsource.org/schema/dm-server/plan
+ http://www.springsource.org/schema/dm-server/plan/springsource-dm-server-plan.xsd">
+
+ <artifact type="bundle" name="com.springsource.kernel.agent.dm" version="[2.1, 2.2)"/>
+ <artifact type="bundle" name="org.eclipse.virgo.kernel.deployer.dm" version="[2.1, 2.2)"/>
+</plan>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..8026215e
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-Name: DelayBean Bundle
+Created-By: 1.5.0_13 (Apple Computer, Inc.)
+Bundle-SymbolicName: DelayBean
+Bundle-Version: 1.0.0
+
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/spring/delay-context.xml b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/spring/delay-context.xml
new file mode 100644
index 00000000..6dc43d8a
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/META-INF/spring/delay-context.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:beans="http://www.springframework.org/schema/beans"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util-2.5.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <beans:bean id="delayBean" class="delay.Bean" />
+
+</beans:beans>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/delay/Bean.class b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/delay/Bean.class
new file mode 100644
index 00000000..ab7d9713
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/delay/delay/Bean.class
Binary files differ
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..0f930257
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: monitor.failure
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/spring/context.xml b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/spring/context.xml
new file mode 100644
index 00000000..ce29a3fe
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/failure/META-INF/spring/context.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:beans="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <ba
+</beans:beans>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/nondm/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/nondm/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..c3b9ee11
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/nondm/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: monitor.nondm
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..199421b5
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: monitor.success
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/spring/context.xml b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/spring/context.xml
new file mode 100644
index 00000000..974f02f2
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/monitor/success/META-INF/spring/context.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:beans="http://www.springframework.org/schema/beans"
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+
+</beans:beans>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..1e348db9
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/MANIFEST.MF
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.virgo.kernel.dmfragment.test.inbuilt
+Import-Package: org.eclipse.virgo.kernel.osgi.framework
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/spring/context.xml b/org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/spring/context.xml
new file mode 100644
index 00000000..465ad1dc
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/post-processors/inbuilt/META-INF/spring/context.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://www.springframework.org/schema/beans"
+ xmlns:osgi="http://www.springframework.org/schema/osgi"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi
+ http://www.springframework.org/schema/osgi/spring-osgi.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+ <context:load-time-weaver/>
+
+ <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter"/>
+
+ <osgi:reference id="reference" interface="org.eclipse.virgo.kernel.osgi.framework.OsgiFramework" context-class-loader="client"/>
+
+</beans>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleexporter.jar b/org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleexporter.jar
new file mode 100644
index 00000000..3fb9c208
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleexporter.jar
Binary files differ
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleimporter.jar b/org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleimporter.jar
new file mode 100644
index 00000000..3fb9c208
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/quasi/simpleimporter.jar
Binary files differ
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties
new file mode 100644
index 00000000..dcdf9f8e
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/kernel.properties
@@ -0,0 +1,9 @@
+deployer.timeout= 300
+deployer.pickupDirectory= target/pickup
+io.workDirectory= target/work
+io.dumpDirectory= target/serviceability/dump
+shell.enabled= false
+shell.port= 2401
+profile.name= subsystem installation test
+profile.subsystems= subsystem.installation.test
+profile.optionalSubsystems=
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/repository.properties b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/repository.properties
new file mode 100644
index 00000000..1d2e9f00
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/repository.properties
@@ -0,0 +1,13 @@
+bundles.type=external
+bundles.searchPattern=../{bundle}/target/classes
+
+ivy-cache-bundles.type=external
+ivy-cache-bundles.searchPattern=../${ivy.cache::ivy-cache}/repository/{org}/{name}/{version}/{bundle}.jar
+
+ivy-cache-libraries.type=external
+ivy-cache-libraries.searchPattern=../${ivy.cache::ivy-cache}/repository/{org}/{name}/{version}/{library}.libd
+
+src-test-resources-sitrepo.type=external
+src-test-resources-sitrepo.searchPattern=src/test/resources/sit-repo/{bundle}
+
+chain=src-test-resources-sitrepo,bundles,ivy-cache-bundles,ivy-cache-libraries
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/serviceability.xml b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/serviceability.xml
new file mode 100644
index 00000000..c7f27a57
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/sit-config/serviceability.xml
@@ -0,0 +1,55 @@
+<configuration>
+
+ <appender name="LOG_STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <appender name="LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>target/serviceability/log/log.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <FileNamePattern>target/serviceability/log/log_%i.log</FileNamePattern>
+ <MinIndex>1</MinIndex>
+ <MaxIndex>4</MaxIndex>
+ </rollingPolicy>
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <MaxFileSize>10MB</MaxFileSize>
+ </triggeringPolicy>
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <appender name="EVENT_LOG_STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread &lt;%X{medic.eventCode}&gt; %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <appender name="EVENT_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>target/serviceability/eventlog/eventlog.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ <FileNamePattern>target/serviceability/eventlog/eventlog_%i.log</FileNamePattern>
+ <MinIndex>1</MinIndex>
+ <MaxIndex>4</MaxIndex>
+ </rollingPolicy>
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+ <MaxFileSize>10MB</MaxFileSize>
+ </triggeringPolicy>
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-24.24thread &lt;%X{medic.eventCode}&gt; %msg %ex%n</Pattern>
+ </layout>
+ </appender>
+
+ <logger name="org.eclipse.virgo.medic.eventlog.localized">
+ <appender-ref ref="EVENT_LOG_STDOUT" />
+ <appender-ref ref="EVENT_LOG_FILE" />
+ </logger>
+
+ <root level="WARN">
+ <appender-ref ref="LOG_STDOUT" />
+ <appender-ref ref="LOG_FILE" />
+ </root>
+
+</configuration>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/one/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/one/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..0b4b48cc
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/one/META-INF/MANIFEST.MF
@@ -0,0 +1,4 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-Version: 1.0
+Bundle-SymbolicName: sit.one
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/subsystem-1.0.0.xml b/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/subsystem-1.0.0.xml
new file mode 100644
index 00000000..27a09897
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/subsystem-1.0.0.xml
@@ -0,0 +1,4 @@
+<subsystem name="subsystem.installation.test" description="subsystem installation test subsystem">
+ <bundle symbolic-name="sit.one" version="[1.0,1.0]"/>
+ <bundle symbolic-name="sit.two" version="[1.0,3.0)"/>
+</subsystem>
diff --git a/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/two/META-INF/MANIFEST.MF b/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/two/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..f7c6b16b
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/src/test/resources/sit-repo/two/META-INF/MANIFEST.MF
@@ -0,0 +1,4 @@
+Manifest-Version: 1
+Bundle-ManifestVersion: 2
+Bundle-Version: 1.0
+Bundle-SymbolicName: sit.two
diff --git a/org.eclipse.virgo.kernel.test/template.mf b/org.eclipse.virgo.kernel.test/template.mf
new file mode 100644
index 00000000..86182c8f
--- /dev/null
+++ b/org.eclipse.virgo.kernel.test/template.mf
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Virgo Kernel Test
+Bundle-SymbolicName: org.eclipse.virgo.kernel.test
+Bundle-Version: 2.1.0
+Import-Template:
+ org.eclipse.virgo.kernel.*;version="${version:[=.=.=, =.+1)}",
+ org.eclipse.virgo.util.*;version="${org.eclipse.virgo.util:[=.=.=, =.+1)}",
+ javax.management.*;version="0",
+ org.easymock.*;version="${org.easymock:[=.=.=, +1)}",
+ org.junit.*;version="${org.junit:[=.=.=, +1)}",
+ org.eclipse.osgi.*;version="0",
+ org.osgi.*;version="0",
+ org.springframework.*;version="${org.springframework:[2.5.6, =.+1)}",
+ org.springframework.osgi.*;version="${org.springframework.osgi:[=.=.=, +1)}"
+Excluded-Imports: subsystem.installation,
+ com.springsource,
+ org.eclipse.virgo.osgi.extensions.*,
+ org.eclipse.virgo.test.*
+Excluded-Exports: delay

Back to the top