pax exam 3.0.0 migration ...


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1531523 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/AdapterWithAspectTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/AdapterWithAspectTest.java
similarity index 91%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/AdapterWithAspectTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/AdapterWithAspectTest.java
index 39ce6d4..b2ad88d 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/AdapterWithAspectTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/AdapterWithAspectTest.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.dm.test;
+package org.apache.felix.dependencymanager.test2.integration.api;
 
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
@@ -32,22 +32,15 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
-@RunWith(JUnit4TestRunner.class)
-public class AdapterWithAspectTest extends Base {
-    @Configuration
-    public static Option[] configuration() {
-        return options(
-            provision(
-                mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version(Base.OSGI_SPEC_VERSION),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject()
-            ) // ,
-//          new VMOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
-//          new TimeoutOption(0)
-        );
-    }
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
+
+@RunWith(PaxExam.class)
+public class AdapterWithAspectTest extends TestBase {
     
     @Test
-    public void testAdapterWithAspectMultipleTimes(BundleContext context) {
+    public void testAdapterWithAspectMultipleTimes() {
         // TODO this test is broken, it assumes that the order in which listeners are added to the BundleContext will also
         // be the order in which they're invoked (which from a spec point of view is not true)
         
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FactoryConfigurationAdapterTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FactoryConfigurationAdapterTest.java
similarity index 90%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/FactoryConfigurationAdapterTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FactoryConfigurationAdapterTest.java
index e24de32..ed69ce6 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FactoryConfigurationAdapterTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FactoryConfigurationAdapterTest.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.dm.test;
+package org.apache.felix.dependencymanager.test2.integration.api;
 
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
@@ -24,6 +24,7 @@
 
 import java.io.IOException;
 import java.util.Dictionary;
+import java.util.Hashtable;
 import java.util.Map;
 import java.util.Properties;
 
@@ -38,25 +39,17 @@
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
 
-@RunWith(JUnit4TestRunner.class)
-public class FactoryConfigurationAdapterTest extends Base
+@RunWith(PaxExam.class)
+public class FactoryConfigurationAdapterTest extends TestBase
 {
     private static Ensure m_ensure;
     
-    @Configuration
-    public static Option[] configuration() {
-        return options(
-            provision(
-                mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version(Base.OSGI_SPEC_VERSION),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.2.8"),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject()
-            )
-        );
-    }    
-    
     @Test
-    public void testFactoryConfigurationAdapter(BundleContext context) {
+    public void testFactoryConfigurationAdapter() {
         DependencyManager m = new DependencyManager(context);
         // helper class that ensures certain steps get executed in sequence
         m_ensure = new Ensure();
@@ -111,6 +104,7 @@
         // Remove the configuration
         m.remove(s1); // The stop method will remove the configuration
         m_ensure.waitForStep(16, 10000);
+        m.clear();
     }
 
     public static class ConfigurationCreator {
@@ -130,7 +124,7 @@
             try {
                 m_ensure.step(1);
                 m_conf = m_ca.createFactoryConfiguration(m_factoryPid, null);
-                Properties props = new Properties();
+                Hashtable props = new Hashtable();
                 props.put(m_key, m_value);
                 m_conf.update(props);
             }
@@ -140,7 +134,7 @@
         }
         
         public void update(String key, String val) {
-            Properties props = new Properties();
+            Hashtable props = new Hashtable();
             props.put(key, val);
             try {
                 m_conf.update(props);