[jboss-cvs] JBossAS SVN: r87071 - in trunk: testsuite/src/main/org/jboss/test/profileservice/override/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 9 08:42:01 EDT 2009


Author: emuckenhuber
Date: 2009-04-09 08:42:01 -0400 (Thu, 09 Apr 2009)
New Revision: 87071

Modified:
   trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
   trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java
Log:
JBAS-6716

Modified: trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java	2009-04-09 12:38:35 UTC (rev 87070)
+++ trunk/system-jmx/src/main/org/jboss/system/deployers/managed/ServiceMetaDataICF.java	2009-04-09 12:42:01 UTC (rev 87071)
@@ -287,6 +287,21 @@
          }
          // There may not be an attribute value, see if there is a matching property
          
+         // Unwrap the value before, so that we can recreate empty values
+         Object plainValue = null;
+         // Look for a MetaMapper
+         MetaType propertyType = property.getMetaType();
+         MetaMapper metaMapper = property.getTransientAttachment(MetaMapper.class);
+         if(metaMapper != null)
+         {
+            plainValue = metaMapper.unwrapMetaValue(value);
+         }
+         else
+         {
+            PropertyInfo propertyInfo = beanInfo.getProperty(name);
+            plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
+         }
+         
          if (attributeValue == null)
          {
             String aname = mapAttributeName(md, name);
@@ -295,25 +310,19 @@
                ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
                attr.setName(aname);
                md.addAttribute(attr);
-               attributeValue = new ServiceTextValueMetaData("");
+               if(plainValue instanceof Element)
+               {
+                  attributeValue = new ServiceElementValueMetaData();
+               }
+               else
+               {
+                  attributeValue = new ServiceTextValueMetaData("");
+               }
                attr.setValue(attributeValue);
             }
          }
          if (attributeValue != null)
          {
-            Object plainValue = null;
-            // Look for a MetaMapper
-            MetaType propertyType = property.getMetaType();
-            MetaMapper metaMapper = property.getTransientAttachment(MetaMapper.class);
-            if(metaMapper != null)
-            {
-               plainValue = metaMapper.unwrapMetaValue(value);
-            }
-            else
-            {
-               PropertyInfo propertyInfo = beanInfo.getProperty(name);
-               plainValue = metaValueFactory.unwrap(value, propertyInfo.getType());
-            }
             // Unwrap the ServiceValueMetaData types
             if (attributeValue instanceof ServiceTextValueMetaData)
             {

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java	2009-04-09 12:38:35 UTC (rev 87070)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/override/test/JmsDestinationOverrideTestCase.java	2009-04-09 12:42:01 UTC (rev 87071)
@@ -110,13 +110,6 @@
       
       propValues.put("name", SimpleValueSupport.wrap("queueTemplate"));
       propValues.put("JNDIName", SimpleValueSupport.wrap(jndiName));
-      // Security config
-      Map<String, MetaValue> values = new HashMap<String, MetaValue>();
-      values.put("admin", createCompositeValue(true, true, true));
-      values.put("publisher", createCompositeValue(true, true, false));
-      values.put("user", createCompositeValue(true, null, null));
-      CompositeValue map = new MapCompositeValueSupport(values, securityConfType);
-      propValues.put("securityConfig", map);
       
       ComponentType type = KnownComponentTypes.JMSDestination.Queue.getType();
       DeploymentTemplateInfo info = mgtView.getTemplate("QueueTemplate");
@@ -139,14 +132,19 @@
       assertNotNull(queue);
       assertEquals("testQueueTemplate", queue.getName());
       
-      values = new HashMap<String, MetaValue>();
+      Map<String, MetaValue> values = new HashMap<String, MetaValue>();
       values.put("admin", createCompositeValue(true, true, true));
       values.put("publisher", createCompositeValue(true, true, false));
       values.put("user", createCompositeValue(false, false, false));
-      map = new MapCompositeValueSupport(values, securityConfType);
+      MapCompositeValueSupport map = new MapCompositeValueSupport(values, securityConfType);
 
       queue.getProperty("securityConfig").setValue(map);
       mgtView.updateComponent(queue);
+      
+      mgtView = getManagementView();
+      queue = mgtView.getComponent("testQueueTemplate", type);
+      MetaValue securityConfig = queue.getProperty("securityConfig").getValue();
+      assertEquals(map, securityConfig);
    }
    
 




More information about the jboss-cvs-commits mailing list