package org.jboss.test.webservice.samples;
import junit.framework.Test;
import org.jboss.test.JBossTestCase;
import javax.naming.InitialContext;
public class ClientSideEJBTestCase extends JBossTestCase
{
public ClientSideEJBTestCase(String name)
{
super(name);
}
public static Test suite() throws Exception
{
return getDeploySetup(ClientSideEJBTestCase.class, "ws4ee-samples-server-jse.war, ws4ee-samples-server-ejb.jar, ws4ee-samples-client-ejb.jar");
}
public void testClientAccessEJB() throws Exception
{
InitialContext iniCtx = new InitialContext();
OrganizationClientHome home = (OrganizationClientHome)iniCtx.lookup("ejb/OrganizationClientBean");
OrganizationClientRemote bean = home.create();
String info = bean.getContactInfoEJB("mafia");
assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
}
public void testClientAccessJSE() throws Exception
{
InitialContext iniCtx = new InitialContext();
OrganizationClientHome home = (OrganizationClientHome)iniCtx.lookup("ejb/OrganizationClientBean");
OrganizationClientRemote bean = home.create();
String info = bean.getContactInfoJSE("mafia");
assertEquals("The 'mafia' boss is currently out of office, please call again.", info);
}
}