[jboss-cvs] JBossAS SVN: r86421 - branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 27 11:02:58 EDT 2009


Author: emuckenhuber
Date: 2009-03-27 11:02:58 -0400 (Fri, 27 Mar 2009)
New Revision: 86421

Modified:
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
test config-property

Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2009-03-27 14:57:10 UTC (rev 86420)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2009-03-27 15:02:58 UTC (rev 86421)
@@ -596,7 +596,7 @@
       assertTrue("security-domain value is a GenericValue", securityDomainValue instanceof GenericValue);
       log.debug("security-domain value: "+securityDomainValue);
    }
-
+   
    /**
     * Validate the DefaultDS stats that are non-null
     * 
@@ -871,6 +871,9 @@
       propValues.put("config-property", metaValue);
 
       propValues.put("track-connection-by-tx", SimpleValueSupport.wrap(Boolean.TRUE));
+      propValues.put("config-property", 
+            new MapCompositeValueSupport(new HashMap<String, MetaValue>(),
+                  new MapCompositeMetaType(SimpleMetaType.STRING)));
       // todo: how to set the specific domain?
       //ApplicationManagedSecurityMetaData secDomain = new ApplicationManagedSecurityMetaData();
       //props.get("security-domain").setValue(secDomain);
@@ -885,6 +888,18 @@
       assertNotNull(configProperty);
       MetaValue value = configProperty.getValue();
       assertTrue("MapCompositeMetaType", value.getMetaType() instanceof MapCompositeMetaType);
+      
+      MapCompositeValueSupport cValue = (MapCompositeValueSupport) value;
+      cValue.put("testKey", new SimpleValueSupport(SimpleMetaType.STRING, "testValue"));
+      
+      mgtView.updateComponent(dsMC);
+
+      mgtView = getManagementView();
+      dsMC = getManagedComponent(mgtView, compType, jndiName);
+      configProperty = dsMC.getProperty("config-property");
+      assertNotNull(configProperty);
+      cValue = (MapCompositeValueSupport) configProperty.getValue();
+      assertNotNull(cValue.get("testKey"));
    }
 
    /**
@@ -991,12 +1006,20 @@
       for(String propName : propValues.keySet())
       {
          ManagedProperty prop = props.get(propName);
+         // If the property does not exist on the template we don't set it
+         if(prop == null)
+            continue;
+         
          log.debug("template property before: "+prop.getName()+","+prop.getValue());
          assertNotNull("property " + propName + " found in template " + templateName, prop);
          prop.setValue(propValues.get(propName));
          log.debug("template property after: "+prop.getName()+","+prop.getValue());
       }
       
+      // Assert map composite
+      if(dsInfo.getProperties().get("config-property") != null)
+         assertTrue(dsInfo.getProperties().get("config-property").getMetaType() instanceof MapCompositeMetaType);
+      
       mgtView.applyTemplate(deploymentName, dsInfo);
 
       // reload the view




More information about the jboss-cvs-commits mailing list