[jboss-cvs] JBossAS SVN: r112660 - in projects/jboss-jca/branches/Branch_1_0: core/src/test/java/org/jboss/jca/core/inflow and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 16 17:15:24 EST 2012


Author: jesper.pedersen
Date: 2012-02-16 17:15:19 -0500 (Thu, 16 Feb 2012)
New Revision: 112660

Modified:
   projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/ActivationImpl.java
   projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/SimpleResourceAdapterRepository.java
   projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/PureInflowTestCase.java
   projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/ra/inflow/PureInflowActivationSpec.java
   projects/jboss-jca/branches/Branch_1_0/core/src/test/resources/rars/inflow/META-INF/ra.xml
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyRaXmlTestCase.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyTestCase.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectImpl.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectInterface.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnection.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnectionImpl.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyManagedConnectionFactory.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyResourceAdapter.java
   projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/config-property.rar/META-INF/ra.xml
Log:
[JBJCA-749] Default values for ActivationSpec aren't applied

Modified: projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/ActivationImpl.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/ActivationImpl.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/ActivationImpl.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -23,10 +23,13 @@
 package org.jboss.jca.core.rar;
 
 import org.jboss.jca.core.CoreBundle;
+import org.jboss.jca.core.CoreLogger;
 import org.jboss.jca.core.spi.rar.Activation;
 import org.jboss.jca.core.spi.rar.NotFoundException;
+import org.jboss.jca.core.util.Injection;
 
 import java.lang.ref.WeakReference;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -34,6 +37,7 @@
 import javax.resource.spi.ActivationSpec;
 import javax.resource.spi.ResourceAdapter;
 
+import org.jboss.logging.Logger;
 import org.jboss.logging.Messages;
 
 /**
@@ -46,6 +50,10 @@
    /** The bundle */
    private static CoreBundle bundle = Messages.getBundle(CoreBundle.class);
    
+   /** The logger */
+   private static CoreLogger log = Logger.getMessageLogger(CoreLogger.class, 
+      ActivationImpl.class.getName());
+
    /** Resource adapter */
    private WeakReference<ResourceAdapter> rar;
 
@@ -58,22 +66,28 @@
    /** Required config properties */
    private Set<String> requiredConfigProperties;
 
+   /** Value properties */
+   private Map<String, String> valueProperties;
+
    /**
     * Constructor
     * @param rar The resource adapter
     * @param activationSpecClass The activation spec class
     * @param configProperties The config properties
     * @param requiredConfigProperties The required config properties
+    * @param valueProperties The value properties
     */
    ActivationImpl(ResourceAdapter rar,
                   Class<?> activationSpecClass,
                   Map<String, Class<?>> configProperties,
-                  Set<String> requiredConfigProperties)
+                  Set<String> requiredConfigProperties,
+                  Map<String, String> valueProperties)
    {
       this.rar = new WeakReference<ResourceAdapter>(rar);
       this.activationSpecClass = new WeakReference<Class<?>>(activationSpecClass);
       this.configProperties = configProperties;
       this.requiredConfigProperties = requiredConfigProperties;
+      this.valueProperties = valueProperties;
    }
 
    /**
@@ -111,6 +125,30 @@
       ActivationSpec instance = ActivationSpec.class.cast(clz.newInstance());
       instance.setResourceAdapter(ra);
 
+      if (valueProperties != null && valueProperties.size() > 0)
+      {
+         Injection injector = new Injection();
+         Iterator<Map.Entry<String, String>> it = valueProperties.entrySet().iterator();
+         while (it.hasNext())
+         {
+            String propertyName = null;
+            String propertyValue = null;
+            try
+            {
+               Map.Entry<String, String> entry = it.next();
+
+               propertyName = entry.getKey();
+               propertyValue = entry.getValue();
+               
+               injector.inject(instance, propertyName, propertyValue);
+            }
+            catch (Throwable t)
+            {
+               log.debug("Ignoring: " + propertyName + " (" + propertyValue + ")", t);
+            }
+         }
+      }
+
       return instance;
    }
 
@@ -128,6 +166,7 @@
       sb.append(" activationSpecClass=").append(activationSpecClass != null ? activationSpecClass.get() : "null");
       sb.append(" configProperties=").append(configProperties);
       sb.append(" requiredConfigProperties=").append(requiredConfigProperties);
+      sb.append(" valueProperties=").append(valueProperties);
       sb.append("]");
 
       return sb.toString();

Modified: projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/SimpleResourceAdapterRepository.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/SimpleResourceAdapterRepository.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/rar/SimpleResourceAdapterRepository.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -399,6 +399,7 @@
 
          Map<String, Class<?>> configProperties = new HashMap<String, Class<?>>();
          Set<String> requiredConfigProperties = new HashSet<String>();
+         Map<String, String> valueProperties = new HashMap<String, String>();
 
          Activationspec15 as = ml.getActivationspec();
          Class<?> asClz = Class.forName(as.getActivationspecClass().getValue(), true, cl);
@@ -414,6 +415,9 @@
                   Class<?> ct = Class.forName(cp.getConfigPropertyType().getValue(), true, cl);
 
                   configProperties.put(name, ct);
+
+                  if (cp.getConfigPropertyValue() != null && cp.getConfigPropertyValue().getValue() != null)
+                     valueProperties.put(name, cp.getConfigPropertyValue().getValue());
                }
             }
          }
@@ -434,7 +438,8 @@
          ActivationImpl a = new ActivationImpl(rar,
                                                asClz,
                                                Collections.unmodifiableMap(configProperties),
-                                               Collections.unmodifiableSet(requiredConfigProperties));
+                                               Collections.unmodifiableSet(requiredConfigProperties),
+                                               Collections.unmodifiableMap(valueProperties));
 
          return new MessageListenerImpl(type, a);
       }

Modified: projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/PureInflowTestCase.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/PureInflowTestCase.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/PureInflowTestCase.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -22,6 +22,7 @@
 
 package org.jboss.jca.core.inflow;
 
+import org.jboss.jca.core.inflow.ra.inflow.PureInflowActivationSpec;
 import org.jboss.jca.core.spi.rar.Endpoint;
 import org.jboss.jca.core.spi.rar.MessageListener;
 import org.jboss.jca.core.spi.rar.ResourceAdapterRepository;
@@ -111,6 +112,13 @@
          ActivationSpec as = listener.getActivation().createInstance();
          assertNotNull(as);
          assertNotNull(as.getResourceAdapter());
+
+         assertTrue(as instanceof PureInflowActivationSpec);
+         PureInflowActivationSpec pias = (PureInflowActivationSpec)as;
+         assertNotNull(pias.getDefaultString());
+         assertEquals("Default", pias.getDefaultString());
+         assertNotNull(pias.getDefaultBoolean());
+         assertTrue(pias.getDefaultBoolean());
       }
       finally
       {

Modified: projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/ra/inflow/PureInflowActivationSpec.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/ra/inflow/PureInflowActivationSpec.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/core/src/test/java/org/jboss/jca/core/inflow/ra/inflow/PureInflowActivationSpec.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -37,6 +37,12 @@
    /** The logger */
    private static Logger log = Logger.getLogger(PureInflowActivationSpec.class);
 
+   /** Default string */
+   private String defaultString;
+
+   /** Default boolean */
+   private Boolean defaultBoolean;
+
    /** The resource adapter */
    private ResourceAdapter ra;
 
@@ -49,6 +55,44 @@
    }
 
    /**
+    * Set the default string
+    * @param v The value
+    */
+   public void setDefaultString(String v)
+   {
+      log.trace("setDefaultString(" + v + ")");
+      this.defaultString = v;
+   }
+
+   /**
+    * Get the default string
+    * @return The value
+    */
+   public String getDefaultString()
+   {
+      return defaultString;
+   }
+
+   /**
+    * Set the default boolean
+    * @param v The value
+    */
+   public void setDefaultBoolean(Boolean v)
+   {
+      log.trace("setDefaultBoolean(" + v + ")");
+      this.defaultBoolean = v;
+   }
+
+   /**
+    * Get the default boolean
+    * @return The value
+    */
+   public Boolean getDefaultBoolean()
+   {
+      return defaultBoolean;
+   }
+
+   /**
     * This method may be called by a deployment tool to validate the overall
     * activation configuration information provided by the endpoint deployer.
     *

Modified: projects/jboss-jca/branches/Branch_1_0/core/src/test/resources/rars/inflow/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/test/resources/rars/inflow/META-INF/ra.xml	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/core/src/test/resources/rars/inflow/META-INF/ra.xml	2012-02-16 22:15:19 UTC (rev 112660)
@@ -27,8 +27,8 @@
 <connector xmlns="http://java.sun.com/xml/ns/j2ee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-           http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
-           version="1.5">
+           http://java.sun.com/xml/ns/j2ee/connector_1_6.xsd"
+           version="1.6">
 
    <vendor-name>Red Hat Middleware LLC</vendor-name>
    <eis-type>Test RA</eis-type>
@@ -41,6 +41,16 @@
                <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
                <activationspec>
                   <activationspec-class>org.jboss.jca.core.inflow.ra.inflow.PureInflowActivationSpec</activationspec-class>
+                  <config-property>
+                    <config-property-name>defaultBoolean</config-property-name>
+                    <config-property-type>java.lang.Boolean</config-property-type>
+                    <config-property-value>true</config-property-value>
+                  </config-property>
+                  <config-property>
+                    <config-property-name>defaultString</config-property-name>
+                    <config-property-type>java.lang.String</config-property-type>
+                    <config-property-value>Default</config-property-value>
+                  </config-property>
                </activationspec>
             </messagelistener>
          </messageadapter>

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyRaXmlTestCase.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyRaXmlTestCase.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyRaXmlTestCase.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -122,9 +122,13 @@
       assertNotNull(connection);
 
       assertEquals("A", connection.getResourceAdapterProperty());
+      assertEquals("Default", connection.getResourceAdapterDefaultProperty());
+
       assertEquals("B", connection.getManagedConnectionFactoryProperty());
+      assertEquals("Default", connection.getManagedConnectionFactoryDefaultProperty());
 
       assertEquals("C", adminObject.getProperty());
+      assertEquals("Default", adminObject.getDefaultProperty());
 
       connection.close();
    }

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyTestCase.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyTestCase.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/ConfigPropertyTestCase.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -107,9 +107,13 @@
       assertNotNull(connection);
 
       assertEquals("A", connection.getResourceAdapterProperty());
+      assertEquals("Default", connection.getResourceAdapterDefaultProperty());
+
       assertEquals("B", connection.getManagedConnectionFactoryProperty());
+      assertEquals("Default", connection.getManagedConnectionFactoryDefaultProperty());
 
       assertEquals("C", adminObject.getProperty());
+      assertEquals("Default", adminObject.getDefaultProperty());
 
       connection.close();
    }

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectImpl.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectImpl.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectImpl.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -47,6 +47,9 @@
    /** Reference */
    private Reference reference;
 
+   /** default property */
+   private String defaultProperty;
+
    /** property */
    private String property;
 
@@ -59,6 +62,24 @@
    }
 
    /** 
+    * Set default property
+    * @param property The value
+    */
+   public void setDefaultProperty(String property)
+   {
+      this.defaultProperty = property;
+   }
+
+   /** 
+    * Get default property
+    * @return The value
+    */
+   public String getDefaultProperty()
+   {
+      return defaultProperty;
+   }
+
+   /** 
     * Set property
     * @param property The value
     */
@@ -127,6 +148,10 @@
    public int hashCode()
    {
       int result = 17;
+      if (defaultProperty != null)
+         result += 31 * result + 7 * defaultProperty.hashCode();
+      else
+         result += 31 * result + 7;
       if (property != null)
          result += 31 * result + 7 * property.hashCode();
       else
@@ -152,6 +177,13 @@
       boolean result = true; 
       if (result)
       {
+         if (defaultProperty == null)
+            result = obj.getDefaultProperty() == null;
+         else
+            result = defaultProperty.equals(obj.getDefaultProperty());
+      }
+      if (result)
+      {
          if (property == null)
             result = obj.getProperty() == null;
          else

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectInterface.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectInterface.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyAdminObjectInterface.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -33,6 +33,18 @@
 public interface ConfigPropertyAdminObjectInterface extends Referenceable, Serializable
 {
    /** 
+    * Set default property
+    * @param property The value
+    */
+   public void setDefaultProperty(String property);
+
+   /** 
+    * Get default property
+    * @return The value
+    */
+   public String getDefaultProperty();
+
+   /** 
     * Set property
     * @param property The value
     */

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnection.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnection.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnection.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -29,11 +29,21 @@
 public interface ConfigPropertyConnection
 {
    /**
+    * getResourceAdapterDefaultProperty
+    * @return String
+    */
+   public String getResourceAdapterDefaultProperty();
+   /**
     * getResourceAdapterProperty
     * @return String
     */
    public String getResourceAdapterProperty();
    /**
+    * getManagedConnectionFactoryDefaultProperty
+    * @return String
+    */
+   public String getManagedConnectionFactoryDefaultProperty();
+   /**
     * getManagedConnectionFactoryProperty
     * @return String
     */

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnectionImpl.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnectionImpl.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyConnectionImpl.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -55,6 +55,15 @@
    }
 
    /**
+    * Call getResourceAdapterDefaultProperty
+    * @return String
+    */
+   public String getResourceAdapterDefaultProperty()
+   {
+      return ((ConfigPropertyResourceAdapter)mcf.getResourceAdapter()).getDefaultProperty();
+   }
+
+   /**
     * Call getManagedConnectionFactoryProperty
     * @return String
     */
@@ -64,6 +73,15 @@
    }
 
    /**
+    * Call getManagedConnectionFactoryDefaultProperty
+    * @return String
+    */
+   public String getManagedConnectionFactoryDefaultProperty()
+   {
+      return mcf.getDefaultProperty();
+   }
+
+   /**
     * Close
     */
    public void close()

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyManagedConnectionFactory.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyManagedConnectionFactory.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyManagedConnectionFactory.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -51,6 +51,9 @@
    /** The logwriter */
    private PrintWriter logwriter;
 
+   /** defaultProperty */
+   private String defaultProperty;
+
    /** property */
    private String property;
 
@@ -63,6 +66,24 @@
    }
 
    /** 
+    * Set default property
+    * @param property The value
+    */
+   public void setDefaultProperty(String property)
+   {
+      this.defaultProperty = property;
+   }
+
+   /** 
+    * Get default property
+    * @return The value
+    */
+   public String getDefaultProperty()
+   {
+      return defaultProperty;
+   }
+
+   /** 
     * Set property
     * @param property The value
     */
@@ -193,6 +214,10 @@
    public int hashCode()
    {
       int result = 17;
+      if (defaultProperty != null)
+         result += 31 * result + 7 * defaultProperty.hashCode();
+      else
+         result += 31 * result + 7;
       if (property != null)
          result += 31 * result + 7 * property.hashCode();
       else
@@ -218,6 +243,13 @@
       boolean result = true; 
       if (result)
       {
+         if (defaultProperty == null)
+            result = obj.getDefaultProperty() == null;
+         else
+            result = defaultProperty.equals(obj.getDefaultProperty());
+      }
+      if (result)
+      {
          if (property == null)
             result = obj.getProperty() == null;
          else
@@ -225,6 +257,4 @@
       }
       return result;
    }
-
-
 }

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyResourceAdapter.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyResourceAdapter.java	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/java/org/jboss/jca/test/deployers/spec/rars/configproperty/ConfigPropertyResourceAdapter.java	2012-02-16 22:15:19 UTC (rev 112660)
@@ -37,6 +37,9 @@
  */
 public class ConfigPropertyResourceAdapter implements ResourceAdapter
 {
+   /** defaultProperty */
+   private String defaultProperty;
+
    /** property */
    private String property;
 
@@ -48,6 +51,24 @@
    }
 
    /** 
+    * Set default property
+    * @param property The value
+    */
+   public void setDefaultProperty(String property)
+   {
+      this.defaultProperty = property;
+   }
+
+   /** 
+    * Get default property
+    * @return The value
+    */
+   public String getDefaultProperty()
+   {
+      return defaultProperty;
+   }
+
+   /** 
     * Set property
     * @param property The value
     */
@@ -128,6 +149,10 @@
    public int hashCode()
    {
       int result = 17;
+      if (defaultProperty != null)
+         result += 31 * result + 7 * defaultProperty.hashCode();
+      else
+         result += 31 * result + 7;
       if (property != null)
          result += 31 * result + 7 * property.hashCode();
       else
@@ -153,6 +178,13 @@
       boolean result = true; 
       if (result)
       {
+         if (defaultProperty == null)
+            result = obj.getDefaultProperty() == null;
+         else
+            result = defaultProperty.equals(obj.getDefaultProperty());
+      }
+      if (result)
+      {
          if (property == null)
             result = obj.getProperty() == null;
          else

Modified: projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/config-property.rar/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/config-property.rar/META-INF/ra.xml	2012-02-16 22:08:19 UTC (rev 112659)
+++ projects/jboss-jca/branches/Branch_1_0/deployers/src/test/resources/config-property.rar/META-INF/ra.xml	2012-02-16 22:15:19 UTC (rev 112660)
@@ -36,6 +36,11 @@
    <resourceadapter>
       <resourceadapter-class>org.jboss.jca.test.deployers.spec.rars.configproperty.ConfigPropertyResourceAdapter</resourceadapter-class>
       <config-property>
+         <config-property-name>defaultProperty</config-property-name>
+         <config-property-type>java.lang.String</config-property-type>
+         <config-property-value>Default</config-property-value>
+      </config-property>
+      <config-property>
          <config-property-name>property</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>default</config-property-value>
@@ -45,6 +50,11 @@
          <connection-definition>
             <managedconnectionfactory-class>org.jboss.jca.test.deployers.spec.rars.configproperty.ConfigPropertyManagedConnectionFactory</managedconnectionfactory-class>
             <config-property>
+              <config-property-name>defaultProperty</config-property-name>
+              <config-property-type>java.lang.String</config-property-type>
+              <config-property-value>Default</config-property-value>
+            </config-property>
+            <config-property>
                <config-property-name>property</config-property-name>
                <config-property-type>java.lang.String</config-property-type>
                <config-property-value>default</config-property-value>
@@ -62,6 +72,11 @@
          <adminobject-interface>org.jboss.jca.test.deployers.spec.rars.configproperty.ConfigPropertyAdminObjectInterface</adminobject-interface>
          <adminobject-class>org.jboss.jca.test.deployers.spec.rars.configproperty.ConfigPropertyAdminObjectImpl</adminobject-class>
          <config-property>
+           <config-property-name>defaultProperty</config-property-name>
+           <config-property-type>java.lang.String</config-property-type>
+           <config-property-value>Default</config-property-value>
+         </config-property>
+         <config-property>
             <config-property-name>property</config-property-name>
             <config-property-type>java.lang.String</config-property-type>
             <config-property-value>default</config-property-value>



More information about the jboss-cvs-commits mailing list