[jboss-cvs] JBossAS SVN: r90455 - 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
Thu Jun 18 23:17:48 EDT 2009


Author: scott.stark at jboss.org
Date: 2009-06-18 23:17:48 -0400 (Thu, 18 Jun 2009)
New Revision: 90455

Modified:
   trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java
   trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java
   trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-6777, further corrections to the interleaving property usage


Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java	2009-06-19 03:17:13 UTC (rev 90454)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractConnectionFactoryICF.java	2009-06-19 03:17:48 UTC (rev 90455)
@@ -72,7 +72,7 @@
       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;

Modified: trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java	2009-06-19 03:17:13 UTC (rev 90454)
+++ trunk/connector/src/main/org/jboss/resource/deployers/management/AbstractNonXADataSourceICF.java	2009-06-19 03:17:48 UTC (rev 90455)
@@ -76,11 +76,6 @@
          }
          value = mapValue;
       }
-      else if("interleaving".equals(property.getName()))
-      {
-         Boolean interleaving = attachment.isInterleaving();
-         value = SimpleValueSupport.wrap(interleaving);
-      }
       else
       {
          value = super.getValue(beanInfo, property, metaData, attachment);

Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java	2009-06-19 03:17:13 UTC (rev 90454)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java	2009-06-19 03:17:48 UTC (rev 90455)
@@ -257,7 +257,6 @@
    {
       return useJavaContext;
    }
-
    /**
     * Set the useJavaContext.
     * 
@@ -504,7 +503,6 @@
    {
       return backgroundValidation;
    }
-
    public void setBackgroundValidation(boolean backgroundValidation)
    {
       this.backgroundValidation = backgroundValidation;
@@ -531,7 +529,6 @@
    {
       return this.validateOnMatch;
    }
-
    @ManagementProperty(name="isSameRM-override-value", includeInTemplate=true)
    public Boolean getIsSameRMOverrideValue()
    {
@@ -542,9 +539,9 @@
    {
       this.isSameRMOverrideValue = isSameRMOverrideValue;
    }
-
    @Deprecated
-   @ManagementProperty(name="track-connection-by-tx", includeInTemplate=true)
+   @ManagementProperty(name="track-connection-by-tx", includeInTemplate=true,
+         use={ViewUse.CONFIGURATION})
    public Boolean getTrackConnectionByTransaction()
    {
       return !isInterleaving();
@@ -561,13 +558,16 @@
       setInterleaving(!Boolean.TRUE.equals(trackConnectionByTransaction));
    }
 
-   @ManagementProperty(name="interleaving", includeInTemplate=true,
-         use={ViewUse.CONFIGURATION})
    public Boolean isInterleaving()
    {
       return interleaving == Boolean.TRUE && !Boolean.TRUE.equals(getLocalTransactions());
    }
-
+   @ManagementProperty(name="interleaving", includeInTemplate=true,
+         use={ViewUse.CONFIGURATION})
+   public Boolean getInterleaving()
+   {
+      return isInterleaving();
+   }
    public void setInterleaving(Boolean interleaving)
    {
       this.interleaving = interleaving;

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2009-06-19 03:17:13 UTC (rev 90454)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2009-06-19 03:17:48 UTC (rev 90455)
@@ -694,6 +694,7 @@
 
       propValues.put("xa-datasource-class", SimpleValueSupport.wrap("org.hsqldb.jdbcDriver"));
       propValues.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(256)));
+      propValues.put("interleaving", SimpleValueSupport.wrap(true));
 
       HashMap<String, String> xaPropValues = new HashMap<String, String>();
       xaPropValues.put("URL", "jdbc:hsqldb");
@@ -739,6 +740,7 @@
       propValues.put("config-property", metaValue);
 
       propValues.put("xa-transaction", SimpleValueSupport.wrap(Boolean.FALSE));
+      propValues.put("interleaving", SimpleValueSupport.wrap(Boolean.TRUE));
       propValues.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(256)));
 
       // todo: how to set the specific domain?
@@ -747,6 +749,16 @@
 
       createComponentTest("TxConnectionFactoryTemplate", propValues, "testTxCf",
          new ComponentType("ConnectionFactory", "Tx"), jndiName);
+      // Query the interleaving 
+      ManagementView mgtView = getManagementView();
+      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
+      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
+      assertNotNull(txcf);
+      ManagedProperty interleaving = txcf.getProperty("interleaving");
+      assertNotNull("interleaving", interleaving);
+      MetaValue interleavingMV = interleaving.getValue();
+      assertNotNull("interleaving.value", interleavingMV);
+      
    }
 
    /**
@@ -781,6 +793,7 @@
 
       propValues.put("xa-transaction", SimpleValueSupport.wrap(Boolean.TRUE));
       propValues.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(256)));
+      propValues.put("interleaving", SimpleValueSupport.wrap(Boolean.TRUE));
 
       // todo: how to set the specific domain?
       //ApplicationManagedSecurityMetaData secDomain = new ApplicationManagedSecurityMetaData();
@@ -788,6 +801,16 @@
 
       createComponentTest("TxConnectionFactoryTemplate", propValues, "testTxXACf",
          new ComponentType("ConnectionFactory", "Tx"), jndiName);
+      // Query the interleaving 
+      ManagementView mgtView = getManagementView();
+      ComponentType type = new ComponentType("ConnectionFactory", "Tx");
+      ManagedComponent txcf = mgtView.getComponent(jndiName, type);
+      assertNotNull(txcf);
+      ManagedProperty interleaving = txcf.getProperty("interleaving");
+      assertNotNull("interleaving", interleaving);
+      MetaValue interleavingMV = interleaving.getValue();
+      assertNotNull("interleaving.value", interleavingMV);
+      assertEquals(SimpleValueSupport.wrap(Boolean.TRUE), interleavingMV);
    }
 
    /**
@@ -837,7 +860,6 @@
       MetaValue metaValue = this.compositeValueMap(xaProps);
       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)));
@@ -970,7 +992,6 @@
       propValues.put("no-tx-separate-pools", SimpleValueSupport.wrap(Boolean.TRUE));
       propValues.put("statistics-formatter", SimpleValueSupport.wrap("org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter"));
       propValues.put("isSameRM-override-value", SimpleValueSupport.wrap(Boolean.FALSE));
-      propValues.put("track-connection-by-tx", SimpleValueSupport.wrap(Boolean.TRUE));
       propValues.put("type-mapping", SimpleValueSupport.wrap("Hypersonic SQL"));
       // todo: config-property
       // todo: security-domain
@@ -1019,8 +1040,8 @@
       for(String propName : propValues.keySet())
       {
          ManagedProperty prop = dsMC.getProperty(propName);
-         log.debug("Checking: "+prop);
-         assertNotNull(prop);
+         log.debug("Checking: "+propName);
+         assertNotNull(propName, prop);
          Object propValue = prop.getValue();
          Object expectedValue = propValues.get(propName);
          if(propValue instanceof MetaValue)




More information about the jboss-cvs-commits mailing list