You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2009/03/12 00:34:46 UTC

svn commit: r752694 - in /tuscany/java/sca/modules/implementation-osgi: ./ src/test/java/calculator/ src/test/java/calculator/test/ src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/ src/test/java/org/apache/tuscany/sca/implementation/os...

Author: rfeng
Date: Wed Mar 11 23:34:46 2009
New Revision: 752694

URL: http://svn.apache.org/viewvc?rev=752694&view=rev
Log:
Add OSGi DS files

Added:
    tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceDSImpl.java   (with props)
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/add-component.xml   (with props)
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml   (with props)
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/divide-component.xml   (with props)
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/multiply-component.xml   (with props)
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/subtract-component.xml   (with props)
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/META-INF/
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/META-INF/MANIFEST.MF
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/META-INF/
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/META-INF/MANIFEST.MF
Modified:
    tuscany/java/sca/modules/implementation-osgi/pom.xml
    tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceImpl.java
    tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/test/CalculatorOSGiTestCase.java
    tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java
    tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java
    tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java

Modified: tuscany/java/sca/modules/implementation-osgi/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/pom.xml?rev=752694&r1=752693&r2=752694&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/pom.xml (original)
+++ tuscany/java/sca/modules/implementation-osgi/pom.xml Wed Mar 11 23:34:46 2009
@@ -42,6 +42,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.eclipse.osgi</groupId>
+            <artifactId>services</artifactId>
+            <version>3.1.200-v20070605</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-node-api</artifactId>
             <version>2.0-SNAPSHOT</version>

Added: tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceDSImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceDSImpl.java?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceDSImpl.java (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceDSImpl.java Wed Mar 11 23:34:46 2009
@@ -0,0 +1,90 @@
+/*
+ * 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;
+
+import calculator.operations.AddService;
+import calculator.operations.DivideService;
+import calculator.operations.MultiplyService;
+import calculator.operations.SubtractService;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceDSImpl implements CalculatorService {
+    private AddService addService;
+    private SubtractService subtractService;
+    private MultiplyService multiplyService;
+    private DivideService divideService;
+
+    public CalculatorServiceDSImpl() {
+        super();
+    }
+
+    /*
+    protected void activate(ComponentContext context) {
+    }
+    
+    protected void deactivate(ComponentContext context) {
+    }
+    */
+
+    /*
+     * The following setters can be used for DS injection
+     */
+    public void setAddService(AddService addService) {
+        this.addService = addService;
+    }
+
+    public void setSubtractService(SubtractService subtractService) {
+        this.subtractService = subtractService;
+    }
+
+    public void setDivideService(DivideService divideService) {
+        this.divideService = divideService;
+    }
+
+    public void setMultiplyService(MultiplyService multiplyService) {
+        this.multiplyService = multiplyService;
+    }
+
+    private <T> T getService(Class<T> cls) {
+        for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) {
+            if (cls.isInstance(s)) {
+                return cls.cast(s);
+            }
+        }
+        throw new IllegalStateException(cls.getSimpleName() + " is not available");
+    }
+
+    public double add(double n1, double n2) {
+        return getService(AddService.class).add(n1, n2);
+    }
+
+    public double subtract(double n1, double n2) {
+        return getService(SubtractService.class).subtract(n1, n2);
+    }
+
+    public double multiply(double n1, double n2) {
+        return getService(MultiplyService.class).multiply(n1, n2);
+    }
+
+    public double divide(double n1, double n2) {
+        return getService(DivideService.class).divide(n1, n2);
+    }
+}

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceDSImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceDSImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceImpl.java?rev=752694&r1=752693&r2=752694&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceImpl.java (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/CalculatorServiceImpl.java Wed Mar 11 23:34:46 2009
@@ -33,17 +33,17 @@
  * An implementation of the Calculator service.
  */
 public class CalculatorServiceImpl implements CalculatorService {
-    private AddService addService;
-    private SubtractService subtractService;
-    private MultiplyService multiplyService;
-    private DivideService divideService;
+//    private AddService addService;
+//    private SubtractService subtractService;
+//    private MultiplyService multiplyService;
+//    private DivideService divideService;
+
+    private ServiceTracker tracker;
 
     public CalculatorServiceImpl() {
         super();
     }
 
-    private ServiceTracker tracker;
-
     public CalculatorServiceImpl(BundleContext context) {
         super();
         Filter filter = null;
@@ -59,6 +59,7 @@
     /*
      * The following setters can be used for DS injection
      */
+    /*
     public void setAddService(AddService addService) {
         this.addService = addService;
     }
@@ -74,6 +75,7 @@
     public void setMultiplyService(MultiplyService multiplyService) {
         this.multiplyService = multiplyService;
     }
+    */
 
     private <T> T getService(Class<T> cls) {
         for (Object s : tracker.getServices()) {

Modified: tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/test/CalculatorOSGiTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/test/CalculatorOSGiTestCase.java?rev=752694&r1=752693&r2=752694&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/test/CalculatorOSGiTestCase.java (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/java/calculator/test/CalculatorOSGiTestCase.java Wed Mar 11 23:34:46 2009
@@ -62,17 +62,18 @@
         Set<URL> bundles = new HashSet<URL>();
         bundles.add(OSGiTestBundles
             .createBundle("target/test-classes/calculator-bundle.jar",
-                          "calculator",
-                          "calculator",
-                          "calculator.operations,org.osgi.service.packageadmin,org.osgi.util.tracker",
+                          "calculator/META-INF/MANIFEST.MF",
+                          new String[] {"OSGI-INF/calculator-component.xml"},
                           CalculatorService.class,
                           CalculatorServiceImpl.class,
                           CalculatorActivator.class));
 
         bundles.add(OSGiTestBundles.createBundle("target/test-classes/operations-bundle.jar",
-                                                 "calculator.operations",
-                                                 "calculator.operations",
-                                                 "calculator.operations",
+                                                 "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,

Modified: tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java?rev=752694&r1=752693&r2=752694&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiTestCase.java Wed Mar 11 23:34:46 2009
@@ -54,6 +54,7 @@
                                      OSGiTestInterface.class.getName(),
                                      null,
                                      null,
+                                     (String[]) null,
                                      OSGiTestImpl.class, OSGiTestInterface.class);
 
         node =

Modified: tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java?rev=752694&r1=752693&r2=752694&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/test/OSGiTestBundles.java Wed Mar 11 23:34:46 2009
@@ -25,6 +25,7 @@
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
@@ -48,11 +49,42 @@
         return index == -1 ? "" : name.substring(0, index);
     }
 
+    public static URL createBundle(String jarName, String mfFile, String[] resources, Class<?>... classes)
+        throws IOException {
+        InputStream is = OSGiTestBundles.class.getClassLoader().getResourceAsStream(mfFile);
+        Manifest manifest = new Manifest(is);
+        is.close();
+
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        JarOutputStream jarOut = new JarOutputStream(out, manifest);
+
+        for (Class<?> cls : classes) {
+            addClass(jarOut, cls);
+        }
+
+        if (resources != null) {
+            for (String resource : resources) {
+                addResource(jarOut, OSGiTestBundles.class.getClassLoader(), resource);
+            }
+        }
+
+        jarOut.close();
+        out.close();
+
+        File jar = new File(jarName);
+        FileOutputStream fileOut = new FileOutputStream(jar);
+        fileOut.write(out.toByteArray());
+        fileOut.close();
+
+        return jar.toURI().toURL();
+    }
+
     public static URL createBundle(String jarName,
                                    String bundleName,
                                    String exports,
                                    String imports,
-                                   Class<?>... classes) throws Exception {
+                                   String[] resources,
+                                   Class<?>... classes) throws IOException {
 
         Class<?> activator = null;
         Set<String> packages = new HashSet<String>();
@@ -103,6 +135,12 @@
             addClass(jarOut, cls);
         }
 
+        if (resources != null) {
+            for (String resource : resources) {
+                addResource(jarOut, OSGiTestBundles.class.getClassLoader(), resource);
+            }
+        }
+
         jarOut.close();
         out.close();
 
@@ -115,12 +153,19 @@
     }
 
     private static void addClass(JarOutputStream jarOut, Class<?> javaClass) throws IOException, FileNotFoundException {
-        String interfaceClassName = javaClass.getName().replaceAll("\\.", "/") + ".class";
+        String classFile = javaClass.getName().replace('.', '/') + ".class";
+
+        ClassLoader cl = javaClass.getClassLoader();
+
+        addResource(jarOut, cl, classFile);
+    }
 
-        URL url = javaClass.getClassLoader().getResource(interfaceClassName);
+    private static void addResource(JarOutputStream jarOut, ClassLoader cl, String resourceName) throws IOException,
+        FileNotFoundException {
+        URL url = cl.getResource(resourceName);
         String path = url.getPath();
 
-        ZipEntry ze = new ZipEntry(interfaceClassName);
+        ZipEntry ze = new ZipEntry(resourceName);
 
         jarOut.putNextEntry(ze);
         FileInputStream file = new FileInputStream(path);

Modified: tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java?rev=752694&r1=752693&r2=752694&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java Wed Mar 11 23:34:46 2009
@@ -74,6 +74,7 @@
                                      OSGiTestInterface.class.getName(),
                                      null,
                                      null,
+                                     (String[]) null,
                                      OSGiTestImpl.class, OSGiTestInterface.class);
 
     }

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/add-component.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/add-component.xml?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/add-component.xml (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/add-component.xml Wed Mar 11 23:34:46 2009
@@ -0,0 +1,25 @@
+<?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.    
+-->
+<component name="AddComponent" xmlns="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.operations.AddServiceImpl" />
+    <service>
+        <provide interface="calculator.operations.AddService" />
+    </service>
+</component>

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/add-component.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/add-component.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml Wed Mar 11 23:34:46 2009
@@ -0,0 +1,35 @@
+<?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.    
+-->
+<component name="CalculatorComponent" xmlns="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.CalculatorServiceImpl" />
+    <service>
+        <provide interface="calculator.CalculatorService" />
+    </service>
+
+    <reference name="addService" interface="calculator.AddService" bind="setAddService" unbind="setAddService"
+        policy="dynamic" />
+    <reference name="subtractService" interface="calculator.SubtractService" bind="setSubtractService" unbind="setSubtractService"
+        policy="dynamic" />
+    <reference name="multiplyService" interface="calculator.MultiplyService" bind="setMultiplyService" unbind="setMultiplyService"
+        policy="dynamic" />
+    <reference name="divideService" interface="calculator.DivideService" bind="setDivideService" unbind="setDivideService"
+        policy="dynamic" />
+
+</component>

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/divide-component.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/divide-component.xml?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/divide-component.xml (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/divide-component.xml Wed Mar 11 23:34:46 2009
@@ -0,0 +1,25 @@
+<?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.    
+-->
+<component name="DivideComponent" xmlns="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.operations.DivideServiceImpl" />
+    <service>
+        <provide interface="calculator.operations.DivideService" />
+    </service>
+</component>

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/divide-component.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/divide-component.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/multiply-component.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/multiply-component.xml?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/multiply-component.xml (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/multiply-component.xml Wed Mar 11 23:34:46 2009
@@ -0,0 +1,25 @@
+<?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.    
+-->
+<component name="MultiplyComponent" xmlns="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.operations.MultiplyServiceImpl" />
+    <service>
+        <provide interface="calculator.operations.MultiplyService" />
+    </service>
+</component>

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/multiply-component.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/multiply-component.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/subtract-component.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/subtract-component.xml?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/subtract-component.xml (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/subtract-component.xml Wed Mar 11 23:34:46 2009
@@ -0,0 +1,25 @@
+<?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.    
+-->
+<component name="SubtractComponent" xmlns="http://www.osgi.org/xmlns/scr/v1.0.0">
+    <implementation class="calculator.operations.SubtractServiceImpl" />
+    <service>
+        <provide interface="calculator.operations.SubtractService" />
+    </service>
+</component>

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/subtract-component.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/subtract-component.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/META-INF/MANIFEST.MF?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/META-INF/MANIFEST.MF (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/META-INF/MANIFEST.MF Wed Mar 11 23:34:46 2009
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Export-Package: calculator;version="1.0.0"
+Bundle-Version: 1.0.0
+Bundle-Name: calculator
+Bundle-Activator: calculator.CalculatorActivator
+Bundle-ManifestVersion: 2
+Import-Package: calculator.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-Vendor: The Apache Software Foundation
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-DocURL: http://www.apache.org/
+Service-Component: OSGI-INF/calculator-component.xml

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/META-INF/MANIFEST.MF?rev=752694&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/META-INF/MANIFEST.MF (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/META-INF/MANIFEST.MF Wed Mar 11 23:34:46 2009
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Export-Package: calculator.operations;version="1.0.0"
+Bundle-Version: 1.0.0
+Bundle-Name: calculator.operations
+Bundle-Activator: calculator.operations.OperationsActivator
+Bundle-ManifestVersion: 2
+Import-Package: calculator.operations;version="1.0.0",
+ org.osgi.framework,
+ org.osgi.service.component;resolution:=optional
+Bundle-SymbolicName: calculator.operations
+Bundle-Vendor: The Apache Software Foundation
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-DocURL: http://www.apache.org/
+Service-Component: OSGI-INF/add-component.xml,
+ OSGI-INF/subtract-component.xml,
+ OSGI-INF/multiply-component.xml,
+ OSGI-INF/divide-component.xml