summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-01-16 11:02:07 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2009-01-16 11:02:07 +0000
commitcad57e4f97ad5afd5f6e06664e97281e5aa7a77c (patch)
tree06ed0a0baf9675b9872fa23ca3ed6c973a260569
parent942bea5df11bd3ed1c228ca8243757ef9150daa4 (diff)
ASM_0016_TestCase & ASM_0017_TestCase added
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@734972 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java42
-rw-r--r--java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java42
-rw-r--r--java/sca/stest/sampleTest/src/main/resources/TestComposite10.composite47
-rw-r--r--java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite6
-rw-r--r--java/sca/stest/sampleTest/src/main/resources/TestComposite9.composite41
-rw-r--r--java/sca/stest/sampleTest/src/main/resources/Test_ASM_0016.composite61
-rw-r--r--java/sca/stest/sampleTest/src/main/resources/Test_ASM_0017.composite61
-rw-r--r--java/sca/stest/sampleTest/src/test/java/client/ASM_0016_TestCase.java46
-rw-r--r--java/sca/stest/sampleTest/src/test/java/client/ASM_0017_TestCase.java47
9 files changed, 390 insertions, 3 deletions
diff --git a/java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java b/java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java
new file mode 100644
index 0000000000..af9dba4ccf
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/main/java/test/Service1Superset.java
@@ -0,0 +1,42 @@
+/*
+ * 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 superset of the basic test service interface
+ * @author MikeEdwards
+ *
+ */
+public interface Service1Superset {
+
+ /**
+ * Method for invoking testcase service
+ * @param input - input parameter(s) as a String
+ * @return - output data as a String
+ */
+ public String operation1( String input );
+
+ /**
+ * A second method for invoking a testcase service
+ * @param input - input parameter(s) as a String
+ * @return - output data as a String
+ */
+ public String operation2( String input );
+
+}
diff --git a/java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java b/java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java
new file mode 100644
index 0000000000..dfb2fdaf06
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/main/java/test/service1SupersetImpl.java
@@ -0,0 +1,42 @@
+/*
+ * 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 Service1Superset
+ * @author MikeEdwards
+ *
+ */
+@Service(Service1Superset.class)
+public class service1SupersetImpl implements Service1Superset {
+
+ @Property
+ public String serviceName = "service1";
+
+ public String operation1(String input) {
+ return serviceName + " operation1 invoked";
+ }
+
+ public String operation2(String input) {
+ return serviceName + " operation2 invoked";
+ }
+
+}
diff --git a/java/sca/stest/sampleTest/src/main/resources/TestComposite10.composite b/java/sca/stest/sampleTest/src/main/resources/TestComposite10.composite
new file mode 100644
index 0000000000..286790a1b9
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/main/resources/TestComposite10.composite
@@ -0,0 +1,47 @@
+<?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, but where the reference has a binding
+ applied to it, with a target service identified -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://oasis/tests"
+ xmlns:sample="http://oasis/tests"
+ name="TestComposite10">
+
+ <service name="Service1" promote="Composite10Component1/Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+
+ <property name="serviceName" type="string"/>
+
+ <component name="Composite10Component1">
+ <implementation.java class="test.service1Impl2"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName" source="$serviceName"/>
+ </component>
+
+ <reference name="Reference1" promote="Composite10Component1/reference1">
+ <interface.java interface="test.Service1"/>
+ <binding.sca uri="TestComponent2/Service1"/>
+ </reference>
+
+</composite>
diff --git a/java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite b/java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite
index 4aeceb4ec7..4792ad35f3 100644
--- a/java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite
+++ b/java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite
@@ -24,13 +24,13 @@
xmlns:sample="http://oasis/tests"
name="TestComposite4">
- <service name="Service1" promote="TestComponent1/Service1">
+ <service name="Service1" promote="Composite4Component1/Service1">
<interface.java interface="test.Service1"/>
</service>
<property name="serviceName" type="string"/>
- <component name="TestComponent1">
+ <component name="Composite4Component1">
<implementation.java class="test.service1Impl2"/>
<service name="Service1">
<interface.java interface="test.Service1"/>
@@ -38,7 +38,7 @@
<property name="serviceName" source="$serviceName"/>
</component>
- <reference name="Reference1" promote="TestComponent1/reference1">
+ <reference name="Reference1" promote="Composite4Component1/reference1">
<interface.java interface="test.Service1"/>
</reference>
diff --git a/java/sca/stest/sampleTest/src/main/resources/TestComposite9.composite b/java/sca/stest/sampleTest/src/main/resources/TestComposite9.composite
new file mode 100644
index 0000000000..81c1e63190
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/main/resources/TestComposite9.composite
@@ -0,0 +1,41 @@
+<?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 that provides a single service with the extended
+ Service1Superset interface -->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://oasis/tests"
+ xmlns:sample="http://oasis/tests"
+ name="TestComposite9">
+
+ <service name="Service1" promote="Composite9Component1/Service1Superset">
+ <interface.java interface="test.Service1Superset"></interface.java>
+ </service>
+
+ <property name="serviceName" type="string"/>
+
+ <component name="Composite9Component1">
+ <implementation.java class="test.service1SupersetImpl"/>
+ <service name="Service1Superset">
+ <interface.java interface="test.Service1Superset"></interface.java>
+ </service>
+ <property name="serviceName" source="$serviceName"/>
+ </component>
+
+</composite>
diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0016.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0016.composite
new file mode 100644
index 0000000000..08ae9416f2
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0016.composite
@@ -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 interface declared by the <interface/> child element
+ of a <reference/> of a <component/> is a compatible superset of the
+ interface declared on the corresponding <reference/> of the
+ componentType of the <implementation/> of the <component/> -->
+<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_0016">
+
+ <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_0016</property>
+ </component>
+
+ <component name="TestComponent1">
+ <implementation.composite name="tns:TestComposite4"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+ <reference name="Reference1" target="TestComponent2/Service1">
+ <!-- Component type has the interface = test.Service1 - here
+ we use an interface that is a superset -->
+ <interface.java interface="test.Service1Superset"/>
+ </reference>
+ </component>
+
+ <component name="TestComponent2">
+ <implementation.composite name="tns:TestComposite9"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1Superset"></interface.java>
+ </service>
+ <property name="serviceName">service2</property>
+ </component>
+
+</composite>
diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0017.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0017.composite
new file mode 100644
index 0000000000..b2d45743ac
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0017.composite
@@ -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 where a <reference/> of a <component/> has no <binding/>
+ child element, but the corresponding <reference/> element in the
+ componentType does have a binding child element, the <binding/>
+ from the componentType is used for the reference -->
+<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_0017">
+
+ <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_0017</property>
+ </component>
+
+ <component name="TestComponent1">
+ <implementation.composite name="tns:TestComposite10"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+ <!-- ComponentType has a binding for this reference that
+ identifies the target for this reference -->
+ <reference name="Reference1">
+ <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>
diff --git a/java/sca/stest/sampleTest/src/test/java/client/ASM_0016_TestCase.java b/java/sca/stest/sampleTest/src/test/java/client/ASM_0016_TestCase.java
new file mode 100644
index 0000000000..afc6e88fe1
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/test/java/client/ASM_0016_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_0016_TestCase, which tests that the interface declared
+ * by the <interface/> child element of a <reference/> of a <component/>
+ * is a compatible superset of the interface declared on the corresponding
+ * <reference/> of the componentType of the <implementation/> of the <component/>
+ */
+public class ASM_0016_TestCase extends BaseJAXWSTestCase {
+
+
+ protected TestConfiguration getTestConfiguration() {
+ TestConfiguration config = new TestConfiguration();
+ config.testName = "ASM_0016";
+ config.input = "request";
+ config.output = "ASM_0016 request service1 operation1 invoked service2 operation1 invoked";
+ config.composite = "Test_ASM_0016.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_0017_TestCase.java b/java/sca/stest/sampleTest/src/test/java/client/ASM_0017_TestCase.java
new file mode 100644
index 0000000000..e977c1a252
--- /dev/null
+++ b/java/sca/stest/sampleTest/src/test/java/client/ASM_0017_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_0017_TestCase, which tests that where a <reference/>
+ * of a <component/> has no <binding/> child element, but the
+ * corresponding <reference/> element in the componentType does have
+ * a binding child element, the <binding/> from the componentType is
+ * used for the reference
+ */
+public class ASM_0017_TestCase extends BaseJAXWSTestCase {
+
+
+ protected TestConfiguration getTestConfiguration() {
+ TestConfiguration config = new TestConfiguration();
+ config.testName = "ASM_0017";
+ config.input = "request";
+ config.output = "ASM_0017 request service1 operation1 invoked service2 operation1 invoked";
+ config.composite = "Test_ASM_0017.composite";
+ config.testServiceName = "TestClient";
+ config.testClass = ASM_0002_Client.class;
+ config.serviceInterface = TestInvocation.class;
+ return config;
+ }
+
+} // end class Test_ASM_0003