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