diff options
author | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-10 13:29:12 +0000 |
---|---|---|
committer | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-10 13:29:12 +0000 |
commit | 1623bce81d34a7500b27ad604d8e72055fd3002f (patch) | |
tree | 5cf0c15a6f5424406b40ac0449fca63209fb4162 /java/sca/stest/sampleTest/src | |
parent | 1889745e7e214ca6d3dcbb5045bc25084f882129 (diff) |
Added a JAX-WS client and a related server side testcase
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@725276 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/stest/sampleTest/src')
3 files changed, 53 insertions, 1 deletions
diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0001.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0001.composite index ac9bb3ea00..a23a333013 100644 --- a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0001.composite +++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0001.composite @@ -26,6 +26,7 @@ <implementation.java class="test.ASM_0001_Client"/>
<service name="TestInvocation">
<interface.java interface="test.TestInvocation"/>
+ <binding.sca/>
</service>
<!-- reference name="testRef1" target="TestComponent1/service1" / -->
</component>
diff --git a/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0101.composite b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0101.composite new file mode 100644 index 0000000000..c6a44392b4 --- /dev/null +++ b/java/sca/stest/sampleTest/src/main/resources/Test_ASM_0101.composite @@ -0,0 +1,42 @@ +<?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:sample="http://oasis/tests" + name="TEST_ASM_0101">
+ + <component name="TestClient">
+ <implementation.java class="test.ASM_0001_Client"/>
+ <service name="TestInvocation">
+ <interface.java interface="test.TestInvocation"/>
+ <binding.sca/>
+ <binding.ws/>
+ </service>
+ <!-- reference name="testRef1" target="TestComponent1/service1" / -->
+ </component>
+
+<!-- + <component name="TestComponent1"> + <implementation.java class="test.ASM_0001_Impl1"/> + <service name="service1"/> + </component> +-->
+ +</composite> diff --git a/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTest.java b/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTest.java index cedf2e1992..d95421ac08 100644 --- a/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTest.java +++ b/java/sca/stest/sampleTest/src/test/java/client/BaseJAXWSTest.java @@ -29,6 +29,9 @@ import org.junit.Before; import org.junit.Test;
import org.osoa.sca.annotations.Reference;
+import javax.xml.ws.Service;
+import javax.xml.namespace.QName;
+
import test.ASM_0001_Client;
import test.TestInvocation;
@@ -71,6 +74,12 @@ public class BaseJAXWSTest { }
public String invokeTest( String input ) {
+ //Web service invocation
+ QName serviceName = new QName("http://localhost:8080", "TestInvocation");
+ javax.xml.ws.Service webService = Service.create(serviceName);
+ TestInvocation wsProxy = (TestInvocation) webService.getPort(testConfiguration.getServiceInterface());
+ String output = wsProxy.invokeTest(input);
+ System.out.println("web service invoked - output = " + output);
TestInvocation service = (TestInvocation) getService( testConfiguration.getServiceInterface(),
testConfiguration.getTestServiceName() );
@@ -112,7 +121,7 @@ public class BaseJAXWSTest { config.testName = "ASM_0001";
config.input = "request";
config.output = config.testName + " " + config.input + " invoked ok";
- config.composite = "Test_ASM_0001.composite";
+ config.composite = "Test_ASM_0101.composite";
config.testServiceName = "TestClient";
config.testClass = ASM_0001_Client.class;
config.serviceInterface = TestInvocation.class;
|