diff options
16 files changed, 843 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 diff --git a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0024_TestCase.java b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0024_TestCase.java new file mode 100644 index 0000000000..6f224a8951 --- /dev/null +++ b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0024_TestCase.java @@ -0,0 +1,61 @@ +/* + * 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_0024_TestCase, which tests that where a <component/> + * <reference/> has @target set to some service, that the reference + * can have no child <binding/> elements + */ +public class ASM_0024_TestCase extends BaseJAXWSTestCase { + + + /** + * <p> + * OSOA + * Line 1379~1381 + * Note that a binding element may specify an endpoint which is the target of that binding. A + * reference must not mix the use of endpoints specified via binding elements with target endpoints + * specified via the target attribute. + * <p> + * OASIS + * ASM50026 + * If a reference has a value specified for one or more target services in its @target attribute, + * there MUST NOT be any child <binding/> elements declared for that reference. + * <p> + * Jira issue: + * https://issues.apache.org/jira/browse/TUSCANY-2920 + */ + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0024"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0024.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0003 diff --git a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java index 2a5e7afda6..9d79b3b472 100644 --- a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java +++ b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0025_TestCase.java @@ -30,6 +30,11 @@ import testClient.TestInvocation; */ public class ASM_0025_TestCase extends BaseJAXWSTestCase { + public static void main(String[] args) throws Exception { + ASM_0025_TestCase test = new ASM_0025_TestCase(); + test.setUp(); + test.tearDown(); + } /** * <p> diff --git a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0039_TestCase.java b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0039_TestCase.java new file mode 100644 index 0000000000..5f7ef37f61 --- /dev/null +++ b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0039_TestCase.java @@ -0,0 +1,54 @@ +/* + * 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; + +/** + * + */ +public class ASM_0039_TestCase extends BaseJAXWSTestCase { + + + /** + * <p> + * OSOA + * No corresponding statements in OSOA specification. + * <p> + * OASIS + * ASM50023 + * Some reference multiplicity errors can be detected at deployment time, + * where the rules defined in ASM50018, ASM50019, ASM50020, ASM50021 are violated. + * In these cases, an error SHOULD be generated by the SCA runtime at deployment time. + */ + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0039"; + config.input = "request"; + config.output = "ASM_0039 request service1 operation1 invoked service2 operation1 invokedservice2 operation1 invoked"; + config.composite = "Test_ASM_0039.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0039 diff --git a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0040_TestCase.java b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0040_TestCase.java new file mode 100644 index 0000000000..388508c209 --- /dev/null +++ b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0040_TestCase.java @@ -0,0 +1,58 @@ +/* + * 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; + +/** + * For the cases where it is valid for the reference to have no target service specified, + * the component implementation language specification needs to define the programming model + * for interacting with an untargetted reference. + * So the SCA runtime should throw an exception if it is using an untargetted reference. + */ +public class ASM_0040_TestCase extends BaseJAXWSTestCase { + + + /** + * <p> + * OSOA + * No corresponding statements in OSOA specification. + * <p> + * OASIS + * ASM50024 + * Some reference multiplicity errors can only be checked at runtime, + * where the rules defined in ASM50018, ASM50019, ASM50020, ASM50021 are violated. + * In these cases, the SCA runtime MUST generate an error no later than when the reference is + * invoked by the component implementation. + */ + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0040"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0040.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0040 diff --git a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0041_TestCase.java b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0041_TestCase.java new file mode 100644 index 0000000000..441cc61734 --- /dev/null +++ b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0041_TestCase.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** + *test if @wiredByImpl="true", <reference/> element has no <binding/> child elements. + */ +public class ASM_0041_TestCase extends BaseJAXWSTestCase { + + /** + * <p> + * OSOA + * Line 220~221 + * If "true" is set, then the reference should not be wired + * statically within a composite, but left unwired. + * <p> + * OASIS + * ASM50013 + * If @wiredByImpl="true", + * other methods of specifying the target service MUST NOT be used. + * <p> + * Jira issue: + * https://issues.apache.org/jira/browse/TUSCANY-2913 + */ + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0041"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0041.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0041 diff --git a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0042_TestCase.java b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0042_TestCase.java new file mode 100644 index 0000000000..d25fc1e270 --- /dev/null +++ b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0042_TestCase.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** + * test if @wiredByImpl="true", + * No <wire/> elements have the <reference/> element declared as the @source for the wire. + */ +@Ignore("TUSCANY-2925") +public class ASM_0042_TestCase extends BaseJAXWSTestCase { + + + /** + * <p> + * OSOA + * Line 220~221 + * If "true" is set, then the reference should not be wired + * statically within a composite, but left unwired. + * <p> + * OASIS + * ASM50013 + * If @wiredByImpl="true", + * other methods of specifying the target service MUST NOT be used. + * <p> + * Jira issue: + * https://issues.apache.org/jira/browse/TUSCANY-2913 + */ + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0042"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0042.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0042 diff --git a/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0043_TestCase.java b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0043_TestCase.java new file mode 100644 index 0000000000..a554fa1ee6 --- /dev/null +++ b/branches/sca-java-1.x/stest/sampleTest/src/test/java/client/ASM_0043_TestCase.java @@ -0,0 +1,59 @@ +/* + * 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_0043_TestCase, it tests @uri and subelement of <binding> can't coexist, + * and some binding can use specific subelements more than a simple URI. + * + */ +public class ASM_0043_TestCase extends BaseJAXWSTestCase { + + + /** + * <p> + * OSOA + * <p> + * OASIS + * ASM50016 + * It is possible that a particular binding type MAY require that the address of a target service + * uses more than a simple URI. In cases where a reference element has a binding subelement of such a type, + * the @uri attribute of the binding element MUST NOT be used to identify the target service - + * instead, binding specific attributes and/or child elements MUST be used. + * <p> + * Jira issue: + * https://issues.apache.org/jira/browse/TUSCANY-2921 + */ + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0043"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0043.composite"; + config.testServiceName = "TestClient"; + config.testClass = ASM_0002_Client.class; + config.serviceInterface = TestInvocation.class; + return config; + } + +} // end class Test_ASM_0043 |