From 788390fa48358848fc17dd87b4538ccf563af95e Mon Sep 17 00:00:00 2001 From: vamsic007 Date: Tue, 22 Jul 2008 12:18:58 +0000 Subject: Databinding tests - JAXB Top Down tests for List and Map git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@678733 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/itest/databindings/jaxb/HelloService.java | 8 +- .../databindings/jaxb/HelloServiceClient.java | 8 +- .../jaxb/impl/HelloServiceClientImpl.java | 24 +-- .../main/resources/wsdl/wrapped/hello-service.wsdl | 193 +++++++++++++++++++++ .../jaxb/topdown/DatabindingTestCase.java | 46 ++--- 5 files changed, 232 insertions(+), 47 deletions(-) (limited to 'java/sca/itest/databindings/jaxb-top-down') diff --git a/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java index 9305343fdd..352f805c7d 100644 --- a/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java @@ -34,9 +34,9 @@ import org.osoa.sca.annotations.Remotable; public interface HelloService { String getGreetings(String name); String[] getGreetingsArray(String[] names); - //List getGreetingsList(List names); - //ArrayList getGreetingsArrayList(ArrayList names); - //Map getGreetingsMap(Map namesMap); - //HashMap getGreetingsHashMap(HashMap namesMap); + List getGreetingsList(List names); + ArrayList getGreetingsArrayList(ArrayList names); + Map getGreetingsMap(Map namesMap); + HashMap getGreetingsHashMap(HashMap namesMap); String getGreetingsVarArgs(String... names); } diff --git a/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java index b6ca907e25..7bd95cec95 100644 --- a/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java @@ -33,9 +33,9 @@ import java.util.Map; public interface HelloServiceClient { String getGreetingsForward(String name); String[] getGreetingsArrayForward(String[] names); - //List getGreetingsListForward(List names); - //ArrayList getGreetingsArrayListForward(ArrayList names); - //Map getGreetingsMapForward(Map namesMap); - //HashMap getGreetingsHashMapForward(HashMap namesMap); + List getGreetingsListForward(List names); + ArrayList getGreetingsArrayListForward(ArrayList names); + Map getGreetingsMapForward(Map namesMap); + HashMap getGreetingsHashMapForward(HashMap namesMap); String getGreetingsVarArgsForward(String... names); } diff --git a/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java index 393cbc020b..c4026fdb9a 100644 --- a/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java @@ -51,21 +51,21 @@ public class HelloServiceClientImpl { return service.getGreetingsArray(names); } -// public List getGreetingsListForward(List names) { -// return service.getGreetingsList(names); -// } + public List getGreetingsListForward(List names) { + return service.getGreetingsList(names); + } -// public Map getGreetingsMapForward(Map namesMap) { -// return service.getGreetingsMap(namesMap); -// } + public Map getGreetingsMapForward(Map namesMap) { + return service.getGreetingsMap(namesMap); + } -// public ArrayList getGreetingsArrayListForward(ArrayList names) { -// return service.getGreetingsArrayList(names); -// } + public ArrayList getGreetingsArrayListForward(ArrayList names) { + return service.getGreetingsArrayList(names); + } -// public HashMap getGreetingsHashMapForward(HashMap namesMap) { -// return service.getGreetingsHashMap(namesMap); -// } + public HashMap getGreetingsHashMapForward(HashMap namesMap) { + return service.getGreetingsHashMap(namesMap); + } public String getGreetingsVarArgsForward(String... names) { return service.getGreetingsVarArgs(names[0], names[1], names[2]); diff --git a/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl b/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl index 0b3223dce3..926e4154aa 100644 --- a/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl @@ -28,6 +28,36 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40,6 +70,7 @@ @@ -73,6 +104,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -110,6 +205,46 @@ element="tns:getGreetingsArrayResponse"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -131,6 +266,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -159,6 +316,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java b/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java index 709bb02a28..01357aafb3 100644 --- a/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java +++ b/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java @@ -19,6 +19,11 @@ package org.apache.tuscany.sca.itest.databindings.jaxb.topdown; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import junit.framework.Assert; import org.apache.tuscany.sca.itest.databindings.jaxb.HelloServiceClient; @@ -27,7 +32,6 @@ import org.apache.tuscany.sca.node.SCANode2; import org.apache.tuscany.sca.node.SCANode2Factory; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; /** @@ -82,10 +86,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsList. */ @Test - @Ignore public void testW2WList() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); - //performTestList(helloServiceClient); + performTestList(helloServiceClient); } /** @@ -93,10 +96,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsArrayList. */ @Test - @Ignore public void testW2WArrayList() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); - //performTestArrayList(helloServiceClient); + performTestArrayList(helloServiceClient); } /** @@ -104,10 +106,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsMap. */ @Test - @Ignore public void testW2WMap() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); - //performTestMap(helloServiceClient); + performTestMap(helloServiceClient); } /** @@ -115,10 +116,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsHashMap. */ @Test - @Ignore public void testW2WHashMap() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); - //performTestHashMap(helloServiceClient); + performTestHashMap(helloServiceClient); } /** @@ -156,10 +156,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsList. */ @Test - @Ignore public void testJ2WList() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); - //performTestList(helloServiceClient); + performTestList(helloServiceClient); } /** @@ -167,10 +166,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsArrayList. */ @Test - @Ignore public void testJ2WArrayList() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); - //performTestArrayList(helloServiceClient); + performTestArrayList(helloServiceClient); } /** @@ -178,10 +176,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsMap. */ @Test - @Ignore public void testJ2WMap() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); - //performTestMap(helloServiceClient); + performTestMap(helloServiceClient); } /** @@ -189,10 +186,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsHashMap. */ @Test - @Ignore public void testJ2WHashMap() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); - //performTestHashMap(helloServiceClient); + performTestHashMap(helloServiceClient); } /** @@ -230,10 +226,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsList. */ @Test - @Ignore public void testW2JList() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); - //performTestList(helloServiceClient); + performTestList(helloServiceClient); } /** @@ -241,10 +236,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsArrayList. */ @Test - @Ignore public void testW2JArrayList() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); - //performTestArrayList(helloServiceClient); + performTestArrayList(helloServiceClient); } /** @@ -252,10 +246,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsMap. */ @Test - @Ignore public void testW2JMap() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); - //performTestMap(helloServiceClient); + performTestMap(helloServiceClient); } /** @@ -263,10 +256,9 @@ public class DatabindingTestCase { * Service method invoked is getGreetingsHashMap. */ @Test - @Ignore public void testW2JHashMap() throws Exception { HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); - //performTestHashMap(helloServiceClient); + performTestHashMap(helloServiceClient); } /** @@ -293,7 +285,7 @@ public class DatabindingTestCase { } } -/* private void performTestList(HelloServiceClient helloServiceClient) { + private void performTestList(HelloServiceClient helloServiceClient) { List namesList = new ArrayList(); namesList.add("Me"); namesList.add("Pandu"); @@ -340,7 +332,7 @@ public class DatabindingTestCase { Assert.assertEquals("Hello "+entry.getKey(), respMap.get(entry.getKey())); } } -*/ + private void performTestVarArgs(HelloServiceClient helloServiceClient) { String[] names = { "Me", "You", "Pandu" }; // Do not change the array size from 3. String expected = "Hello Me You Pandu"; -- cgit v1.2.3