[jboss-cvs] JBossAS SVN: r68283 - 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 14 08:44:25 EST 2007


Author: alex.loubyansky at jboss.com
Date: 2007-12-14 08:44:25 -0500 (Fri, 14 Dec 2007)
New Revision: 68283

Modified:
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-4671 added tests for remaining connection factories

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-14 13:43:52 UTC (rev 68282)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2007-12-14 13:44:25 UTC (rev 68283)
@@ -85,6 +85,10 @@
       suite.addTest(new ProfileServiceUnitTestCase("testRemoveXADataSource"));
       suite.addTest(new ProfileServiceUnitTestCase("testAddTxConnectionFactory"));
       suite.addTest(new ProfileServiceUnitTestCase("testRemoveTxConnectionFactory"));
+      suite.addTest(new ProfileServiceUnitTestCase("testAddNoTxConnectionFactory"));
+      suite.addTest(new ProfileServiceUnitTestCase("testRemoveNoTxConnectionFactory"));
+      suite.addTest(new ProfileServiceUnitTestCase("testAddNoTxDataSource"));
+      suite.addTest(new ProfileServiceUnitTestCase("testRemoveNoTxDataSource"));
       return suite;
    }
 
@@ -162,7 +166,7 @@
       ManagementView mgtView = getManagementView();
       Set<String> names = mgtView.getTemplateNames();
       log.info("getTemplateNames, "+names);
-      assertTrue("DsDataSourceTemplate exists", names.contains("DsDataSourceTemplate"));
+      assertTrue("LocalTxDataSourceTemplate exists", names.contains("LocalTxDataSourceTemplate"));
    }
 
    /**
@@ -370,10 +374,8 @@
    public void testAddDataSource() throws Exception
    {
       ManagementView mgtView = getManagementView();
-      log.trace("Templates: "+mgtView.getTemplateNames());
-      DeploymentTemplateInfo dsInfo = mgtView.getTemplate("DsDataSourceTemplate");
+      DeploymentTemplateInfo dsInfo = mgtView.getTemplate("LocalTxDataSourceTemplate");
       Map<String, ManagedProperty> props = dsInfo.getProperties();
-      log.trace("ManagedPropertys: "+props);
 
       ManagedProperty jndiName = props.get("jndi-name");
       jndiName.setValue("TestHqldbDS");
@@ -386,14 +388,14 @@
       ManagedProperty password = props.get("password");
       password.setValue("");
       
-      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testHqldbDS", dsInfo);
+      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testLocalTxDs", dsInfo);
       mgtView.process();
    }
 
    public void testRemoveDataSource()
       throws Exception
    {
-      removeDeployment("testHqldbDS-ds.xml");
+      removeDeployment("testLocalTxDs-ds.xml");
    }
 
    /**
@@ -428,7 +430,7 @@
       xaPropsValue.add(xaPropMD);
       xaDsProps.setValue(xaPropsValue);
 
-      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testHqldbXADS", dsInfo);
+      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testXaDs", dsInfo);
       mgtView.process();
    }
 
@@ -439,7 +441,7 @@
    public void testRemoveXADataSource()
       throws Exception
    {
-      removeDeployment("testHqldbXADS-ds.xml");
+      removeDeployment("testXaDs-ds.xml");
    }
 
    /**
@@ -482,7 +484,7 @@
       //ApplicationManagedSecurityMetaData secDomain = new ApplicationManagedSecurityMetaData();
       //props.get("security-domain").setValue(secDomain);
 
-      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testJmsXACf", dsInfo);
+      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testTxCf", dsInfo);
       mgtView.process();
    }
 
@@ -493,9 +495,88 @@
    public void testRemoveTxConnectionFactory()
       throws Exception
    {
-      removeDeployment("testJmsXACf-ds.xml");
+      removeDeployment("testTxCf-ds.xml");
    }
 
+   /**
+    * Test adding a new no-tx-datasource deployment (JBAS-4671)
+    * @throws Exception
+    */
+   public void testAddNoTxDataSource() throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      DeploymentTemplateInfo dsInfo = mgtView.getTemplate("NoTxDataSourceTemplate");
+      Map<String, ManagedProperty> props = dsInfo.getProperties();
+
+      ManagedProperty jndiName = props.get("jndi-name");
+      jndiName.setValue("TestNoTxDs");
+      ManagedProperty connURL = props.get("connection-url");
+      connURL.setValue("jdbc:hsqldb:.");
+      ManagedProperty driverClass = props.get("driver-class");
+      driverClass.setValue("org.hsqldb.jdbcDriver");
+      ManagedProperty username = props.get("user-name");
+      username.setValue("sa");
+      ManagedProperty password = props.get("password");
+      password.setValue("");
+
+      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testNoTxDs", dsInfo);
+      mgtView.process();
+   }
+
+   public void testRemoveNoTxDataSource()
+      throws Exception
+   {
+      removeDeployment("testNoTxDs-ds.xml");
+   }
+
+   /**
+    * Test adding a new no-tx-connection-factory deployment
+    * @throws Exception
+    */
+   public void testAddNoTxConnectionFactory() throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      DeploymentTemplateInfo dsInfo = mgtView.getTemplate("NoTxConnectionFactoryTemplate");
+      Map<String, ManagedProperty> props = dsInfo.getProperties();
+
+      props.get("jndi-name").setValue("testNoTxJms");
+      props.get("rar-name").setValue("jms-ra.rar");
+      props.get("connection-definition").setValue("org.jboss.resource.adapter.jms.JmsConnectionFactory");
+
+      ManagedProperty configProps = props.get("config-property");
+      ArrayList<ManagedConnectionFactoryPropertyMetaData> configPropsValue = new ArrayList<ManagedConnectionFactoryPropertyMetaData>();
+      ManagedConnectionFactoryPropertyMetaData configPropMD = new ManagedConnectionFactoryPropertyMetaData();
+      configPropMD.setName("SessionDefaultType");
+      configPropMD.setType("java.lang.String");
+      configPropMD.setValue("javax.jms.Topic");
+      configPropsValue.add(configPropMD);
+      configPropMD = new ManagedConnectionFactoryPropertyMetaData();
+      configPropMD.setName("JmsProviderAdapterJNDI");
+      configPropMD.setType("java.lang.String");
+      configPropMD.setValue("java:/DefaultJMSProvider");
+      configPropsValue.add(configPropMD);
+      configProps.setValue(configPropsValue);
+
+      props.get("min-pool-size").setValue(new Integer(20));
+
+      // todo: how to set the specific domain?
+      //ApplicationManagedSecurityMetaData secDomain = new ApplicationManagedSecurityMetaData();
+      //props.get("security-domain").setValue(secDomain);
+
+      mgtView.applyTemplate(DeploymentPhase.APPLICATION, "testNoTxCf", dsInfo);
+      mgtView.process();
+   }
+
+   /**
+    * removes the tx-connection-factory created in the testAddTxConnectionFactory
+    * @throws Exception
+    */
+   public void testRemoveNoTxConnectionFactory()
+      throws Exception
+   {
+      removeDeployment("testNoTxCf-ds.xml");
+   }
+
    protected void removeDeployment(String deployment)
       throws Exception
    {




More information about the jboss-cvs-commits mailing list