[jboss-cvs] JBossAS SVN: r86277 - in branches/Branch_5_x: 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 20:57:29 EDT 2009
Author: scott.stark at jboss.org
Date: 2009-03-24 20:57:29 -0400 (Tue, 24 Mar 2009)
New Revision: 86277
Modified:
branches/Branch_5_x/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java
branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-6667, Change XA ConnectionFactory subtype to Tx
Modified: branches/Branch_5_x/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java
===================================================================
--- branches/Branch_5_x/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java 2009-03-25 00:33:53 UTC (rev 86276)
+++ branches/Branch_5_x/connector/src/main/org/jboss/resource/metadata/mcf/TxConnectionFactoryDeploymentMetaData.java 2009-03-25 00:57:29 UTC (rev 86277)
@@ -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: branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2009-03-25 00:33:53 UTC (rev 86276)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2009-03-25 00:57:29 UTC (rev 86277)
@@ -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