assertTrue( !hasInvalid );
}
public void testSerialization() throws IOException, ClassNotFoundException
{
Descriptor desc = getDescriptor();
checkDescriptor( desc );
File file = new File( "test.file" );
ObjectOutputStream oos = new ObjectOutputStream( new FileOutputStream( file ) );
oos.writeObject( desc );
oos.close();
ObjectInputStream ois = new ObjectInputStream( new FileInputStream( file ) );
Descriptor serialized = (Descriptor) ois.readObject();
ois.close();
file.delete();
assertTrue( desc != serialized ); // Ensure this is not the same instance
checkDescriptor( serialized );
assertEquals( desc, serialized );
assertEquals( desc.hashCode(), serialized.hashCode() );
}