// kernel.startGBean(selfName);
// ((MockAdminObject) proxy).getSomething();
}
public void testSerialization() throws Exception {
MockAdminObject proxy = (MockAdminObject) kernel.invoke(selfName, "$getResource");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(proxy);
oos.flush();
byte[] bytes = baos.toByteArray();
oos.close();
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
Object proxy2 = ois.readObject();
assertNotNull(proxy2);
assertTrue(proxy instanceof MockAdminObject);
MockAdminObject mockAdminObject = proxy.getSomething();
assertNotNull(mockAdminObject);
kernel.stopGBean(selfName);
ObjectInputStream ois2 = new ObjectInputStream(new ByteArrayInputStream(bytes));
MockAdminObject proxy3 = (MockAdminObject) ois2.readObject();
// try {
// proxy3.getSomething();
// fail();
// } catch (IllegalStateException ise) {
// }
kernel.startGBean(selfName);
proxy3.getSomething();
}