summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java12
-rw-r--r--java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml1
-rw-r--r--java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType8
-rw-r--r--java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite38
-rw-r--r--java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite38
-rw-r--r--java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite4
6 files changed, 88 insertions, 13 deletions
diff --git a/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java b/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java
index 7e9433751e..8a6e04807f 100644
--- a/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java
+++ b/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java
@@ -71,7 +71,7 @@ public class OSGiReadImplTestCase {
.getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
OSGiTestBundles.createBundle("target/test-classes/OSGiTestService.jar",
- OSGiTestInterface.class.getName(),
+ "osgi.test",
null,
null,
(String[]) null,
@@ -127,9 +127,9 @@ public class OSGiReadImplTestCase {
public void testReadOSGiImplementation() throws Exception {
String str =
- "<?xml version=\"1.0\" encoding=\"ASCII\"?>" + "<implementation.osgi xmlns=\"http://tuscany.apache.org/xmlns/sca/1.1\" targetNamespace=\"http://osgi\" "
- + "bundleSymbolicName=\"OSGiTestService\" "
- + "bundleVersion=\"2.0.0\" "
+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>" + "<implementation.osgi xmlns=\"http://tuscany.apache.org/xmlns/sca/1.1\" targetNamespace=\"http://test\" "
+ + "bundleSymbolicName=\"osgi.test\" "
+ + "bundleVersion=\"1.0.0\" "
+ "/>";
ByteArrayInputStream is = new ByteArrayInputStream(str.getBytes());
@@ -138,8 +138,8 @@ public class OSGiReadImplTestCase {
OSGiImplementation osgiImpl = (OSGiImplementation)staxProcessor.read(reader);
- assertEquals(osgiImpl.getBundleSymbolicName(), "OSGiTestService");
- assertEquals(osgiImpl.getBundleVersion(), "2.0.0");
+ assertEquals(osgiImpl.getBundleSymbolicName(), "osgi.test");
+ assertEquals(osgiImpl.getBundleVersion(), "1.0.0");
}
}
diff --git a/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml b/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml
index a78433e002..442ab858e9 100644
--- a/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml
+++ b/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml
@@ -18,7 +18,6 @@
* under the License.
-->
<scr:component name="CalculatorComponent"
- immediate="true"
xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
<implementation class="calculator.CalculatorServiceDSImpl" />
<service>
diff --git a/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType b/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType
index df2b34c8c3..73c7ca7c13 100644
--- a/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType
+++ b/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType
@@ -31,22 +31,22 @@
<!-- The reference elment defines an SCA proxy to a remote OSGi service -->
<reference name="addService">
- <interface.java interface="calculator.AddService"/>
+ <interface.java interface="calculator.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.SubtractService"/>
+ <interface.java interface="calculator.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.MultiplyService"/>
+ <interface.java interface="calculator.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.DivideService"/>
+ <interface.java interface="calculator.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/src/test/resources/calculator/calculator.composite b/java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite
new file mode 100644
index 0000000000..9674e6d68f
--- /dev/null
+++ b/java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<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"
+ name="CalculatorComposite">
+
+ <component name="CalculatorComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator" bundleVersion="1.0.0" />
+ <reference name="addService" target="OperationsComponent/AddService">
+ </reference>
+ <reference name="subtractService" target="OperationsComponent/SubtractService">
+ </reference>
+ <reference name="multiplyService" target="OperationsComponent/MultiplyService">
+ </reference>
+ <reference name="divideService" target="OperationsComponent/DivideService">
+ </reference>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite b/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite
new file mode 100644
index 0000000000..8afb7dc8a2
--- /dev/null
+++ b/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<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"
+ name="OperationsComposite">
+
+ <component name="OperationsComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.operations" bundleVersion="1.0.0" />
+ <service name="AddService">
+ </service>
+ <service name="SubtractService">
+ </service>
+ <service name="MultiplyService">
+ </service>
+ <service name="DivideService">
+ </service>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite b/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite
index c5f0f27560..24c5716abd 100644
--- a/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite
+++ b/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite
@@ -24,8 +24,8 @@
name="OSGiTestComposite">
<component name="OSGiTestServiceComponent">
- <tuscany:implementation.osgi bundle="OSGiTestService"
- bundleSymbolicName="org.apache.tuscany.sca.implementation.osgi.test.OSGiTestInterface" />
+ <tuscany:implementation.osgi bundleVersion="1.0.0"
+ bundleSymbolicName="osgi.test" />
<property name="currency" type="xsd:string">USD</property>
<property name="exchangeRate" type="xsd:double">2.0</property>