pax-exam 3.0.0 migration ...
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1531642 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/ConfigurationDependencyTest.java
similarity index 86%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/ConfigurationDependencyTest.java
index 686cf7f..f4f890f 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ConfigurationDependencyTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/ConfigurationDependencyTest.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,37 +24,30 @@
import java.io.IOException;
import java.util.Dictionary;
+import java.util.Hashtable;
import java.util.Properties;
import junit.framework.Assert;
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
import org.apache.felix.dm.Component;
import org.apache.felix.dm.DependencyManager;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.junit.PaxExam;
import org.osgi.framework.BundleContext;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
-@RunWith(JUnit4TestRunner.class)
-public class ConfigurationDependencyTest 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.configadmin").version("1.2.4"),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject()
- )
- );
- }
-
+
+@RunWith(PaxExam.class)
+public class ConfigurationDependencyTest extends TestBase {
@Test
- public void testComponentWithRequiredConfigurationAndServicePropertyPropagation(BundleContext context) {
+ public void testComponentWithRequiredConfigurationAndServicePropertyPropagation() {
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
@@ -74,7 +67,7 @@
}
@Test
- public void testFELIX2987(BundleContext context) {
+ public void testFELIX2987() {
// mimics testComponentWithRequiredConfigurationAndServicePropertyPropagation
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
@@ -107,7 +100,7 @@
try {
m_ensure.step(1);
org.osgi.service.cm.Configuration conf = m_ca.getConfiguration("test", null);
- Properties props = new Properties();
+ Hashtable props = new Properties();
props.put("testkey", "testvalue");
conf.update(props);
}
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2696_ConfigurationAndServiceDependencyTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX2696_ConfigurationAndServiceDependencyTest.java
similarity index 79%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2696_ConfigurationAndServiceDependencyTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX2696_ConfigurationAndServiceDependencyTest.java
index f2c0543..1ab9e2c 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2696_ConfigurationAndServiceDependencyTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX2696_ConfigurationAndServiceDependencyTest.java
@@ -16,45 +16,30 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.dm.test;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
+package org.apache.felix.dependencymanager.test2.integration.api;
import java.io.IOException;
import java.util.Dictionary;
-import java.util.Properties;
+import java.util.Hashtable;
import junit.framework.Assert;
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
import org.apache.felix.dm.Component;
import org.apache.felix.dm.DependencyManager;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
+import org.ops4j.pax.exam.junit.PaxExam;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
-@RunWith(JUnit4TestRunner.class)
-public class FELIX2696_ConfigurationAndServiceDependencyTest 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.configadmin").version("1.2.4"),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject()
- )
- );
- }
-
+
+@RunWith(PaxExam.class)
+public class FELIX2696_ConfigurationAndServiceDependencyTest extends TestBase {
@Test
- public void testComponentWithRequiredConfigurationAndServicePropertyPropagation(BundleContext context) {
+ public void testComponentWithRequiredConfigurationAndServicePropertyPropagation() {
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
@@ -95,7 +80,7 @@
public void init() {
try {
org.osgi.service.cm.Configuration conf = m_ca.getConfiguration("test", null);
- Properties props = new Properties();
+ Hashtable props = new Hashtable();
props.put("testkey", "testvalue");
conf.update(props);
}
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2955_ShellCommandTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX2955_ShellCommandTest.java
similarity index 75%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2955_ShellCommandTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX2955_ShellCommandTest.java
index bd8e1fc..57d75c7 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2955_ShellCommandTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX2955_ShellCommandTest.java
@@ -16,49 +16,30 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.dm.test;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
+package org.apache.felix.dependencymanager.test2.integration.api;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import junit.framework.Assert;
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
import org.apache.felix.dm.Component;
import org.apache.felix.dm.DependencyManager;
import org.apache.felix.shell.ShellService;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.junit.PaxExam;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-@RunWith(JUnit4TestRunner.class)
-public class FELIX2955_ShellCommandTest extends Base {
+@RunWith(PaxExam.class)
+public class FELIX2955_ShellCommandTest extends TestBase {
private long m_testBundleId;
private Bundle m_deploymentAdmin;
- @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.4"),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.shell").version("1.4.2"),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.deploymentadmin").version("0.9.0").start(false),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject(),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager.shell").versionAsInProject()
- )
- );
- }
-
@Test
- public void testShellCommands(BundleContext context) throws Throwable {
+ public void testShellCommands() throws Throwable {
m_testBundleId = context.getBundle().getBundleId();
for (Bundle b : context.getBundles()) {
if (b.getSymbolicName().equals("org.apache.felix.deploymentadmin")) {
@@ -113,20 +94,20 @@
Thread t = new Thread("Shell Client") {
public void run() {
m_ensure.step(1);
- execute("dm",
+ execute("dm " + m_testBundleId,
"[" + m_testBundleId + "] pax-exam-probe\n" +
" ShellClient registered\n" +
" org.apache.felix.shell.ShellService service required available\n",
"");
m_ensure.step(2);
// see if there's anything that's not available
- execute("dm notavail",
+ execute("dm notavail " + m_testBundleId,
"",
"");
m_ensure.step(3);
// check again, now there should be something missing
m_ensure.waitForStep(4, 5000);
- execute("dm notavail",
+ execute("dm notavail " + m_testBundleId,
"[" + m_testBundleId + "] pax-exam-probe\n" +
" Object unregistered\n" +
" java.lang.Object service required unavailable\n",
@@ -134,7 +115,7 @@
m_ensure.step(5);
m_ensure.waitForStep(6, 5000);
// this next step actually triggers the bug in FELIX-2955
- execute("dm notavail",
+ execute("dm notavail " + m_testBundleId,
"",
"");
m_ensure.step(7);
@@ -152,8 +133,9 @@
try {
ByteArrayOutputStream output = new ByteArrayOutputStream();
ByteArrayOutputStream error = new ByteArrayOutputStream();
- m_shell.executeCommand(command, new PrintStream(output), new PrintStream(error));
- Assert.assertEquals(expectedOutput, output.toString());
+ m_shell.executeCommand(command, new PrintStream(output), new PrintStream(error));
+ // In pax-exam 3.0.0, we have to work around something like "[25] PAXEXAM-PROBE-3f88597d-4bc5-4bf4-affb-74db4e453e71 ..."
+ Assert.assertEquals(expectedOutput, output.toString().replaceAll("PAXEXAM-PROBE.*", "pax-exam-probe"));
Assert.assertEquals(expectedError, error.toString());
}
catch (Throwable throwable) {
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX3337_UpdatedConfigurationDependencyWithPropagationTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX3337_UpdatedConfigurationDependencyWithPropagationTest.java
similarity index 81%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX3337_UpdatedConfigurationDependencyWithPropagationTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX3337_UpdatedConfigurationDependencyWithPropagationTest.java
index c4b0cdb..2d007fa 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX3337_UpdatedConfigurationDependencyWithPropagationTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/FELIX3337_UpdatedConfigurationDependencyWithPropagationTest.java
@@ -16,31 +16,27 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.dm.test;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
+package org.apache.felix.dependencymanager.test2.integration.api;
import java.io.IOException;
import java.util.Dictionary;
-import java.util.Map;
+import java.util.Hashtable;
import java.util.Properties;
import junit.framework.Assert;
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
import org.apache.felix.dm.Component;
import org.apache.felix.dm.DependencyManager;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
+import org.ops4j.pax.exam.junit.PaxExam;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
+
/**
* This test validates the following scenario:
* - Service S1 depends on a ConfigurationDependency with propagate = true
@@ -50,20 +46,8 @@
* - S1 is then called in its updated callback
* - S2 is called in its "change" callback.
*/
-@RunWith(JUnit4TestRunner.class)
-public class FELIX3337_UpdatedConfigurationDependencyWithPropagationTest
-{
- @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.4"),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject()
- )
- );
- }
-
+@RunWith(PaxExam.class)
+public class FELIX3337_UpdatedConfigurationDependencyWithPropagationTest extends TestBase {
/*
* This Pojo creates the configuration pid "test".
*/
@@ -74,7 +58,7 @@
public void init() {
try {
m_conf = m_ca.getConfiguration("test", null);
- Properties props = new Properties();
+ Hashtable props = new Properties();
props.put("testkey", "testvalue");
m_conf.update(props);
}
@@ -85,7 +69,7 @@
public void update() {
try {
- Properties props = new Properties();
+ Hashtable props = new Properties();
props.put("testkey", "testvalue");
props.put("testkey2", "testvalue2");
m_conf.update(props);
@@ -131,7 +115,7 @@
}
@Test
- public void testComponentWithRequiredUpdatedConfigurationAndServicePropertyPropagation(BundleContext context) {
+ public void testComponentWithRequiredUpdatedConfigurationAndServicePropertyPropagation() {
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ServiceTrackerTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/ServiceTrackerTest.java
similarity index 77%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/ServiceTrackerTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/ServiceTrackerTest.java
index 904c74d..fca373b 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/ServiceTrackerTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/ServiceTrackerTest.java
@@ -16,42 +16,26 @@
* 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;
-import static org.ops4j.pax.exam.CoreOptions.provision;
-
-import java.util.Properties;
+import java.util.Hashtable;
import junit.framework.Assert;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
import org.apache.felix.dm.DependencyManager;
import org.apache.felix.dm.ServiceUtil;
import org.apache.felix.dm.tracker.ServiceTracker;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
+import org.ops4j.pax.exam.junit.PaxExam;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceRegistration;
-@RunWith(JUnit4TestRunner.class)
-public class ServiceTrackerTest 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()
- )
- );
- }
-
+@RunWith(PaxExam.class)
+public class ServiceTrackerTest extends TestBase {
@Test
- public void testPlainServiceTracker(BundleContext context) {
+ public void testPlainServiceTracker() {
ServiceTracker st = new ServiceTracker(context, ServiceInterface.class.getName(), null);
st.open();
ServiceRegistration sr = context.registerService(ServiceInterface.class.getName(), new ServiceProvider(), null);
@@ -62,7 +46,7 @@
}
@Test
- public void testAspectServiceTracker(BundleContext context) {
+ public void testAspectServiceTracker() {
ServiceTracker st = new ServiceTracker(context, ServiceInterface.class.getName(), null);
st.open();
@@ -71,12 +55,12 @@
final long sid = ServiceUtil.getServiceId(sr.getReference());
ServiceRegistration asr = context.registerService(ServiceInterface.class.getName(), new ServiceProvider(),
- new Properties() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 10); }});
+ new Hashtable() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 10); }});
Assert.assertEquals("There should be one service that matches the tracker", 1, st.getServices().length);
Assert.assertEquals("Service ranking should be 10", Integer.valueOf(10), (Integer) st.getServiceReference().getProperty(Constants.SERVICE_RANKING));
ServiceRegistration asr2 = context.registerService(ServiceInterface.class.getName(), new ServiceProvider(),
- new Properties() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 20); }});
+ new Hashtable() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 20); }});
Assert.assertEquals("There should be one service that matches the tracker", 1, st.getServices().length);
Assert.assertEquals("Service ranking should be 20", Integer.valueOf(20), (Integer) st.getServiceReference().getProperty(Constants.SERVICE_RANKING));
@@ -95,14 +79,14 @@
}
@Test
- public void testExistingAspectServiceTracker(BundleContext context) {
+ public void testExistingAspectServiceTracker() {
ServiceTracker st = new ServiceTracker(context, ServiceInterface.class.getName(), null);
ServiceRegistration sr = context.registerService(ServiceInterface.class.getName(), new ServiceProvider(), null);
final long sid = ServiceUtil.getServiceId(sr.getReference());
ServiceRegistration asr = context.registerService(ServiceInterface.class.getName(), new ServiceProvider(),
- new Properties() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 10); }});
+ new Hashtable() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 10); }});
ServiceRegistration asr2 = context.registerService(ServiceInterface.class.getName(), new ServiceProvider(),
- new Properties() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 20); }});
+ new Hashtable() {{ put(DependencyManager.ASPECT, sid); put(Constants.SERVICE_RANKING, 20); }});
st.open();
Assert.assertEquals("There should be one service that matches the tracker", 1, st.getServices().length);
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/SharingDependenciesWithMultipleServicesTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/SharingDependenciesWithMultipleServicesTest.java
similarity index 88%
rename from dependencymanager/test/src/test/java/org/apache/felix/dm/test/SharingDependenciesWithMultipleServicesTest.java
rename to dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/SharingDependenciesWithMultipleServicesTest.java
index 1bd6958..51669b8 100644
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/SharingDependenciesWithMultipleServicesTest.java
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/api/SharingDependenciesWithMultipleServicesTest.java
@@ -16,16 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.felix.dm.test;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
+package org.apache.felix.dependencymanager.test2.integration.api;
import java.net.URL;
import java.util.Dictionary;
-import java.util.Properties;
+import java.util.Hashtable;
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
import org.apache.felix.dm.BundleDependency;
import org.apache.felix.dm.Component;
import org.apache.felix.dm.ConfigurationDependency;
@@ -36,9 +34,7 @@
import org.apache.felix.dm.ServiceDependency;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.junit.PaxExam;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
@@ -47,21 +43,10 @@
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
-@RunWith(JUnit4TestRunner.class)
-public class SharingDependenciesWithMultipleServicesTest 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(),
- mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.2.8")
- )
- );
- }
-
+@RunWith(PaxExam.class)
+public class SharingDependenciesWithMultipleServicesTest extends TestBase {
@Test
- public void testShareServiceDependencyWithMultipleServices(BundleContext context) {
+ public void testShareServiceDependencyWithMultipleServices() {
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
@@ -82,7 +67,7 @@
}
@Test
- public void testShareConfigurationDependencyWithMultipleServices(BundleContext context) {
+ public void testShareConfigurationDependencyWithMultipleServices() {
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
@@ -109,7 +94,7 @@
}
@Test
- public void testShareBundleDependencyWithMultipleServices(BundleContext context) {
+ public void testShareBundleDependencyWithMultipleServices() {
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
@@ -127,7 +112,7 @@
}
@Test
- public void testShareResourceDependencyWithMultipleServices(BundleContext context) throws Exception {
+ public void testShareResourceDependencyWithMultipleServices() throws Exception {
DependencyManager m = new DependencyManager(context);
// helper class that ensures certain steps get executed in sequence
Ensure e = new Ensure();
@@ -206,7 +191,7 @@
public void init() {
try {
org.osgi.service.cm.Configuration conf = m_configAdmin.getConfiguration("test", null);
- conf.update(new Properties() {{ put("testkey", "testvalue"); }} );
+ conf.update(new Hashtable() {{ put("testkey", "testvalue"); }} );
m_ensure.step(1);
}
catch (Exception e) {