1 22 package org.jboss.test.webservice.samples; 23 24 25 import junit.framework.Test; 26 import org.jboss.test.webservice.WebserviceTestBase; 27 28 import javax.naming.InitialContext ; 29 import javax.xml.rpc.Service ; 30 31 37 public class ClientSideApplTestCase extends WebserviceTestBase 38 { 39 40 public ClientSideApplTestCase(String name) 41 { 42 super(name); 43 } 44 45 46 public static Test suite() throws Exception 47 { 48 return getDeploySetup(ClientSideApplTestCase.class, "ws4ee-samples-server-jse.war, ws4ee-samples-server-ejb.jar, ws4ee-samples-client-appl.jar"); 49 } 50 51 52 public void testApplClientAccessEJB() throws Exception 53 { 54 InitialContext iniCtx = getClientContext(); 55 Service service = (Service )iniCtx.lookup("java:comp/env/service/OrganizationServiceEJB"); 56 Organization endpoint = (Organization)service.getPort(Organization.class); 57 String info = endpoint.getContactInfo("mafia"); 58 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 59 } 60 61 62 public void testApplClientAccessJSE() throws Exception 63 { 64 InitialContext iniCtx = getClientContext(); 65 OrganizationService service = (OrganizationService)iniCtx.lookup("java:comp/env/service/OrganizationServiceJSE"); 66 Organization endpoint = service.getOrganizationPort(); 67 String info = endpoint.getContactInfo("mafia"); 68 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 69 } 70 } 71 | Popular Tags |