use of java.rmi.MarshalledObject in project jdk8u_jdk by JetBrains.
the class Chaining method test.
static void test(Throwable t, String msg, Throwable cause) throws Exception {
check(t, msg, cause);
Throwable[] pair = new Throwable[] { t, cause };
pair = (Throwable[]) new MarshalledObject(pair).get();
check(pair[0], msg, pair[1]);
}
use of java.rmi.MarshalledObject in project jdk8u_jdk by JetBrains.
the class LoadProxyClasses method unmarshalProxyClass.
private static Proxy unmarshalProxyClass(Proxy proxy, ClassLoader fnnLoader, ClassLoader expectedLoader, int n, LoadChecker checker) throws ClassNotFoundException, IOException, InstantiationException, IllegalAccessException {
FnnUnmarshal fnnUnmarshal = (FnnUnmarshal) fnnLoader.loadClass("FnnClass").newInstance();
Proxy unmarshalled = (Proxy) fnnUnmarshal.unmarshal(new MarshalledObject(proxy));
ClassLoader unmarshalledLoader = unmarshalled.getClass().getClassLoader();
if (checker != null) {
checker.checkLoad(unmarshalled, expectedLoader);
} else {
if (unmarshalledLoader != expectedLoader) {
TestLibrary.bomb("case" + n + ": proxy class not " + "placed into incorrect loader: " + unmarshalledLoader);
} else {
System.err.println("\ncase" + n + ": proxy class correctly" + " placed into expected loader: " + expectedLoader);
}
}
return proxy;
}
use of java.rmi.MarshalledObject 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 java.rmi.MarshalledObject in project tomee by apache.
the class Complex2HandleTests method Xtest02_copyHandleByMarshalledObject.
public void Xtest02_copyHandleByMarshalledObject() {
try {
final MarshalledObject obj = new MarshalledObject(ejbHandle);
final Handle copy = (Handle) obj.get();
final EJBObject object = copy.getEJBObject();
assertNotNull("The EJBObject is null", object);
assertTrue("EJBObjects are not identical", object.isIdentical(ejbObject));
} catch (final Exception e) {
fail("Received Exception " + e.getClass() + " : " + e.getMessage());
}
}
Aggregations