use of org.jboss.as.test.integration.ejb.home.remotehome.SimpleInterface in project wildfly by wildfly.
the class AnnotationHomeTestCase method testGetEjbLocalObject.
@Test
public void testGetEjbLocalObject() throws Exception {
final String message = "Bean Message";
final SimpleStatefulHome home = (SimpleStatefulHome) iniCtx.lookup("java:module/SimpleStatefulBean!" + SimpleStatefulHome.class.getName());
SimpleInterface ejbInstance = home.createSimple(message);
try {
Assert.assertEquals(message, ejbInstance.otherMethod());
} catch (EJBException e) {
Assert.assertEquals(IllegalStateException.class, e.getCause().getClass());
}
}
use of org.jboss.as.test.integration.ejb.home.remotehome.SimpleInterface in project wildfly by wildfly.
the class AnnotationHomeTestCase method testStatefulLocalHome.
@Test
public void testStatefulLocalHome() throws Exception {
final String message = "Bean Message";
final SimpleStatefulHome home = (SimpleStatefulHome) iniCtx.lookup("java:module/SimpleStatefulBean!" + SimpleStatefulHome.class.getName());
SimpleInterface ejbInstance = home.createSimple(message);
Assert.assertEquals(message, ejbInstance.sayHello());
ejbInstance = home.createComplex("hello", "world");
Assert.assertEquals("hello world", ejbInstance.sayHello());
ejbInstance.remove();
try {
ejbInstance.sayHello();
fail("Expected bean to be removed");
} catch (NoSuchObjectException expected) {
}
}
use of org.jboss.as.test.integration.ejb.home.remotehome.SimpleInterface in project wildfly by wildfly.
the class AnnotationHomeTestCase method testStatelessLocalHome.
@Test
public void testStatelessLocalHome() throws Exception {
final SimpleHome home = (SimpleHome) iniCtx.lookup("java:module/SimpleStatelessBean!" + SimpleHome.class.getName());
final SimpleInterface ejbInstance = home.createSimple();
Assert.assertEquals("Hello World", ejbInstance.sayHello());
}
use of org.jboss.as.test.integration.ejb.home.remotehome.SimpleInterface in project wildfly by wildfly.
the class SimpleHomeTestCase method testStatefulLocalHome.
@Test
public void testStatefulLocalHome() throws Exception {
final String message = "Bean Message";
final SimpleStatefulHome home = (SimpleStatefulHome) iniCtx.lookup("java:module/SimpleStatefulHomeBean!" + SimpleStatefulHome.class.getName());
SimpleInterface ejbInstance = home.createSimple(message);
Assert.assertEquals(message, ejbInstance.sayHello());
ejbInstance = home.createComplex("hello", "world");
Assert.assertEquals("hello world", ejbInstance.sayHello());
}
use of org.jboss.as.test.integration.ejb.home.remotehome.SimpleInterface in project wildfly by wildfly.
the class SimpleHomeTestCase method testgetEjbLocalObject.
@Test
public void testgetEjbLocalObject() throws Exception {
final String message = "Bean Message";
final SimpleStatefulHome home = (SimpleStatefulHome) iniCtx.lookup("java:module/SimpleStatefulHomeBean!" + SimpleStatefulHome.class.getName());
SimpleInterface ejbInstance = home.createSimple(message);
Assert.assertEquals(message, ejbInstance.otherMethod());
ejbInstance = home.createComplex("hello", "world");
Assert.assertEquals("hello world", ejbInstance.otherMethod());
}
Aggregations