1 22 package org.jboss.test.webservice.samples; 23 24 import junit.framework.Test; 25 import org.jboss.test.JBossTestCase; 26 import org.jboss.test.webservice.WebserviceTestBase; 27 28 import javax.naming.InitialContext ; 29 30 36 public class ClientSideEJBTestCase extends WebserviceTestBase 37 { 38 39 public ClientSideEJBTestCase(String name) 40 { 41 super(name); 42 } 43 44 45 public static Test suite() throws Exception 46 { 47 return getDeploySetup(ClientSideEJBTestCase.class, "ws4ee-samples-server-jse.war, ws4ee-samples-server-ejb.jar, ws4ee-samples-client-ejb.jar"); 48 } 49 50 51 public void testClientAccessEJB() throws Exception 52 { 53 InitialContext iniCtx = new InitialContext (); 54 OrganizationClientHome home = (OrganizationClientHome)iniCtx.lookup("ejb/OrganizationClientBean"); 55 OrganizationClientRemote bean = home.create(); 56 String info = bean.getContactInfoEJB("mafia"); 57 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 58 } 59 60 61 public void testClientAccessJSE() throws Exception 62 { 63 InitialContext iniCtx = new InitialContext (); 64 OrganizationClientHome home = (OrganizationClientHome)iniCtx.lookup("ejb/OrganizationClientBean"); 65 OrganizationClientRemote bean = home.create(); 66 String info = bean.getContactInfoJSE("mafia"); 67 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 68 } 69 } 70 | Popular Tags |