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 +++++++++++++++++++++ 8 files changed, 386 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 (limited to 'java/sca/stest/sampleTest/src/main') 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 + + + -- cgit v1.2.3