[jboss-cvs] JBossAS SVN: r87886 - in trunk/connector/src: main/org/jboss/resource/metadata/mcf and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 27 13:58:04 EDT 2009


Author: emuckenhuber
Date: 2009-04-27 13:58:03 -0400 (Mon, 27 Apr 2009)
New Revision: 87886

Added:
   trunk/connector/src/main/org/jboss/resource/deployers/management/SecurityDomainMetaMapper.java
Removed:
   trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java
Modified:
   trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java
   trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
   trunk/connector/src/main/org/jboss/resource/metadata/mcf/SecurityMetaData.java
   trunk/connector/src/tests/org/jboss/tests/jca/managed/ManagedObjectTestCase.java
Log:
[JBAS-6796] change securityDomain meta mapping.

Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java	2009-04-27 17:57:18 UTC (rev 87885)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java	2009-04-27 17:58:03 UTC (rev 87886)
@@ -26,7 +26,7 @@
 
 import org.jboss.beans.info.spi.BeanInfo;
 import org.jboss.beans.info.spi.PropertyInfo;
-import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.Fields;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.managed.api.factory.ManagedObjectFactory;
 import org.jboss.managed.plugins.factory.AbstractInstanceClassFactory;
@@ -63,6 +63,20 @@
          MetaData metaData,
          T attachment)
    {
+      // Get the property name
+      String propertyName = property.getMappedName();
+      if(propertyName == null)
+         propertyName = property.getName();
+      
+      // Get the property info
+      PropertyInfo propertyInfo = property.getField(Fields.PROPERTY_INFO, PropertyInfo.class);
+      if(propertyInfo == null)
+         propertyInfo = beanInfo.getProperty(propertyName);
+      
+      // Check if the property is readable
+      if(propertyInfo != null && propertyInfo.isReadable() == false)
+         return null;
+      
       MetaValue value = null;
       if("config-property".equals(property.getName()))
       {
@@ -89,15 +103,6 @@
    }
    
    @Override
-   protected void setManagedObject(BeanInfo beanInfo,
-         PropertyInfo propertyInfo, T object,
-         ManagedObject mo)
-   {
-      if(propertyInfo.getName().equals("security-domain"))
-         InstanceClassFactoryUtils.setValue(object, mo);
-   }
-   
-   @Override
    protected Object unwrapValue(BeanInfo beanInfo, ManagedProperty property,
          MetaValue value)
    {

Deleted: trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java	2009-04-27 17:57:18 UTC (rev 87885)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/InstanceClassFactoryUtils.java	2009-04-27 17:58:03 UTC (rev 87886)
@@ -1,147 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.resource.deployers.management;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.metatype.api.types.SimpleMetaType;
-import org.jboss.metatype.api.values.EnumValue;
-import org.jboss.metatype.api.values.MapCompositeValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValue;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.jboss.resource.metadata.mcf.ApplicationManagedSecurityMetaData;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentMetaData;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryPropertyMetaData;
-import org.jboss.resource.metadata.mcf.SecurityDeploymentType;
-import org.jboss.resource.metadata.mcf.SecurityDomainApplicationManagedMetaData;
-import org.jboss.resource.metadata.mcf.SecurityDomainMetaData;
-import org.jboss.resource.metadata.mcf.SecurityMetaData;
-
-/**
- * property to meta value conversion for common properties
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class InstanceClassFactoryUtils
-{
-   /**
-    * Transform the ManagedConnectionFactoryProperties into a
-    * MapCompositeValueSupport value.
-    * 
-    * @param <T>
-    * @param beanInfo
-    * @param property
-    * @param attachment
-    * @return
-    */
-   static <T extends ManagedConnectionFactoryDeploymentMetaData>
-      MetaValue getConfigPropertyValue(BeanInfo beanInfo, ManagedProperty property, T attachment)
-   {
-      MapCompositeValueSupport map = new MapCompositeValueSupport(SimpleMetaType.STRING);
-      List<ManagedConnectionFactoryPropertyMetaData> list = attachment.getManagedConnectionFactoryProperties();
-      if(list != null)
-      {
-         for(ManagedConnectionFactoryPropertyMetaData prop : list)
-         {
-            String name = prop.getName();               
-            MetaValue svalue = SimpleValueSupport.wrap(prop.getValue());
-            map.put(name, svalue);
-            MetaValue stype = SimpleValueSupport.wrap(prop.getValue());
-            map.put(name+".type", stype);
-         }
-      }
-      return map;
-   }
-   /**
-    * 
-    * @param beanInfo
-    * @param property
-    * @param value
-    * @param metaValueFactory
-    * @return
-    */
-   static Object unwrapConfigPropertyValue(BeanInfo beanInfo, ManagedProperty property,
-         MetaValue value, MetaValueFactory metaValueFactory)
-   {
-      MapCompositeValueSupport mapValue = (MapCompositeValueSupport) value;
-      List<ManagedConnectionFactoryPropertyMetaData> list = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
-      for(String name : mapValue.getMetaType().keySet())
-      {
-         ManagedConnectionFactoryPropertyMetaData prop = new ManagedConnectionFactoryPropertyMetaData();
-         prop.setName(name);
-         String svalue = (String) metaValueFactory.unwrap(mapValue.get(name));
-         prop.setValue(svalue);
-         String nameType = name+".type";
-         MetaValue typeValue = mapValue.get(nameType);
-         if(typeValue != null)
-         {
-            String type = (String) metaValueFactory.unwrap(typeValue);
-            prop.setType(type);
-         }
-         list.add(prop);
-      }
-      return list;
-   }
-
-   /**
-    * Handle the mapping of SecurityMetaData managed object values
-    * @param beanInfo
-    * @param property
-    * @param attachment
-    * @param value
-    */
-   static void setValue(ManagedConnectionFactoryDeploymentMetaData attachment, ManagedObject mo)
-   {
-      // Create the correct type of SecurityMetaData
-      ManagedProperty type = mo.getProperty("securityDeploymentType");
-      ManagedProperty domain = mo.getProperty("domain");
-      String domainName = ((SimpleValue) domain.getValue()).getValue().toString();
-      EnumValue typeValue = (EnumValue) type.getValue();
-      String typeString = typeValue.getValue();
-      SecurityDeploymentType stype = SecurityDeploymentType.valueOf(typeString);
-      SecurityMetaData domainMD = null;
-      switch(stype)
-      {
-         case APPLICATION:
-            domainMD = new ApplicationManagedSecurityMetaData();
-            break;
-         case DOMAIN:
-            domainMD = new SecurityDomainMetaData();
-            break;
-         case DOMAIN_AND_APPLICATION:
-            domainMD = new SecurityDomainApplicationManagedMetaData();
-            break;
-         default:
-         case NONE:
-            domainMD = new SecurityMetaData();
-            break;
-      }
-      domainMD.setDomain(domainName);
-      attachment.setSecurityMetaData(domainMD);
-   }
-}

Added: trunk/connector/src/main/org/jboss/resource/deployers/management/SecurityDomainMetaMapper.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/SecurityDomainMetaMapper.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/SecurityDomainMetaMapper.java	2009-04-27 17:58:03 UTC (rev 87886)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.resource.deployers.management;
+
+import java.lang.reflect.Type;
+
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.EnumMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.plugins.types.MutableCompositeMetaType;
+import org.jboss.metatype.spi.values.MetaMapper;
+import org.jboss.resource.metadata.mcf.ApplicationManagedSecurityMetaData;
+import org.jboss.resource.metadata.mcf.SecurityDeploymentType;
+import org.jboss.resource.metadata.mcf.SecurityDomainApplicationManagedMetaData;
+import org.jboss.resource.metadata.mcf.SecurityDomainMetaData;
+import org.jboss.resource.metadata.mcf.SecurityMetaData;
+
+/**
+ * A security-domain meta mapper.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class SecurityDomainMetaMapper extends MetaMapper<SecurityMetaData>
+{
+
+   /** The composite names. */
+   private static final String DOMAIN = "domain";
+   private static final String DeploymentTypeName = "securityDeploymentType";
+   
+   /** The meta value factory. */
+   private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
+   
+   /** The meta type. */
+   private static final MutableCompositeMetaType metaType;
+   
+   static
+   {
+      // Create the type manually, as the creation from the metaTypeFactory doesn't work
+      EnumMetaType enumMetaType = new EnumMetaType(SecurityDeploymentType.values());
+      metaType = new MutableCompositeMetaType(SecurityMetaData.class.getName(), "The security domain meta data");
+      metaType.addItem(DOMAIN, "the security domain", SimpleMetaType.STRING);
+      metaType.addItem(DeploymentTypeName, "the security deployment type", enumMetaType);
+      metaType.freeze();
+   }
+   
+   @Override
+   public Type mapToType()
+   {
+      return SecurityMetaData.class;
+   }
+   
+   @Override
+   public MetaType getMetaType()
+   {
+      return metaType;
+   }
+   
+   @Override
+   public MetaValue createMetaValue(MetaType metaType, SecurityMetaData object)
+   {
+      if(object == null)
+         return null;
+      if(metaType instanceof CompositeMetaType)
+      {
+         // Extract the meta types
+         CompositeMetaType composite = (CompositeMetaType) metaType;
+         EnumMetaType enumMetaType= (EnumMetaType) composite.getType(DeploymentTypeName);
+         // Create the composite value
+         CompositeValueSupport securityDomain = new CompositeValueSupport(composite);
+         // Set a default deplooymentType
+         SecurityDeploymentType deploymentType = object.getSecurityDeploymentType();
+         if(deploymentType == null)
+            deploymentType = SecurityDeploymentType.NONE;
+         
+         // Set domain and deployment type
+         securityDomain.set(DOMAIN, SimpleValueSupport.wrap(object.getDomain()));
+         securityDomain.set(DeploymentTypeName, new EnumValueSupport(enumMetaType, deploymentType));
+         //
+         return securityDomain;
+      }
+      throw new IllegalArgumentException("Cannot convert securityDomain " + object);
+   }
+
+   @Override
+   public SecurityMetaData unwrapMetaValue(MetaValue metaValue)
+   {
+      if(metaValue == null)
+         return null;
+      
+      if(metaValue instanceof CompositeValue)
+      {
+         CompositeValue compositeValue = (CompositeValue) metaValue;
+
+         String domainName = (String) metaValueFactory.unwrap(compositeValue.get(DOMAIN));         
+         SecurityDeploymentType deploymentType = (SecurityDeploymentType) metaValueFactory.unwrap(compositeValue.get(DeploymentTypeName));
+         if(deploymentType == null)
+            deploymentType = SecurityDeploymentType.NONE;
+         
+         SecurityMetaData securityDomain = null;
+         switch(deploymentType)
+         {
+            case APPLICATION:
+               securityDomain = new ApplicationManagedSecurityMetaData();
+               break;
+            case DOMAIN:
+               securityDomain = new SecurityDomainMetaData();
+               break;
+            case DOMAIN_AND_APPLICATION:
+               securityDomain = new SecurityDomainApplicationManagedMetaData();
+               break;
+            default:
+            case NONE:
+               securityDomain = new SecurityMetaData();
+               break;
+         }
+         // Sanity check
+         if(securityDomain.requiresDomain() && domainName == null)
+            throw new IllegalStateException("null security domain not allowed for SecurityDeploymentType " + deploymentType);
+         // Set the domain
+         securityDomain.setDomain(domainName);
+         //
+         return securityDomain;
+      }
+      throw new IllegalStateException("Unable to unwrap securityDomain " + metaValue);
+   }
+
+}
+

Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java	2009-04-27 17:57:18 UTC (rev 87885)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java	2009-04-27 17:58:03 UTC (rev 87886)
@@ -323,7 +323,7 @@
     */
    @ManagementProperty(name="security-domain",
          description="The security-domain used to validate connections",
-         managed=true, includeInTemplate=true)
+         includeInTemplate=true)
    public SecurityMetaData getSecurityMetaData()
    {
       return securityMetaData;

Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/SecurityMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/SecurityMetaData.java	2009-04-27 17:57:18 UTC (rev 87885)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/SecurityMetaData.java	2009-04-27 17:58:03 UTC (rev 87886)
@@ -27,8 +27,8 @@
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlValue;
 
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.metatype.api.annotations.MetaMapping;
+import org.jboss.resource.deployers.management.SecurityDomainMetaMapper;
 
 /**
  * A SecurityMetaData.
@@ -37,7 +37,7 @@
  * @version $Revision$
  */
 @XmlAccessorType(XmlAccessType.NONE)
- at ManagementObject(description="The security domain, type information")
+ at MetaMapping(SecurityDomainMetaMapper.class)
 public class SecurityMetaData implements Serializable, SecurityMetaDataSupport
 {
    /** The serialVersionUID */
@@ -61,7 +61,6 @@
             || getSecurityDeploymentType().equals(SecurityDeploymentType.DOMAIN_AND_APPLICATION));
    }   
 
-   @ManagementProperty
    public String getDomain()
    {
       return domain;
@@ -71,7 +70,6 @@
       this.domain = domain;
    }
 
-   @ManagementProperty
    public SecurityDeploymentType getSecurityDeploymentType()
    {
       return type;

Modified: trunk/connector/src/tests/org/jboss/tests/jca/managed/ManagedObjectTestCase.java
===================================================================
--- trunk/connector/src/tests/org/jboss/tests/jca/managed/ManagedObjectTestCase.java	2009-04-27 17:57:18 UTC (rev 87885)
+++ trunk/connector/src/tests/org/jboss/tests/jca/managed/ManagedObjectTestCase.java	2009-04-27 17:58:03 UTC (rev 87886)
@@ -28,26 +28,35 @@
 import java.util.Set;
 import java.util.TreeSet;
 
+import javax.management.ObjectName;
+
 import org.jboss.managed.api.DeploymentTemplateInfo;
 import org.jboss.managed.api.ManagedObject;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.managed.api.factory.ManagedObjectFactory;
 import org.jboss.managed.plugins.factory.DeploymentTemplateInfoFactory;
 import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.EnumMetaType;
 import org.jboss.metatype.api.types.MetaType;
 import org.jboss.metatype.api.values.CompositeValue;
-import org.jboss.metatype.api.values.GenericValue;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.EnumValue;
+import org.jboss.metatype.api.values.EnumValueSupport;
 import org.jboss.metatype.api.values.MapCompositeValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValue;
 import org.jboss.metatype.api.values.SimpleValueSupport;
 import org.jboss.resource.connectionmanager.JBossManagedConnectionPool;
 import org.jboss.resource.deployers.management.LocalDSInstanceClassFactory;
 import org.jboss.resource.deployers.management.NoTxCFInstanceClassFactory;
 import org.jboss.resource.deployers.management.TxInstanceClassFactory;
 import org.jboss.resource.deployers.management.XADSInstanceClassFactory;
+import org.jboss.resource.metadata.mcf.ApplicationManagedSecurityMetaData;
 import org.jboss.resource.metadata.mcf.DataSourceConnectionPropertyMetaData;
 import org.jboss.resource.metadata.mcf.LocalDataSourceDeploymentMetaData;
 import org.jboss.resource.metadata.mcf.NoTxDataSourceDeploymentMetaData;
+import org.jboss.resource.metadata.mcf.SecurityDeploymentType;
+import org.jboss.resource.metadata.mcf.SecurityDomainApplicationManagedMetaData;
 import org.jboss.resource.metadata.mcf.SecurityMetaData;
 import org.jboss.resource.metadata.mcf.TxConnectionFactoryDeploymentMetaData;
 import org.jboss.resource.metadata.mcf.XAConnectionPropertyMetaData;
@@ -68,6 +77,8 @@
    static final String[] ManagedConnectionFactoryDeploymentTemplate_NAMES = {
       "jndi-name",
       "use-java-context",
+      "jmx-invoker-name",
+      "rar-name",
       "connection-definition",
       "min-pool-size",
       "max-pool-size",
@@ -81,7 +92,6 @@
       "statistics-formatter",
       "isSameRM-override-value",
       "track-connection-by-tx",
-      "config-property",
       "security-domain",
       "type-mapping",
       "metadata",
@@ -176,7 +186,7 @@
    {
       super(name);
    }
-
+   
    public void testNoTxDataSourceDeploymentMetaData()
    {
       enableTrace("org.jboss.managed.plugins.factory");
@@ -248,7 +258,7 @@
       mof.setInstanceClassFactory(LocalDataSourceDeploymentMetaData.class, icf);
       LocalDataSourceDeploymentMetaData lds = new LocalDataSourceDeploymentMetaData();
       // Set a SecurityMetaData to validate its MO
-      SecurityMetaData smd = new SecurityMetaData();
+      SecurityMetaData smd = new ApplicationManagedSecurityMetaData();
       smd.setDomain("java:/jaas/SomeDomain");
       lds.setSecurityMetaData(smd);
       ManagedObject mo = mof.initManagedObject(lds, "LocalDataSourceDeploymentMetaData", null);
@@ -303,15 +313,29 @@
       // Validate the security-domain
       ManagedProperty secDomain = mo.getProperty("security-domain");
       assertNotNull("security-domain", secDomain);
-      GenericValue sdGV = (GenericValue) secDomain.getValue();
-      assertNotNull("security-domain.GV", sdGV);
-      ManagedObject secDomainMO = (ManagedObject) sdGV.getValue();
+      CompositeMetaType compType = (CompositeMetaType) secDomain.getMetaType();
+      assertNotNull(compType);
+      CompositeValue sdCV = (CompositeValue) secDomain.getValue();
+      assertNotNull("security-domain.CV", sdCV);
 
-      assertNotNull("security-domain.MO", secDomainMO);
-      ManagedProperty domainName = secDomainMO.getProperty("domain");
-      assertNotNull("security-domain.MO.domain", domainName);
-      assertEquals(SimpleValueSupport.wrap("java:/jaas/SomeDomain"), domainName.getValue());
+      SimpleValue domainName = (SimpleValue) sdCV.get("domain");
+      assertNotNull("security-domain.domain", domainName);
+      assertEquals(SimpleValueSupport.wrap("java:/jaas/SomeDomain"), domainName);
+      assertNotNull("security-domain.deploymentType", sdCV.get("securityDeploymentType"));
+      assertEquals("APPLICATION", ((EnumValue) sdCV.get("securityDeploymentType")).getValue());
+      assertFalse(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
+      
+      // Set a new security domain and check if the metaType changed
+      CompositeValueSupport newSecDomain = new CompositeValueSupport(compType);
+      newSecDomain.set("domain", SimpleValueSupport.wrap("test"));
+      newSecDomain.set("securityDeploymentType", new EnumValueSupport(
+            (EnumMetaType) compType.getType("securityDeploymentType"),
+            SecurityDeploymentType.DOMAIN_AND_APPLICATION));
+      secDomain.setValue(newSecDomain);
+      
+      assertTrue(lds.getSecurityMetaData() instanceof SecurityDomainApplicationManagedMetaData);
    }
+   
    public void testXADataSourceDeploymentMetaData()
    {
       enableTrace("org.jboss.managed.plugins.factory");
@@ -450,7 +474,7 @@
       validatePropertyMetaValues(props);
    }
 
-   public void testJBossManagedConnectionPool()
+   public void testJBossManagedConnectionPool() throws Exception
    {
       enableTrace("org.jboss.managed.plugins.factory");
       ManagedObjectFactory mof = ManagedObjectFactory.getInstance();
@@ -458,6 +482,7 @@
       mof.setInstanceClassFactory(ServiceMetaData.class, icf);
       ServiceMetaData smd = new ServiceMetaData();
       smd.setCode(JBossManagedConnectionPool.class.getName());
+      smd.setObjectName(new ObjectName("jboss:service=Hypersonic,database=localDB"));
       ManagedObject mo = mof.initManagedObject(smd, null, null);
       // Validate the expected property names
       Set<String> expectedPropertyNames = new TreeSet<String>();




More information about the jboss-cvs-commits mailing list