summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/itest/wsdlgen/src/test/java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-01 15:23:45 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-01 15:23:45 +0000
commit574b17f369e247d6711421eeeaf6d4759e7fb2e1 (patch)
treef16098831fa8637b115782ff4a75ee2db89dfd0d /branches/sca-java-1.x/itest/wsdlgen/src/test/java
parent00a5b3a769c59878e1754307f87abb3d235ee828 (diff)
TUSCANY-3283 - improve the wsdlgen test case to test the situation where a type with a namespace references a type without a namespace
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@820686 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/itest/wsdlgen/src/test/java')
-rw-r--r--branches/sca-java-1.x/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java54
1 files changed, 53 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java b/branches/sca-java-1.x/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java
index d52db8e812..c5c1d50bc1 100644
--- a/branches/sca-java-1.x/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java
+++ b/branches/sca-java-1.x/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java
@@ -22,6 +22,11 @@ import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.After;
@@ -29,6 +34,10 @@ import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
+import yetanotherpackage.DBean;
+
+import anotherpackage.BBean;
+
/**
* Tests that the helloworld server is available
*/
@@ -42,11 +51,54 @@ public class HttpTransportTestCase{
}
@Test
- public void testComponent1() throws IOException {
+ public void testComponent1SCA() throws IOException {
HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent1/HelloWorldService");
assertNotNull(helloWorldService);
+ HelloWorldService helloWorldClient = scaDomain.getService(HelloWorldService.class, "HelloWorldClientComponent1/HelloWorldService");
+ assertNotNull(helloWorldClient);
+
assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
+ assertEquals("Hello Hello Smith", helloWorldClient.getGreetings("Smith"));
+
+ BBean bbean = new BBean();
+ bbean.setField1("1");
+ bbean.setField2("2");
+
+ DBean abean = new DBean();
+ abean.setField1("3");
+ abean.setField2("4");
+ abean.setField3(bbean);
+
+ assertEquals("Hello Hello 3 4 1 2", helloWorldClient.getGreetingsDBean(abean));
+ }
+
+ @Test
+ public void testComponent1JAXWS() throws IOException {
+
+ // talk to the service using JAXWS with WSDL generated from this service used wsgen
+ // the idea here is to demonstrate that the service is providing a JAXWS compliant
+ // interface
+ QName serviceName = new QName("http://helloworld/", "HelloWorldImplService");
+ URL wsdlLocation = this.getClass().getClassLoader().getResource("wsdl/HelloWorldImplService.wsdl");
+ Service webService = Service.create( wsdlLocation, serviceName );
+ HelloWorldService wsProxy = (HelloWorldService) webService.getPort(HelloWorldService.class);
+
+ assertEquals("Hello Fred", wsProxy.getGreetings("Fred"));
+
+ BBean bbean = new BBean();
+ bbean.setField1("1");
+ bbean.setField2("2");
+
+ DBean abean = new DBean();
+ abean.setField1("3");
+ abean.setField2("4");
+ abean.setField3(bbean);
+
+ assertEquals("Hello 3 4 1 2", wsProxy.getGreetingsDBean(abean));
+
+ // repeat the JAXWS call with WSDL generated by tuscany
+
}