1 22 package org.jboss.test.webservice.jbws632; 23 24 import javax.naming.InitialContext ; 25 import javax.xml.rpc.Service ; 26 27 import junit.framework.Test; 28 29 import org.jboss.test.webservice.WebserviceTestBase; 30 31 39 public class JBWS632TestCase extends WebserviceTestBase 40 { 41 private static TestSEI port; 42 43 public JBWS632TestCase(String name) 44 { 45 super(name); 46 } 47 48 49 public static Test suite() throws Exception 50 { 51 return getDeploySetup(JBWS632TestCase.class, "ws4ee-jbws632.war, ws4ee-jbws632-client.jar"); 52 } 53 54 protected void setUp() throws Exception 55 { 56 super.setUp(); 57 if (port == null) 58 { 59 InitialContext iniCtx = getClientContext(); 60 Service service = (Service )iniCtx.lookup("java:comp/env/service/TestService"); 61 port = (TestSEI)service.getPort(TestSEI.class); 62 } 63 } 64 65 public void testStringArray() throws Exception 66 { 67 String [][] arr = new String [][]{new String []{"a", "b"}, new String []{"", null}, new String []{"c", "d"}}; 68 String [][] retObj = port.echo(arr); 69 assertEquals("a", retObj[0][0]); 70 assertEquals("b", retObj[0][1]); 71 assertEquals("", retObj[1][0]); 72 assertEquals(null, retObj[1][1]); 73 assertEquals("c", retObj[2][0]); 74 assertEquals("d", retObj[2][1]); 75 } 76 77 public void testNullArray() throws Exception 78 { 79 String [][] retObj = port.echo(null); 80 assertNull(retObj); 81 } 82 83 public void testEmptyArray() throws Exception 84 { 85 String [][] retObj = port.echo(new String [][]{}); 86 assertNotNull(retObj); 87 assertEquals(0, retObj.length); 88 } 89 } 90 | Popular Tags |