summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-impl-osgi/src/test
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-24 18:51:23 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-24 18:51:23 +0000
commit76a651e92a54408ef02779cee1aff057e9d89c2c (patch)
treec8ffc3d7040ab7947d3207b7dc3eec690998c221 /java/sca/modules/node-impl-osgi/src/test
parent48e4adb6cc908419f0d89fb3b527c14a8a162312 (diff)
Add coding to parse RFC-119 service-descriptions file
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@757952 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-impl-osgi/src/test')
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java11
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java12
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/OSGiTestBundles.java6
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/remote-service/calculator-service-descriptions.xml65
4 files changed, 82 insertions, 12 deletions
diff --git a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
index dbb45dedb4..bda8b0bdbb 100644
--- a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
+++ b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
@@ -84,7 +84,8 @@ public class CalculatorOSGiNodeTestCase {
bundles.add(OSGiTestBundles.createBundle("target/test-classes/calculator-bundle.jar",
"calculator/dosgi/META-INF/MANIFEST.MF",
new String[][] {
- {"OSGI-INF/calculator-component.xml", null},
+ {"OSGI-INF/remote-service/calculator-service-descriptions.xml"},
+ {"OSGI-INF/calculator-component.xml"},
{"calculator/dosgi/bundle.componentType",
"OSGI-INF/sca/bundle.componentType"},
{"calculator/dosgi/calculator.composite",
@@ -106,10 +107,10 @@ public class CalculatorOSGiNodeTestCase {
.createBundle("target/test-classes/operations-bundle.jar",
"calculator/dosgi/operations/META-INF/MANIFEST.MF",
new String[][] {
- {"OSGI-INF/add-component.xml", null},
- {"OSGI-INF/subtract-component.xml", null},
- {"OSGI-INF/multiply-component.xml", null},
- {"OSGI-INF/divide-component.xml", null},
+ {"OSGI-INF/add-component.xml"},
+ {"OSGI-INF/subtract-component.xml"},
+ {"OSGI-INF/multiply-component.xml"},
+ {"OSGI-INF/divide-component.xml"},
{"calculator/dosgi/operations/bundle.componentType",
"OSGI-INF/sca/bundle.componentType"},
{"calculator/dosgi/operations/operations.composite",
diff --git a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
index 6ff261d01f..18d762638d 100644
--- a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
+++ b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
@@ -64,7 +64,7 @@ public class CalculatorOSGiTestCase {
bundles.add(OSGiTestBundles.createBundle("target/test-classes/calculator-bundle.jar",
"calculator/dosgi/META-INF/MANIFEST.MF",
new String[][] {
- {"OSGI-INF/calculator-component.xml", null},
+ {"OSGI-INF/calculator-component.xml"},
{"calculator/dosgi/bundle.componentType",
"OSGI-INF/sca/bundle.componentType"},
{"calculator/dosgi/calculator.composite",
@@ -77,10 +77,10 @@ public class CalculatorOSGiTestCase {
bundles.add(OSGiTestBundles.createBundle("target/test-classes/operations-bundle.jar",
"calculator/dosgi/operations/META-INF/MANIFEST.MF",
new String[][] {
- {"OSGI-INF/add-component.xml", null},
- {"OSGI-INF/subtract-component.xml", null},
- {"OSGI-INF/multiply-component.xml", null},
- {"OSGI-INF/divide-component.xml", null},
+ {"OSGI-INF/add-component.xml"},
+ {"OSGI-INF/subtract-component.xml"},
+ {"OSGI-INF/multiply-component.xml"},
+ {"OSGI-INF/divide-component.xml"},
{"calculator/dosgi/operations/bundle.componentType",
"OSGI-INF/sca/bundle.componentType"},
{"calculator/dosgi/operations/operations.composite",
@@ -113,7 +113,7 @@ public class CalculatorOSGiTestCase {
System.out.println(string(b, false));
}
}
-
+
// Sleep for 1 sec so that the DS is available
Thread.sleep(1000);
// Use the DS version
diff --git a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/OSGiTestBundles.java b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/OSGiTestBundles.java
index 1a7b961271..6898ce30f9 100644
--- a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/OSGiTestBundles.java
+++ b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/OSGiTestBundles.java
@@ -64,7 +64,11 @@ public class OSGiTestBundles {
if (resources != null) {
for (String resource[] : resources) {
- addResource(jarOut, OSGiTestBundles.class.getClassLoader(), resource[0], resource[1]);
+ if (resource.length >= 1) {
+ String r1 = resource[0];
+ String r2 = resource.length > 1 ? resource[1] : r1;
+ addResource(jarOut, OSGiTestBundles.class.getClassLoader(), r1, r2);
+ }
}
}
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/remote-service/calculator-service-descriptions.xml b/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/remote-service/calculator-service-descriptions.xml
new file mode 100644
index 0000000000..25e96fe490
--- /dev/null
+++ b/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/remote-service/calculator-service-descriptions.xml
@@ -0,0 +1,65 @@
+<?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.
+-->
+<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+ <service-description>
+ <provide interface="calculator.operations.AddService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ addService
+ </property>
+ </service-description>
+ <service-description>
+ <provide interface="calculator.operations.SubtractService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ subtractService
+ </property>
+ </service-description>
+ <service-description>
+ <provide interface="calculator.operations.MultiplyService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ multiplyService
+ </property>
+ </service-description>
+ <service-description>
+ <provide interface="calculator.operations.DivideService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ divideService
+ </property>
+ </service-description>
+</service-descriptions>