Examples of PersistedManagedObject


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

      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

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

   {
      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

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

     
      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

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

      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

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

      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

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

      p.setValue(
            new CompositeValueSupport(nested.getMetaType(), changedMap)
            );

      // Save and restore
      PersistedManagedObject restored = restore(mo);
      assertNotNull(restored);
     
      // Create empty
      mo = update(new TestMetaData(), restored);
     
View Full Code Here

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

      SimpleValue v = (SimpleValue) composite.get("testString2");
      assertNotNull(v);
     
      composite.put("testString2", SimpleValueSupport.wrap("changedString"));
     
      PersistedManagedObject restored = restore(mo);
      assertNotNull(restored);
     
      mo = update(new TestMetaData(), restored);
     
      p = mo.getProperty("testMap");
View Full Code Here

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

     
      SimpleValueSupport svs = (SimpleValueSupport) a.getValue(1);
      assertNotNull(svs);
      svs.setValue('H');
     
      PersistedManagedObject restored = restore(mo);
      assertNotNull(restored);
     
      //
      mo = update(new TestMetaData(), restored);
     
View Full Code Here

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

      ManagedObjectPersistencePlugin plugin = getPersistenceFactory().getPersistencePlugin();
      for(ServiceMetaData md : deployment.getServices())
      {
         // Bypass the ServiceMetaDataICF...
         ManagedObject mo = getMOF().initManagedObject(md, null);
         PersistedManagedObject persisted = plugin.createPersistedManagedObject(mo);
        
         // Fix the names, as we don't use the ServiceMetaDataICF
         String name = md.getObjectName().getCanonicalName();
         persisted.setName(name);
         persisted.setOriginalName(name);
         persisted.setModificationInfo(ModificationInfo.ADDED);
        
         components.add(new PersistedComponent(persisted));
      }
     
      PersistenceRoot root = new PersistenceRoot();
View Full Code Here

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

      @Override
      protected PersistedComponent createComponent(Object attachment, ManagedComponent component)
      {
         // Note: this is using the TestMgtComponentImpl to get the MO
         ManagedObject mo = (ManagedObject) component.getParent();
         PersistedManagedObject persisted = getPersistencePlugin().createPersistedManagedObject(mo);
         PersistedComponent persistedComponent = new PersistedComponent(persisted);
         setComponentName(persistedComponent, mo);
         return persistedComponent;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.