From 76a651e92a54408ef02779cee1aff057e9d89c2c Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 24 Mar 2009 18:51:23 +0000 Subject: 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 --- .../dosgi/test/CalculatorOSGiNodeTestCase.java | 11 ++-- .../dosgi/test/CalculatorOSGiTestCase.java | 12 ++-- .../calculator/dosgi/test/OSGiTestBundles.java | 6 +- .../calculator-service-descriptions.xml | 65 ++++++++++++++++++++++ 4 files changed, 82 insertions(+), 12 deletions(-) create mode 100644 java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/remote-service/calculator-service-descriptions.xml (limited to 'java/sca/modules/node-impl-osgi/src') 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 @@ + + + + + + sca:SOAP sca:HTTP + sca + + OSGI-INF/sca/bundle.componentType + + + addService + + + + + sca:SOAP sca:HTTP + sca + + OSGI-INF/sca/bundle.componentType + + + subtractService + + + + + sca:SOAP sca:HTTP + sca + + OSGI-INF/sca/bundle.componentType + + + multiplyService + + + + + sca:SOAP sca:HTTP + sca + + OSGI-INF/sca/bundle.componentType + + + divideService + + + -- cgit v1.2.3