1 22 package org.jboss.test.webservice.jbws331; 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 JBWS331TestCase extends WebserviceTestBase 40 { 41 public JBWS331TestCase(String name) 42 { 43 super(name); 44 } 45 46 public static Test suite() throws Exception 47 { 48 return getDeploySetup(JBWS331TestCase.class, "ws4ee-jbws331.ear"); 49 } 50 51 public void testEndpointAccess() throws Exception 52 { 53 InitialContext iniCtx = getClientContext(); 54 Service service = (Service )iniCtx.lookup("java:comp/env/service/HelloService"); 55 Hello endpoint = (Hello)service.getPort(Hello.class); 56 57 String retStr = endpoint.hello("Hello Server"); 58 assertEquals("Hello Server", retStr); 59 } 60 61 public void testRemoteAccess() throws Exception 62 { 63 InitialContext iniCtx = getClientContext(); 64 HelloHome home = (HelloHome)iniCtx.lookup("java:comp/env/ejb/Hello"); 65 HelloRemote slsb = home.create(); 66 67 String retStr = slsb.hello("Hello Server"); 68 assertEquals("Hello Server", retStr); 69 } 70 } 71 | Popular Tags |