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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 24 23:52:22 EDT 2009


Author: scott.stark at jboss.org
Date: 2009-03-24 23:52:22 -0400 (Tue, 24 Mar 2009)
New Revision: 86283

Modified:
   trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-6667, Change XA ConnectionFactory subtype to Tx


Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java	2009-03-25 03:50:31 UTC (rev 86282)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java	2009-03-25 03:52:22 UTC (rev 86283)
@@ -40,7 +40,7 @@
  */
 @XmlType(name="tx-connection-factory")
 @XmlAccessorType(XmlAccessType.FIELD)
- at ManagementObject(componentType=@ManagementComponent(type="ConnectionFactory",subtype="XA"))
+ at ManagementObject(componentType=@ManagementComponent(type="ConnectionFactory",subtype="Tx"))
 public class TxConnectionFactoryDeploymentMetaData extends ManagedConnectionFactoryDeploymentMetaData
 {
 

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2009-03-25 03:50:31 UTC (rev 86282)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2009-03-25 03:52:22 UTC (rev 86283)
@@ -120,6 +120,8 @@
       suite.addTest(new ProfileServiceUnitTestCase("testRemoveXADataSource"));
       suite.addTest(new ProfileServiceUnitTestCase("testAddTxConnectionFactory"));
       suite.addTest(new ProfileServiceUnitTestCase("testRemoveTxConnectionFactory"));
+      suite.addTest(new ProfileServiceUnitTestCase("testAddTxXAConnectionFactory"));
+      suite.addTest(new ProfileServiceUnitTestCase("testRemoveTxXAConnectionFactory"));
       suite.addTest(new ProfileServiceUnitTestCase("testAddNoTxConnectionFactory"));
       suite.addTest(new ProfileServiceUnitTestCase("testRemoveNoTxConnectionFactory"));
       suite.addTest(new ProfileServiceUnitTestCase("testAddNoTxDataSource"));
@@ -274,13 +276,21 @@
       }
    }
 
+   /** 
+    * Test the expected template names
+    * @throws Exception
+    */
    public void testTemplateNames()
       throws Exception
    {
       ManagementView mgtView = getManagementView();
       Set<String> names = mgtView.getTemplateNames();
       log.info("getTemplateNames, "+names);
+      assertTrue("TopicTemplate exists", names.contains("TopicTemplate"));
+      assertTrue("QueueTemplate exists", names.contains("QueueTemplate"));
       assertTrue("LocalTxDataSourceTemplate exists", names.contains("LocalTxDataSourceTemplate"));
+      assertTrue("TxConnectionFactoryTemplate exists", names.contains("TxConnectionFactoryTemplate"));
+      assertTrue("NoTxConnectionFactoryTemplate exists", names.contains("NoTxConnectionFactoryTemplate"));
    }
 
    /**
@@ -761,7 +771,7 @@
 
       propValues.put("config-property", metaValue);
 
-      propValues.put("xa-transaction", SimpleValueSupport.wrap(Boolean.TRUE));
+      propValues.put("xa-transaction", SimpleValueSupport.wrap(Boolean.FALSE));
       propValues.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(256)));
 
       // todo: how to set the specific domain?
@@ -769,7 +779,7 @@
       //props.get("security-domain").setValue(secDomain);
 
       createComponentTest("TxConnectionFactoryTemplate", propValues, "testTxCf",
-         new ComponentType("ConnectionFactory", "XA"), jndiName);
+         new ComponentType("ConnectionFactory", "Tx"), jndiName);
    }
 
    /**
@@ -783,6 +793,47 @@
    }
 
    /**
+    * Test adding a new tx-connection-factory deployment with xa enabled
+    * @throws Exception
+    */
+   public void testAddTxXAConnectionFactory() throws Exception
+   {
+      String jndiName = "TestTxCf";
+      Map<String, MetaValue> propValues = new HashMap<String, MetaValue>();
+
+      addCommonCfProperties(propValues, jndiName, "jms-ra.rar", "org.jboss.resource.adapter.jms.JmsConnectionFactory");
+
+      Map<String, String> xaProps = new HashMap<String, String>();
+      xaProps.put("SessionDefaultType", "javax.jms.Topic");
+      xaProps.put("SessionDefaultType.type", "java.lang.String");
+      xaProps.put("JmsProviderAdapterJNDI", "java:/DefaultJMSProvider");
+      xaProps.put("JmsProviderAdapterJNDI.type", "java.lang.String");
+      MetaValue metaValue = this.compositeValueMap(xaProps);
+
+      propValues.put("config-property", metaValue);
+
+      propValues.put("xa-transaction", SimpleValueSupport.wrap(Boolean.TRUE));
+      propValues.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(256)));
+
+      // todo: how to set the specific domain?
+      //ApplicationManagedSecurityMetaData secDomain = new ApplicationManagedSecurityMetaData();
+      //props.get("security-domain").setValue(secDomain);
+
+      createComponentTest("TxConnectionFactoryTemplate", propValues, "testTxXACf",
+         new ComponentType("ConnectionFactory", "Tx"), jndiName);
+   }
+
+   /**
+    * removes the tx-connection-factory created in the testAddXAConnectionFactory
+    * @throws Exception
+    */
+   public void testRemoveTxXAConnectionFactory()
+      throws Exception
+   {
+      removeDeployment("testTxXACf-ds.xml");
+   }
+
+   /**
     * Test adding a new no-tx-datasource deployment (JBAS-4671)
     * @throws Exception
     */




More information about the jboss-cvs-commits mailing list