summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/implementation-osgi-runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/implementation-osgi-runtime/src')
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorActivator.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorActivator.java)4
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorService.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorService.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorServiceDSImpl.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorServiceDSImpl.java)10
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorServiceImpl.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorServiceImpl.java)10
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/AddService.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/AddService.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/AddServiceImpl.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/AddServiceImpl.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/DivideService.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/DivideService.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/DivideServiceImpl.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/DivideServiceImpl.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/MultiplyService.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/MultiplyService.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/MultiplyServiceImpl.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/MultiplyServiceImpl.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/OperationsActivator.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/OperationsActivator.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/SubtractService.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/SubtractService.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/SubtractServiceImpl.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/SubtractServiceImpl.java)2
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java201
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java (renamed from java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/test/CalculatorOSGiTestCase.java)28
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/add-component.xml4
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/calculator-component.xml12
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/divide-component.xml4
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/multiply-component.xml4
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/sca/bundle.componentType10
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/subtract-component.xml4
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/META-INF/MANIFEST.MF (renamed from java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/META-INF/MANIFEST.MF)10
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/calculator.composite (renamed from java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/calculator.composite)4
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/operations/META-INF/MANIFEST.MF (renamed from java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/operations/META-INF/MANIFEST.MF)10
-rw-r--r--java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/operations/operations.composite (renamed from java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/operations/operations.composite)4
25 files changed, 270 insertions, 69 deletions
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorActivator.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorActivator.java
index 1489ae2b07..b2d8ffb44c 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorActivator.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorActivator.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package calculator;
+package calculator.dosgi;
import java.util.Dictionary;
import java.util.Hashtable;
@@ -29,7 +29,7 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
-import calculator.operations.AddService;
+import calculator.dosgi.operations.AddService;
/**
*
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorService.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorService.java
index 0f7dec116f..656b78b717 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorService.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator;
+package calculator.dosgi;
import java.rmi.Remote;
import java.rmi.RemoteException;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorServiceDSImpl.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorServiceDSImpl.java
index 7f9fa6803c..9a1d64077b 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorServiceDSImpl.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorServiceDSImpl.java
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator;
+package calculator.dosgi;
import org.osgi.service.component.ComponentContext;
-import calculator.operations.AddService;
-import calculator.operations.DivideService;
-import calculator.operations.MultiplyService;
-import calculator.operations.SubtractService;
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.SubtractService;
/**
* An implementation of the Calculator service.
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorServiceImpl.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorServiceImpl.java
index 2d36ba76ad..f1f3409d1a 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/CalculatorServiceImpl.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/CalculatorServiceImpl.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator;
+package calculator.dosgi;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
@@ -24,10 +24,10 @@ import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.util.tracker.ServiceTracker;
-import calculator.operations.AddService;
-import calculator.operations.DivideService;
-import calculator.operations.MultiplyService;
-import calculator.operations.SubtractService;
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.SubtractService;
/**
* An implementation of the Calculator service.
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/AddService.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/AddService.java
index 2fe405a322..971500782f 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/AddService.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/AddService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import org.oasisopen.sca.annotation.Remotable;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/AddServiceImpl.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/AddServiceImpl.java
index 685d641b1c..6bdbfa5fb5 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/AddServiceImpl.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/AddServiceImpl.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import java.util.logging.Level;
import java.util.logging.Logger;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/DivideService.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/DivideService.java
index dfc5df6784..49b8a1c0bf 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/DivideService.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/DivideService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import org.oasisopen.sca.annotation.Remotable;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/DivideServiceImpl.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/DivideServiceImpl.java
index 945b0315b0..eafc9b0f4f 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/DivideServiceImpl.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/DivideServiceImpl.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import java.util.logging.Level;
import java.util.logging.Logger;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/MultiplyService.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/MultiplyService.java
index b70c233f1a..f4e59d12ea 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/MultiplyService.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/MultiplyService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import org.oasisopen.sca.annotation.Remotable;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/MultiplyServiceImpl.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/MultiplyServiceImpl.java
index 175322c14d..c2e39ad2f4 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/MultiplyServiceImpl.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/MultiplyServiceImpl.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import java.util.logging.Level;
import java.util.logging.Logger;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/OperationsActivator.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/OperationsActivator.java
index 5da79ee803..7db89cd98d 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/OperationsActivator.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/OperationsActivator.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import java.util.Dictionary;
import java.util.Hashtable;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/SubtractService.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/SubtractService.java
index 1d83a23229..bfb9b820f7 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/SubtractService.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/SubtractService.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import org.oasisopen.sca.annotation.Remotable;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/SubtractServiceImpl.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/SubtractServiceImpl.java
index cf1744bc61..64cc776884 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/operations/SubtractServiceImpl.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/operations/SubtractServiceImpl.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package calculator.operations;
+package calculator.dosgi.operations;
import java.util.logging.Level;
import java.util.logging.Logger;
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
new file mode 100644
index 0000000000..180fd58046
--- /dev/null
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
@@ -0,0 +1,201 @@
+/*
+ * 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 calculator.dosgi.test;
+
+import java.io.File;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.tuscany.sca.contribution.osgi.impl.OSGiBundleActivator;
+import org.apache.tuscany.sca.implementation.osgi.test.OSGiTestBundles;
+import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
+import org.apache.tuscany.sca.node.osgi.impl.NodeImpl;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+import calculator.dosgi.CalculatorActivator;
+import calculator.dosgi.CalculatorService;
+import calculator.dosgi.CalculatorServiceDSImpl;
+import calculator.dosgi.CalculatorServiceImpl;
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.AddServiceImpl;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.DivideServiceImpl;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.MultiplyServiceImpl;
+import calculator.dosgi.operations.OperationsActivator;
+import calculator.dosgi.operations.SubtractService;
+import calculator.dosgi.operations.SubtractServiceImpl;
+
+/**
+ *
+ */
+public class CalculatorOSGiNodeTestCase {
+ private static EquinoxHost host;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ Set<URL> bundles = new HashSet<URL>();
+
+ File plugins = new File("target/test-classes/plugins");
+ for (File f : plugins.listFiles()) {
+ if (f.isFile()) {
+ bundles.add(f.toURI().toURL());
+ }
+ }
+
+ bundles.add(OSGiTestBundles.createBundle("target/test-classes/calculator-bundle.jar",
+ "calculator/META-INF/MANIFEST.MF",
+ new String[] {"OSGI-INF/calculator-component.xml",
+ "OSGI-INF/sca/bundle.componentType",
+ "calculator/calculator.composite"},
+ CalculatorService.class,
+ CalculatorServiceImpl.class,
+ CalculatorServiceDSImpl.class,
+ CalculatorActivator.class));
+
+ bundles.add(OSGiTestBundles.createBundle("target/test-classes/operations-bundle.jar",
+ "calculator/operations/META-INF/MANIFEST.MF",
+ new String[] {"OSGI-INF/add-component.xml",
+ "OSGI-INF/subtract-component.xml",
+ "OSGI-INF/multiply-component.xml",
+ "OSGI-INF/divide-component.xml"},
+ OperationsActivator.class,
+ AddService.class,
+ AddServiceImpl.class,
+ SubtractService.class,
+ SubtractServiceImpl.class,
+ MultiplyService.class,
+ MultiplyServiceImpl.class,
+ DivideService.class,
+ DivideServiceImpl.class));
+ try {
+ host = new EquinoxHost(bundles);
+ BundleContext context = host.start();
+ for (Bundle b : context.getBundles()) {
+ if (b.getSymbolicName().equals("org.eclipse.equinox.ds")) {
+ b.start();
+ System.out.println(string(b, false));
+ }
+ }
+ for (Bundle b : context.getBundles()) {
+ if (b.getSymbolicName().equals("calculator")) {
+ b.start();
+ // HACK
+ OSGiBundleActivator.setBundleContext(b.getBundleContext());
+ NodeImpl node = new NodeImpl(b);
+ node.start();
+ System.out.println(string(b, false));
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ private static <T> T cast(Object obj, Class<T> cls) {
+ if (cls.isInstance(obj)) {
+ return cls.cast(obj);
+ } else {
+ return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(),
+ new Class<?>[] {cls},
+ new InvocationHandlerImpl(obj)));
+ }
+ }
+
+ private static class InvocationHandlerImpl implements InvocationHandler {
+ private Object instance;
+
+ public InvocationHandlerImpl(Object instance) {
+ super();
+ this.instance = instance;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes());
+ return m.invoke(instance, args);
+ }
+
+ }
+
+ @Test
+ public void testOSGi() {
+
+ }
+
+ /**
+ * Returns a string representation of the given bundle.
+ *
+ * @param b
+ * @param verbose
+ * @return
+ */
+ static String string(Bundle bundle, boolean verbose) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName());
+ int s = bundle.getState();
+ if ((s & Bundle.UNINSTALLED) != 0) {
+ sb.append(" UNINSTALLED");
+ }
+ if ((s & Bundle.INSTALLED) != 0) {
+ sb.append(" INSTALLED");
+ }
+ if ((s & Bundle.RESOLVED) != 0) {
+ sb.append(" RESOLVED");
+ }
+ if ((s & Bundle.STARTING) != 0) {
+ sb.append(" STARTING");
+ }
+ if ((s & Bundle.STOPPING) != 0) {
+ sb.append(" STOPPING");
+ }
+ if ((s & Bundle.ACTIVE) != 0) {
+ sb.append(" ACTIVE");
+ }
+
+ if (verbose) {
+ sb.append(" ").append(bundle.getLocation());
+ sb.append(" ").append(bundle.getHeaders());
+ }
+ return sb.toString();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (host != null) {
+ host.stop();
+ }
+ }
+
+}
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/test/CalculatorOSGiTestCase.java b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
index 3477732c5f..0523b74403 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/test/CalculatorOSGiTestCase.java
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package calculator.test;
+package calculator.dosgi.test;
import java.io.File;
import java.lang.reflect.InvocationHandler;
@@ -36,19 +36,19 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import calculator.CalculatorActivator;
-import calculator.CalculatorService;
-import calculator.CalculatorServiceDSImpl;
-import calculator.CalculatorServiceImpl;
-import calculator.operations.AddService;
-import calculator.operations.AddServiceImpl;
-import calculator.operations.DivideService;
-import calculator.operations.DivideServiceImpl;
-import calculator.operations.MultiplyService;
-import calculator.operations.MultiplyServiceImpl;
-import calculator.operations.OperationsActivator;
-import calculator.operations.SubtractService;
-import calculator.operations.SubtractServiceImpl;
+import calculator.dosgi.CalculatorActivator;
+import calculator.dosgi.CalculatorService;
+import calculator.dosgi.CalculatorServiceDSImpl;
+import calculator.dosgi.CalculatorServiceImpl;
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.AddServiceImpl;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.DivideServiceImpl;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.MultiplyServiceImpl;
+import calculator.dosgi.operations.OperationsActivator;
+import calculator.dosgi.operations.SubtractService;
+import calculator.dosgi.operations.SubtractServiceImpl;
/**
*
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/add-component.xml b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/add-component.xml
index f1ed05111a..a7d563023c 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/add-component.xml
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/add-component.xml
@@ -18,8 +18,8 @@
* under the License.
-->
<scr:component name="AddComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.operations.AddServiceImpl" />
+ <implementation class="calculator.dosgi.operations.AddServiceImpl" />
<service>
- <provide interface="calculator.operations.AddService" />
+ <provide interface="calculator.dosgi.operations.AddService" />
</service>
</scr:component>
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/calculator-component.xml b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/calculator-component.xml
index 442ab858e9..3e537df732 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/calculator-component.xml
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/calculator-component.xml
@@ -19,18 +19,18 @@
-->
<scr:component name="CalculatorComponent"
xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.CalculatorServiceDSImpl" />
+ <implementation class="calculator.dosgi.CalculatorServiceDSImpl" />
<service>
- <provide interface="calculator.CalculatorService" />
+ <provide interface="calculator.dosgi.CalculatorService" />
</service>
- <reference name="addService" interface="calculator.operations.AddService" bind="setAddService" unbind="unsetAddService"
+ <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService"
policy="dynamic" />
- <reference name="subtractService" interface="calculator.operations.SubtractService" bind="setSubtractService"
+ <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService"
unbind="unsetSubtractService" policy="dynamic" />
- <reference name="multiplyService" interface="calculator.operations.MultiplyService" bind="setMultiplyService"
+ <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService"
unbind="unsetMultiplyService" policy="dynamic" />
- <reference name="divideService" interface="calculator.operations.DivideService" bind="setDivideService"
+ <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService"
unbind="unsetDivideService" policy="dynamic" />
</scr:component>
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/divide-component.xml b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/divide-component.xml
index 60a6cef4e1..def7fce23c 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/divide-component.xml
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/divide-component.xml
@@ -18,8 +18,8 @@
* under the License.
-->
<scr:component name="DivideComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.operations.DivideServiceImpl" />
+ <implementation class="calculator.dosgi.operations.DivideServiceImpl" />
<service>
- <provide interface="calculator.operations.DivideService" />
+ <provide interface="calculator.dosgi.operations.DivideService" />
</service>
</scr:component>
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/multiply-component.xml b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/multiply-component.xml
index 2fd843b272..57f627f990 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/multiply-component.xml
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/multiply-component.xml
@@ -18,8 +18,8 @@
* under the License.
-->
<scr:component name="MultiplyComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.operations.MultiplyServiceImpl" />
+ <implementation class="calculator.dosgi.operations.MultiplyServiceImpl" />
<service>
- <provide interface="calculator.operations.MultiplyService" />
+ <provide interface="calculator.dosgi.operations.MultiplyService" />
</service>
</scr:component>
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/sca/bundle.componentType b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/sca/bundle.componentType
index 73c7ca7c13..7860094626 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/sca/bundle.componentType
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/sca/bundle.componentType
@@ -23,7 +23,7 @@
<!-- The service elment defines an SCA view of the OSGi service -->
<service name="Calculator">
<!-- The interface will be mapped into the OSGi service class -->
- <interface.java interface="calculator.CalculatorService"/>
+ <interface.java interface="calculator.dosgi.CalculatorService"/>
<!-- The list of OSGi properties -->
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
@@ -31,22 +31,22 @@
<!-- The reference elment defines an SCA proxy to a remote OSGi service -->
<reference name="addService">
- <interface.java interface="calculator.operations.AddService"/>
+ <interface.java interface="calculator.dosgi.operations.AddService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
<reference name="subtractService">
- <interface.java interface="calculator.operations.SubtractService"/>
+ <interface.java interface="calculator.dosgi.operations.SubtractService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
<reference name="multiplyService">
- <interface.java interface="calculator.operations.MultiplyService"/>
+ <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
<reference name="divideService">
- <interface.java interface="calculator.operations.DivideService"/>
+ <interface.java interface="calculator.dosgi.operations.DivideService"/>
<t:osgi.property name="prop1">1</t:osgi.property>
<t:osgi.property name="prop2">ABC</t:osgi.property>
</reference>
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/subtract-component.xml b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/subtract-component.xml
index ceb0a5d821..073ee5ea40 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/subtract-component.xml
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/OSGI-INF/subtract-component.xml
@@ -18,8 +18,8 @@
* under the License.
-->
<scr:component name="SubtractComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.operations.SubtractServiceImpl" />
+ <implementation class="calculator.dosgi.operations.SubtractServiceImpl" />
<service>
- <provide interface="calculator.operations.SubtractService" />
+ <provide interface="calculator.dosgi.operations.SubtractService" />
</service>
</scr:component>
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/META-INF/MANIFEST.MF b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/META-INF/MANIFEST.MF
index 808cc60c79..f0f640541f 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/META-INF/MANIFEST.MF
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/META-INF/MANIFEST.MF
@@ -1,15 +1,15 @@
Manifest-Version: 1.0
-Export-Package: calculator;version="1.0.0"
+Export-Package: calculator.dosgi;version="1.0.0"
Bundle-Version: 1.0.0
-Bundle-Name: calculator
-Bundle-Activator: calculator.CalculatorActivator
+Bundle-Name: calculator.dosgi
+Bundle-Activator: calculator.dosgi.CalculatorActivator
Bundle-ManifestVersion: 2
-Import-Package: calculator.operations;version="1.0.0",
+Import-Package: calculator.dosgi.operations;version="1.0.0",
org.osgi.framework,
org.osgi.service.packageadmin,
org.osgi.util.tracker,
org.osgi.service.component;resolution:=optional
-Bundle-SymbolicName: calculator
+Bundle-SymbolicName: calculator.dosgi
Bundle-Vendor: The Apache Software Foundation
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/calculator.composite b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/calculator.composite
index 9674e6d68f..44d53f6345 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/calculator.composite
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/calculator.composite
@@ -20,11 +20,11 @@
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://calculator"
+ targetNamespace="http://calculator.dosgi"
name="CalculatorComposite">
<component name="CalculatorComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator" bundleVersion="1.0.0" />
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
<reference name="addService" target="OperationsComponent/AddService">
</reference>
<reference name="subtractService" target="OperationsComponent/SubtractService">
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/operations/META-INF/MANIFEST.MF b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/operations/META-INF/MANIFEST.MF
index 1414d227b0..2dbead0b88 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/operations/META-INF/MANIFEST.MF
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/operations/META-INF/MANIFEST.MF
@@ -1,13 +1,13 @@
Manifest-Version: 1.0
-Export-Package: calculator.operations;version="1.0.0"
+Export-Package: calculator.dosgi.operations;version="1.0.0"
Bundle-Version: 1.0.0
-Bundle-Name: calculator.operations
-Bundle-Activator: calculator.operations.OperationsActivator
+Bundle-Name: calculator.dosgi.operations
+Bundle-Activator: calculator.dosgi.operations.OperationsActivator
Bundle-ManifestVersion: 2
-Import-Package: calculator.operations;version="1.0.0",
+Import-Package: calculator.dosgi.operations;version="1.0.0",
org.osgi.framework,
org.osgi.service.component;resolution:=optional
-Bundle-SymbolicName: calculator.operations
+Bundle-SymbolicName: calculator.dosgi.operations
Bundle-Vendor: The Apache Software Foundation
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
diff --git a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/operations/operations.composite b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/operations/operations.composite
index 8afb7dc8a2..14c2b6a4e4 100644
--- a/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/operations/operations.composite
+++ b/java/sca/modules/implementation-osgi-runtime/src/test/resources/calculator/dosgi/operations/operations.composite
@@ -20,11 +20,11 @@
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://calculator"
+ targetNamespace="http://calculator.dosgi"
name="OperationsComposite">
<component name="OperationsComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.operations" bundleVersion="1.0.0" />
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
<service name="AddService">
</service>
<service name="SubtractService">