1 22 package org.jboss.test.webservice.jbws377; 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 JBWS377TestCase extends WebserviceTestBase 39 { 40 42 public JBWS377TestCase(String name) 43 { 44 super(name); 45 } 46 47 48 public static Test suite() throws Exception 49 { 50 return getDeploySetup(JBWS377TestCase.class, "ws4ee-jbws377.war, ws4ee-jbws377-client.jar"); 51 } 52 53 public void testEndpointNotNull() throws Exception 54 { 55 InitialContext iniCtx = getClientContext(); 56 Service service = (Service )iniCtx.lookup("java:comp/env/service/HelloService"); 57 Hello hello = (Hello)service.getPort(Hello.class); 58 59 UserType user = new UserType("kermit"); 60 String retObj = hello.echoStrings("str1", "str2", user); 61 assertEquals("str1str2[value=kermit]", retObj); 62 } 63 64 public void testEndpointNull() throws Exception 65 { 66 InitialContext iniCtx = getClientContext(); 67 Service service = (Service )iniCtx.lookup("java:comp/env/service/HelloService"); 68 Hello hello = (Hello)service.getPort(Hello.class); 69 70 String retObj = hello.echoStrings(null, "str2", null); 71 assertEquals("nullstr2null", retObj); 72 } 73 } 74 | Popular Tags |