super(name);
}
public void test() throws Throwable
{
ManagedObject mo = getMOF().initManagedObject(createMD(), null);
assertNotNull(mo);
ManagedProperty p = mo.getProperty("name");
CompositeValue c = (CompositeValue) p.getValue();
assertNotNull(c);
PropertiesMetaValue properties = (PropertiesMetaValue) c.get("keyPropertyList");
properties.put("v", "value5");
// Assert xml information
PersistedManagedObject restoredElement = restore(mo);
assertNotNull(restoredElement);
// The objectName
PersistedProperty pp = restoredElement.getProperties().get(1);
assertNotNull(pp);
PersistedCompositeValue pcv = (PersistedCompositeValue) pp.getValue();
assertNotNull(pcv);
PersistedSimpleValue psv = (PersistedSimpleValue) pcv.getValues().get(0);
assertEquals("domain", psv.getName());
assertEquals("org.jboss", psv.getValue());
PersistedPropertiesValue ppv = (PersistedPropertiesValue) pcv.getValues().get(1);
assertEquals("keyPropertyList", ppv.getName());
assertEquals(2, ppv.getEntries().size());
// The other object name
PersistedProperty po = restoredElement.getProperties().get(0);
assertNotNull(po);
assertTrue(po.getValue() instanceof PersistedSimpleValue);
//
ManagedObject restored = update(new ObjectNameMetaData(), restoredElement);
assertNotNull(restored);
ObjectNameMetaData metaData = (ObjectNameMetaData) restored.getAttachment();
assertEquals(createObjectName("value5"), metaData.getName());
}