Search in sources :

Example 11 with EJBHome

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

the class ComplexHomeHandleTests 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(javax.ejb.EJBHome)

Example 12 with EJBHome

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

the class UnknownEjbMetaDataTests 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(javax.ejb.EJBHome)

Example 13 with EJBHome

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

the class UnknownHomeHandleTests 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(javax.ejb.EJBHome)

Example 14 with EJBHome

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

the class Unknown2HomeHandleTests method Xtest03_copyHandleBySerialize.

public void Xtest03_copyHandleBySerialize() {
    try {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(ejbHomeHandle);
        oos.flush();
        oos.close();
        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        final ObjectInputStream ois = new ObjectInputStream(bais);
        final HomeHandle copy = (HomeHandle) ois.readObject();
        assertNotNull("The HomeHandle copy is null", copy);
        final EJBHome home = copy.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) EJBHome(javax.ejb.EJBHome) HomeHandle(javax.ejb.HomeHandle) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ObjectOutputStream(java.io.ObjectOutputStream) ObjectInputStream(java.io.ObjectInputStream)

Example 15 with EJBHome

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

the class Unknown2HomeHandleTests 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(javax.ejb.EJBHome)

Aggregations

EJBHome (javax.ejb.EJBHome)63 RemoteException (java.rmi.RemoteException)14 EJBObject (javax.ejb.EJBObject)11 InitialContext (javax.naming.InitialContext)10 HomeHandle (javax.ejb.HomeHandle)8 ObjectNotFoundException (javax.ejb.ObjectNotFoundException)7 EJBException (javax.ejb.EJBException)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 Method (java.lang.reflect.Method)2 EJBLocalHome (javax.ejb.EJBLocalHome)2 EJBMetaData (javax.ejb.EJBMetaData)2 Handle (javax.ejb.Handle)2 RemoveException (javax.ejb.RemoveException)2 Test (org.junit.Test)2 CreateException (javax.ejb.CreateException)1 EJBAccessException (javax.ejb.EJBAccessException)1