super(name);
}
public void test() throws Throwable
{
ManagedObject mo = createNestedMO();
// deployment1
ManagedObject deployment = getDeployment("testDeployment1", mo);
assertNotNull(deployment);
deployment.getProperty("");
ManagedProperty p = deployment.getProperty("primitive");
assertNotNull(p);
CompositeValue composite = (CompositeValue) p.getValue();
Map<String, MetaValue> valueMap = new HashMap<String, MetaValue>();
valueMap.put("optionalName",
new SimpleValueSupport(SimpleMetaType.STRING, "changed"));
valueMap.put("integer", new SimpleValueSupport(
SimpleMetaType.INTEGER_PRIMITIVE, 111));
//
p.setValue(new CompositeValueSupport(composite.getMetaType(), valueMap));
ManagedProperty property = deployment.getProperty("name");
assertNotNull(property);
property.setValue(SimpleValueSupport.wrap("ChangedName"));
// deployment3
deployment = getDeployment("testDeployment3", mo);
assertNotNull(deployment);
property = deployment.getProperty("name");
assertNotNull(property);
property.setValue(SimpleValueSupport.wrap("ChangedName3"));
PersistedManagedObject restored = restore(mo);
assertNotNull(restored);
PersistedCollectionValue collection = (PersistedCollectionValue) restored.getProperties().get(0).getValue();
assertNotNull(collection);
PersistedManagedObject o = ((PersistedGenericValue) collection.getValues().get(0)).getManagedObject();
assertNotNull(o);
enableTrace("org.jboss.system.server.profileservice.persistence");
// Recreate
mo = update(createNestedTestMetaData(), restored);
deployment = getDeployment("ChangedName", mo);
assertNotNull("changed name deployment null", deployment);
p = deployment.getProperty("primitive");
assertNotNull(p);
composite = (CompositeValue) p.getValue();
assertNotNull(composite);