Author: edwardsmj
Date: Thu Jan 15 09:00:30 2009
New Revision: 734757

URL: http://svn.apache.org/viewvc?rev=734757&view=rev
Log:
ASM_0014_TestCase & ASM_0014_TestCase added

Added:
    
tuscany/java/sca/stest/sampleTest/src/main/resources/TestComposite8.composite
    tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0014.composite
    tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0015.composite
    
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java
    
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java
Modified:
    
tuscany/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java

Added: 
tuscany/java/sca/stest/sampleTest/src/main/resources/TestComposite8.composite
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/stest/sampleTest/src/main/resources/TestComposite8.composite?rev=734757&view=auto
==============================================================================
--- 
tuscany/java/sca/stest/sampleTest/src/main/resources/TestComposite8.composite 
(added)
+++ 
tuscany/java/sca/stest/sampleTest/src/main/resources/TestComposite8.composite 
Thu Jan 15 09:00:30 2009
@@ -0,0 +1,48 @@
+<?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.    
+-->
+<!-- An example of a composite which has a single service and
+     a single reference with multiplicity 0..1   -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+           targetNamespace="http://oasis/tests";
+           xmlns:sample="http://oasis/tests";
+           name="TestComposite8">
+           
+       <service name="Service1" promote="TestComponent1/Service1">
+               <interface.java interface="test.Service1"/>
+       </service>
+
+    <property name="serviceName" type="string"/>
+ 
+    <component name="TestComponent1">
+               <implementation.java class="test.service1Impl4"/>
+        <service name="Service1">
+               <interface.java interface="test.Service1"/>
+        </service>
+        <property name="serviceName" source="$serviceName"/>
+        <reference name="reference1" multiplicity="0..n">
+               <interface.java interface="test.Service1"/>
+        </reference>
+    </component>
+    
+    <reference name="Reference1" promote="TestComponent1/reference1" 
multiplicity="0..1">
+        <interface.java interface="test.Service1"/>
+    </reference>
+    
+</composite>

Added: 
tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0014.composite
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0014.composite?rev=734757&view=auto
==============================================================================
--- 
tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0014.composite 
(added)
+++ 
tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0014.composite 
Thu Jan 15 09:00:30 2009
@@ -0,0 +1,61 @@
+<?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.    
+-->
+<!-- Tests that the multiplicity of a <reference/> element of a 
+     <component/>  is 0..n where the multiplicity of the equivalent 
+     <reference/> element in the <componentType/> of the 
+     <implementation/> of the <component/> is 1..1 -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+           targetNamespace="http://oasis/tests";
+           xmlns:tns="http://oasis/tests";
+           xmlns:sample="http://oasis/tests";
+           name="TEST_ASM_0014">
+           
+    <component name="TestClient">
+               <implementation.composite name="tns:TestClient_0002"/>
+               <service name="TestInvocation">
+                       <interface.java interface="test.TestInvocation"/>
+            <binding.ws/>
+               </service>
+        <reference name="reference1" target="TestComponent1/Service1" />
+        <property name="testName">ASM_0014</property>
+    </component>
+    
+    <component name="TestComponent1">
+               <implementation.composite name="tns:TestComposite4"/>
+        <service name="Service1">
+               <interface.java interface="test.Service1"/>
+        </service>
+        <property name="serviceName">service1</property>
+        <!-- The multiplicity declared for this reference is 0..n while the 
multiplicity of
+             the corresponding reference on the componentType of the 
implementation is 1..1 -->
+        <reference name="Reference1" target="TestComponent2/Service1" 
multiplicity="0..n">
+               <interface.java interface="test.Service1"/>
+        </reference>
+    </component>
+    
+    <component name="TestComponent2">
+               <implementation.composite name="tns:TestComposite1"/>
+        <service name="Service1">
+               <interface.java interface="test.Service1"></interface.java>
+        </service>
+        <property name="serviceName">service2</property>
+    </component>    
+    
+</composite>

Added: 
tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0015.composite
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0015.composite?rev=734757&view=auto
==============================================================================
--- 
tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0015.composite 
(added)
+++ 
tuscany/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0015.composite 
Thu Jan 15 09:00:30 2009
@@ -0,0 +1,62 @@
+<?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.    
+-->
+<!-- Tests that the the multiplicity 
+     of a <reference/> element of a <component/> is 
+     1..1 where the multiplicity of the equivalent <reference/> 
+     element in the <componentType/> of the <implementation/> of the 
+     <component/> is 0..1 -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+           targetNamespace="http://oasis/tests";
+           xmlns:tns="http://oasis/tests";
+           xmlns:sample="http://oasis/tests";
+           name="TEST_ASM_0015">
+           
+    <component name="TestClient">
+               <implementation.composite name="tns:TestClient_0002"/>
+               <service name="TestInvocation">
+                       <interface.java interface="test.TestInvocation"/>
+            <binding.ws/>
+               </service>
+        <reference name="reference1" target="TestComponent1/Service1" />
+        <property name="testName">ASM_0015</property>
+    </component>
+    
+    <component name="TestComponent1">
+               <implementation.composite name="tns:TestComposite8"/>
+        <service name="Service1">
+               <interface.java interface="test.Service1"/>
+        </service>
+        <property name="serviceName">service1</property>
+        <!-- The multiplicity declared for this reference is 1..1 while the 
multiplicity of
+             the corresponding reference on the componentType of the 
implementation is 0..1 -->
+        <reference name="Reference1" target="TestComponent2/Service1" 
multiplicity="1..1">
+               <interface.java interface="test.Service1"/>
+        </reference>
+    </component>
+    
+    <component name="TestComponent2">
+               <implementation.composite name="tns:TestComposite1"/>
+        <service name="Service1">
+               <interface.java interface="test.Service1"></interface.java>
+        </service>
+        <property name="serviceName">service2</property>
+    </component>    
+    
+</composite>

Added: 
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java?rev=734757&view=auto
==============================================================================
--- 
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java 
(added)
+++ 
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0014_TestCase.java 
Thu Jan 15 09:00:30 2009
@@ -0,0 +1,46 @@
+/*
+ * 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 client;
+
+
+import test.ASM_0002_Client;
+import testClient.TestInvocation;
+
+/**
+ * Client for ASM_0014_TestCase, which tests that the multiplicity of a 
+ * <reference/> element of a <component/>  is 0..n where the multiplicity 
+ * of the equivalent <reference/> element in the <componentType/> of the 
+ * <implementation/> of the <component/> is 1..1
+ */
+public class ASM_0014_TestCase extends BaseJAXWSTestCase {
+
+ 
+    protected TestConfiguration getTestConfiguration() {
+       TestConfiguration config = new TestConfiguration();
+       config.testName                 = "ASM_0014";
+       config.input                    = "request";
+       config.output                   = "exception";
+       config.composite                = "Test_ASM_0014.composite";
+       config.testServiceName  = "TestClient";
+       config.testClass                = ASM_0002_Client.class;
+       config.serviceInterface = TestInvocation.class;
+       return config;
+    }
+    
+} // end class Test_ASM_0003

Added: 
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java?rev=734757&view=auto
==============================================================================
--- 
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java 
(added)
+++ 
tuscany/java/sca/stest/sampleTest/src/test/java/client/ASM_0015_TestCase.java 
Thu Jan 15 09:00:30 2009
@@ -0,0 +1,46 @@
+/*
+ * 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 client;
+
+
+import test.ASM_0002_Client;
+import testClient.TestInvocation;
+
+/**
+ * Client for ASM_0015_TestCase, which tests that the the multiplicity 
+ * of a <reference/> element of a <component/> is 1..1 where the 
+ * multiplicity of the equivalent <reference/> element in the 
+ * <componentType/> of the <implementation/> of the <component/> is 0..1
+ */
+public class ASM_0015_TestCase extends BaseJAXWSTestCase {
+
+ 
+    protected TestConfiguration getTestConfiguration() {
+       TestConfiguration config = new TestConfiguration();
+       config.testName                 = "ASM_0015";
+       config.input                    = "request";
+       config.output                   = "ASM_0015 request service1 operation1 
invoked service2 operation1 invoked";
+       config.composite                = "Test_ASM_0015.composite";
+       config.testServiceName  = "TestClient";
+       config.testClass                = ASM_0002_Client.class;
+       config.serviceInterface = TestInvocation.class;
+       return config;
+    }
+    
+} // end class Test_ASM_0003

Modified: 
tuscany/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java?rev=734757&r1=734756&r2=734757&view=diff
==============================================================================
--- 
tuscany/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java 
(original)
+++ 
tuscany/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java 
Thu Jan 15 09:00:30 2009
@@ -81,12 +81,13 @@
        if( proceed == false ) return;
        
        // System.out.println("Test " + testName + " starting");
+       String output = null;
        try {
                // Just requires input to proceed
                // System.in.read();
                //
-               String output = invokeTest( testConfiguration.getInput() );
-               assertEquals( testConfiguration.getExpectedOutput(), output );
+               output = invokeTest( testConfiguration.getInput() );
+
        } catch ( TestException_Exception e ) {
                TestException exceptionContent = e.getFaultInfo();
                System.out.println("Service fault received - detail: " + 
exceptionContent.getMessage() );
@@ -96,6 +97,7 @@
                        System.out.println( "Exception received - detail: " + 
e.getMessage() );
                assertEquals( testConfiguration.getExpectedOutput(), 
"exception" );
        }
+       assertEquals( testConfiguration.getExpectedOutput(), output );
        System.out.println("Test " + testConfiguration.getTestName() + " 
completed successfully");
     }
     


Reply via email to