validate(cbh);
}
public void testSerializability() throws Exception
{
JBossCallbackHandler cbh = new JBossCallbackHandler();
cbh.setSecurityInfo(new SimplePrincipal("anil"), "testpass");
// Serialize to a byte array
ByteArrayOutputStream bos = new ByteArrayOutputStream() ;
ObjectOutputStream out = new ObjectOutputStream(bos) ;
out.writeObject(cbh);
out.close();
//Deserialize from a byte array
JBossCallbackHandler otherCBH = null;
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()));
otherCBH = (JBossCallbackHandler) in.readObject();
in.close();
assertNotNull("The deserialized cbh is not null:", otherCBH);
validate(otherCBH);