[jboss-cvs] JBossAS SVN: r68037 - trunk/testsuite/src/main/org/jboss/test/profileservice/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 7 08:52:35 EST 2007
Author: alex.loubyansky at jboss.com
Date: 2007-12-07 08:52:34 -0500 (Fri, 07 Dec 2007)
New Revision: 68037
Modified:
trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-4671 added a test for tx-connection-factory
Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2007-12-07 13:22:23 UTC (rev 68036)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java 2007-12-07 13:52:34 UTC (rev 68037)
@@ -48,6 +48,7 @@
import org.jboss.test.JBossTestCase;
import org.jboss.virtual.VFS;
import org.jboss.resource.metadata.mcf.XAConnectionPropertyMetaData;
+import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryPropertyMetaData;
/** Test of using ProfileService
@@ -82,6 +83,8 @@
suite.addTest(new ProfileServiceUnitTestCase("testRemoveDataSource"));
suite.addTest(new ProfileServiceUnitTestCase("testAddXADataSource"));
suite.addTest(new ProfileServiceUnitTestCase("testRemoveXADataSource"));
+ suite.addTest(new ProfileServiceUnitTestCase("testAddTxConnectionFactory"));
+ suite.addTest(new ProfileServiceUnitTestCase("testRemoveTxConnectionFactory"));
return suite;
}
@@ -441,6 +444,59 @@
removeDeployment("testHqldbXADS-ds.xml");
}
+ /**
+ * Test adding a new tx-connection-factory deployment
+ * @throws Exception
+ */
+ public void testAddTxConnectionFactory() throws Exception
+ {
+ ManagementView mgtView = getManagementView();
+ DeploymentTemplateInfo dsInfo = mgtView.getTemplate("DsDataSourceTemplate");
+ Map<String, ManagedProperty> props = dsInfo.getProperties();
+
+ ManagedProperty jndiName = props.get("jndi-name");
+ jndiName.setValue("ra/cicsr9s");
+ ManagedProperty dsType = props.get("datasource-type");
+ dsType.setValue("tx-connection-factory");
+
+ ManagedProperty configProps = props.get("config-property");
+ ArrayList<ManagedConnectionFactoryPropertyMetaData> configPropsValue = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
+ ManagedConnectionFactoryPropertyMetaData configPropMD = new ManagedConnectionFactoryPropertyMetaData();
+ configPropMD.setName("ConnectionURL");
+ configPropMD.setType("java.lang.String");
+ configPropMD.setValue("tcp://arno");
+ configPropsValue.add(configPropMD);
+ configPropMD = new ManagedConnectionFactoryPropertyMetaData();
+ configPropMD.setName("PortNumber");
+ configPropMD.setType("java.lang.String");
+ configPropMD.setValue("2006");
+ configPropsValue.add(configPropMD);
+ configPropMD = new ManagedConnectionFactoryPropertyMetaData();
+ configPropMD.setName("ServerName");
+ configPropMD.setType("java.lang.String");
+ configPropMD.setValue("CICSR9S");
+ configPropsValue.add(configPropMD);
+ configPropMD = new ManagedConnectionFactoryPropertyMetaData();
+ configPropMD.setName("UserName");
+ configPropMD.setType("java.lang.String");
+ configPropMD.setValue("CICSUSER");
+ configPropsValue.add(configPropMD);
+ configProps.setValue(configPropsValue);
+
+ mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testCicsr9sTxCf", dsInfo);
+ mgtView.process();
+ }
+
+ /**
+ * removes the tx-connection-factory created in the testAddTxConnectionFactory
+ * @throws Exception
+ */
+ public void testRemoveTxConnectionFactory()
+ throws Exception
+ {
+ removeDeployment("testCicsr9sTxCf-ds.xml");
+ }
+
protected void removeDeployment(String deployment)
throws Exception
{
More information about the jboss-cvs-commits
mailing list