use of java.rmi.activation.Activatable in project jdk8u_jdk by JetBrains.
the class NotSerializable method main.
public static void main(String[] args) throws Exception {
System.err.println("\nRegression test for bug 4460983\n");
Activatable act = new FakeActivatable();
try {
ObjectOutputStream out = new ObjectOutputStream(new ByteArrayOutputStream());
try {
out.writeObject(act);
throw new RuntimeException("TEST FAILED: " + "Activatable instance successfully serialized");
} catch (NotSerializableException e) {
System.err.println("NotSerializableException as expected:");
e.printStackTrace();
}
// other exceptions cause test failure
System.err.println("TEST PASSED");
} finally {
try {
Activatable.unexportObject(act, true);
} catch (NoSuchObjectException e) {
}
}
}
Aggregations