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 17:45:15 UTC

svn commit: r752928 - in /tuscany/java/sca/modules/implementation-osgi/src/test: java/org/apache/tuscany/sca/implementation/osgi/xml/ resources/ resources/OSGI-INF/ resources/calculator/ resources/calculator/operations/

Author: rfeng
Date: Thu Mar 12 16:45:15 2009
New Revision: 752928

URL: http://svn.apache.org/viewvc?rev=752928&view=rev
Log:
Add/Fix some of the composite files

Added:
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite
Modified:
    tuscany/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiReadImplTestCase.java
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType
    tuscany/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite

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=752928&r1=752927&r2=752928&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 Thu Mar 12 16:45:15 2009
@@ -71,7 +71,7 @@
                 .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 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 @@
 
         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");
     }
 
 }

Modified: 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=752928&r1=752927&r2=752928&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/calculator-component.xml Thu Mar 12 16:45:15 2009
@@ -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>

Modified: tuscany/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType?rev=752928&r1=752927&r2=752928&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/bundle.componentType Thu Mar 12 16:45:15 2009
@@ -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>

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite?rev=752928&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/calculator.composite Thu Mar 12 16:45:15 2009
@@ -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>

Added: tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite?rev=752928&view=auto
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite (added)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/calculator/operations/operations.composite Thu Mar 12 16:45:15 2009
@@ -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>

Modified: tuscany/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite?rev=752928&r1=752927&r2=752928&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite (original)
+++ tuscany/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite Thu Mar 12 16:45:15 2009
@@ -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>