diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-25 06:18:08 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-25 06:18:08 +0000 |
commit | 61bc9db44a50cd6c07a790b41e559cdd119cb850 (patch) | |
tree | b175867ceaf9ff5b0c3740bcaa4a0f2dc063de3c /java/sca/modules | |
parent | 1bcac3456224bd6678bd5e6247bf1c11ed1d8f19 (diff) |
Refactor the structure for test resources
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@758155 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
11 files changed, 177 insertions, 436 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 bda8b0bdbb..06ad78d7a5 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 @@ -19,9 +19,10 @@ package calculator.dosgi.test; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; +import static calculator.dosgi.test.OSGiTestBundles.generateCalculatorBundle; +import static calculator.dosgi.test.OSGiTestBundles.generateOperationsBundle; +import static calculator.dosgi.test.OSGiTestBundles.bundleStatus; + import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; @@ -37,19 +38,7 @@ import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; -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; /** * @@ -81,49 +70,12 @@ public class CalculatorOSGiNodeTestCase { if (client == null || client.booleanValue()) { System.out.println("Generating calculator.dosgi bundle..."); - bundles.add(OSGiTestBundles.createBundle("target/test-classes/calculator-bundle.jar", - "calculator/dosgi/META-INF/MANIFEST.MF", - new String[][] { - {"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", - "OSGI-INF/sca/bundle.composite"}}, - CalculatorService.class, - // Package the interfaces so that the operations bundle can be remote - AddService.class, - SubtractService.class, - MultiplyService.class, - DivideService.class, - CalculatorServiceImpl.class, - CalculatorServiceDSImpl.class, - CalculatorActivator.class)); + bundles.add(generateCalculatorBundle()); } if (client == null || !client.booleanValue()) { System.out.println("Generating calculator.dosgi.operations bundle..."); - bundles.add(OSGiTestBundles - .createBundle("target/test-classes/operations-bundle.jar", - "calculator/dosgi/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"}, - {"calculator/dosgi/operations/bundle.componentType", - "OSGI-INF/sca/bundle.componentType"}, - {"calculator/dosgi/operations/operations.composite", - "OSGI-INF/sca/bundle.composite"}}, - OperationsActivator.class, - AddService.class, - AddServiceImpl.class, - SubtractService.class, - SubtractServiceImpl.class, - MultiplyService.class, - MultiplyServiceImpl.class, - DivideService.class, - DivideServiceImpl.class)); + bundles.add(generateOperationsBundle()); } host = new EquinoxHost(); context = host.start(); @@ -136,16 +88,16 @@ public class CalculatorOSGiNodeTestCase { try { b.start(); } catch (Exception e) { - System.out.println(string(b, false)); + System.out.println(bundleStatus(b, false)); e.printStackTrace(); } - System.out.println(string(b, false)); + System.out.println(bundleStatus(b, false)); } } for (Bundle b : context.getBundles()) { if (b.getSymbolicName().startsWith("calculator.dosgi")) { b.start(); - System.out.println(string(b, false)); + System.out.println(bundleStatus(b, false)); } } } catch (Exception e) { @@ -154,31 +106,6 @@ public class CalculatorOSGiNodeTestCase { } } - 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() { if (client == null || client.booleanValue()) { @@ -186,7 +113,7 @@ public class CalculatorOSGiNodeTestCase { Assert.assertNotNull(ref); Object service = context.getService(ref); Assert.assertNotNull(service); - CalculatorService calculator = cast(service, CalculatorService.class); + CalculatorService calculator = OSGiTestBundles.cast(service, CalculatorService.class); System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0)); System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0)); System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0)); @@ -195,43 +122,6 @@ public class CalculatorOSGiNodeTestCase { } /** - * 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 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 18d762638d..c77aa8e569 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 @@ -19,9 +19,8 @@ package calculator.dosgi.test; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; +import static calculator.dosgi.test.OSGiTestBundles.bundleStatus; + import java.net.URL; import java.util.HashSet; import java.util.Set; @@ -34,19 +33,7 @@ import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; -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; /** * @@ -61,39 +48,9 @@ public class CalculatorOSGiTestCase { public static void setUpBeforeClass() throws Exception { Set<URL> bundles = new HashSet<URL>(); - bundles.add(OSGiTestBundles.createBundle("target/test-classes/calculator-bundle.jar", - "calculator/dosgi/META-INF/MANIFEST.MF", - new String[][] { - {"OSGI-INF/calculator-component.xml"}, - {"calculator/dosgi/bundle.componentType", - "OSGI-INF/sca/bundle.componentType"}, - {"calculator/dosgi/calculator.composite", - "OSGI-INF/sca/bundle.composite"}}, - CalculatorService.class, - CalculatorServiceImpl.class, - CalculatorServiceDSImpl.class, - CalculatorActivator.class)); + bundles.add(OSGiTestBundles.generateCalculatorBundle()); - bundles.add(OSGiTestBundles.createBundle("target/test-classes/operations-bundle.jar", - "calculator/dosgi/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"}, - {"calculator/dosgi/operations/bundle.componentType", - "OSGI-INF/sca/bundle.componentType"}, - {"calculator/dosgi/operations/operations.composite", - "OSGI-INF/sca/bundle.composite"}}, - OperationsActivator.class, - AddService.class, - AddServiceImpl.class, - SubtractService.class, - SubtractServiceImpl.class, - MultiplyService.class, - MultiplyServiceImpl.class, - DivideService.class, - DivideServiceImpl.class)); + bundles.add(OSGiTestBundles.generateOperationsBundle()); try { host = new EquinoxHost(); BundleContext context = host.start(); @@ -102,15 +59,15 @@ public class CalculatorOSGiTestCase { } for (Bundle b : context.getBundles()) { if (b.getSymbolicName().equals("org.eclipse.equinox.ds")) { - System.out.println(string(b, false)); + System.out.println(bundleStatus(b, false)); b.start(); - System.out.println(string(b, false)); + System.out.println(bundleStatus(b, false)); } } for (Bundle b : context.getBundles()) { if (b.getSymbolicName().startsWith("calculator.dosgi")) { b.start(); - System.out.println(string(b, false)); + System.out.println(bundleStatus(b, false)); } } @@ -120,7 +77,7 @@ public class CalculatorOSGiTestCase { String filter = "(component.name=CalculatorComponent)"; System.out.println(filter); ServiceReference ref = context.getServiceReferences(CalculatorService.class.getName(), filter)[0]; - CalculatorService calculator = cast(context.getService(ref), CalculatorService.class); + CalculatorService calculator = OSGiTestBundles.cast(context.getService(ref), CalculatorService.class); System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0)); System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0)); System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0)); @@ -131,74 +88,12 @@ public class CalculatorOSGiTestCase { } } - 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 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 6898ce30f9..610a0473e6 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 @@ -26,6 +26,9 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +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; @@ -33,9 +36,24 @@ import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import java.util.zip.ZipEntry; +import org.osgi.framework.Bundle; import org.osgi.framework.BundleActivator; import org.osgi.framework.Constants; +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; + /** * * Utility class to create OSGi bundles @@ -43,6 +61,21 @@ import org.osgi.framework.Constants; * @version $Rev$ $Date$ */ public class OSGiTestBundles { + 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); + } + + } + private static String getPackageName(Class<?> cls) { String name = cls.getName(); int index = name.lastIndexOf('.'); @@ -184,4 +217,105 @@ public class OSGiTestBundles { jarOut.write(fileContents); jarOut.closeEntry(); } + + static URL generateCalculatorBundle() throws IOException { + return createBundle("target/test-classes/calculator-bundle.jar", + "calculator/dosgi/META-INF/MANIFEST.MF", + new String[][] { + { + "calculator/dosgi/OSGI-INF/remote-service/calculator-service-descriptions.xml", + "OSGI-INF/remote-service/calculator-service-descriptions.xml"}, + {"calculator/dosgi/OSGI-INF/calculator-component.xml", + "OSGI-INF/calculator-component.xml"}, + {"calculator/dosgi/bundle.componentType", + "OSGI-INF/sca/bundle.componentType"}, + {"calculator/dosgi/calculator.composite", "OSGI-INF/sca/bundle.composite"}, + {"calculator/dosgi/META-INF/sca-contribution.xml", + "META-INF/sca-contribution.xml"}}, + CalculatorService.class, + // Package the interfaces so that the operations bundle can be remote + AddService.class, + SubtractService.class, + MultiplyService.class, + DivideService.class, + CalculatorServiceImpl.class, + CalculatorServiceDSImpl.class, + CalculatorActivator.class); + } + + static URL generateOperationsBundle() throws IOException { + return createBundle("target/test-classes/operations-bundle.jar", + "calculator/dosgi/operations/META-INF/MANIFEST.MF", + new String[][] { + {"calculator/dosgi/operations/OSGI-INF/add-component.xml", + "OSGI-INF/add-component.xml"}, + {"calculator/dosgi/operations/OSGI-INF/subtract-component.xml", + "OSGI-INF/subtract-component.xml"}, + {"calculator/dosgi/operations/OSGI-INF/multiply-component.xml", + "OSGI-INF/multiply-component.xml"}, + {"calculator/dosgi/operations/OSGI-INF/divide-component.xml", + "OSGI-INF/divide-component.xml"}, + {"calculator/dosgi/operations/bundle.componentType", + "OSGI-INF/sca/bundle.componentType"}, + {"calculator/dosgi/operations/operations.composite", + "OSGI-INF/sca/bundle.composite"}, + {"calculator/dosgi/operations/META-INF/sca-contribution.xml", + "META-INF/sca-contribution.xml"}}, + OperationsActivator.class, + AddService.class, + AddServiceImpl.class, + SubtractService.class, + SubtractServiceImpl.class, + MultiplyService.class, + MultiplyServiceImpl.class, + DivideService.class, + DivideServiceImpl.class); + } + + /** + * Returns a string representation of the given bundle. + * + * @param b + * @param verbose + * @return + */ + static String bundleStatus(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(); + } + + 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))); + } + } } diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/add-component.xml b/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/add-component.xml deleted file mode 100644 index a7d563023c..0000000000 --- a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/add-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?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. ---> -<scr:component name="AddComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.AddServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.AddService" /> - </service> -</scr:component> diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/calculator-component.xml b/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/calculator-component.xml deleted file mode 100644 index 3e537df732..0000000000 --- a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/calculator-component.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?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. ---> -<scr:component name="CalculatorComponent" - xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.CalculatorServiceDSImpl" /> - <service> - <provide interface="calculator.dosgi.CalculatorService" /> - </service> - - <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService" - policy="dynamic" /> - <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService" - unbind="unsetSubtractService" policy="dynamic" /> - <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService" - unbind="unsetMultiplyService" policy="dynamic" /> - <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService" - unbind="unsetDivideService" policy="dynamic" /> - -</scr:component> diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/divide-component.xml b/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/divide-component.xml deleted file mode 100644 index def7fce23c..0000000000 --- a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/divide-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?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. ---> -<scr:component name="DivideComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.DivideServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.DivideService" /> - </service> -</scr:component> diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/multiply-component.xml b/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/multiply-component.xml deleted file mode 100644 index 57f627f990..0000000000 --- a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/multiply-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?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. ---> -<scr:component name="MultiplyComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.MultiplyServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.MultiplyService" /> - </service> -</scr:component> 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 deleted file mode 100644 index 25e96fe490..0000000000 --- a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/remote-service/calculator-service-descriptions.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?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> diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/subtract-component.xml b/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/subtract-component.xml deleted file mode 100644 index 073ee5ea40..0000000000 --- a/java/sca/modules/node-impl-osgi/src/test/resources/OSGI-INF/subtract-component.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?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. ---> -<scr:component name="SubtractComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0"> - <implementation class="calculator.dosgi.operations.SubtractServiceImpl" /> - <service> - <provide interface="calculator.dosgi.operations.SubtractService" /> - </service> -</scr:component> diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/META-INF/sca-contribution.xml b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/META-INF/sca-contribution.xml index 1149eb5cbf..b14b3516f6 100644 --- a/java/sca/modules/node-impl-osgi/src/test/resources/META-INF/sca-contribution.xml +++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/META-INF/sca-contribution.xml @@ -19,6 +19,6 @@ --> <contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" - xmlns:sc="http://sample/composite"> - <deployable composite="sc:HelloWorld" /> + xmlns:c="http://calculator.dosgi"> + <deployable composite="c:CalculatorComposite" /> </contribution> diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/META-INF/sca-contribution.xml b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..16a33f4f65 --- /dev/null +++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ +<?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. +--> +<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" + xmlns:c="http://calculator.dosgi"> + <deployable composite="c:OperationsComposite" /> +</contribution> |