summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/stest/sampleTest/src/main/resources
diff options
context:
space:
mode:
authorbeckerdo <beckerdo@13f79535-47bb-0310-9956-ffa450edef68>2009-03-19 17:58:28 +0000
committerbeckerdo <beckerdo@13f79535-47bb-0310-9956-ffa450edef68>2009-03-19 17:58:28 +0000
commitcc03e01e3bc7f08a8f6c345ed93506a7784ba35c (patch)
tree66d92b7a3c713d785af669b6ef060f717e63aab3 /branches/sca-java-1.x/stest/sampleTest/src/main/resources
parent75319940d7a4a24358abad327dcbd6cca3d05be3 (diff)
TUSCANY-2923 Stest code ASM_0024 - ASM_0043
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@756113 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/stest/sampleTest/src/main/resources')
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/TestComposite23.composite48
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0024.composite60
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0025.composite11
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0039.composite70
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0040.composite53
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0041.composite63
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0042.composite65
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0043.composite89
-rw-r--r--branches/sca-java-1.x/stest/sampleTest/src/main/resources/jndi.properties39
9 files changed, 489 insertions, 9 deletions
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/TestComposite23.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/TestComposite23.composite
new file mode 100644
index 0000000000..35bd141aef
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/TestComposite23.composite
@@ -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="TestComposite23">
+
+ <service name="Service1" promote="TestComponent1/Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+
+ <property name="serviceName" type="string"/>
+
+ <component name="TestComponent1">
+ <implementation.java class="test.service1Impl2"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName" source="$serviceName"/>
+ <reference name="reference1" multiplicity="1..1">
+ <interface.java interface="test.Service1"/>
+ </reference>
+ </component>
+
+ <reference name="Reference1" promote="TestComponent1/reference1" multiplicity="0..1">
+ <interface.java interface="test.Service1"/>
+ </reference>
+
+</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0024.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0024.composite
new file mode 100644
index 0000000000..6859c22502
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0024.composite
@@ -0,0 +1,60 @@
+<?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 <component/> <reference/> has @target set to
+ some service, that the reference can have no child <binding/> elements -->
+<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_0024">
+
+ <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_0024</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" >
+ <interface.java interface="test.Service1" target="TestComponent2/Service1"/>
+ <!--A binding which contradicts the @target attribute -->
+ <binding.ws uri="http://localhost:8080/TestComponent2"/>
+ </reference>
+ </component>
+
+ <component name="TestComponent2">
+ <implementation.composite name="tns:TestComposite1"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ <binding.ws/>
+ </service>
+ <property name="serviceName">service2</property>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0025.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0025.composite
index 7e54a659f7..92c5e3189f 100644
--- a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0025.composite
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0025.composite
@@ -41,21 +41,14 @@
<service name="Service1">
<interface.java interface="test.Service1"/>
</service>
- <property name="serviceName">service1</property>
<!-- Property with complex type with a value declared using a <value/> subelement -->
<property name="complexType" type="test:ComplexType1">
<ComplexType1Value type="test:ComplexType1">
<test:firstData>complex1</test:firstData>
<test:secondData>complex2</test:secondData>
- </ComplexType1Value>
-
- <!--
- <value>
- <firstData>complex1</firstData>
- <secondData>complex2</secondData>
- </value>
- -->
+ </ComplexType1Value>
</property>
+ <property name="serviceName">service1</property>
</component>
</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0039.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0039.composite
new file mode 100644
index 0000000000..bf69bef4fe
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0039.composite
@@ -0,0 +1,70 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://oasis/tests"
+ xmlns:tns="http://oasis/tests"
+ xmlns:test="http://oasis/tests"
+ name="TEST_ASM_0039">
+
+ <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_0039</property>
+ </component>
+
+ <!-- Implementation with a single reference with multiplicity 1..n which
+ has multiple concrete bindings applied to it -->
+ <component name="TestComponent1">
+ <implementation.composite name="tns:TestComposite8"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+ <!-- multiplicity is restricted to 1, but 2 tagets is specified, this should be detected in deployment time -->
+ <!--In the test, it reported "WARNING: Too many targets on reference: Reference1"-->
+ <!--if the multiplicity is specified to "1..1", it reported "Component reference multiplicity incompatible with reference multiplicity: Component = TestComponent1 Reference = Reference1"-->
+ <reference name="Reference1" target="TestComponent2/Service1 TestComponent3/Service1" multiplicity="0..1">
+ <interface.java interface="test.Service1"/>
+ </reference>
+ </component>
+
+
+ <component name="TestComponent2">
+ <implementation.composite name="tns:TestComposite1"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service2</property>
+ </component>
+
+ <component name="TestComponent3">
+ <implementation.composite name="tns:TestComposite1"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service3</property>
+ </component>
+
+</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0040.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0040.composite
new file mode 100644
index 0000000000..1b01ddc9d3
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0040.composite
@@ -0,0 +1,53 @@
+<?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 if the runtime is using an untargeted reference,
+it should throw an exception.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://oasis/tests"
+ xmlns:tns="http://oasis/tests"
+ xmlns:test="http://oasis/tests"
+ name="TEST_ASM_0040">
+
+ <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_0040</property>
+ </component>
+
+
+ <component name="TestComponent1">
+ <implementation.composite name="tns:TestComposite23"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+ <!--Reference1 has no target service, the SCA runtime will throw the ServiceRunTimeExceptions.-->
+ <reference name="Reference1" multiplicity="0..1">
+ <interface.java interface="test.Service1"/>
+ </reference>
+ </component>
+
+
+</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0041.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0041.composite
new file mode 100644
index 0000000000..b56100c8e9
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0041.composite
@@ -0,0 +1,63 @@
+<?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.
+-->
+<!--
+test if @wiredByImpl="true", <reference/> element has no <binding/> child elements.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://oasis/tests"
+ xmlns:tns="http://oasis/tests"
+ xmlns:test="http://oasis/tests"
+ name="TEST_ASM_0041">
+
+ <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_0041</property>
+ </component>
+
+
+ <component name="TestComponent1">
+ <implementation.composite name="tns:TestComposite23"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+
+ <reference name="Reference1" wiredByImpl="true">
+ <interface.java interface="test.Service1"/>
+ <binding.sca uri="TestComponent2/Service1"/>
+ </reference>
+ </component>
+
+ <component name="TestComponent2">
+ <implementation.composite name="tns:TestComposite1"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+
+ </component>
+
+
+</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0042.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0042.composite
new file mode 100644
index 0000000000..9904308676
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0042.composite
@@ -0,0 +1,65 @@
+<?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.
+-->
+<!-- test if @wiredByImpl="true",
+No <wire/> elements have the <reference/> element declared as the @source for the wire.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://oasis/tests"
+ xmlns:tns="http://oasis/tests"
+ xmlns:test="http://oasis/tests"
+ name="TEST_ASM_0042">
+
+
+ <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_0041</property>
+ </component>
+
+
+ <component name="TestComponent1">
+ <implementation.composite name="tns:TestComposite23"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+
+ <reference name="Reference1" wiredByImpl="true">
+ <interface.java interface="test.Service1"/>
+
+ </reference>
+ </component>
+
+ <component name="TestComponent2">
+ <implementation.composite name="tns:TestComposite1"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+
+ </component>
+
+ <wire source="TestComponent1/Reference1" target="TestComponent2/Service1"/>
+
+</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0043.composite b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0043.composite
new file mode 100644
index 0000000000..b71c81a749
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/Test_ASM_0043.composite
@@ -0,0 +1,89 @@
+<?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.
+-->
+<!-- test if @wiredByImpl="true",
+No <wire/> elements have the <reference/> element declared as the @source for the wire.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://oasis/tests"
+ xmlns:tns="http://oasis/tests"
+ xmlns:test="http://oasis/tests"
+ name="TEST_ASM_0043">
+
+
+ <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_0043</property>
+ </component>
+
+ <!--JMS client-->
+ <component name="TestComponent1">
+ <implementation.composite name="tns:TestComposite23"/>
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ </service>
+ <property name="serviceName">service1</property>
+
+ <reference name="Reference1" target="TestComponent2/Service1">
+ <interface.java interface="test.Service1"/>
+ <binding.jms uri="jms:DestQueueA">
+ <destination name="DestQueueA"/>
+ </binding.jms>
+
+ </reference>
+ </component>
+
+ <!--JMS service-->
+ <component name="TestComponent2">
+
+ <implementation.java class="test.service1Impl"/>
+
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ <binding.jms>
+ <destination name="DestQueueA" create="always"/>
+ </binding.jms>
+
+ </service>
+ <property name="serviceName">service1</property>
+
+ </component>
+
+ <!--WebService service-->
+ <component name="TestComponent3">
+
+ <implementation.java class="test.service1Impl"/>
+
+ <service name="Service1">
+ <interface.java interface="test.Service1"/>
+ <binding.ws uri="http://localhost:8080/Service1"/>
+
+ </service>
+ <property name="serviceName">service1</property>
+
+ </component>
+
+
+
+</composite>
diff --git a/branches/sca-java-1.x/stest/sampleTest/src/main/resources/jndi.properties b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/jndi.properties
new file mode 100644
index 0000000000..9abdff215d
--- /dev/null
+++ b/branches/sca-java-1.x/stest/sampleTest/src/main/resources/jndi.properties
@@ -0,0 +1,39 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.RequestQueue = RequestQueue
+queue.ResponseQueue = ResponseQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi