Package org.jboss.system.server.profileservice.persistence.xml

Examples of org.jboss.system.server.profileservice.persistence.xml.PersistedManagedObject


   }
  
   public void test() throws Throwable
   {
      ManagedObject mo = initMO();
      PersistedManagedObject moElement = restore(mo);
      assertNotNull(moElement);
     
      ManagedObject restored = update(new CollectionMetaData(), moElement);
     
      assertNotNull(restored);
View Full Code Here


   @Override
   protected PersistedComponent createComponent(Object attachment, ManagedComponent component)
   {
      // Note: this is using the TestMgtComponentImpl to get the MO
      ManagedObject mo = (ManagedObject) component.getParent();
      PersistedManagedObject persistedMO = getPersistencePlugin().createPersistedManagedObject(mo);
      PersistedComponent persisted = new PersistedComponent(persistedMO);
      setComponentName(persisted, mo);
      return persisted;
   }
View Full Code Here

      assertNotNull(value);
      assertNotNull(value.get("test1"));
      getLog().debug("keys: " + value.getMetaType().itemSet());
     
      enableTrace("org.jboss.system");
      PersistedManagedObject moElement = restore(mo);
      assertNotNull(moElement);
     
      ManagedObject restored = update(new SimpleStringMapMetaData(), moElement);
      assertNotNull(restored);
      SimpleStringMapMetaData metadata = (SimpleStringMapMetaData) restored.getAttachment();
View Full Code Here

      return getMOF().initManagedObject(o, null);
   }
  
   protected PersistedManagedObject restore(ManagedObject mo) throws Exception
   {
      PersistedManagedObject moElement = plugin.createPersistedManagedObject(mo);
     
      File file = File.createTempFile("test", null);
      serialize(moElement, file);
      return deserialize(file);
   }
View Full Code Here

   }
  
   public void testSimpleArray() throws Throwable
   {
      ManagedObject mo = initMO();
      PersistedManagedObject moElement = restore(mo);
     
      assertNotNull(moElement);
      ManagedObject restored = update(new SimpleArrayMetaData(), moElement);
     
      assertNotNull(restored.getProperties());
View Full Code Here

      CollectionValue collection = (CollectionValue) mo.getProperty("list").getValue();
      ManagedObject child2 = (ManagedObject) ((GenericValue) collection.getElements()[1]).getValue();
      child2.getProperty("string").setValue(SimpleValueSupport.wrap("changedName"));
      // TODO test generic array
     
      PersistedManagedObject moElement = restore(mo);

      ManagedObject restored = update(new GenericSupportMetaData(), moElement);

      GenericSupportMetaData md = (GenericSupportMetaData) restored.getAttachment();
      assertNotNull(md);
View Full Code Here

   {
      ManagedObject mo = initMO();
      assertNotNull(mo);

      // Restore
      PersistedManagedObject moElement = restore(mo);
      assertNotNull(moElement);
      assertNotNull(moElement.getProperties());

      // Recreate MO
      ManagedObject restored = update(new SimpleTableMetaData(), moElement);

      // Assert
View Full Code Here

     
      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
View Full Code Here

      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);
View Full Code Here

      p.setValue(SimpleValueSupport.wrap(111));
     
      mo.getProperty("optionalName").setValue(SimpleValueSupport.wrap("optional"));
     
      // Assert the restored information
      PersistedManagedObject restored = restore(mo);
      assertNotNull(restored);
     
      mo = update(new PrimitiveMetaData(), restored);
     
      assertEquals("newName", getMVF().unwrap(mo.getProperty("name").getValue()));
View Full Code Here

TOP

Related Classes of org.jboss.system.server.profileservice.persistence.xml.PersistedManagedObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.