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