diff --git a/karaf/gshell/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/CoreTest.java b/karaf/gshell/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/CoreTest.java
deleted file mode 100644
index 6f90dc2..0000000
--- a/karaf/gshell/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/CoreTest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.gshell.itests;
-
-import org.apache.geronimo.gshell.commandline.CommandLineExecutionFailed;
-import org.apache.geronimo.gshell.registry.NoSuchCommandException;
-import org.apache.geronimo.gshell.shell.Shell;
-import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest;
-import org.osgi.framework.Bundle;
-
-public class CoreTest extends AbstractIntegrationTest {
-
-    static {
-        System.setProperty("servicemix.startLocalConsole", "false");
-        System.setProperty("servicemix.startRemoteShell", "false");
-    }
-
-    @Override
-    protected String getManifestLocation() {
-        return "classpath:org/apache/servicemix/kernel/gshell/itests/MANIFEST.MF";
-    }
-
-    @Override
-    protected String[] getTestBundlesNames() {
-        return new String[] {
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jline"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-httpclient"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-jexl"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-vfs"),
-            getBundle("org.apache.mina", "mina-core"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.oro"),
-            getBundle("org.apache.servicemix.kernel.jaas", "org.apache.servicemix.kernel.jaas.config"),
-            getBundle("org.apache.sshd", "sshd-core"),
-            getBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.core"),
-            getBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.osgi")
-        };
-    }
-
-    public void testHelp() throws Exception {
-        Shell shell = getOsgiService(Shell.class);
-        shell.execute("help");
-    }
-
-    public void testInstallCommand() throws Exception {
-        Shell shell = getOsgiService(Shell.class);
-
-        try {
-            shell.execute("log/display");
-            fail("command should not exist");
-        } catch (CommandLineExecutionFailed e) {
-            assertNotNull(e.getCause());
-            assertTrue(e.getCause() instanceof NoSuchCommandException);
-        }
-
-        Bundle b = installBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.log", null, "jar");
-
-        shell.execute("log/display");
-
-        b.uninstall();
-
-        try {
-            shell.execute("log/display");
-            fail("command should not exist");
-        } catch (CommandLineExecutionFailed e) {
-            assertNotNull(e.getCause());
-            assertTrue(e.getCause() instanceof NoSuchCommandException);
-        }
-    }
-
-    public void testCommandGroup() throws Exception {
-        Shell shell = getOsgiService(Shell.class);
-        shell.execute("osgi");
-        shell.execute("help");
-        shell.execute("..");
-    }
-    
-    public void testInstallFeature() throws Exception {
-        Shell shell = getOsgiService(Shell.class);
-
-        try {
-            shell.execute("obr");
-            fail("command should not exist");
-        } catch (CommandLineExecutionFailed e) {
-            assertNotNull(e.getCause());
-            assertTrue(e.getCause() instanceof NoSuchCommandException);
-        }
-        try {
-            shell.execute("wrapper");
-            fail("command should not exist");
-        } catch (CommandLineExecutionFailed e) {
-            assertNotNull(e.getCause());
-            assertTrue(e.getCause() instanceof NoSuchCommandException);
-        }
-        String url = getClass().getClassLoader().getResource("features.xml").toString();
-        addFeatureRepo(url);
-        installFeature("obr");
-        installFeature("wrapper");
-        shell.execute("obr");
-        shell.execute("wrapper");
-    }
-
-    /**
-     * TODO: This test seems to fail, there must be a timing issue somewhere
-     *
-    public void testCommandGroupAfterInstall() throws Exception {
-        Bundle b = installBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.log", null, "jar");
-        Shell shell = getOsgiService(Shell.class);
-        shell.execute("log");
-        shell.execute("help");
-        shell.execute("..");
-    }
-     */
-
-
-}
diff --git a/karaf/gshell/itests/src/test/resources/org/apache/servicemix/kernel/gshell/itests/MANIFEST.MF b/karaf/gshell/itests/src/test/resources/org/apache/servicemix/kernel/gshell/itests/MANIFEST.MF
deleted file mode 100644
index df8a1a7..0000000
--- a/karaf/gshell/itests/src/test/resources/org/apache/servicemix/kernel/gshell/itests/MANIFEST.MF
+++ /dev/null
@@ -1,30 +0,0 @@
-Manifest-Version: 1.0
-License-00: .
-License-01: Licensed to the Apache Software Foundation (ASF) under one or more
-License-02: contributor license agreements.  See the NOTICE file distributed with
-License-03: this work for additional information regarding copyright ownership.
-License-04: The ASF licenses this file to You under the Apache License, Version 2.0
-License-05: (the "License"); you may not use this file except in compliance with
-License-06: the License.  You may obtain a copy of the License at
-License-07: .
-License-08:      http://www.apache.org/licenses/LICENSE-2.0
-License-09: .
-License-10: Unless required by applicable law or agreed to in writing, software
-License-11: distributed under the License is distributed on an "AS IS" BASIS,
-License-12: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-License-13: See the License for the specific language governing permissions and
-License-14: limitations under the License.
-License-15: .
-Bundle-Name: org.apache.servicemix.testing.itests
-Bundle-SymbolicName: org.apache.servicemix.testing.itests
-Bundle-Vendor: Spring Framework
-Bundle-Activator: org.springframework.osgi.test.JUnitTestActivator
-Import-Package: junit.framework,
- org.osgi.framework;specification-version="1.3.0",
- org.apache.commons.logging,
- org.springframework.core.io,
- org.springframework.osgi.test,
- org.apache.servicemix.kernel.testing.support,
- org.apache.geronimo.gshell.commandline,
- org.apache.geronimo.gshell.registry,
- org.apache.geronimo.gshell.shell
diff --git a/karaf/gshell/pom.xml b/karaf/gshell/pom.xml
index 3c2d24f..87cd59f 100644
--- a/karaf/gshell/pom.xml
+++ b/karaf/gshell/pom.xml
@@ -43,7 +43,6 @@
         <module>gshell-log</module>
         <module>gshell-config</module>
         <module>gshell-packages</module>
-        <module>itests</module>
     </modules>
 
 </project>
\ No newline at end of file
diff --git a/karaf/gshell/itests/pom.xml b/karaf/itests/pom.xml
similarity index 76%
rename from karaf/gshell/itests/pom.xml
rename to karaf/itests/pom.xml
index c684ceb..e5b931b 100644
--- a/karaf/gshell/itests/pom.xml
+++ b/karaf/itests/pom.xml
@@ -28,17 +28,22 @@
     </parent>
 
     <groupId>org.apache.servicemix.kernel.gshell</groupId>
-    <artifactId>org.apache.servicemix.kernel.gshell.itests</artifactId>
+    <artifactId>itests</artifactId>
     <packaging>jar</packaging>
     <version>1.2.0-SNAPSHOT</version>
-    <name>Apache ServiceMix Kernel :: GShell ITests</name>
+    <name>Apache ServiceMix Kernel :: ITests</name>
 
     <description>
-        Provides the OSGi GShell commands
+        Integration tests
     </description>
 
     <dependencies>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.servicemix.kernel.gshell</groupId>
             <artifactId>org.apache.servicemix.kernel.gshell.core</artifactId>
             <scope>test</scope>
@@ -59,17 +64,52 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.servicemix.kernel.testing</groupId>
-            <artifactId>org.apache.servicemix.kernel.testing.support</artifactId>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.junit</artifactId>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-default</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit-extender-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+        </dependency>
     </dependencies>
 
+    <repositories>
+        <repository>
+            <id>ops4j.releases</id>
+            <url>http://repository.ops4j.org/maven2</url>
+        </repository>
+        <repository>
+            <id>ops4j.snapshots</id>
+            <url>http://repository.ops4j.org/mvn-snapshots</url>
+        </repository>
+    </repositories>
+    <pluginRepositories>
+        <pluginRepository>
+            <id>ops4j.releases</id>
+            <url>http://repository.ops4j.org/maven2</url>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
     <build>
         <plugins>
             <plugin>
diff --git a/karaf/gshell/itests/src/test/filtered-resources/features.xml b/karaf/itests/src/test/filtered-resources/features.xml
similarity index 100%
rename from karaf/gshell/itests/src/test/filtered-resources/features.xml
rename to karaf/itests/src/test/filtered-resources/features.xml
diff --git a/karaf/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/AbstractIntegrationTest.java b/karaf/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/AbstractIntegrationTest.java
new file mode 100644
index 0000000..cabbf35
--- /dev/null
+++ b/karaf/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/AbstractIntegrationTest.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.kernel.gshell.itests;
+
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Inject;
+import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.util.tracker.ServiceTracker;
+
+public abstract class AbstractIntegrationTest {
+
+    public static final long DEFAULT_TIMEOUT = 30000;
+
+    @Inject
+    protected BundleContext bundleContext;
+
+    protected <T> T getOsgiService(Class<T> type, long timeout) {
+        return getOsgiService(type, null, timeout);
+    }
+
+    protected <T> T getOsgiService(Class<T> type) {
+        return getOsgiService(type, null, DEFAULT_TIMEOUT);
+    }
+
+    protected <T> T getOsgiService(Class<T> type, String filter, long timeout) {
+        ServiceTracker tracker = null;
+        try {
+            String flt;
+            if (filter != null) {
+                if (filter.startsWith("(")) {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")" + filter + ")";
+                } else {
+                    flt = "(&(" + Constants.OBJECTCLASS + "=" + type.getName() + ")(" + filter + "))";
+                }
+            } else {
+                flt = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
+            }
+            Filter osgiFilter = FrameworkUtil.createFilter(flt);
+            tracker = new ServiceTracker(bundleContext, osgiFilter, null);
+            tracker.open();
+            // Note that the tracker is not closed to keep the reference
+            // This is buggy, has the service reference may change i think
+            Object svc = type.cast(tracker.waitForService(timeout));
+            if (svc == null) {
+                throw new RuntimeException("Gave up waiting for service " + flt);
+            }
+            return type.cast(svc);
+        } catch (InvalidSyntaxException e) {
+            throw new IllegalArgumentException("Invalid filter", e);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected Bundle installBundle(String groupId, String artifactId) throws Exception {
+        MavenArtifactProvisionOption mvnUrl = mavenBundle(groupId, artifactId);
+        return bundleContext.installBundle(mvnUrl.getURL());
+    }
+
+    protected Bundle getInstalledBundle(String symbolicName) {
+        for (Bundle b : bundleContext.getBundles()) {
+            if (b.getSymbolicName().equals(symbolicName)) {
+                return b;
+            }
+        }
+        return null;
+    }
+
+    public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) {
+        return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
+    }
+
+}
diff --git a/karaf/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/CoreTest.java b/karaf/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/CoreTest.java
new file mode 100644
index 0000000..cb66fd1
--- /dev/null
+++ b/karaf/itests/src/test/java/org/apache/servicemix/kernel/gshell/itests/CoreTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.kernel.gshell.itests;
+
+import org.apache.geronimo.gshell.commandline.CommandLineExecutionFailed;
+import org.apache.geronimo.gshell.registry.NoSuchCommandException;
+import org.apache.geronimo.gshell.shell.Shell;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import static org.ops4j.pax.exam.CoreOptions.felix;
+import static org.ops4j.pax.exam.CoreOptions.mavenConfiguration;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.configProfile;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.logProfile;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.profile;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.Bundle;
+
+@RunWith(JUnit4TestRunner.class)
+public class CoreTest extends AbstractIntegrationTest{
+
+    @Test
+    public void testHelp() throws Exception {
+        Shell shell = getOsgiService(Shell.class);
+        shell.execute("help");
+    }
+
+    @Test
+    public void testInstallCommand() throws Exception {
+        Shell shell = getOsgiService(Shell.class);
+
+        try {
+            shell.execute("log/display");
+            fail("command should not exist");
+        } catch (CommandLineExecutionFailed e) {
+            assertNotNull(e.getCause());
+            assertTrue(e.getCause() instanceof NoSuchCommandException);
+        }
+
+        Bundle b = getInstalledBundle("org.apache.servicemix.kernel.gshell.log");
+        b.start();
+
+        shell.execute("log/display");
+
+        b.uninstall();
+
+        try {
+            shell.execute("log/display");
+            fail("command should not exist");
+        } catch (CommandLineExecutionFailed e) {
+            assertNotNull(e.getCause());
+            assertTrue(e.getCause() instanceof NoSuchCommandException);
+        }
+    }
+
+    @Test
+    public void testCommandGroup() throws Exception {
+        Shell shell = getOsgiService(Shell.class);
+        shell.execute("osgi");
+        shell.execute("help");
+        shell.execute("..");
+    }
+    
+//    @Test
+//    public void testInstallFeature() throws Exception {
+//        Shell shell = getOsgiService(Shell.class);
+//
+//        try {
+//            shell.execute("obr");
+//            fail("command should not exist");
+//        } catch (CommandLineExecutionFailed e) {
+//            assertNotNull(e.getCause());
+//            assertTrue(e.getCause() instanceof NoSuchCommandException);
+//        }
+//        try {
+//            shell.execute("wrapper");
+//            fail("command should not exist");
+//        } catch (CommandLineExecutionFailed e) {
+//            assertNotNull(e.getCause());
+//            assertTrue(e.getCause() instanceof NoSuchCommandException);
+//        }
+//        String url = getClass().getClassLoader().getResource("features.xml").toString();
+//        addFeatureRepo(url);
+//        installFeature("obr");
+//        installFeature("wrapper");
+//        shell.execute("obr");
+//        shell.execute("wrapper");
+//    }
+
+    /**
+     * TODO: This test seems to fail, there must be a timing issue somewhere
+     *
+    public void testCommandGroupAfterInstall() throws Exception {
+        Bundle b = installBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.log", null, "jar");
+        Shell shell = getOsgiService(Shell.class);
+        shell.execute("log");
+        shell.execute("help");
+        shell.execute("..");
+    }
+     */
+
+    @Configuration
+    public static Option[] configuration() {
+        Option[] options = options(
+            // install log service using pax runners profile abstraction (there are more profiles, like DS)
+            logProfile(),
+            configProfile(),
+            profile("spring.dm").version("1.2.0-rc1"),
+
+            // this is how you set the default log level when using pax logging (logProfile)
+            systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+            systemProperty("servicemix.name").value("root"),
+            systemProperty("servicemix.base").value("target/smx.base"),
+            systemProperty("servicemix.startLocalConsole").value("false"),
+            systemProperty("servicemix.startRemoteShell").value("false"),
+
+            // hack system packages
+            systemPackages("org.apache.servicemix.kernel.main.spi;version=1.0.0", "org.apache.servicemix.kernel.jaas.boot"),
+            bootClasspathLibrary(mavenBundle("org.apache.servicemix.kernel.jaas", "org.apache.servicemix.kernel.jaas.boot")).afterFramework(),
+            bootClasspathLibrary(mavenBundle("org.apache.servicemix.kernel", "org.apache.servicemix.kernel.main")).afterFramework(),
+
+            // Bundles
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jline"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-httpclient"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-jexl"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.commons-vfs"),
+            mavenBundle("org.apache.mina", "mina-core"),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.oro"),
+            mavenBundle("org.apache.servicemix.kernel.jaas", "org.apache.servicemix.kernel.jaas.config"),
+            mavenBundle("org.apache.sshd", "sshd-core"),
+            mavenBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.core"),
+            mavenBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.osgi"),
+            mavenBundle("org.apache.servicemix.kernel.gshell", "org.apache.servicemix.kernel.gshell.log").noStart(),
+
+            felix()
+        );
+
+        // use config generated by the Maven plugin (until PAXEXAM-62/64 get resolved)
+        if (CoreTest.class.getClassLoader().getResource("META-INF/maven/paxexam-config.args") != null) {
+            options = OptionUtils.combine(options, mavenConfiguration());
+        }
+
+        return options;
+    }
+
+}
diff --git a/karaf/gshell/itests/src/test/resources/log4j.properties b/karaf/itests/src/test/resources/log4j.properties
similarity index 100%
rename from karaf/gshell/itests/src/test/resources/log4j.properties
rename to karaf/itests/src/test/resources/log4j.properties
diff --git a/karaf/pom.xml b/karaf/pom.xml
index 0fb8094..32251db 100644
--- a/karaf/pom.xml
+++ b/karaf/pom.xml
@@ -39,10 +39,10 @@
         <module>filemonitor</module>
         <module>gshell</module>
         <module>spring</module>
-        <module>testing</module>
         <module>jaas</module>
         <module>client</module>
         <module>management</module>
+        <module>itests</module>
         <module>assembly</module>
         <module>demos</module>
     </modules>
@@ -92,6 +92,7 @@
         <log4j.version>1.2.14</log4j.version>
         <mina.version>2.0.0-M5</mina.version>
         <oro.version>2.0.8_1</oro.version>
+        <pax.exam.version>0.5.0</pax.exam.version>
         <pax.logging.version>1.3.0</pax.logging.version>
         <pax.url.version>0.3.3</pax.url.version>
         <servicemix.legal.version>1.0</servicemix.legal.version>
@@ -787,6 +788,26 @@
                     </exclusion>
                 </exclusions>
             </dependency>
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam</artifactId>
+                <version>${pax.exam.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-junit</artifactId>
+                <version>${pax.exam.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-container-default</artifactId>
+                <version>${pax.exam.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.ops4j.pax.exam</groupId>
+                <artifactId>pax-exam-junit-extender-impl</artifactId>
+                <version>${pax.exam.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 
diff --git a/karaf/testing/itests/pom.xml b/karaf/testing/itests/pom.xml
deleted file mode 100644
index 8442902..0000000
--- a/karaf/testing/itests/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <!--
-
-        Licensed to the Apache Software Foundation (ASF) under one or more
-        contributor license agreements.  See the NOTICE file distributed with
-        this work for additional information regarding copyright ownership.
-        The ASF licenses this file to You under the Apache License, Version 2.0
-        (the "License"); you may not use this file except in compliance with
-        the License.  You may obtain a copy of the License at
-
-           http://www.apache.org/licenses/LICENSE-2.0
-
-        Unless required by applicable law or agreed to in writing, software
-        distributed under the License is distributed on an "AS IS" BASIS,
-        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-        See the License for the specific language governing permissions and
-        limitations under the License.
-    -->
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.servicemix.kernel.testing</groupId>
-        <artifactId>testing</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.apache.servicemix.kernel.testing</groupId>
-    <artifactId>org.apache.servicemix.kernel.testing.itests</artifactId>
-    <packaging>jar</packaging>
-    <version>1.2.0-SNAPSHOT</version>
-    <name>Apache ServiceMix Kernel :: Testing - ITests</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.servicemix.kernel.testing</groupId>
-            <artifactId>org.apache.servicemix.kernel.testing.support</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.specs</groupId>
-            <artifactId>org.apache.servicemix.specs.jaxp-api-1.4</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.woodstox</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.jaxp-ri</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <!-- generate dependencies versions -->
-            <plugin>
-                <groupId>org.apache.servicemix.tooling</groupId>
-                <artifactId>depends-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-depends-file</id>
-                        <goals>
-                            <goal>generate-depends-file</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
\ No newline at end of file
diff --git a/karaf/testing/itests/src/test/java/org/apache/servicemix/kernel/testing/itests/SimpleTest.java b/karaf/testing/itests/src/test/java/org/apache/servicemix/kernel/testing/itests/SimpleTest.java
deleted file mode 100644
index dec38ae..0000000
--- a/karaf/testing/itests/src/test/java/org/apache/servicemix/kernel/testing/itests/SimpleTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.itests;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.validation.SchemaFactory;
-
-import org.apache.servicemix.kernel.testing.support.AbstractIntegrationTest;
-import org.osgi.framework.Bundle;
-
-public class SimpleTest extends AbstractIntegrationTest {
-
-    static {
-        System.setProperty("jaxp.debug", "true");
-        System.setProperty("org.apache.servicemix.specs.debug", "true");
-    }
-
-    /**
-	 * The manifest to use for the "virtual bundle" created
-	 * out of the test classes and resources in this project
-	 *
-	 * This is actually the boilerplate manifest with one additional
-	 * import-package added. We should provide a simpler customization
-	 * point for such use cases that doesn't require duplication
-	 * of the entire manifest...
-	 */
-	protected String getManifestLocation() {                            
-		return "classpath:org/apache/servicemix/MANIFEST.MF";
-	}
-
-	/**
-	 * The location of the packaged OSGi bundles to be installed
-	 * for this test. Values are Spring resource paths. The bundles
-	 * we want to use are part of the same multi-project maven
-	 * build as this project is. Hence we use the localMavenArtifact
-	 * helper method to find the bundles produced by the package
-	 * phase of the maven build (these tests will run after the
-	 * packaging phase, in the integration-test phase).
-	 *
-	 * JUnit, commons-logging, spring-core and the spring OSGi
-	 * test bundle are automatically included so do not need
-	 * to be specified here.
-	 */
-	protected String[] getTestBundlesNames() {
-        return new String[0];
-	}
-
-    /**
-     * Do not include the jaxp-ri bundle by default, as we want to test it
-     * @return
-     */
-    @Override
-    protected String[] getTestFrameworkBundlesNames() {
-        return new String[] {
-            getBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
-            getBundle("org.apache.servicemix.specs", "org.apache.servicemix.specs.jaxp-api-1.4"),
-            getBundle("org.apache.felix", "org.osgi.compendium"),
-            getBundle("org.apache.felix", "org.apache.felix.configadmin"),
-            getBundle("org.ops4j.pax.logging", "pax-logging-api"),
-            getBundle("org.ops4j.pax.logging", "pax-logging-service"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.aopalliance"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.asm"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.junit"),
-            getBundle("org.springframework", "spring-beans"),
-            getBundle("org.springframework", "spring-core"),
-            getBundle("org.springframework", "spring-context"),
-            getBundle("org.springframework", "spring-aop"),
-            getBundle("org.springframework", "spring-test"),
-            getBundle("org.springframework.osgi", "spring-osgi-core"),
-            getBundle("org.springframework.osgi", "spring-osgi-io"),
-            getBundle("org.springframework.osgi", "spring-osgi-extender"),
-            getBundle("org.springframework.osgi", "spring-osgi-test"),
-            getBundle("org.springframework.osgi", "spring-osgi-annotation"),
-            getBundle("org.apache.servicemix.kernel.testing", "org.apache.servicemix.kernel.testing.support"),
-		};
-    }
-
-    public void testDocumentBuilderFactory() throws Exception {
-        try {
-            DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-            fail("Implementation should not have been found");
-        } catch (Throwable t) {
-        }
-        Bundle b = installBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxp-ri", null, "jar");
-        try {
-		    assertNotNull(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
-        } finally {
-            b.uninstall();
-        }
-    }
-
-    public void testTransformerFactory() throws Exception {
-        try {
-            TransformerFactory.newInstance().newTransformer();
-            fail("Implementation should not have been found");
-        } catch (Throwable t) {
-        }
-        Bundle b = installBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxp-ri", null, "jar");
-        try {
-            assertNotNull(TransformerFactory.newInstance().newTransformer());
-        } finally {
-            b.uninstall();
-        }
-    }
-
-    public void testSchemaFactory() throws Exception {
-        try {
-            SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema").newSchema();
-            fail("Implementation should not have been found");
-        } catch (Throwable t) {
-        }
-        Bundle b = installBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxp-ri", null, "jar");
-        try {
-            assertNotNull(SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema").newSchema());
-        } finally {
-            b.uninstall();
-        }
-    }
-
-    public void testStax() throws Exception {
-        try {
-            XMLInputFactory.newInstance();
-            fail("Implementation should not have been found");
-        } catch (Throwable t) {
-        }
-        Bundle b = installBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxp-ri", null, "jar");
-        try {
-            assertNotNull(XMLInputFactory.newInstance());
-        } finally {
-            b.uninstall();
-        }
-    }
-
-}
diff --git a/karaf/testing/itests/src/test/resources/log4j.properties b/karaf/testing/itests/src/test/resources/log4j.properties
deleted file mode 100644
index 7944dfb..0000000
--- a/karaf/testing/itests/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-# 
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed  under the  License is distributed on an "AS IS" BASIS,
-# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
-# implied.
-#  
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-
-#
-# The logging properties used during tests..
-#
-log4j.rootLogger=DEBUG, stdout
-
-log4j.logger.org.springframework=INFO
-log4j.logger.org.apache.activemq=INFO
-log4j.logger.org.apache.activemq.spring=WARN
-
-
-#log4j.logger.org.apache.servicemix=DEBUG
-
-# CONSOLE appender 
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-
-# File appender
-log4j.appender.out=org.apache.log4j.FileAppender
-log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-log4j.appender.out.file=target/servicemix-test.log
-log4j.appender.out.append=true
diff --git a/karaf/testing/itests/src/test/resources/org/apache/servicemix/MANIFEST.MF b/karaf/testing/itests/src/test/resources/org/apache/servicemix/MANIFEST.MF
deleted file mode 100644
index f26d98a..0000000
--- a/karaf/testing/itests/src/test/resources/org/apache/servicemix/MANIFEST.MF
+++ /dev/null
@@ -1,32 +0,0 @@
-Manifest-Version: 1.0
-License-00: .
-License-01: Licensed to the Apache Software Foundation (ASF) under one or more
-License-02: contributor license agreements.  See the NOTICE file distributed with
-License-03: this work for additional information regarding copyright ownership.
-License-04: The ASF licenses this file to You under the Apache License, Version 2.0
-License-05: (the "License"); you may not use this file except in compliance with
-License-06: the License.  You may obtain a copy of the License at
-License-07: .
-License-08:      http://www.apache.org/licenses/LICENSE-2.0
-License-09: .
-License-10: Unless required by applicable law or agreed to in writing, software
-License-11: distributed under the License is distributed on an "AS IS" BASIS,
-License-12: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-License-13: See the License for the specific language governing permissions and
-License-14: limitations under the License.
-License-15: .
-Bundle-Name: org.apache.servicemix.testing.itests
-Bundle-SymbolicName: org.apache.servicemix.testing.itests
-Bundle-Vendor: Spring Framework
-Bundle-Activator: org.springframework.osgi.test.JUnitTestActivator
-Import-Package: junit.framework,
- org.osgi.framework;specification-version="1.3.0",
- org.apache.commons.logging,
- org.springframework.core.io,
- org.springframework.osgi.test,
- org.apache.servicemix.kernel.testing.support,
- org.springframework.osgi.util,
- javax.xml.stream,
- javax.xml.transform,
- javax.xml.validation,
- javax.xml.parsers
diff --git a/karaf/testing/pom.xml b/karaf/testing/pom.xml
deleted file mode 100644
index 9a62891..0000000
--- a/karaf/testing/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <!--
-
-        Licensed to the Apache Software Foundation (ASF) under one or more
-        contributor license agreements.  See the NOTICE file distributed with
-        this work for additional information regarding copyright ownership.
-        The ASF licenses this file to You under the Apache License, Version 2.0
-        (the "License"); you may not use this file except in compliance with
-        the License.  You may obtain a copy of the License at
-
-           http://www.apache.org/licenses/LICENSE-2.0
-
-        Unless required by applicable law or agreed to in writing, software
-        distributed under the License is distributed on an "AS IS" BASIS,
-        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-        See the License for the specific language governing permissions and
-        limitations under the License.
-    -->
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.servicemix.kernel</groupId>
-        <artifactId>kernel</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.apache.servicemix.kernel.testing</groupId>
-    <artifactId>testing</artifactId>
-    <packaging>pom</packaging>
-    <version>1.2.0-SNAPSHOT</version>
-    <name>Apache ServiceMix Kernel :: Testing</name>
-
-    <modules>
-        <module>support</module>
-        <module>itests</module>
-    </modules>
-
-</project>
diff --git a/karaf/testing/support/pom.xml b/karaf/testing/support/pom.xml
deleted file mode 100644
index 7eb620a..0000000
--- a/karaf/testing/support/pom.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <!--
-
-        Licensed to the Apache Software Foundation (ASF) under one or more
-        contributor license agreements.  See the NOTICE file distributed with
-        this work for additional information regarding copyright ownership.
-        The ASF licenses this file to You under the Apache License, Version 2.0
-        (the "License"); you may not use this file except in compliance with
-        the License.  You may obtain a copy of the License at
-
-           http://www.apache.org/licenses/LICENSE-2.0
-
-        Unless required by applicable law or agreed to in writing, software
-        distributed under the License is distributed on an "AS IS" BASIS,
-        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-        See the License for the specific language governing permissions and
-        limitations under the License.
-    -->
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.servicemix.kernel.testing</groupId>
-        <artifactId>testing</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
-    </parent>
-
-    <groupId>org.apache.servicemix.kernel.testing</groupId>
-    <artifactId>org.apache.servicemix.kernel.testing.support</artifactId>
-    <packaging>bundle</packaging>
-    <version>1.2.0-SNAPSHOT</version>
-    <name>Apache ServiceMix Kernel :: Testing - Support</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.servicemix.kernel</groupId>
-            <artifactId>org.apache.servicemix.kernel.main</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.configadmin</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.logging</groupId>
-            <artifactId>pax-logging-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.logging</groupId>
-            <artifactId>pax-logging-service</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-test</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-extender</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.osgi</groupId>
-            <artifactId>spring-osgi-annotation</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.5_spec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.specs</groupId>
-            <artifactId>org.apache.servicemix.specs.jaxp-api-1.4</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.asm</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.junit</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.woodstox</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.jaxp-ri</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.url</groupId>
-            <artifactId>pax-url-mvn</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                    <id>copy-resources</id>
-                    <!-- here the phase you need -->
-                    <phase>compile</phase>
-                    <goals>
-                        <goal>copy-resources</goal>
-                    </goals>
-                    <configuration>
-                            <outputDirectory>${basedir}/target/classes/org/apache/servicemix/kernel/testing/support/</outputDirectory>
-                            <resources>          
-                                <resource>
-                                    <directory>../../${config.location}</directory>
-                                        <includes>
-                                            <include>config.properties</include>
-                                        </includes>
-                                </resource>
-                            </resources>              
-                        </configuration>            
-                    </execution>
-                </executions>
-            </plugin>            
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-                        <Import-Package>
-                            org.apache.felix*;resolution:=optional,
-                            org.apache.servicemix.kernel.main;resolution:=optional,
-                            org.apache.servicemix.kernel.main.spi;resolution:=optional;version="1.0.0",
-                            *
-                        </Import-Package>
-                        <Export-Package>${pom.artifactId}</Export-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTest.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTest.java
deleted file mode 100644
index 14cc73a..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTest.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.log4j.PropertyConfigurator;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.core.io.Resource;
-import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests;
-import org.springframework.osgi.test.provisioning.ArtifactLocator;
-import org.springframework.osgi.util.OsgiFilterUtils;
-import org.springframework.osgi.util.OsgiListenerUtils;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-
-public class AbstractIntegrationTest extends AbstractConfigurableBundleCreatorTests {
-
-    static {
-        try {
-            File f = new File("target/smx4");
-            f.mkdirs();
-            System.setProperty("servicemix.name", "root");
-            System.setProperty("servicemix.home", f.getAbsolutePath());
-            System.setProperty("servicemix.base", f.getAbsolutePath());
-            System.setProperty("org.apache.servicemix.filemonitor.configDir", new File(f, "etc").getAbsolutePath());
-            System.setProperty("org.apache.servicemix.filemonitor.monitorDir", new File(f, "deploy").getAbsolutePath());
-            System.setProperty("org.apache.servicemix.filemonitor.generatedJarDir", new File(f, "data/generate-bundles").getAbsolutePath());
-            System.setProperty("bundles.configuration.location", new File("src/test/conf").getAbsolutePath());
-            System.setProperty("org.osgi.vendor.framework", "org.apache.servicemix.kernel.testing.support");
-            PropertyConfigurator.configure("target/test-classes/log4j.properties");
-        } catch (Throwable t) {}
-    }
-
-    private Properties dependencies;
-    private FeatureInstaller featureInstaller;
-
-    @Override
-    protected String getPlatformName() {
-        String systemProperty = System.getProperty(OSGI_FRAMEWORK_SELECTOR);
-        if (logger.isTraceEnabled())
-            logger.trace("system property [" + OSGI_FRAMEWORK_SELECTOR + "] has value=" + systemProperty);
-
-        return (systemProperty == null ? SmxKernelPlatform.class.getName() : systemProperty);
-    }
-
-    protected String getBundle(String groupId, String artifactId) {
-        return groupId + "," + artifactId + "," + getBundleVersion(groupId, artifactId);
-    }
-
-    protected String getBundleVersion(String groupId, String artifactId) {
-        if (dependencies == null) {
-            try {
-                File f = new File(System.getProperty("basedir"), "target/classes/META-INF/maven/dependencies.properties");
-                Properties prop = new Properties();
-                prop.load(new FileInputStream(f));
-                dependencies = prop;
-            } catch (IOException e) {
-                throw new IllegalStateException("Unable to load dependencies informations", e);
-            }
-        }
-        String version = dependencies.getProperty(groupId + "/" + artifactId + "/version");
-        if (version == null) {
-            throw new IllegalStateException("Unable to find dependency information for: " + groupId + "/" + artifactId + "/version");
-        }
-        return version;
-    }
-
-    protected String[] getTestFrameworkBundlesNames() {
-        return new String[] {
-            getBundle("org.apache.geronimo.specs", "geronimo-servlet_2.5_spec"),
-            getBundle("org.apache.servicemix.specs", "org.apache.servicemix.specs.jaxp-api-1.4"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.jaxp-ri"),
-            getBundle("org.apache.felix", "org.osgi.compendium"),
-            getBundle("org.apache.felix", "org.apache.felix.configadmin"),
-            getBundle("org.ops4j.pax.logging", "pax-logging-api"),
-            getBundle("org.ops4j.pax.logging", "pax-logging-service"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.aopalliance"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.asm"),
-            getBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.junit"),
-            getBundle("org.springframework", "spring-beans"),
-            getBundle("org.springframework", "spring-core"),
-            getBundle("org.springframework", "spring-context"),
-            getBundle("org.springframework", "spring-aop"),
-            getBundle("org.springframework", "spring-test"),
-            getBundle("org.springframework.osgi", "spring-osgi-core"),
-            getBundle("org.springframework.osgi", "spring-osgi-io"),
-            getBundle("org.springframework.osgi", "spring-osgi-extender"),
-            getBundle("org.springframework.osgi", "spring-osgi-test"),
-            getBundle("org.springframework.osgi", "spring-osgi-annotation"),
-            getBundle("org.ops4j.pax.url", "pax-url-mvn"),
-            getBundle("org.apache.servicemix.kernel.testing", "org.apache.servicemix.kernel.testing.support"),
-        };
-    }
-
-    protected Bundle installBundle(String groupId, String artifactId, String classifier, String type) throws Exception {
-        String version = getBundleVersion(groupId, artifactId);
-        File loc = localMavenBundle(groupId, artifactId, version, classifier, type);
-        Bundle bundle = bundleContext.installBundle(loc.toURI().toString());
-        bundle.start();
-        return bundle;
-    }
-    
-    protected void addFeatureRepo(String url) throws Exception {
-        if (featureInstaller == null) {
-            featureInstaller = new FeatureInstaller();
-            featureInstaller.setBundleContext(bundleContext);
-        }
-        featureInstaller.addRepository(new URI(url));
-    }
-    
-    protected void installFeature(String name) throws Exception {
-        installFeature(name, FeatureImpl.DEFAULT_VERSION);
-    }
-
-    protected void installFeature(String name, String version) throws Exception {
-        if (featureInstaller == null) {
-            featureInstaller = new FeatureInstaller();
-            featureInstaller.setBundleContext(bundleContext);
-            
-        }
-        featureInstaller.installFeature(name, version);
-    }
-    
-    protected Resource locateBundle(String bundleId) {
-        Assert.hasText(bundleId, "bundleId should not be empty");
-
-        // parse the String
-        String[] artifactId = StringUtils.commaDelimitedListToStringArray(bundleId);
-
-        Assert.isTrue(artifactId.length >= 3, "the CSV string " + bundleId + " contains too few values");
-        // TODO: add a smarter mechanism which can handle 1 or 2 values CSVs
-        for (int i = 0; i < artifactId.length; i++) {
-            artifactId[i] = StringUtils.trimWhitespace(artifactId[i]);
-        }
-
-        File f;
-        if (artifactId.length == 3) {
-            f = localMavenBundle(artifactId[0], artifactId[1], artifactId[2], null, ArtifactLocator.DEFAULT_ARTIFACT_TYPE);
-        } else {
-            f = localMavenBundle(artifactId[0], artifactId[1], artifactId[2], null, artifactId[3]);
-        }
-        return new FileSystemResource(f);
-    }
-
-
-    protected File localMavenBundle(String groupId, String artifact, String version, String classifier, String type) {
-        String defaultHome = new File(new File(System.getProperty("user.home")), ".m2/repository").getAbsolutePath();
-        File repositoryHome = new File(System.getProperty("localRepository", defaultHome));
-
-        StringBuffer location = new StringBuffer(groupId.replace('.', '/'));
-        location.append('/');
-        location.append(artifact);
-        location.append('/');
-        location.append(getSnapshot(version));
-        location.append('/');
-        location.append(artifact);
-        location.append('-');
-        location.append(version);
-        if (classifier != null) {
-            location.append('-');
-            location.append(classifier);
-        }
-        location.append(".");
-        location.append(type);
-
-        return new File(repositoryHome, location.toString());
-    }
-
-    protected static String getSnapshot(String version) {
-        if (isTimestamped(version)) {
-            return version.substring(0, version.lastIndexOf('-', version.lastIndexOf('-') - 1)) + "-SNAPSHOT";
-        }
-        return version;
-    }
-
-    protected static boolean isTimestamped(String version) {
-        return version.matches(".+-\\d\\d\\d\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d\\d-\\d+");
-    }
-
-    protected static boolean isSnapshot(String version) {
-        return version.matches(".+-SNAPSHOT");
-    }
-
-    public <T> T getOsgiService(Class<T> type) {
-        return getOsgiService(type, DEFAULT_WAIT_TIME);
-    }
-
-    public <T> T getOsgiService(Class<T> type, long timeout) {
-        // translate from seconds to miliseconds
-        long time = timeout * 1000;
-
-        // use the counter to make sure the threads block
-        final Counter counter = new Counter("waitForOsgiService on bnd=" + type.getName());
-
-        counter.increment();
-
-        final List<T> services = new ArrayList<T>();
-
-        ServiceListener listener = new ServiceListener() {
-            public void serviceChanged(ServiceEvent event) {
-                if (event.getType() == ServiceEvent.REGISTERED) {
-                    services.add((T) bundleContext.getService(event.getServiceReference()));
-                    counter.decrement();
-                }
-            }
-        };
-
-        String filter = OsgiFilterUtils.unifyFilter(type.getName(), null);
-        OsgiListenerUtils.addServiceListener(bundleContext, listener, filter);
-
-        if (logger.isDebugEnabled())
-            logger.debug("start waiting for OSGi service=" + type.getName());
-
-        try {
-            if (counter.waitForZero(time)) {
-                logger.warn("waiting for OSGi service=" + type.getName() + " timed out");
-                throw new RuntimeException("Gave up waiting for OSGi service '" + type.getName() + "' to be created");
-            }
-            else if (logger.isDebugEnabled()) {
-                logger.debug("found OSGi service=" + type.getName());
-            }
-            return services.get(0);
-        }
-        finally {
-            // inform waiting thread
-            bundleContext.removeServiceListener(listener);
-        }
-    }
-
-    protected void checkBundleStarted(String name) {
-        assertNotNull(bundleContext);
-        for (int i = 0; i < bundleContext.getBundles().length; i++) {
-            Bundle b = bundleContext.getBundles()[i];
-            if (b.getSymbolicName().equals(name)) {
-                assertEquals("Bundle '" + name + "' is not active", Bundle.ACTIVE, b.getState());
-                return;
-            }
-        }
-        fail("Bundle '" + name + "' not found");
-    }
-
-
-}
\ No newline at end of file
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/Counter.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/Counter.java
deleted file mode 100644
index 95a3a44..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/Counter.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2002-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Simple counting class which can be incremented or decremented in a
- * synchronized manner. This class can be used as a synchronization mechanism
- * between threads mainly though {@link #waitForZero(long)} method.
- *
- * The main usage of the class is to allow a master thread, to know when other
- * threads (slaves) have passed a certain point in execution.
- *
- * <p/> As opposed to a Barrier or a Semaphore, this class should be used only
- * with 1 waiting thread (a master) and any number of slave threads.
- *
- * <pre style="code">
- * Thread 1:
- *  synchronized(counter) {
- *    counter.increment();
- *    thread2.start();
- *    counter.increment();
- *    thread3.start();
- *
- *    // wait 1 second for other threads to complete
- *    counter.waitForZero(1000);
- * }
- *
- * Thread 2:
- *  // do some work
- *  counter.decrement();
- *
- * Thread 3:
- *  // do some work
- *  counter.decrement();
- *
- * </pre>
- *
- * <p/> Mainly for usage inside the framework. All methods are thread-safe
- * however for the master/slave pattern, synchronized blocks are recommended as
- * multiple operations have to be executed at once.
- *
- * @author Costin Leau
- *
- */
-public class Counter {
-
-	private int counter = 0;
-
-	private static final Log log = LogFactory.getLog(Counter.class);
-
-	private final String name;
-
-	/**
-	 * Create counter with a given name.
-	 * @param name counter name
-	 */
-	public Counter(String name) {
-		this.name = name;
-	}
-
-	/**
-	 * Increment the counter value.
-	 */
-	public synchronized void increment() {
-		counter++;
-		if (log.isTraceEnabled())
-			log.trace("counter [" + name + "] incremented to " + counter);
-	}
-
-	/**
-	 * Decrement the counter value.
-	 */
-	public synchronized void decrement() {
-		counter--;
-		if (log.isTraceEnabled())
-			log.trace("counter [" + name + "] decremented to " + counter);
-		notifyAll();
-	}
-
-	public synchronized boolean decrementAndWait(long timeToWait) {
-		decrement();
-		if (counter > 0)
-			return waitForZero(timeToWait);
-		return true;
-	}
-
-	/**
-	 * Check if the counter value is zero.
-	 * @return true if value is equal or below zero, false otherwise.
-	 */
-	public synchronized boolean isZero() {
-		return is(0);
-	}
-
-	public synchronized boolean is(int value) {
-		return counter == value;
-	}
-
-	/**
-	 * Return the counter value.
-	 *
-	 * @return the counter value.
-	 */
-	public synchronized int getValue() {
-		return counter;
-	}
-
-	public synchronized String toString() {
-		return "" + counter;
-	}
-
-	/**
-	 * Specialized method which waits for 0. Identical to waitFor(0, waitTime).
-	 *
-	 * @see #waitFor(int, long)
-	 * @param waitTime
-	 * @return true if the waiting timed out, false otherwise
-	 */
-	public synchronized boolean waitForZero(long waitTime) {
-		return waitFor(0, waitTime);
-	}
-
-	/**
-	 * Wait maximum the givem amount of time, for the counter to reach the given
-	 * value.. This mechanism relies on {@link Object#wait(long)} and
-	 * {@link Object#notify()} mechanism to work appropriately. Please see the
-	 * class javadoc for more info.
-	 *
-	 * <p/> This method will stop waiting and return true if the thread
-	 * is interrupted.
-	 *
-	 * @param value the value to wait for
-	 * @param waitTime the time (in miliseconds) to wait for zero value
-	 * @return true if the waiting timed out, false otherwise
-	 */
-	public synchronized boolean waitFor(int value, long waitTime) {
-		boolean timedout = false;
-		long remainingTime = waitTime;
-		long startTime = System.currentTimeMillis();
-
-		while (counter > value && !timedout) {
-			// start waiting
-			try {
-				this.wait(remainingTime);
-				// compute the remaining time
-				remainingTime = waitTime - (System.currentTimeMillis() - startTime);
-				timedout = remainingTime <= 0;
-			}
-			catch (InterruptedException ex) {
-				timedout = true;
-			}
-		}
-
-		return timedout;
-	}
-}
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/Feature.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/Feature.java
deleted file mode 100644
index 56006cf..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/Feature.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * A feature is a list of bundles associated identified by its name.
- */
-public interface Feature {
-
-    String getId();
-
-    String getName();
-
-    String getVersion();
-
-    List<Feature> getDependencies();
-
-    List<String> getBundles();
-
-    Map<String, Map<String, String>> getConfigurations();
-    
-    void addDependency(Feature dependency);
-    
-    void addBundle(String bundle);
-    
-    void addConfig(String name, Map<String,String> properties);
-
-}
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureImpl.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureImpl.java
deleted file mode 100644
index 9c8c9a2..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-public class FeatureImpl implements Feature {
-
-    private String id;
-    private String name;
-    private String version;
-    private List<Feature> dependencies = new ArrayList<Feature>();
-    private List<String> bundles = new ArrayList<String>();
-    private Map<String, Map<String,String>> configs = new HashMap<String, Map<String,String>>();
-    public static String SPLIT_FOR_NAME_AND_VERSION = "_split_for_name_and_version_";
-    public static String DEFAULT_VERSION = "0.0.0";
-    
-    public FeatureImpl(String name) {
-        this(name, DEFAULT_VERSION);
-    }
-    
-    public FeatureImpl(String name, String version) {
-        this.name = name;
-        this.version = version;
-        this.id = name + "-" + version;
-    }
-
-    
-    public String getId() {
-        return id;
-    }
-
-    
-    public String getName() {
-        return name;
-    }
-
-    
-    public String getVersion() {
-        return version;
-    }
-    
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    
-    public List<Feature> getDependencies() {
-        return dependencies;
-    }
-
-    public List<String> getBundles() {
-        return bundles;
-    }
-
-    public Map<String, Map<String, String>> getConfigurations() {
-        return configs;
-    }
-
-    public void addDependency(Feature dependency) {
-        dependencies.add(dependency);
-    }
-
-    public void addBundle(String bundle) {
-        bundles.add(bundle);
-    }
-
-    public void addConfig(String name, Map<String,String> properties) {
-        configs.put(name, properties);
-    }
-
-    public String toString() {
-        String ret = getName() + SPLIT_FOR_NAME_AND_VERSION + getVersion();
-        return ret;
-    }
-    
-    public static Feature valueOf(String str) {
-        if (str.indexOf(SPLIT_FOR_NAME_AND_VERSION) >= 0) {
-            String strName = str.substring(0, str.indexOf(SPLIT_FOR_NAME_AND_VERSION));
-            String strVersion = str.substring(str.indexOf(SPLIT_FOR_NAME_AND_VERSION) 
-                    + SPLIT_FOR_NAME_AND_VERSION.length(), str.length());
-            return new FeatureImpl(strName, strVersion);
-        } else {
-            return new FeatureImpl(str);
-        }
-                
-        
-    }
-
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        FeatureImpl feature = (FeatureImpl) o;
-
-        if (!name.equals(feature.name)) return false;
-        if (!version.equals(feature.version)) return false;
-
-        return true;
-    }
-
-    public int hashCode() {
-        int result = name.hashCode();
-        result = 31 * result + version.hashCode();
-        return result;
-    }
-}
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureInstaller.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureInstaller.java
deleted file mode 100644
index d200e40..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureInstaller.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.servicemix.kernel.testing.support;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.jar.JarInputStream;
-import java.util.jar.Manifest;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Version;
-
-
-public class FeatureInstaller {
-
-    private Map<URI, FeatureRepositoryImpl> repositories = new HashMap<URI, FeatureRepositoryImpl>();
-    private Map<String, Map<String, Feature>> features;
-    private BundleContext bundleContext;
-    
-    public void addRepository(URI uri) throws Exception {
-        if (!repositories.values().contains(uri)) {
-            internalAddRepository(uri);
-        }
-    }
-    
-    protected FeatureRepositoryImpl internalAddRepository(URI uri) throws Exception {
-        FeatureRepositoryImpl repo = new FeatureRepositoryImpl(uri);
-        repositories.put(uri, repo);
-        features = null;
-        return repo;
-    }
-    
-    public void setBundleContext(BundleContext bundleContext) {
-        this.bundleContext = bundleContext;
-    }
-    
-    
-    public void installFeature(String name, String version) throws Exception {
-        Feature f = getFeature(name, version);
-        if (f == null) {
-            throw new Exception("No feature named '" + name 
-                    + "' with version '" + version + "' available");
-        }
-        for (Feature dependency : f.getDependencies()) {
-            installFeature(dependency.getName(), dependency.getVersion());
-        }
-       
-        Set<Long> bundles = new HashSet<Long>();
-        for (String bundleLocation : f.getBundles()) {
-            Bundle b = installBundleIfNeeded(bundleLocation);
-            bundles.add(b.getBundleId());
-        }
-        for (long id : bundles) {
-            bundleContext.getBundle(id).start();
-        }
-
-        
-    }
-    
-    protected Feature getFeature(String name, String version) throws Exception {
-        Map<String, Feature> versions = getFeatures().get(name);
-        if (versions == null || versions.isEmpty()) {
-            return null;
-        } else {
-            Feature feature = versions.get(version);
-            if (feature == null && FeatureImpl.DEFAULT_VERSION.equals(version)) {
-                Version latest = new Version(cleanupVersion(version));
-                for (String available : versions.keySet()) {
-                    Version availableVersion = new Version(cleanupVersion(available));
-                    if (availableVersion.compareTo(latest) > 0) {
-                        feature = versions.get(available);
-                        latest = availableVersion;
-                    }
-                }
-            }
-            return feature;
-        }
-    }
-    
-    protected Map<String, Map<String, Feature>> getFeatures() throws Exception {
-        if (features == null) {
-            //the outer map's key is feature name, the inner map's key is feature version       
-            Map<String, Map<String, Feature>> map = new HashMap<String, Map<String, Feature>>();
-            // Two phase load:
-            // * first load dependent repositories
-            for (;;) {
-                boolean newRepo = false;
-                for (FeatureRepositoryImpl repo : listRepositories()) {
-                    for (URI uri : repo.getRepositories()) {
-                        if (!repositories.keySet().contains(uri)) {
-                            internalAddRepository(uri);
-                            newRepo = true;
-                        }
-                    }
-                }
-                if (!newRepo) {
-                    break;
-                }
-            }
-            // * then load all features
-            for (FeatureRepositoryImpl repo : repositories.values()) {
-                for (Feature f : repo.getFeatures()) {
-                    if (map.get(f.getName()) == null) {
-                        Map<String, Feature> versionMap = new HashMap<String, Feature>();
-                        versionMap.put(f.getVersion(), f);
-                        map.put(f.getName(), versionMap);
-                    } else {
-                        map.get(f.getName()).put(f.getVersion(), f);
-                    }
-                }
-            }
-            features = map;
-        }
-        return features;
-    }
-    
-    public FeatureRepositoryImpl[] listRepositories() {
-        Collection<FeatureRepositoryImpl> repos = repositories.values();
-        return repos.toArray(new FeatureRepositoryImpl[repos.size()]);
-    }
-    
-    protected Bundle installBundleIfNeeded(String bundleLocation) throws IOException, BundleException {
-        InputStream is = new BufferedInputStream(new URL(bundleLocation).openStream());
-        try {
-            is.mark(256 * 1024);
-            JarInputStream jar = new JarInputStream(is);
-            Manifest m = jar.getManifest();
-            String sn = m.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME);
-            String vStr = m.getMainAttributes().getValue(Constants.BUNDLE_VERSION);
-            Version v = vStr == null ? Version.emptyVersion : Version.parseVersion(vStr);
-            for (Bundle b : bundleContext.getBundles()) {
-                if (b.getSymbolicName() != null && b.getSymbolicName().equals(sn)) {
-                    vStr = (String) b.getHeaders().get(Constants.BUNDLE_VERSION);
-                    Version bv = vStr == null ? Version.emptyVersion : Version.parseVersion(vStr);
-                    if (v.equals(bv)) {
-                        return b;
-                    }
-                }
-            }
-            try {
-                is.reset();
-            } catch (IOException e) {
-                is.close();
-                is = new BufferedInputStream(new URL(bundleLocation).openStream());
-            }
-            return getBundleContext().installBundle(bundleLocation, is);
-        } finally {
-            is.close();
-        }
-    }
-    
-    private BundleContext getBundleContext() {
-        return this.bundleContext;
-    }
-
-    /**
-     * Clean up version parameters. Other builders use more fuzzy definitions of
-     * the version syntax. This method cleans up such a version to match an OSGi
-     * version.
-     *
-     * @param version
-     * @return
-     */
-    static Pattern fuzzyVersion  = Pattern.compile("(\\d+)(\\.(\\d+)(\\.(\\d+))?)?([^a-zA-Z0-9](.*))?",
-                                                   Pattern.DOTALL);
-    static Pattern fuzzyModifier = Pattern.compile("(\\d+[.-])*(.*)",
-                                                   Pattern.DOTALL);
-    static public String cleanupVersion(String version) {
-        Matcher m = fuzzyVersion.matcher(version);
-        if (m.matches()) {
-            StringBuffer result = new StringBuffer();
-            String d1 = m.group(1);
-            String d2 = m.group(3);
-            String d3 = m.group(5);
-            String qualifier = m.group(7);
-
-            if (d1 != null) {
-                result.append(d1);
-                if (d2 != null) {
-                    result.append(".");
-                    result.append(d2);
-                    if (d3 != null) {
-                        result.append(".");
-                        result.append(d3);
-                        if (qualifier != null) {
-                            result.append(".");
-                            cleanupModifier(result, qualifier);
-                        }
-                    } else if (qualifier != null) {
-                        result.append(".0.");
-                        cleanupModifier(result, qualifier);
-                    }
-                } else if (qualifier != null) {
-                    result.append(".0.0.");
-                    cleanupModifier(result, qualifier);
-                }
-                return result.toString();
-            }
-        }
-        return version;
-    }
-
-    static void cleanupModifier(StringBuffer result, String modifier) {
-        Matcher m = fuzzyModifier.matcher(modifier);
-        if (m.matches())
-            modifier = m.group(2);
-
-        for (int i = 0; i < modifier.length(); i++) {
-            char c = modifier.charAt(i);
-            if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z')
-                    || (c >= 'A' && c <= 'Z') || c == '_' || c == '-')
-                result.append(c);
-        }
-    }
-
-}
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureRepositoryImpl.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureRepositoryImpl.java
deleted file mode 100644
index fb296bb..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FeatureRepositoryImpl.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-
-
-/**
- * The repository implementation.
- */
-
-public class FeatureRepositoryImpl {
-
-    private URI uri;
-    private List<Feature> features;
-    private List<URI> repositories;
-
-    public FeatureRepositoryImpl(URI uri) {
-        this.uri = uri;
-    }
-
-    
-    public URI getURI() {
-        return uri;
-    }
-
-    public URI[] getRepositories() throws Exception {
-        if (repositories == null) {
-            load();
-        }
-        return repositories.toArray(new URI[repositories.size()]);
-    }
-
-    public Feature[] getFeatures() throws Exception {
-        if (features == null) {
-            load();
-        }
-        return features.toArray(new Feature[features.size()]);
-    }
-
-    public void load() throws IOException {
-        try {
-            repositories = new ArrayList<URI>();
-            features = new ArrayList<Feature>();
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            Document doc = factory.newDocumentBuilder().parse(uri.toURL().openStream());
-            NodeList nodes = doc.getDocumentElement().getChildNodes();
-            for (int i = 0; i < nodes.getLength(); i++) {
-                Node node = nodes.item(i);
-                if (!(node instanceof Element)) {
-                    continue;
-                }
-                if ("repository".equals(node.getNodeName())) {
-                    Element e = (Element) nodes.item(i);
-                    repositories.add(new URI(e.getTextContent()));
-                } else if ("feature".equals(node.getNodeName())) {
-                    Element e = (Element) nodes.item(i);
-                    String name = e.getAttribute("name");
-                    String version = e.getAttribute("version");
-                    Feature f;
-                    if (version != null && version.length() > 0) {
-                        f = new FeatureImpl(name, version);
-                    } else {
-                        f = new FeatureImpl(name);
-                    }
-
-                    NodeList featureNodes = e.getElementsByTagName("feature");
-                    for (int j = 0; j < featureNodes.getLength(); j++) {
-                        Element b = (Element) featureNodes.item(j);
-                        String dependencyFeatureVersion = b.getAttribute("version");
-                        if (dependencyFeatureVersion != null && dependencyFeatureVersion.length() > 0) {
-                            f.addDependency(new FeatureImpl(b.getTextContent(), dependencyFeatureVersion));
-                        } else {
-                            f.addDependency(new FeatureImpl(b.getTextContent()));
-                        }
-                    }
-                    NodeList configNodes = e.getElementsByTagName("config");
-                    for (int j = 0; j < configNodes.getLength(); j++) {
-                        Element c = (Element) configNodes.item(j);
-                        String cfgName = c.getAttribute("name");
-                        String data = c.getTextContent();
-                        Properties properties = new Properties();
-                        properties.load(new ByteArrayInputStream(data.getBytes()));
-                        Map<String, String> hashtable = new Hashtable<String, String>();
-                        for (Object key : properties.keySet()) {
-                            String n = key.toString();
-                            hashtable.put(n, properties.getProperty(n));
-                        }
-                        f.addConfig(cfgName, hashtable);
-                    }
-                    NodeList bundleNodes = e.getElementsByTagName("bundle");
-                    for (int j = 0; j < bundleNodes.getLength(); j++) {
-                        Element b = (Element) bundleNodes.item(j);
-                        f.addBundle(b.getTextContent());
-                    }
-                    features.add(f);
-                }
-            }
-        } catch (SAXException e) {
-            throw (IOException) new IOException().initCause(e);
-        } catch (ParserConfigurationException e) {
-            throw (IOException) new IOException().initCause(e);
-        } catch (URISyntaxException e) {
-            throw (IOException) new IOException().initCause(e);
-        }
-    }
-
-}
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FrameworkUtil.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FrameworkUtil.java
deleted file mode 100644
index e3427a9..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/FrameworkUtil.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-
-import org.apache.felix.framework.FilterImpl;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-
-/**
- */
-public class FrameworkUtil {
-
-    public static Filter createFilter(String f) throws InvalidSyntaxException {
-        return new FilterImpl(f);
-    }
-
-}
diff --git a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/SmxKernelPlatform.java b/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/SmxKernelPlatform.java
deleted file mode 100644
index eed2d5e..0000000
--- a/karaf/testing/support/src/main/java/org/apache/servicemix/kernel/testing/support/SmxKernelPlatform.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.felix.framework.Felix;
-import org.apache.felix.framework.util.CompoundEnumeration;
-import org.apache.felix.framework.util.FelixConstants;
-import org.apache.servicemix.kernel.main.Main;
-import org.apache.servicemix.kernel.main.spi.MainService;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.springframework.osgi.test.platform.FelixPlatform;
-import org.springframework.osgi.test.platform.OsgiPlatform;
-import org.springframework.util.ClassUtils;
-
-public class SmxKernelPlatform implements OsgiPlatform {
-
-    private static final Log log = LogFactory.getLog(FelixPlatform.class);
-
-    private static final String FELIX_CONF_FILE = "config.properties";
-
-    private static final String FELIX_CONFIG_PROPERTY = "config.properties";
-
-    public final static String	FRAMEWORK_STORAGE = "org.osgi.framework.storage";
-
-    private BundleContext context;
-
-    private Object platform;
-
-    private File felixStorageDir;
-
-    private Properties configurationProperties = new Properties();
-
-    protected Properties getPlatformProperties() {
-        // load Felix configuration
-        Properties props = new Properties();
-        props.putAll(getFelixConfiguration());
-        props.putAll(getLocalConfiguration());
-        return props;
-    }
-
-    public Properties getConfigurationProperties() {
-        // local properties
-        configurationProperties.putAll(getPlatformProperties());
-        // system properties
-        configurationProperties.putAll(System.getProperties());
-        return configurationProperties;
-    }
-
-    public BundleContext getBundleContext() {
-        return context;
-    }
-
-    private Set<String> getJars(Class... classes) {
-        Set<String> jars = new HashSet<String>();
-        for (Class cl : classes) {
-            String name = cl.getName().replace('.', '/') + ".class";
-            URL url = (cl.getClassLoader() != null ? cl.getClassLoader() : getClass().getClassLoader()).getResource(name);
-            String path = url.toString();
-            if (path.startsWith("jar:")) {
-                path = path.substring(0, path.indexOf('!'));
-            } else {
-                path = path.substring(0, path.indexOf(name));
-            }
-            jars.add(path);
-        }
-        return jars;
-    }
-
-    public void start() throws Exception {
-        Set<String> jars = getJars(Felix.class);
-        ClassLoader classLoader = new GuardClassLoader(toURLs(jars.toArray(new String[jars.size()])), null);
-
-        BundleActivator activator = new BundleActivator() {
-            private ServiceRegistration registration;
-
-            public void start(BundleContext context) {
-                registration = context.registerService(MainService.class.getName(), new MainService() {
-                    public String[] getArgs() {
-                        return new String[0];
-                    }
-                    public int getExitCode() {
-                        return 0;
-                    }
-                    public void setExitCode(int exitCode) {
-                    }
-                }, null);
-            }
-
-            public void stop(BundleContext context) {
-                registration.unregister();
-            }
-        };
-        List<BundleActivator> activations = new ArrayList<BundleActivator>();
-        activations.add(activator);
-
-        Properties props = getConfigurationProperties();
-        props.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, activations);
-
-        Thread.currentThread().setContextClassLoader(classLoader);
-        Class cl = classLoader.loadClass(Felix.class.getName());
-        Constructor cns = cl.getConstructor(Map.class);
-        platform = cns.newInstance(props);
-        platform.getClass().getMethod("start").invoke(platform);
-
-        Bundle systemBundle = (Bundle) platform;
-
-        // call getBundleContext
-        final Method getContext = systemBundle.getClass().getMethod("getBundleContext", null);
-
-        AccessController.doPrivileged(new PrivilegedAction() {
-
-            public Object run() {
-                getContext.setAccessible(true);
-                return null;
-            }
-        });
-        context = (BundleContext) getContext.invoke(systemBundle, null);
-    }
-
-    public void stop() throws Exception {
-        try {
-            platform.getClass().getMethod("stop").invoke(platform);
-        }
-        finally {
-            // remove cache folder
-            delete(felixStorageDir);
-        }
-    }
-
-    public String toString() {
-        return getClass().getName();
-    }
-
-    File createTempDir(String suffix) {
-        if (suffix == null)
-            suffix = "osgi";
-        File tempFileName;
-
-        try {
-            tempFileName = File.createTempFile("org.sfw.osgi", suffix);
-        }
-        catch (IOException ex) {
-            if (log.isWarnEnabled()) {
-                log.warn("Could not create temporary directory, returning a temp folder inside the current folder", ex);
-            }
-            return new File("./tmp-test");
-        }
-
-        tempFileName.delete(); // we want it to be a directory...
-        File tempFolder = new File(tempFileName.getAbsolutePath());
-        tempFolder.mkdir();
-        return tempFolder;
-    }
-
-    /**
-     * Configuration settings for the OSGi test run.
-     *
-     * @return
-     */
-    private Properties getLocalConfiguration() {
-        Properties props = new Properties();
-        felixStorageDir = createTempDir("felix");
-        props.setProperty(FRAMEWORK_STORAGE, this.felixStorageDir.getAbsolutePath());
-        if (log.isTraceEnabled())
-            log.trace("felix storage dir is " + felixStorageDir.getAbsolutePath());
-
-        return props;
-    }
-
-    /**
-     * Loads Felix config.properties.
-     *
-     * <strong>Note</strong> the current implementation uses Felix's Main class
-     * to resolve placeholders as opposed to loading the properties manually
-     * (through JDK's Properties class or Spring's PropertiesFactoryBean).
-     *
-     * @return
-     */
-    // TODO: this method should be removed once Felix 1.0.2 is released
-    private Properties getFelixConfiguration() {
-        String location = "/".concat(ClassUtils.classPackageAsResourcePath(getClass())).concat("/").concat(FELIX_CONF_FILE);
-        URL url = getClass().getResource(location);
-        if (url == null)
-            throw new RuntimeException("cannot find felix configuration properties file:" + location);
-
-        // used with Main
-        System.getProperties().setProperty(FELIX_CONFIG_PROPERTY, url.toExternalForm());
-
-        // load config.properties (use Felix's Main for resolving placeholders)
-        Properties props = new Properties();
-        InputStream is = null;
-        try {
-            is = url.openConnection().getInputStream();
-            props.load(is);
-            is.close();
-        }
-        catch (FileNotFoundException ex) {
-            // Ignore file not found.
-        }
-        catch (Exception ex) {
-            System.err.println("Main: Error loading system properties from " + url);
-            System.err.println("Main: " + ex);
-            try {
-                if (is != null) is.close();
-            }
-            catch (IOException ex2) {
-                // Nothing we can do.
-            }
-            return null;
-        }
-        // Perform variable substitution for system properties.
-        for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
-            String name = (String) e.nextElement();
-            props.setProperty(name, Main.substVars(props.getProperty(name), name, null, props));
-        }
-        return props;
-    }
-
-    /**
-     * Delete the given file (can be a simple file or a folder).
-     *
-     * @param file the file to be deleted
-     * @return if the deletion succeded or not
-     */
-    public static boolean delete(File file) {
-
-        // bail out quickly
-        if (file == null)
-            return false;
-
-        // recursively delete children file
-        boolean success = true;
-
-        if (file.isDirectory()) {
-            String[] children = file.list();
-            for (int i = 0; i < children.length; i++) {
-                success &= delete(new File(file, children[i]));
-            }
-        }
-
-        // The directory is now empty so delete it
-        return (success &= file.delete());
-    }
-
-    private static URL[] toURLs(String[] jars) throws MalformedURLException {
-        URL[] urls = new URL[jars.length];
-        for (int i = 0; i < urls.length; i++) {
-            String s = jars[i];
-            if (s.startsWith("jar:")) {
-                s = s.substring("jar:".length());
-            }
-            urls[i] = new URL(s);
-        }
-        return urls;
-    }
-
-    public class GuardClassLoader extends URLClassLoader {
-        private Set<String> bootDelegationPackages = new HashSet<String>();
-        private Set<String> packages = new HashSet<String>();
-        private List<ClassLoader> parents = new ArrayList<ClassLoader>();
-
-        public GuardClassLoader(URL[] urls, List<String> additionalPackages) throws MalformedURLException {
-            super(urls, SmxKernelPlatform.class.getClassLoader());
-            Properties props = getConfigurationProperties();
-            String prop = props.getProperty("org.osgi.framework.system.packages");
-            String[] ps = prop.split(",");
-            for (String p : ps) {
-                String[] spack = p.split(";");
-                for (String sp : spack) {
-                    sp = sp.trim();
-                    if (!sp.startsWith("version")) {
-                        packages.add(sp);
-                    }
-                }
-            }
-            if (additionalPackages != null) {
-                packages.addAll(additionalPackages);
-            }
-            prop = props.getProperty("org.osgi.framework.bootdelegation");
-            ps = prop.split(",");
-            for (String p : ps) {
-                p = p.trim();
-                if (p.endsWith("*")) {
-                    p = p.substring(0, p.length() - 1);
-                }
-                bootDelegationPackages.add(p);
-            }
-            ClassLoader cl = getParent();
-            while (cl != null) {
-                parents.add(0, cl);
-                cl = cl.getParent();
-            }
-            //System.err.println("Boot packages: " + packages);
-        }
-
-        protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
-            //System.err.println("Loading class: " + name);
-            Class c = findLoadedClass(name);
-            if (c == null) {
-                String pkg = name.substring(0, name.lastIndexOf('.'));
-                boolean match = name.startsWith("java.") || packages.contains(pkg);
-                if (!match) {
-                    for (String p : bootDelegationPackages) {
-                        if (pkg.startsWith(p)) {
-                            match = true;
-                            break;
-                        }
-                    }
-                }
-                if (match) {
-                    for (ClassLoader cl : parents) {
-                        try {
-                            c = cl.loadClass(name);
-                            //System.err.println("Class loaded from: " + cl.getResource(name.replace('.', '/') + ".class"));
-                            break;
-                        } catch (ClassNotFoundException e) {
-                        }
-                    }
-                    if (c == null) {
-                        throw new ClassNotFoundException(name);
-                    }
-                    //c = getParent().loadClass(name);
-                } else  {
-                    c = findClass(name);
-                }
-            }
-            if (resolve) {
-                resolveClass(c);
-            }
-            return c;
-        }
-
-        public URL getResource(String name) {
-            //System.err.println("GetResource: " + name);
-            URL url = getParent().getResource(name);
-            if (url != null && url.toString().startsWith("file:")) {
-                return url;
-            }
-            url = findResource(name);
-            System.err.println("Resource " + name + " found at " + url);
-            return url;
-            /*
-            URL u = getParent().getResource(name);
-            if (u != null) {
-                String path = u.toString();
-                int idx = path.indexOf('!');
-                if (idx > 0) {
-                    path = path.substring(0, idx);
-                    if (!jars.contains(path)) {
-                        return null;
-                    }
-                } else {
-                    idx = 0;
-                }
-            }
-            return u;
-            */
-        }
-
-        public Enumeration<URL> getResources(final String name) throws IOException {
-            //System.err.println("GetResources: " + name);
-            Enumeration[] tmp = new Enumeration[2];
-            final Enumeration<URL> e = getParent().getResources(name);
-            tmp[0] = new Enumeration<URL>() {
-                URL next = null;
-                public boolean hasMoreElements() {
-                    while (next == null && e.hasMoreElements()) {
-                        next = e.nextElement();
-                        String path = next.toString();
-                        if (!path.startsWith("file:")) {
-                            next = null;
-                        }
-                    }
-                    return next != null;
-                }
-                public URL nextElement() {
-                    return next;
-                }
-            };
-            tmp[1] = findResources(name);
-            return new CompoundEnumeration(tmp) {
-                public Object nextElement() {
-                    Object next = super.nextElement();
-                    System.err.println("Resources " + name + " found at " + next);
-                    return next;
-                }
-            };
-        }
-    }
-}
diff --git a/karaf/testing/support/src/test/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTestTest.java b/karaf/testing/support/src/test/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTestTest.java
deleted file mode 100644
index 9acba05..0000000
--- a/karaf/testing/support/src/test/java/org/apache/servicemix/kernel/testing/support/AbstractIntegrationTestTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.kernel.testing.support;
-
-import junit.framework.TestCase;
-
-
-public class AbstractIntegrationTestTest extends TestCase {
-
-    public void testSnapshotVersion() {
-        assertTrue(AbstractIntegrationTest.isTimestamped("0.9.0-20070713.230317-1"));
-        assertTrue(AbstractIntegrationTest.isSnapshot("0.9.0-SNAPSHOT"));
-        assertFalse(AbstractIntegrationTest.isSnapshot("0.9.0"));
-        assertEquals("0.9.0-SNAPSHOT", AbstractIntegrationTest.getSnapshot("0.9.0-20070713.230317-1"));
-        assertEquals("0.9.0", "0.9.0");
-    }
-
-}
