Object object2 = class2.newInstance();
call(object2, "setValue", new Object[] { "foo" });
// First test to see waht happens if we mock it to be a remote object.
Object proxy1 = createProxy(object1,true);
proxy1 = new BytesMarshalledObject(proxy1).get();
call(proxy1, "setValue", new Object[] { object2 });
Object rc = call(proxy1, "getValue", new Object[] {
});
rc = call(rc, "getValue", new Object[] {
});
assertSame(rc, null); // The value was marsalled cause it's remote.
// Second test to see what happens if we mock it to be a local object.
proxy1 = createProxy(object1,false);
proxy1 = new BytesMarshalledObject(proxy1).get();
call(proxy1, "setValue", new Object[] { object2 });
rc = call(proxy1, "getValue", new Object[] {
});
rc = call(rc, "getValue", new Object[] {
});