From bd7725852757ad03f5fd0e224c4af92f0c5c4be8 Mon Sep 17 00:00:00 2001 From: edwardsmj Date: Mon, 12 Jan 2009 13:27:02 +0000 Subject: Added Test_ASM_0009, Test_ASM_0010, Test_ASM_0011 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@733740 13f79535-47bb-0310-9956-ffa450edef68 --- .../sampleTest/src/main/java/test/Service2.java | 35 ++++++++++++ .../src/main/java/test/service1Impl3.java | 49 +++++++++++++++++ .../src/main/java/test/service2Impl.java | 38 +++++++++++++ .../src/main/resources/TestComposite5.composite | 41 ++++++++++++++ .../src/main/resources/TestComposite6.composite | 48 +++++++++++++++++ .../src/main/resources/Test_ASM_0009.composite | 63 ++++++++++++++++++++++ .../src/main/resources/Test_ASM_0010.composite | 51 ++++++++++++++++++ .../src/main/resources/Test_ASM_0011.composite | 61 +++++++++++++++++++++ .../src/test/java/client/ASM_0009_TestCase.java | 45 ++++++++++++++++ .../src/test/java/client/ASM_0010_TestCase.java | 47 ++++++++++++++++ .../src/test/java/client/ASM_0011_TestCase.java | 46 ++++++++++++++++ 11 files changed, 524 insertions(+) create mode 100644 java/sca/stest/sampleTest/src/main/java/test/Service2.java create mode 100644 java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java create mode 100644 java/sca/stest/sampleTest/src/main/java/test/service2Impl.java create mode 100644 java/sca/stest/sampleTest/src/main/resources/TestComposite5.composite create mode 100644 java/sca/stest/sampleTest/src/main/resources/TestComposite6.composite create mode 100644 java/sca/stest/sampleTest/src/main/resources/Test_ASM_0009.composite create mode 100644 java/sca/stest/sampleTest/src/main/resources/Test_ASM_0010.composite create mode 100644 java/sca/stest/sampleTest/src/main/resources/Test_ASM_0011.composite create mode 100644 java/sca/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java create mode 100644 java/sca/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java create mode 100644 java/sca/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java (limited to 'java/sca/stest/sampleTest/src') diff --git a/java/sca/stest/sampleTest/src/main/java/test/Service2.java b/java/sca/stest/sampleTest/src/main/java/test/Service2.java new file mode 100644 index 0000000000..15bcb9481c --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/java/test/Service2.java @@ -0,0 +1,35 @@ +/* + * 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 test; + +/** + * A test service interface, designed to be incompatible with the Service1 interface + * @author MikeEdwards + * + */ +public interface Service2 { + + /** + * Method for invoking testcase service + * @param input - input parameter(s) as a String + * @return - output data as a String + */ + public int operation2( int input ); + +} diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java b/java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java new file mode 100644 index 0000000000..75373f6316 --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/java/test/service1Impl3.java @@ -0,0 +1,49 @@ +/* + * 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 test; + +import org.osoa.sca.annotations.*; + +/** + * Enhanced Java component implementation for business interface Service1, + * where the implementation also has a single reference using the Service1 + * interface with mutiplicity 1..n all of which and which get called when + * operation1 is invoked + * @author MikeEdwards + * + */ +@Service(Service1.class) +public class service1Impl3 implements Service1 { + + @Property + public String serviceName = "service1"; + // Required = true + an array -> multiplicity 1..n + @Reference(required=true) + public Service1[] reference1 = null; + + public String operation1(String input) { + String result = ""; + // Call each of the references in the array, concatenating the results + for( int i=0 ; i < reference1.length; i++ ) { + result = result.concat( reference1[i].operation1(input) ); + } // end for + return serviceName + " operation1 invoked" + " " + result; + } + +} diff --git a/java/sca/stest/sampleTest/src/main/java/test/service2Impl.java b/java/sca/stest/sampleTest/src/main/java/test/service2Impl.java new file mode 100644 index 0000000000..db2fa299d6 --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/java/test/service2Impl.java @@ -0,0 +1,38 @@ +/* + * 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 test; + +import org.osoa.sca.annotations.*; + +/** + * Simple Java component implementation for business interface Service2 + * @author MikeEdwards + * + */ +@Service(Service2.class) +public class service2Impl implements Service2 { + + @Property + public String serviceName = "service1"; + + public int operation2(int input) { + return input+1; + } + +} diff --git a/java/sca/stest/sampleTest/src/main/resources/TestComposite5.composite b/java/sca/stest/sampleTest/src/main/resources/TestComposite5.composite new file mode 100644 index 0000000000..808f20727f --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/TestComposite5.composite @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/java/sca/stest/sampleTest/src/main/resources/TestComposite6.composite b/java/sca/stest/sampleTest/src/main/resources/TestComposite6.composite new file mode 100644 index 0000000000..dc9ea75f3b --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/TestComposite6.composite @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0009.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0009.composite new file mode 100644 index 0000000000..9d836489c8 --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0009.composite @@ -0,0 +1,63 @@ + + + + + + + + + + + + + ASM_0009 + + + + + + + + service1 + + + + + + + + service2 + + + + + + + + service2 + + + diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0010.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0010.composite new file mode 100644 index 0000000000..ef1b5d1663 --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0010.composite @@ -0,0 +1,51 @@ + + + + + + + + + + + + + ASM_0010 + + + + + + + + + service1 + + + diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0011.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0011.composite new file mode 100644 index 0000000000..d8e5958132 --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0011.composite @@ -0,0 +1,61 @@ + + + + + + + + + + + + + ASM_0011 + + + + + + + + service1 + + + + + + + + + + + + service2 + + + diff --git a/java/sca/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java b/java/sca/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java new file mode 100644 index 0000000000..cb1e600542 --- /dev/null +++ b/java/sca/stest/sampleTest/src/test/java/client/ASM_0009_TestCase.java @@ -0,0 +1,45 @@ +/* + * 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_0009_TestCase, which tests that the @name attribute of a + * element in a is not the same as the @name + * attribute of a second component in the same + */ +public class ASM_0009_TestCase extends BaseJAXWSTestCase { + + + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0009"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0009.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0003 diff --git a/java/sca/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java b/java/sca/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java new file mode 100644 index 0000000000..7af957db99 --- /dev/null +++ b/java/sca/stest/sampleTest/src/test/java/client/ASM_0010_TestCase.java @@ -0,0 +1,47 @@ +/* + * 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_0009_TestCase, which tests that the interface specified + * by the child element of a element is a compatible + * subset of the interface declared for the element with the + * same @name attribute in the of the + * of the parent of the + */ +public class ASM_0010_TestCase extends BaseJAXWSTestCase { + + + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0010"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0010.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0003 diff --git a/java/sca/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java b/java/sca/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java new file mode 100644 index 0000000000..ed850761f7 --- /dev/null +++ b/java/sca/stest/sampleTest/src/test/java/client/ASM_0011_TestCase.java @@ -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_0011_TestCase, which tests that the the multiplicity + * of a element of a can be 1..1 where the + * multiplicity of the equivalent element in the + * of the of the is 1..n + */ +public class ASM_0011_TestCase extends BaseJAXWSTestCase { + + + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0011"; + config.input = "request"; + config.output = "ASM_0011 request service1 operation1 invoked service2 operation1 invoked"; + config.composite = "Test_ASM_0011.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0003 -- cgit v1.2.3