assertNotNull(root.getComponents());
// serialize / deserialize
PersistenceRoot persisted = restore(root);
// Create a new root attachment with empty components
TestDeployment test = new TestDeployment();
test.getComponents().add(createComponentMetaData("component1", null, null));
test.getComponents().add(createComponentMetaData("component2", null, null));
// Apply the persisted information, which should recreate the missing properties
getPersistenceFactory().restorePersistenceRoot(persisted, test, null);
assertFalse(test.getComponents().isEmpty());
// Check if the properties are available again
for(TestComponent restoredComponent : test.getComponents())
{
assertNotNull("null object name "+ restoredComponent.getName(), restoredComponent.getObjectName());
assertNotNull("null composite "+ restoredComponent.getName(), restoredComponent.getComposite());
}
}