From 919179fe81fe5f7da3f546c88664402fcebaa233 Mon Sep 17 00:00:00 2001 From: edwardsmj Date: Fri, 9 Jan 2009 11:05:06 +0000 Subject: Added Test_ASM_0008 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@733007 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/resources/TestComposite4.composite | 45 ++++++++++++++++ .../src/main/resources/Test_ASM_0008.composite | 61 ++++++++++++++++++++++ .../src/test/java/client/ASM_0008_TestCase.java | 46 ++++++++++++++++ .../src/test/java/client/BaseJAXWSTestCase.java | 16 +++++- 4 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite create mode 100644 java/sca/stest/sampleTest/src/main/resources/Test_ASM_0008.composite create mode 100644 java/sca/stest/sampleTest/src/test/java/client/ASM_0008_TestCase.java diff --git a/java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite b/java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite new file mode 100644 index 0000000000..7408a4dd97 --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/TestComposite4.composite @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0008.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0008.composite new file mode 100644 index 0000000000..9ddb8aa8cf --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0008.composite @@ -0,0 +1,61 @@ + + + + + + + + + + + + + ASM_0005 + + + + + + + + service1 + + + + + + + + + + service2 + + + diff --git a/java/sca/stest/sampleTest/src/test/java/client/ASM_0008_TestCase.java b/java/sca/stest/sampleTest/src/test/java/client/ASM_0008_TestCase.java new file mode 100644 index 0000000000..0bdc3af4a3 --- /dev/null +++ b/java/sca/stest/sampleTest/src/test/java/client/ASM_0008_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_0008_TestCase, which Tests that the @name attribute of a + * element of a component is equal to the @name attribute of a + * element of the of the of + * the + */ +public class ASM_0008_TestCase extends BaseJAXWSTestCase { + + + protected TestConfiguration getTestConfiguration() { + TestConfiguration config = new TestConfiguration(); + config.testName = "ASM_0008"; + config.input = "request"; + config.output = "exception"; + config.composite = "Test_ASM_0008.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/BaseJAXWSTestCase.java b/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java index 5a350dc40f..4098e94952 100644 --- a/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java +++ b/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTestCase.java @@ -47,6 +47,7 @@ public class BaseJAXWSTestCase { protected NodeLauncher launcher; protected Node node; protected TestConfiguration testConfiguration = getTestConfiguration(); + static boolean proceed = true; public static void main(String[] args) throws Exception { BaseJAXWSTestCase test = new BaseJAXWSTestCase(); @@ -56,7 +57,17 @@ public class BaseJAXWSTestCase { @Before public void setUp() throws Exception { - startContribution(); + try { + startContribution(); + } catch (Exception e) { + // If the SCA runtime refuses to start an invalid contribution, then this is also + // regarded as a successful outcome + System.out.println( "Exception received - detail: " + e.getMessage() ); + assertEquals( testConfiguration.getExpectedOutput(), "exception" ); + System.out.println("Test " + testConfiguration.getTestName() + " completed successfully"); + // Mark this test as not to proceed further + proceed = false; + } // end try } @After @@ -66,6 +77,9 @@ public class BaseJAXWSTestCase { @Test public void testDummy() throws Exception { + // If an exception were thrown during initialization, let's go no further + if( proceed == false ) return; + // System.out.println("Test " + testName + " starting"); try { // Just requires input to proceed -- cgit v1.2.3