Search in sources :

Example 56 with EJBHome

use of jakarta.ejb.EJBHome in project tomee by apache.

the class ComplexEjbMetaDataTests method test01_getEJBHome.

// =================================
// Test meta data methods
// 
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbMetaData.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(jakarta.ejb.EJBHome)

Example 57 with EJBHome

use of jakarta.ejb.EJBHome in project tomee by apache.

the class SingletonRmiIiopTests method test39_returnEJBHomeArray.

public void test39_returnEJBHomeArray() {
    try {
        final EncSingletonHome[] expected = new EncSingletonHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/singleton/EncBean");
            expected[i] = (EncSingletonHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }
        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(jakarta.ejb.EJBHome) EJBObject(jakarta.ejb.EJBObject) RemoteException(java.rmi.RemoteException)

Example 58 with EJBHome

use of jakarta.ejb.EJBHome in project tomee by apache.

the class StatefulRmiIiopTests method test39_returnEJBHomeArray.

public void test39_returnEJBHomeArray() {
    try {
        final EncStatefulHome[] expected = new EncStatefulHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/stateful/EncBean");
            expected[i] = (EncStatefulHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }
        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(jakarta.ejb.EJBHome) EJBObject(jakarta.ejb.EJBObject) RemoteException(java.rmi.RemoteException)

Example 59 with EJBHome

use of jakarta.ejb.EJBHome in project tomee by apache.

the class SingletonPojoHomeHandleTests method test01_getEJBHome.

// =================================
// Test home handle methods
// 
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbHomeHandle.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(jakarta.ejb.EJBHome)

Example 60 with EJBHome

use of jakarta.ejb.EJBHome in project tomee by apache.

the class StatefulPojoEjbObjectTests method test01_getEjbHome.

// ===============================
// Start EJBObject methods test
// 
/*
         * According to the EJB3.0 "Core Contracts and Requirements" specs, section
         * 3.6.4, a session EJBObject supports:
         * 1. Get the session object's remote home interface.
         * 2. Get the session object's handle.
         * 3. Test if the session object is identical with another session object.
         * 4. Remove the session object.
         */
/**
 * A method to test retrieving the EJBHome interface of a session bean using its EJBObject reference.
 */
public void test01_getEjbHome() {
    try {
        final EJBHome home = ejbObject.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(jakarta.ejb.EJBHome)

Aggregations

EJBHome (jakarta.ejb.EJBHome)60 RemoteException (java.rmi.RemoteException)14 EJBObject (jakarta.ejb.EJBObject)8 InitialContext (javax.naming.InitialContext)8 ObjectNotFoundException (jakarta.ejb.ObjectNotFoundException)7 EJBException (jakarta.ejb.EJBException)6 HomeHandle (jakarta.ejb.HomeHandle)6 ByteArrayInputStream (java.io.ByteArrayInputStream)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ObjectInputStream (java.io.ObjectInputStream)3 ObjectOutputStream (java.io.ObjectOutputStream)3 MarshalledObject (java.rmi.MarshalledObject)3 EJBLocalHome (jakarta.ejb.EJBLocalHome)2 RemoveException (jakarta.ejb.RemoveException)2 Method (java.lang.reflect.Method)2 CreateException (jakarta.ejb.CreateException)1 EJBAccessException (jakarta.ejb.EJBAccessException)1 EJBLocalObject (jakarta.ejb.EJBLocalObject)1 AnnotatedMethod (jakarta.enterprise.inject.spi.AnnotatedMethod)1 LoginException (javax.security.auth.login.LoginException)1