calledResolve=0;
ClassMetamodelFactory.clear(false);
for (int i=0;i<20;i++)
{
ByteArrayInputStream byteInpt = new ByteArrayInputStream(byteOut.toByteArray());
JBossObjectInputStream is = new JBossObjectInputStreamSharedTree(byteInpt)
{
protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
calledResolve++;
return super.resolveClass(desc);
}
};
domain2= is.readObject();
}
assertTrue("ReadResolve wasn't called for shared tree",calledResolve>0);
calledResolve=0;
for (int i=0;i<20;i++)
{
ByteArrayInputStream byteInpt = new ByteArrayInputStream(byteOut.toByteArray());
JBossObjectInputStream is = new JBossObjectInputStreamSharedTree(byteInpt)
{
protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
calledResolve++;
return super.resolveClass(desc);
}
};
domain2= is.readObject();
}
assertTrue("ReadResolve wasn't supposed to be called here",calledResolve==0);
}
catch (Throwable e)