use of jakarta.ejb.HomeHandle in project tomee by apache.
the class Unknown2HomeHandleTests method Xtest02_copyHandleByMarshalledObject.
public void Xtest02_copyHandleByMarshalledObject() {
try {
final MarshalledObject obj = new MarshalledObject(ejbHomeHandle);
final HomeHandle copy = (HomeHandle) obj.get();
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());
}
}
use of jakarta.ejb.HomeHandle in project tomee by apache.
the class Cmp2HomeHandleTests 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());
}
}
Aggregations