From af13b17fdca8f3936596a8dffc6c7ef9a197267a Mon Sep 17 00:00:00 2001 From: vamsic007 Date: Thu, 3 Jul 2008 10:25:44 +0000 Subject: Databinding tests JAXB Top Down for String, String array and var args. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@673645 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/itest/databindings/jaxb/HelloService.java | 42 +++ .../databindings/jaxb/HelloServiceClient.java | 41 +++ .../jaxb/impl/HelloServiceClientImpl.java | 73 +++++ .../databindings/jaxb/impl/HelloServiceImpl.java | 86 +++++ .../main/resources/wsdl/wrapped/hello-service.wsdl | 178 ++++++++++ .../resources/wsdl/wrapped/helloservice.composite | 80 +++++ .../jaxb/topdown/DatabindingTestCase.java | 358 +++++++++++++++++++++ 7 files changed, 858 insertions(+) create mode 100644 java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java create mode 100644 java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java create mode 100644 java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java create mode 100644 java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java create mode 100644 java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl create mode 100644 java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite create mode 100644 java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java (limited to 'java/sca/itest/databindings') 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 new file mode 100644 index 0000000000..9305343fdd --- /dev/null +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java @@ -0,0 +1,42 @@ +/* + * 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 org.apache.tuscany.sca.itest.databindings.jaxb; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.osoa.sca.annotations.Remotable; + +/** + * The interface for HelloService. + * + * @version $Rev$ $Date$ + */ +@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); + 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 new file mode 100644 index 0000000000..b6ca907e25 --- /dev/null +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java @@ -0,0 +1,41 @@ +/* + * 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 org.apache.tuscany.sca.itest.databindings.jaxb; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * The interface for HelloServiceClient. + * + * @version $Rev$ $Date$ + */ +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); + 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 new file mode 100644 index 0000000000..393cbc020b --- /dev/null +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java @@ -0,0 +1,73 @@ +/* + * 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 org.apache.tuscany.sca.itest.databindings.jaxb.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.tuscany.sca.itest.databindings.jaxb.HelloService; +import org.apache.tuscany.sca.itest.databindings.jaxb.HelloServiceClient; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + * An implementation of HelloServiceClient. + * The client forwards the request to the service component and returns the response from the service component. + */ +@Service(HelloServiceClient.class) +public class HelloServiceClientImpl { + + private HelloService service; + + @Reference + public void setHelloService(HelloService service) { + this.service = service; + } + + public String getGreetingsForward(String name) { + return service.getGreetings(name); + } + + public String[] getGreetingsArrayForward(String[] names) { + return service.getGreetingsArray(names); + } + +// public List getGreetingsListForward(List names) { +// return service.getGreetingsList(names); +// } + +// public Map getGreetingsMapForward(Map namesMap) { +// return service.getGreetingsMap(namesMap); +// } + +// public ArrayList getGreetingsArrayListForward(ArrayList names) { +// return service.getGreetingsArrayList(names); +// } + +// 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/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java new file mode 100644 index 0000000000..fc2dc64b7d --- /dev/null +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java @@ -0,0 +1,86 @@ +/* + * 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 org.apache.tuscany.sca.itest.databindings.jaxb.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.tuscany.sca.itest.databindings.jaxb.HelloService; +import org.osoa.sca.annotations.Service; + +/** + * An implementation of HelloService. + * + * @version $Rev$ $Date$ + */ +@Service(interfaces = {HelloService.class}) +public class HelloServiceImpl implements HelloService { + public String getGreetings(String name) { + return "Hello " + name; + } + + public String[] getGreetingsArray(String[] names) { + String[] resps = new String[names.length]; + for (int i = 0; i < names.length; ++i) { + resps[i] = "Hello " + names[i]; + } + return resps; + } + + public List getGreetingsList(List names) { + List resps = new ArrayList(); + for (int i = 0; i < names.size(); ++i) { + resps.add("Hello " + names.get(i)); + } + return resps; + } + + public ArrayList getGreetingsArrayList(ArrayList names) { + ArrayList resps = new ArrayList(); + for (int i = 0; i < names.size(); ++i) { + resps.add("Hello " + names.get(i)); + } + return resps; + } + + public Map getGreetingsMap(Map namesMap) { + for (Map.Entry entry : namesMap.entrySet()) { + entry.setValue("Hello " + entry.getKey()); + } + return namesMap; + } + + public HashMap getGreetingsHashMap(HashMap namesMap) { + for (Map.Entry entry : namesMap.entrySet()) { + entry.setValue("Hello " + entry.getKey()); + } + return namesMap; + } + + public String getGreetingsVarArgs(String... names) { + String resp = "Hello"; + for(int i = 0; i < names.length; ++i) { + resp += (" "+names[i]); + } + return resp; + } +} 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 new file mode 100644 index 0000000000..73d92e753f --- /dev/null +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite b/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite new file mode 100644 index 0000000000..63151f6a2d --- /dev/null +++ b/java/sca/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..0348adbe5f --- /dev/null +++ b/java/sca/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java @@ -0,0 +1,358 @@ +/* + * 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 org.apache.tuscany.sca.itest.databindings.jaxb.topdown; + +import java.io.File; +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; +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +/** + * @version $Rev$ $Date$ + */ +public class DatabindingTestCase { + + private static SCAClient client; + private static SCANode2 node; + + /** + * Runs once before running the tests + */ + @BeforeClass + public static void setUp() throws Exception { + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = nodeFactory.createSCANode(new File("src/main/resources/wsdl/wrapped/helloservice.composite").toURL().toString(), + new SCAContribution("TestContribution", new File("src/main/resources/wsdl/wrapped").toURL().toString())); + node.start(); + client = (SCAClient)node; + } + + /** + * Runs once after running the tests + */ + @AfterClass + public static void tearDown() { + node.stop(); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetings. + */ + @Test + public void testW2W() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); + performTest(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsArray. + */ + @Test + public void testW2WArray() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); + performTestArray(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsList. + */ + @Test + @Ignore + public void testW2WList() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); + //performTestList(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsArrayList. + */ + @Test + @Ignore + public void testW2WArrayList() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); + //performTestArrayList(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsMap. + */ + @Test + @Ignore + public void testW2WMap() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); + //performTestMap(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsHashMap. + */ + @Test + @Ignore + public void testW2WHashMap() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); + //performTestHashMap(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsVarArgs. + */ + @Test + public void testW2WVarArgs() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2WComponent"); + performTestVarArgs(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetings. + */ + @Test + public void testJ2W() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); + performTest(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsArray. + */ + @Test + public void testJ2WArray() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); + performTestArray(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsList. + */ + @Test + @Ignore + public void testJ2WList() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); + //performTestList(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsArrayList. + */ + @Test + @Ignore + public void testJ2WArrayList() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); + //performTestArrayList(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsMap. + */ + @Test + @Ignore + public void testJ2WMap() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); + //performTestMap(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsHashMap. + */ + @Test + @Ignore + public void testJ2WHashMap() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); + //performTestHashMap(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsVarArgs. + */ + @Test + public void testJ2WVarArgs() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientJ2WComponent"); + performTestVarArgs(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetings. + */ + @Test + public void testW2J() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); + performTest(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsArray. + */ + @Test + public void testW2JArray() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); + performTestArray(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsList. + */ + @Test + @Ignore + public void testW2JList() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); + //performTestList(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsArrayList. + */ + @Test + @Ignore + public void testW2JArrayList() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); + //performTestArrayList(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsMap. + */ + @Test + @Ignore + public void testW2JMap() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); + //performTestMap(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsHashMap. + */ + @Test + @Ignore + public void testW2JHashMap() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); + //performTestHashMap(helloServiceClient); + } + + /** + * Invokes the HelloService service using WS binding. + * Service method invoked is getGreetingsVarArgs. + */ + @Test + public void testW2JVarArgs() throws Exception { + HelloServiceClient helloServiceClient = client.getService(HelloServiceClient.class, "HelloServiceClientW2JComponent"); + performTestVarArgs(helloServiceClient); + } + + private void performTest(HelloServiceClient helloServiceClient) { + String name = "Pandu"; + String resp = helloServiceClient.getGreetingsForward(name); + Assert.assertEquals("Hello "+name, resp); + } + + private void performTestArray(HelloServiceClient helloServiceClient) { + String[] names = {"Me", "Pandu"}; + String[] resps = helloServiceClient.getGreetingsArrayForward(names); + for(int i = 0; i < names.length; ++i) { + Assert.assertEquals("Hello "+names[i], resps[i]); + } + } + +/* private void performTestList(HelloServiceClient helloServiceClient) { + List namesList = new ArrayList(); + namesList.add("Me"); + namesList.add("Pandu"); + namesList.add("Chinnipandu"); + List respList = helloServiceClient.getGreetingsListForward(namesList); + Assert.assertEquals(namesList.size(), respList.size()); + for(int i = 0; i < namesList.size(); ++i) { + Assert.assertEquals("Hello "+namesList.get(i), respList.get(i)); + } + } + + private void performTestArrayList(HelloServiceClient helloServiceClient) { + ArrayList namesList = new ArrayList(); + namesList.add("Me"); + namesList.add("Pandu"); + namesList.add("Chinnipandu"); + ArrayList respList = helloServiceClient.getGreetingsArrayListForward(namesList); + Assert.assertEquals(namesList.size(), respList.size()); + for(int i = 0; i < namesList.size(); ++i) { + Assert.assertEquals("Hello "+namesList.get(i), respList.get(i)); + } + } + + private void performTestMap(HelloServiceClient helloServiceClient) { + Map namesMap = new HashMap(); + namesMap.put("Me", null); + namesMap.put("Pandu", null); + namesMap.put("Chinnipandu", null); + Map respMap = helloServiceClient.getGreetingsMapForward(namesMap); + Assert.assertEquals(namesMap.keySet().size(), respMap.keySet().size()); + for(Map.Entry entry: namesMap.entrySet()) { + Assert.assertEquals("Hello "+entry.getKey(), respMap.get(entry.getKey())); + } + } + + private void performTestHashMap(HelloServiceClient helloServiceClient) { + HashMap namesMap = new HashMap(); + namesMap.put("Me", null); + namesMap.put("Pandu", null); + namesMap.put("Chinnipandu", null); + Map respMap = helloServiceClient.getGreetingsHashMapForward(namesMap); + Assert.assertEquals(namesMap.keySet().size(), respMap.keySet().size()); + for(Map.Entry entry: namesMap.entrySet()) { + 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"; + String actual = helloServiceClient.getGreetingsVarArgsForward(names[0], names[1], names[2]); + Assert.assertEquals(expected, actual); + } +} -- cgit v1.2.3