[embjopr-commits] EMBJOPR SVN: r427 - in trunk/jsfunit: src/test/java/org/jboss/jopr/jsfunit and 7 other directories.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Fri May 15 14:17:55 EDT 2009


Author: fjuma
Date: 2009-05-15 14:17:55 -0400 (Fri, 15 May 2009)
New Revision: 427

Added:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryCreationTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryDeletionTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryMetricsTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryTest.java
   trunk/jsfunit/testdata/connfactories/
   trunk/jsfunit/testdata/connfactories/DeleteNoTxCFExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/DeleteTxCFExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/FlushNoTxCFAfterMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/FlushTxCFAfterMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterClosingConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterClosingConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterClosingConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterClosingConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/MetricsNoTxCFClosingConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/MetricsNoTxCFInitialConnectionExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/MetricsNoTxCFMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/MetricsTxCFClosingConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/MetricsTxCFInitialConnectionExistingFile-ds.xml
   trunk/jsfunit/testdata/connfactories/MetricsTxCFMultipleConnectionsExistingFile-ds.xml
   trunk/jsfunit/testdata/rar/embjoprtestadapter.rar
Modified:
   trunk/jsfunit/pom.xml
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceConfigurationTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceDeletionTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceMetricsTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceOperationsTest.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSTest.java
Log:
Adding creation tests, deletion tests, metrics tests, and operations tests for connection factories.


Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/pom.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -393,6 +393,14 @@
                            <file>${basedir}/testdata/datasources/testFiles</file>
                            <toDir>deploy</toDir>
                          </copy>
+                        <copy>
+                           <file>${basedir}/testdata/connfactories</file>
+                           <toDir>deploy</toDir>
+                        </copy>
+                        <copy>
+                           <file>${basedir}/testdata/rar/embjoprtestadapter.rar</file>
+                           <toDir>deploy</toDir>
+                         </copy>
                        </files>
                      </configuration>
                      <!-- /Container configuration -->

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -63,24 +63,9 @@
     public static final String NO_TX_DS_NAV_LABEL = "No Tx Datasources";
     public static final String XA_DS_NAV_LABEL = "XA Datasources";
     
-    // Datasource operations
-    public static final String FLUSH = "Flush";
-    public static final String LIST_FORMATTED_SUB_POOL_STATISTICS = "List Formatted Sub Pool Statistics";
-    public static final String LIST_STATISTICS = "List Statistics";
+    // The root element in a datasource -ds.xml file
+    public static final String DS_ROOT_ELEMENT = "datasources";
     
-    // Datasource metrics
-    public static final String AVAILABLE_CONNECTION_COUNT = "Available Connection Count";
-    public static final String CONNECTION_COUNT = "Connection Count";
-    public static final String CONNECTION_CREATED_COUNT = "Connection Created Count";
-    public static final String CONNECTION_DESTROYED_COUNT = "Connection Destroyed Count";
-    public static final String IN_USE_CONNECTION_COUNT = "In Use Connection Count";
-    public static final String MAX_CONNECTIONS_IN_USE_COUNT = "Max Connections In Use Count";
-    public static final String MAX_SIZE = "Max Size";
-    public static final String MIN_SIZE = "Min Size";
-    
-    // Gets displayed in the output of the "List Formatted Sub Pool Statistics" operation
-    public static final String POOL_SEPARATOR = "------------------------------------------------------";
-   
     // Datasource types, as they appear in the left nav
     public enum DatasourceType {
 
@@ -544,28 +529,7 @@
 
     }// isMBeanStateDeployed()
 
-
     /**
-     * containsElement returns whether or not the *-ds.xml file corresponding
-     * to the datasource given by jndiName contains the given element.
-     */
-    protected boolean containsElement(String jndiName, String elementName) {
-        try {
-            File file = new File(this.getDatasourceConfigFile(jndiName));
-            SAXBuilder builder = new SAXBuilder();
-            Document doc = builder.build(file);
-
-            Element root = doc.getRootElement();
-            assertTrue(root.getName().equals("datasources"));
-            return root.getChild(elementName) != null;
-        } catch(Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-
-
-    /**
      * Make sure that the metrics corresponding to the given datasource
      * are correct.
      *

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -198,7 +198,9 @@
         {
             HtmlAnchor link = (HtmlAnchor)i.next();
             String linkText = link.getTextContent();
-            if (linkText.contains(linkLabel)) return link;
+            
+            linkText = linkText.trim(); // ignore any leading or trailing spaces
+            if (linkText.equals(linkLabel)) return link;
         }
 
         throw new IllegalStateException("Link for '"+ linkLabel +"' not found in form #"+formId);
@@ -420,11 +422,20 @@
         // Look for an enable/disable checkbox corresponding to this
         // input element. 
         if(isRadioButton) {
+            List<HtmlInput> propertyButtons = (List<HtmlInput>)form.getByXPath(".//input[@ondblclick='//" + propertyName
+                                              + "' and @type='radio']");
+            
+            int numButtons = propertyButtons.size();
+            
+            xpath = ".//input[@onclick=\"";
+            
+            for(int i = 0; i < numButtons; i++) {
+                xpath = xpath + "setInputUnset(document.getElementById('"
+                        + id.substring(0, id.lastIndexOf(":")) + ":" + i + "'), this.checked);";
+            }
+            
+            xpath = xpath + "\"]";
 
-            xpath = ".//input[@onclick=\"setInputUnset(document.getElementById('" 
-                    + id 
-                    + "'), this.checked);setInputUnset(document.getElementById('"
-                    + id.substring(0, id.lastIndexOf(":")) + ":1'), this.checked);\"]";
         } else {
             xpath = ".//input[@onclick=\"setInputUnset(document.getElementById('" 
                     + id + "'), this.checked);\"]";
@@ -526,21 +537,24 @@
 		}
 
 
-    /**
-     * Check that the given messages occur on the client side and server side.
+		/**
+		 * Check that the given messages occur on the client side and server side.
 		 * Uses checkClientAndServerMessages( String, String, FacesMessage.Severity ),
 		 * kept for backwards compat.
-     */
-    public void checkClientAndServerMessages(String expectedClientMsg,
-                                             String expectedServerMsg,
-                                             boolean isErrorMsg)
+		 */
+		public void checkClientAndServerMessages(String expectedClientMsg,
+		                                         String expectedServerMsg,
+		                                         boolean isErrorMsg)
 		{
+		    FacesMessage.Severity expectedSeverity;
 
-				FacesMessage.Severity expectedSeverity = FacesMessage.SEVERITY_INFO;
-
-        if(isErrorMsg) {
-					expectedSeverity = FacesMessage.SEVERITY_ERROR;
-        }
+		    if(isErrorMsg) {
+		        expectedSeverity = FacesMessage.SEVERITY_ERROR;
+		    } else {
+		        expectedSeverity = FacesMessage.SEVERITY_INFO;
+		    }
+		    
+		    checkClientAndServerMessages(expectedClientMsg, expectedServerMsg, expectedSeverity);
 		}
 
 		/**

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -36,6 +36,8 @@
 import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
+import java.util.LinkedHashMap;
 import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
 import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.NavTreeNode;
 import org.jboss.jopr.jsfunit.exceptions.*;
@@ -102,15 +104,40 @@
     public static final String CURRENT_PAGE_SIZE = "currentPageSize";
     public static final String NEXT_PAGE = "nextPage";
     
+    // Datasource and ConnectionFactory operations
+    public static final String FLUSH = "Flush";
+    public static final String LIST_FORMATTED_SUB_POOL_STATISTICS = "List Formatted Sub Pool Statistics";
+    public static final String LIST_STATISTICS = "List Statistics";
+    
+    // Datasource and ConnectionFactory metrics
+    public static final String AVAILABLE_CONNECTION_COUNT = "Available Connection Count";
+    public static final String CONNECTION_COUNT = "Connection Count";
+    public static final String CONNECTION_CREATED_COUNT = "Connection Created Count";
+    public static final String CONNECTION_DESTROYED_COUNT = "Connection Destroyed Count";
+    public static final String IN_USE_CONNECTION_COUNT = "In Use Connection Count";
+    public static final String MAX_CONNECTIONS_IN_USE_COUNT = "Max Connections In Use Count";
+    public static final String MAX_SIZE = "Max Size";
+    public static final String MIN_SIZE = "Min Size";
+    
+    // Gets displayed in the output of the "List Formatted Sub Pool Statistics" operation
+    public static final String POOL_SEPARATOR = "------------------------------------------------------";
+    
     // Useful constants for the tests
     public static final int FIRST_ROW = 1;
     public static final int OPERATION_STATUS_COLUMN = 2;
+    public static final int NAME_COLUMN = 0;
+    public static final int VALUE_COLUMN = 1;
     public static final String EMPTY_LIST = "[]";
     public static final String TABLE_CELL_DELIM = "<td>";
     public static final String TABLE_CELL_END_DELIM = "</td>";
     public static final String TABLE_ROW_DELIM = "<tr>";
     public static final String TABLE_ROW_END_DELIM = "</tr>";
     
+    // Datasource and Connection Factory properties to check during the "List Statistics" tests
+    public String[] listStatisticsProps = new String[] { "blocking-timeout-millis", "idle-timeout-minutes",
+                                                         "max-pool-size", "min-pool-size", "no-tx-separate-pools",
+                                                         "prefill", "track-connection-by-tx" };
+    
     /**
      * Create a new resource using the given type, template, and properties.
      *   
@@ -448,6 +475,67 @@
     }
     
     /**
+     * Perform the given operation for the given resource and 
+     * then check that the "Value" box in the operations history table
+     * contains the correct text.
+     */
+    protected void performResourceOperationAndCheckValueBox(String resourceCategory,
+                                                            String resourceSubCategory,
+                                                            String resourceName,
+                                                            String operationName,
+                                                            Boolean takesParameters,
+                                                            StringBuffer expectedBuffer,
+                                                            String errorMessage) throws Exception {
+        performResourceOperation(resourceCategory, resourceSubCategory, 
+                                 resourceName, operationName, takesParameters);
+        
+        // Get the result of the operation
+        HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_RESULTS);
+        HtmlTextArea resultTextBox = (HtmlTextArea)historyPanel.getFirstByXPath(".//textarea[@class='property-value-input']"); 
+
+        assertNotNull("Could not get the result of the operation", resultTextBox);
+        
+        String actualResult = resultTextBox.getText();
+        
+        assertTrue(errorMessage + " - \nexpected the result to contain:\n\n" 
+                   + expectedBuffer.toString() + "\n\nbut was:\n\n" + actualResult,
+                   actualResult.contains(expectedBuffer.toString()));
+    }
+    
+    /**
+     * Perform the given operation for the given resource and
+     * then check that the resulting table contains the correct values.
+     */
+    protected void performResourceOperationAndCheckTable(String resourceCategory,
+                                                         String resourceSubCategory,
+                                                         String resourceName,
+                                                         String operationName,
+                                                         Boolean takesParameters,
+                                                         Map<String, String> expectedValues) throws Exception {
+        performResourceOperation(resourceCategory, resourceSubCategory, 
+                                 resourceName, operationName, takesParameters);
+        
+        // Get the resulting table: it will have two columns, Name and Value
+        HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_RESULTS);
+        HtmlTable table = (HtmlTable)historyPanel.getFirstByXPath(".//table[@class='openmap-properties-table']");
+        
+        List<HtmlTableRow> rows = table.getRows();
+        Iterator i = rows.iterator();
+        HtmlTableRow headerRow = (HtmlTableRow)i.next(); // Skip over the row that contains column names
+
+        while(i.hasNext()) {
+            
+            // Get the actual value
+            HtmlTableRow row = (HtmlTableRow)i.next();
+            String rowName = ((HtmlTableCell)row.getCell(NAME_COLUMN)).asText();
+            String rowValue = ((HtmlTableCell)row.getCell(VALUE_COLUMN)).asText();
+            
+            String expectedValue = expectedValues.get(rowName);
+            assertEquals("Incorrect value for '" + rowName + "' - ", expectedValue, rowValue);
+        }
+    }
+    
+    /**
      * Make sure the appropriate text gets displayed in the operations
      * history table when the operation has no parameters and returns
      * no results.
@@ -475,4 +563,34 @@
         String cellValueAsHtml = TABLE_CELL_DELIM + cellValue + TABLE_CELL_END_DELIM;
         return cellValueAsHtml;
     }
+    
+    /**
+     * Format the expected results of the "List Statistics" operation
+     * for datasources and connection factories.
+     */
+    protected Map<String, String> formatListStatisticsResults(String jndiName, 
+                                                              ComponentType componentType,
+                                                              String[] specificProps) throws Exception {
+        Map<String, String> propertiesMap = formatPropertiesMap(getSpecificComponentProperties(jndiName, 
+                                                                                               componentType,
+                                                                                               listStatisticsProps));
+        
+        // Set up the expected values
+        Map<String, String> expectedStatistics = new LinkedHashMap<String, String>();
+        Integer idleTimeoutMillis = new Integer(Integer.valueOf(propertiesMap.get("idle-timeout-minutes")) * 60000);
+        
+        expectedStatistics.put("idleTimeout", idleTimeoutMillis.toString());
+        expectedStatistics.put("blockingTimeout", propertiesMap.get("blocking-timeout-millis"));
+        expectedStatistics.put("max", propertiesMap.get("max-pool-size"));
+        expectedStatistics.put("min", propertiesMap.get("min-pool-size"));
+        
+        // @TODO: Currently, "noTxnSeparatePool" is spelled incorrectly in the table
+        // We are using the incorrect spelling below as a workaround until the typo is fixed
+        expectedStatistics.put("noTxnSeperatePool", propertiesMap.get("no-tx-separate-pools")); 
+        
+        expectedStatistics.put("prefill", propertiesMap.get("prefill"));
+        expectedStatistics.put("trackByTxn", propertiesMap.get("track-connection-by-tx")); 
+        
+        return expectedStatistics;
+    }
 }

Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryCreationTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryCreationTest.java	                        (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryCreationTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit.as5.connfactories;
+
+import org.jboss.jopr.jsfunit.*;
+import com.gargoylesoftware.htmlunit.html.*;
+import java.io.*;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.jopr.jsfunit.exceptions.*;
+import org.jboss.jopr.jsfunit.as5.ResourceTestBase;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import java.util.Map;
+
+
+/**
+ * This class contains tests for creating Connection Factories with JBoss AS 5.
+ * 
+ * @author Shelly McGowan
+ * @author Farah Juma
+ *
+ */
+
+public class ConnFactoryCreationTest extends ConnFactoryTest {
+
+    /*
+     * CREATION TESTS
+     */
+
+    /**
+     * Test Name: testCreateTxConnectionFactory
+     * Assertion: Create a Tx ConnectionFactory.
+     */
+    public void testCreateTxConnectionFactory() throws Exception {
+        
+        String jndiName = "CreateTxConnFactory";
+        Map<String, MetaValue> propertiesMapAsMetaValues = createConnFactoryPropertiesAsMetaValues(jndiName);
+        
+        // Add an additional property
+        propertiesMapAsMetaValues.put("track-connection-by-tx", SimpleValueSupport.wrap(Boolean.TRUE)); 
+        
+        createConnFactoryCommon(jndiName, CFType.LOCAL_TX_CF, 
+                                LOCAL_TX_COMPONENT_TYPE, propertiesMapAsMetaValues);
+    }
+    
+    /**
+     * Test Name: testCreateNoTxConnectionFactory
+     * Assertion: Create a No Tx ConnectionFactory.
+     */
+    public void testCreateNoTxConnectionFactory() throws Exception {
+        
+        String jndiName = "CreateNoTxConnFactory";     
+        Map<String, MetaValue> propertiesMapAsMetaValues = createConnFactoryPropertiesAsMetaValues(jndiName);
+        
+        createConnFactoryCommon(jndiName, CFType.NO_TX_CF, 
+                                NO_TX_COMPONENT_TYPE, propertiesMapAsMetaValues);
+    }
+    
+    /**
+     * Common code for the creation tests.
+     */
+    private void createConnFactoryCommon(String jndiName, CFType cfType, 
+                                         ComponentType componentType,
+                                         Map<String, MetaValue> propertiesMapAsMetaValues) throws Exception {
+        
+        createConnFactory(cfType, propertiesMapAsMetaValues);
+        client.click(SAVE_BUTTON);
+
+        // Check for the appropriate success messages
+        String expectedMessage = ADD_MESSAGE;
+        checkClientAndServerMessages(expectedMessage, expectedMessage, false);
+
+        // Make sure the ManagedComponent was created and that the properties are
+        // set correctly
+        assertTrue("Connection Factory is not deployed (isDeployed() returned false).",
+                   isDeployed(jndiName + "-ds.xml"));
+
+        checkComponentProperties(propertiesMapAsMetaValues, jndiName, componentType);
+
+        // Clean up
+        deleteConnFactory(cfType, jndiName);
+        
+    }
+    
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite() {
+        return new TestSuite(ConnFactoryCreationTest.class);
+    }
+}

Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryDeletionTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryDeletionTest.java	                        (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryDeletionTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,147 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit.as5.connfactories;
+
+import com.gargoylesoftware.htmlunit.html.*;
+import org.jboss.jopr.jsfunit.*;
+import java.io.*;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.jopr.jsfunit.exceptions.*;
+import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
+import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.*;
+import org.jboss.jopr.jsfunit.as5.ResourceTestBase;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+
+
+/**
+ * This class contains tests for deleting Connection Factories with JBoss AS 5.
+ * 
+ * @author Shelly McGowan
+ * @author Farah Juma
+ *
+ */
+
+public class ConnFactoryDeletionTest extends ConnFactoryTest {
+
+    /*
+     * DELETE TESTS
+     */
+
+     /**
+      * Test Name: testDeleteTxConnectionFactory
+      * Assertion: Verify the ability to delete a TxConnectionFactory. 
+      * 
+      * Strategy: Create a Tx ConnectionFactory and then delete it. The resource adaptor
+      * should remain deployed.  
+      */
+     public void testDeleteTxConnectionFactory() throws Exception {
+         String jndiName = "DeleteTxConnFactory";
+
+         createTxConnFactory(jndiName);
+         deleteConnFactoryCommon(jndiName, CFType.LOCAL_TX_CF, LOCAL_TX_COMPONENT_TYPE, 
+                                 EMBJOPR_TEST_ADAPTER);
+     }
+     
+     /**
+      * Test Name: testDeleteTxConnectionFactoryUsingExistingDSFile
+      * Assertion: Verify the ability to delete a TxConnectionFactory. 
+      * 
+      * Strategy: Delete a Tx ConnectionFactory that already exists. 
+      * The resource adaptor should remain deployed. 
+      */
+     public void testDeleteTxConnectionFactoryUsingExistingDSFile() throws Exception {
+         String jndiName = "DeleteTxCFExistingFile";
+
+         expandNavTreeArrow(CF_NAV_LABEL);
+         deleteConnFactoryCommon(jndiName, CFType.LOCAL_TX_CF, LOCAL_TX_COMPONENT_TYPE, 
+                                 EMBJOPR_TEST_ADAPTER);  
+     }
+     
+     /**
+      * Test Name: testDeleteNoTxConnectionFactory
+      * Assertion: Verify the ability to delete a No Tx ConnectionFactory. 
+      * 
+      * Strategy: Create a No Tx ConnectionFactory and then delete it. The resource adaptor
+      * should remain deployed.  
+      */
+     public void testDeleteNoTxConnectionFactory() throws Exception {
+         String jndiName = "DeleteNoTxConnFactory";
+
+         createNoTxConnFactory(jndiName);
+         deleteConnFactoryCommon(jndiName, CFType.NO_TX_CF, NO_TX_COMPONENT_TYPE, 
+                                 EMBJOPR_TEST_ADAPTER);
+     }
+     
+     /**
+      * Test Name: testDeleteNoTxConnectionFactoryUsingExistingDSFile
+      * Assertion: Verify the ability to delete a No Tx ConnectionFactory. 
+      * 
+      * Strategy: Delete a No Tx ConnectionFactory that already exists. 
+      * The resource adaptor should remain deployed.
+      */
+     public void testDeleteNoTxConnectionFactoryUsingExistingDSFile() throws Exception {
+         String jndiName = "DeleteNoTxCFExistingFile";
+
+         expandNavTreeArrow(CF_NAV_LABEL);
+         deleteConnFactoryCommon(jndiName, CFType.NO_TX_CF, NO_TX_COMPONENT_TYPE, 
+                                 EMBJOPR_TEST_ADAPTER);  
+     }
+     
+     /**
+      * Common code for the testDelete* tests.
+      */
+     public void deleteConnFactoryCommon(String jndiName, 
+                                         CFType cfType, 
+                                         ComponentType componentType,
+                                         String resourceAdaptorName) throws Exception {
+         deleteConnFactory(cfType, jndiName);
+         
+         // Check for the appropriate success messages
+         String expectedMessage = DELETE_MESSAGE + cfType.getName() + " '" + jndiName + "'";
+         checkClientAndServerMessages(expectedMessage, expectedMessage, false);
+         
+         // Make sure the resource adaptor is still deployed
+         assertTrue("The resource adaptor is no longer deployed (isDeployed() returned false).",
+                    isDeployed(resourceAdaptorName));
+         
+         // Make sure the ManagedComponent was removed
+         assertNull("The connection factory was not removed after deletion (the ManagedComponent is non-null)",
+                    getManagedComponent(jndiName, componentType));
+         
+         // The entry should still be found in the -ds.xml file
+         assertTrue("The connection factory was removed from the -ds.xml file",
+                    containsElement(getConnFactoryConfigFile(jndiName),
+                                    cfType.getXmlElementName(),
+                                    CF_ROOT_ELEMENT));
+     }
+
+     /**
+      * @return the suite of tests being tested
+      */
+     public static Test suite() {
+         return new TestSuite(ConnFactoryDeletionTest.class);
+     }
+}

Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryMetricsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryMetricsTest.java	                        (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryMetricsTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,354 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit.as5.connfactories;
+
+import org.jboss.jopr.jsfunit.*;
+import com.gargoylesoftware.htmlunit.html.*;
+import java.io.*;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.jopr.jsfunit.exceptions.*;
+import org.jboss.jopr.jsfunit.as5.ResourceTestBase;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.LinkedHashMap;
+import javax.resource.cci.ConnectionFactory;
+import javax.resource.cci.Connection;
+
+/**
+ * This class contains metrics tests for Connection Factories.
+ * This test class should be run against JBoss AS 5.
+ * 
+ * @author Farah Juma
+ */
+
+public class ConnFactoryMetricsTest extends ConnFactoryTest {
+   
+    /**
+     * Test Name: testTxConnectionFactoryMetricsAfterCreation
+     * Assertion: Verify that the metrics are correct after creating a new
+     * Tx Connection Factory. 
+     */
+    public void testMetricsAfterTxConnectionFactoryCreation() throws Exception {
+        String jndiName = "MetricsCreateTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+
+        checkMetricsAfterConnectionFactoryCreation(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryMetricsAfterCreation
+     * Assertion: Verify that the metrics are correct after creating a new
+     * No Tx Connection Factory. 
+     */
+    public void testMetricsAfterNoTxConnectionFactoryCreation() throws Exception {
+        String jndiName = "MetricsCreateNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+
+        checkMetricsAfterConnectionFactoryCreation(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Common code for the creation tests.
+     */
+    protected void checkMetricsAfterConnectionFactoryCreation(String jndiName, CFType cfType) throws Exception {
+        
+        // Set up the expected values
+        Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+        expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "20");
+        expectedMetrics.put(CONNECTION_COUNT, "0");
+        expectedMetrics.put(CONNECTION_CREATED_COUNT, "0");
+        expectedMetrics.put(CONNECTION_DESTROYED_COUNT, "0");
+        expectedMetrics.put(IN_USE_CONNECTION_COUNT, "0");
+        expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "0");
+        expectedMetrics.put(MAX_SIZE, "20");
+        expectedMetrics.put(MIN_SIZE, "5"); 
+
+        checkConnFactoryMetrics(jndiName, expectedMetrics, cfType, null);
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryMetricsAfterInitialConnection
+     * Assertion: Verify that the metrics for Tx Connection Factories 
+     * are correct after requesting a connection.
+     */
+    public void testTxConnectionFactoryMetricsAfterInitialConnection() throws Exception {
+        String jndiName = "MetricsInitialConnectionTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactoryWithPrefill(jndiName, Boolean.FALSE);;
+        
+        checkMetricsAfterInitialConnection(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryMetricsAfterInitialConnectionUsingExistingDSFile
+     * Assertion: Verify that the metrics for Tx Connection Factories are correct after 
+     * requesting a connection. Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryMetricsAfterInitialConnectionUsingExistingDSFile() throws Exception {
+        
+        // Use an existing connection factory
+        String jndiName = "MetricsTxCFInitialConnectionExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        checkMetricsAfterInitialConnection(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryMetricsAfterInitialConnection
+     * Assertion: Verify that the metrics for No Tx Connection Factories 
+     * are correct after requesting a connection.
+     */
+    public void testNoTxConnectionFactoryMetricsAfterInitialConnection() throws Exception {
+        String jndiName = "MetricsInitialConnectionNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactoryWithPrefill(jndiName, Boolean.FALSE);;
+        
+        checkMetricsAfterInitialConnection(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryMetricsAfterInitialConnectionUsingExistingDSFile
+     * Assertion: Verify that the metrics for No Tx Connection Factories are correct after 
+     * requesting a connection. Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryMetricsAfterInitialConnectionUsingExistingDSFile() throws Exception {
+        
+        // Use an existing connection factory
+        String jndiName = "MetricsNoTxCFInitialConnectionExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        checkMetricsAfterInitialConnection(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Common code for the test*ConnectionFactoryMetricsAfterInitialConnection* tests.
+     */
+    private void checkMetricsAfterInitialConnection(String jndiName, CFType cfType) throws Exception {
+
+        // Create the first connection
+        ArrayList<Connection> connections = createConnections(1, jndiName);
+
+        // Set up the expected values
+        Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+        expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "19");
+        expectedMetrics.put(CONNECTION_COUNT, "5");
+        expectedMetrics.put(CONNECTION_CREATED_COUNT, "5");
+        expectedMetrics.put(CONNECTION_DESTROYED_COUNT, "0");
+        expectedMetrics.put(IN_USE_CONNECTION_COUNT, "1");
+        expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "1");
+        expectedMetrics.put(MAX_SIZE, "20");
+        expectedMetrics.put(MIN_SIZE, "5"); 
+
+        checkConnFactoryMetrics(jndiName, expectedMetrics, cfType, connections);
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryMetricsAfterMultipleConnections
+     * Assertion: Verify that the metrics for Tx Connection Factories are correct 
+     * after requesting multiple connections.
+     */
+    public void testTxConnectionFactoryMetricsAfterMultipleConnections() throws Exception {
+        String jndiName = "MetricsMultipleConnectionsTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+        
+        checkMetricsAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryMetricsAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the metrics for Tx Connection Factories are correct after 
+     * requesting multiple connections. Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryMetricsAfterMutlipleConnectionsUsingExistingDSFile() throws Exception {
+        
+        // Use an existing connection factory
+        String jndiName = "MetricsTxCFMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        checkMetricsAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryMetricsAfterMultipleConnections
+     * Assertion: Verify that the metrics for No Tx Connection Factories are correct 
+     * after requesting multiple connections.
+     */
+    public void testNoTxConnectionFactoryMetricsAfterMultipleConnections() throws Exception {
+        String jndiName = "MetricsMultipleConnectionsNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+        
+        checkMetricsAfterMultipleConnections(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryMetricsAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the metrics for No Tx Connection Factories are correct after 
+     * requesting multiple connections. Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryMetricsAfterMutlipleConnectionsUsingExistingDSFile() throws Exception {
+        
+        // Use an existing connection factory
+        String jndiName = "MetricsNoTxCFMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        checkMetricsAfterMultipleConnections(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Common code for the test*ConnectionFactoryMetricsAfterMultipleConnections* tests.
+     */
+    private void checkMetricsAfterMultipleConnections(String jndiName, CFType cfType) throws Exception {
+
+        // Create multiple connections
+        ArrayList<Connection> connections = createConnections(6, jndiName);
+
+        // Set up the expected values
+        Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+        expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "14");
+        expectedMetrics.put(CONNECTION_COUNT, "6");
+        expectedMetrics.put(CONNECTION_CREATED_COUNT, "6");
+        expectedMetrics.put(CONNECTION_DESTROYED_COUNT, "0");
+        expectedMetrics.put(IN_USE_CONNECTION_COUNT, "6");
+        expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "6");
+        expectedMetrics.put(MAX_SIZE, "20");
+        expectedMetrics.put(MIN_SIZE, "5");
+
+        checkConnFactoryMetrics(jndiName, expectedMetrics, cfType, connections);
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryMetricsAfterClosingConnections
+     * Assertion: Verify that the metrics for Tx Connection Factories are 
+     * correct after requesting multiple connections and then closing some of them.
+     */
+    public void testTxConnectionFactoryMetricsAfterClosingConnections() throws Exception {
+        String jndiName = "MetricsCloseConnectionsTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+        
+        checkMetricsAfterClosingConnections(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryMetricsAfterClosingConnectionsUsingExistingDSFile
+     * Assertion: Verify that the metrics for Tx Connection Factories are correct after 
+     * requesting multiple connections and then closing some of them. 
+     * Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryMetricsAfterClosingConnectionsUsingExistingDSFile() throws Exception {
+        
+        // Use an existing connection factory
+        String jndiName = "MetricsTxCFClosingConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        checkMetricsAfterClosingConnections(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryMetricsAfterClosingConnections
+     * Assertion: Verify that the metrics for No Tx Connection Factories are 
+     * correct after requesting multiple connections and then closing some of them.
+     */
+    public void testNoTxConnectionFactoryMetricsAfterClosingConnections() throws Exception {
+        String jndiName = "MetricsCloseConnectionsNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+        
+        checkMetricsAfterClosingConnections(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryMetricsAfterClosingConnectionsUsingExistingDSFile
+     * Assertion: Verify that the metrics for No Tx Connection Factories are correct after 
+     * requesting multiple connections and then closing some of them. 
+     * Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryMetricsAfterClosingConnectionsUsingExistingDSFile() throws Exception {
+        
+        // Use an existing connection factory
+        String jndiName = "MetricsNoTxCFClosingConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        checkMetricsAfterClosingConnections(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Common code for the test*ConnectionFactoryMetricsAfterMultipleConnections* tests.
+     */
+    private void checkMetricsAfterClosingConnections(String jndiName, CFType cfType) throws Exception {
+
+        // Create multiple connections
+        ArrayList<Connection> connections = createConnections(10, jndiName);
+        
+        // Close some connections
+        for(int i = 0; i < 2; i++) {
+            connections.get(i).close();
+            connections.set(i, null);
+        }
+
+        // Set up the expected values
+        Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+        expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "12"); 
+        expectedMetrics.put(CONNECTION_COUNT, "10");          
+        expectedMetrics.put(CONNECTION_CREATED_COUNT, "10");    
+        expectedMetrics.put(CONNECTION_DESTROYED_COUNT, "0");   
+        expectedMetrics.put(IN_USE_CONNECTION_COUNT, "8");     
+        expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "10");
+        expectedMetrics.put(MAX_SIZE, "20");
+        expectedMetrics.put(MIN_SIZE, "5");
+        
+        checkConnFactoryMetrics(jndiName, expectedMetrics, cfType, connections);
+    }
+      
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite() {
+        return new TestSuite(ConnFactoryMetricsTest.class);
+    }
+}

Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java	                        (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,730 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit.as5.connfactories;
+
+import org.jboss.jopr.jsfunit.*;
+import com.gargoylesoftware.htmlunit.html.*;
+import java.io.*;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.jopr.jsfunit.exceptions.*;
+import org.jboss.jopr.jsfunit.as5.ResourceTestBase;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.LinkedHashMap;
+import javax.resource.cci.ConnectionFactory;
+import javax.resource.cci.Connection;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.managed.api.ComponentType;
+
+/**
+ * This class contains operations tests for Connection Factories.
+ * This test class should be run against JBoss AS 5.
+ * 
+ * @author Farah Juma
+ */
+
+public class ConnFactoryOperationsTest extends ConnFactoryTest {
+   
+    /* 
+     * OPERATION #1 - FLUSH
+     * Applies to both Tx and No Tx Connection Factories.
+     */
+    
+    /**
+     * Test Name: testTxConnectionFactoryFlushOperationAfterCreation
+     * Assertion: Verify that the metrics for Tx Connection Factories 
+     * are correct after executing the "Flush" operation on a newly created 
+     * connection factory.
+     */
+    public void testTxConnectionFactoryFlushOperationAfterCreation() throws Exception { 
+        String jndiName = "FlushAfterTxCFCreation";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+
+        performFlushAfterCreation(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryFlushOperationAfterCreation
+     * Assertion: Verify that the metrics for No Tx Connection Factories 
+     * are correct after executing the "Flush" operation on a newly created 
+     * connection factory.
+     */
+    public void testNoTxConnectionFactoryFlushOperationAfterCreation() throws Exception { 
+        String jndiName = "FlushAfterNoTxCFCreation";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+
+        performFlushAfterCreation(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Common code for the test*ConnectionFactoryFlushOperationAfterCreation tests.
+     */
+    private void performFlushAfterCreation(String jndiName, 
+                                           CFType cfType) throws Exception {
+        
+        // Make sure the metrics are updated appropriately
+        Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+        expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "20");
+        expectedMetrics.put(CONNECTION_COUNT, "0"); 
+        expectedMetrics.put(CONNECTION_CREATED_COUNT, "0");
+        expectedMetrics.put(CONNECTION_DESTROYED_COUNT, "0");
+        expectedMetrics.put(IN_USE_CONNECTION_COUNT, "0");
+        expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "0");
+        expectedMetrics.put(MAX_SIZE, "20");
+        expectedMetrics.put(MIN_SIZE, "5");
+
+        performConnFactoryOperationAndCheckMetrics(cfType, jndiName, FLUSH, expectedMetrics,
+                                                   null);
+        
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryFlushOperationAfterMultipleConnections
+     * Assertion: Verify that the metrics for Tx Connection Factories are correct 
+     * after executing the "Flush" operation when there are multiple connections.
+     */
+    public void testTxConnectionFactoryFlushOperationAfterMultipleConnections() throws Exception { 
+        String jndiName = "FlushAfterMultipleConnectionsTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+
+        performFlushAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF);   
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryFlushOperationAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the metrics for Tx Connection Factories are 
+     * correct after executing the "Flush" operation when there are multiple 
+     * connections. Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryFlushOperationAfterMultipleConnectionsUsingExistingDSFile() throws Exception {
+        String jndiName = "FlushTxCFAfterMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performFlushAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryFlushOperationAfterMultipleConnections
+     * Assertion: Verify that the metrics for No Tx Connection Factories are correct 
+     * after executing the "Flush" operation when there are multiple connections.
+     */
+    public void testNoTxConnectionFactoryFlushOperationAfterMultipleConnections() throws Exception { 
+        String jndiName = "FlushAfterMultipleConnectionsNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+
+        performFlushAfterMultipleConnections(jndiName, CFType.NO_TX_CF);   
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryFlushOperationAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the metrics for No Tx Connection Factories are 
+     * correct after executing the "Flush" operation when there are multiple 
+     * connections. Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryFlushOperationAfterMultipleConnectionsUsingExistingDSFile() throws Exception {
+        String jndiName = "FlushNoTxCFAfterMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performFlushAfterMultipleConnections(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Common code for the testConnectionFactoryFlushOperationAfterMultipleConnections* tests.
+     */
+    private void performFlushAfterMultipleConnections(String jndiName, CFType cfType) throws Exception {
+        
+        // Create some connections and then close them. This will
+        // result in non-zero values for "Connection Created Count" and
+        // "Max Connections In Use Count".
+        ArrayList<Connection> connections = createConnections(5, jndiName); 
+        closeConnections(connections); 
+        
+        // Make sure the metrics are updated appropriately
+        Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+        expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "20");
+        expectedMetrics.put(CONNECTION_COUNT, "0"); 
+        expectedMetrics.put(CONNECTION_CREATED_COUNT, "0");
+        expectedMetrics.put(CONNECTION_DESTROYED_COUNT, "0");
+        expectedMetrics.put(IN_USE_CONNECTION_COUNT, "0");
+        expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "0");
+        expectedMetrics.put(MAX_SIZE, "20");
+        expectedMetrics.put(MIN_SIZE, "5");   
+
+        performConnFactoryOperationAndCheckMetrics(cfType, jndiName, FLUSH, expectedMetrics,
+                                                   connections);
+    }
+    
+    /* 
+     * OPERATION #2 - LIST FORMATTED SUB POOL STATISTICS
+     * Applies to both Tx and No Tx Connection Factories.
+     */
+    
+    /**
+     * Test Name: testTxConnectionFactoryListFormattedSubPoolStatisticsAfterCreation
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation on a newly
+     * created Tx Connection Factory.
+     */
+    public void testTxConnectionFactoryListFormattedSubPoolStatisticsAfterCreation() throws Exception {
+        String jndiName = "ListFormattedSubPoolStatisticsAfterTxCFCreation";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+
+        performListFormattedSubPoolStatisticsAfterCreation(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterCreation
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation on a newly
+     * created No Tx Connection Factory.
+     */
+    public void testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterCreation() throws Exception {
+        String jndiName = "ListFormattedSubPoolStatisticsAfterNoTxCFCreation";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+
+        performListFormattedSubPoolStatisticsAfterCreation(jndiName, CFType.NO_TX_CF);
+    }
+    
+    /**
+     * Common code for the 
+     * test*ConnectionFactoryListFormattedSubPoolStatisticsAfterCreation tests.
+     */
+    private void performListFormattedSubPoolStatisticsAfterCreation(String jndiName,
+                                                                    CFType cfType) throws Exception {
+        // Set up the expected results
+        StringBuffer expectedBuffer = new StringBuffer();
+        expectedBuffer.append("Sub Pool Statistics: \n");
+        expectedBuffer.append("Sub Pool Count: 0\n");
+        expectedBuffer.append(POOL_SEPARATOR);
+        expectedBuffer.append("\n\n");
+        
+        String errorMessage = "Incorrect sub pool statistics";
+
+        performResourceOperationAndCheckValueBox(CF_NAV_LABEL, cfType.getLabel(),
+                                                 jndiName, LIST_FORMATTED_SUB_POOL_STATISTICS,
+                                                 Boolean.TRUE, expectedBuffer, errorMessage);
+        
+        // Clean up
+        deleteConnFactory(cfType, jndiName);
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a Tx Connection
+     * Factory when there are multiple connections.
+     */
+    public void testTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnections() throws Exception {
+        String jndiName = "ListFormattedSubPoolStatisticsAfterMultipleConnectionsTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+
+        performListFormattedSubPoolStatisticsAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF);   
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a Tx Connection 
+     * Factory when there are multiple connections. Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnectionsUsingExistingDSFile() 
+        throws Exception {
+        String jndiName = "ListFormattedTxCFAfterMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListFormattedSubPoolStatisticsAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a No Tx Connection
+     * Factory when there are multiple connections.
+     */
+    public void testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnections() throws Exception {
+        String jndiName = "ListFormattedSubPoolStatisticsAfterMultipleConnectionsNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+
+        performListFormattedSubPoolStatisticsAfterMultipleConnections(jndiName, CFType.NO_TX_CF);   
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a No Tx Connection 
+     * Factory when there are multiple connections. Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnectionsUsingExistingDSFile() 
+        throws Exception {
+        String jndiName = "ListFormattedNoTxCFAfterMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListFormattedSubPoolStatisticsAfterMultipleConnections(jndiName, CFType.NO_TX_CF);
+    }
+
+    /**
+     * Common code for the 
+     * testConnectionFactoryListFormattedSubPoolStatisticsAfterMultipleConnections* tests.
+     */
+    private void performListFormattedSubPoolStatisticsAfterMultipleConnections(String jndiName,
+                                                                               CFType cfType) throws Exception {
+        
+        // Create some connections
+        ArrayList<Connection> connections = createConnections(6, jndiName); 
+        
+        try { 
+            
+            // Set up the expected results
+            StringBuffer expectedBuffer = new StringBuffer();
+            expectedBuffer.append("Sub Pool Statistics: \n");
+            expectedBuffer.append("Sub Pool Count: 1\n");
+            expectedBuffer.append(POOL_SEPARATOR);
+            expectedBuffer.append("\n\n");
+            
+            if(cfType == CFType.NO_TX_CF) {
+                expectedBuffer.append("Track By Transaction: false\n");
+            } else {
+                expectedBuffer.append("Track By Transaction: true\n");
+            }
+            expectedBuffer.append("Available Connections Count: 14\n");
+            expectedBuffer.append("Max Connections In Use Count:6\n");
+            expectedBuffer.append("Connections Destroyed Count:0\n");
+            expectedBuffer.append("Connections In Use Count:6\n");
+            
+            String errorMessage = "Incorrect sub pool statistics";
+
+            performResourceOperationAndCheckValueBox(CF_NAV_LABEL, cfType.getLabel(),
+                                                     jndiName, LIST_FORMATTED_SUB_POOL_STATISTICS,
+                                                     Boolean.TRUE, expectedBuffer, errorMessage);
+        } finally {
+            
+            // Clean up
+            closeConnections(connections);
+            deleteConnFactory(cfType, jndiName);
+        }
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a Tx Connection 
+     * Factory after closing connections.
+     */
+    public void testTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnections() throws Exception {
+        String jndiName = "ListFormattedSubPoolStatisticsAfterClosingConnectionsTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+
+        performListFormattedSubPoolStatisticsAfterClosingConnections(jndiName, CFType.LOCAL_TX_CF); 
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a Tx Connection Factory 
+     * after closing connections. Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnectionsUsingExistingDSFile() throws Exception {
+        String jndiName = "ListFormattedTxCFAfterClosingConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListFormattedSubPoolStatisticsAfterClosingConnections(jndiName, CFType.LOCAL_TX_CF); 
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a No Tx Connection 
+     * Factory after closing connections.
+     */
+    public void testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnections() throws Exception {
+        String jndiName = "ListFormattedSubPoolStatisticsAfterClosingConnectionsNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+
+        performListFormattedSubPoolStatisticsAfterClosingConnections(jndiName, CFType.NO_TX_CF); 
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Formatted Sub Pool Statistics" operation for a No Tx Connection Factory 
+     * after closing connections. Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnectionsUsingExistingDSFile() 
+        throws Exception {
+        
+        String jndiName = "ListFormattedNoTxCFAfterClosingConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListFormattedSubPoolStatisticsAfterClosingConnections(jndiName, CFType.NO_TX_CF); 
+    }
+    
+    /**
+     * Common code for the 
+     * testConnectionFactoryListFormattedSubPoolStatisticsAfterClosingConnections* tests.
+     */
+    private void performListFormattedSubPoolStatisticsAfterClosingConnections(String jndiName,
+                                                                              CFType cfType) throws Exception {
+        
+        // Create some connections
+        ArrayList<Connection> connections = createConnections(10, jndiName);
+        
+        try {
+            
+            // Close some connections
+            for(int i = 0; i < 2; i++) {
+                connections.get(i).close();
+                connections.set(i, null);
+            }
+            
+            // Set up the expected results
+            StringBuffer expectedBuffer = new StringBuffer();
+            expectedBuffer.append("Sub Pool Statistics: \n");
+            expectedBuffer.append("Sub Pool Count: 1\n");
+            expectedBuffer.append(POOL_SEPARATOR);
+            expectedBuffer.append("\n\n");
+            
+            if(cfType == CFType.NO_TX_CF) {
+                expectedBuffer.append("Track By Transaction: false\n");
+            } else {
+                expectedBuffer.append("Track By Transaction: true\n");
+            }
+            
+            expectedBuffer.append("Available Connections Count: 12\n");
+            expectedBuffer.append("Max Connections In Use Count:10\n");
+            expectedBuffer.append("Connections Destroyed Count:0\n");
+            expectedBuffer.append("Connections In Use Count:8");
+        
+            String errorMessage = "Incorrect sub pool statistics";
+
+            performResourceOperationAndCheckValueBox(CF_NAV_LABEL, cfType.getLabel(),
+                                                     jndiName, LIST_FORMATTED_SUB_POOL_STATISTICS,
+                                                     Boolean.TRUE, expectedBuffer, errorMessage);
+        } finally {
+            
+            // Clean up
+            closeConnections(connections);
+            deleteConnFactory(cfType, jndiName);
+        }
+    }
+    
+    /* 
+     * OPERATION #3 - LIST STATISTICS
+     * Applies to Tx and No Tx Connection Factories.
+     */
+     
+    /**
+     * Test Name: testTxConnectionFactoryListStatisticsAfterCreation
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation on a newly created Tx Connection Factory.
+     */
+    public void testTxConnectionFactoryListStatisticsAfterCreation() throws Exception {
+        String jndiName = "ListStatisticsTxCFAfterCreation";
+        
+        createTxConnFactory(jndiName);
+        
+        performListStatisticsAfterCreation(jndiName, CFType.LOCAL_TX_CF, LOCAL_TX_COMPONENT_TYPE);
+    } 
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListStatisticsAfterCreation
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation on a newly created No Tx Connection Factory.
+     */
+    public void testNoTxConnectionFactoryListStatisticsAfterCreation() throws Exception {
+        String jndiName = "ListStatisticsNoTxCFAfterCreation";
+        
+        createNoTxConnFactory(jndiName);
+        
+        performListStatisticsAfterCreation(jndiName, CFType.NO_TX_CF, NO_TX_COMPONENT_TYPE);
+    } 
+    
+    /**
+     * Common code for the test*ConnectionFactoryListStatisticsAfterCreation tests.
+     */
+    private void performListStatisticsAfterCreation(String jndiName, 
+                                                    CFType cfType, 
+                                                    ComponentType componentType) throws Exception {
+        // Set up the expectedStatistics
+        Map<String, String> expectedStatistics = formatListStatisticsResults(jndiName, 
+                                                                             componentType, 
+                                                                             listStatisticsProps);
+        
+        // Additional statistics that need to be checked
+        expectedStatistics.put("criteria", "ByApplication");
+        expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name=" 
+                               + jndiName);
+        expectedStatistics.put("subPoolCount", "0"); 
+        expectedStatistics.put("totalConnectionsInUseCount", "0");
+        expectedStatistics.put("totalMaxConnectionsInUseCount", "0");
+        
+        performResourceOperationAndCheckTable(CF_NAV_LABEL, cfType.getLabel(), jndiName,
+                                              LIST_STATISTICS, Boolean.FALSE, expectedStatistics);
+        
+        deleteConnFactory(cfType, jndiName);
+    }
+    
+    
+    /**
+     * Test Name: testTxConnectionFactoryListStatisticsAfterMultipleConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a Tx Connection Factory when 
+     * there are multiple connections.
+     */
+    public void testTxConnectionFactoryListStatisticsAfterMultipleConnections() throws Exception {
+        String jndiName = "ListStatisticsAfterMultipleConnectionsTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+        performListStatisticsAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF, 
+                                                      LOCAL_TX_COMPONENT_TYPE);   
+    } 
+    
+    /**
+     * Test Name: testTxConnectionFactoryListStatisticsAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a Tx Connection Factory when there 
+     * are multiple connections. Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryListStatisticsAfterMultipleConnectionsUsingExistingDSFile() throws Exception {
+        String jndiName = "ListStatisticsTxCFAfterMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListStatisticsAfterMultipleConnections(jndiName, CFType.LOCAL_TX_CF, 
+                                                      LOCAL_TX_COMPONENT_TYPE);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListStatisticsAfterMultipleConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a No Tx Connection Factory when 
+     * there are multiple connections.
+     */
+    public void testNoTxConnectionFactoryListStatisticsAfterMultipleConnections() throws Exception {
+        String jndiName = "ListStatisticsAfterMultipleConnectionsNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+        performListStatisticsAfterMultipleConnections(jndiName, CFType.NO_TX_CF, 
+                                                      NO_TX_COMPONENT_TYPE);   
+    } 
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListStatisticsAfterMultipleConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a No Tx Connection Factory when there 
+     * are multiple connections. Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryListStatisticsAfterMultipleConnectionsUsingExistingDSFile() throws Exception {
+        String jndiName = "ListStatisticsNoTxCFAfterMultipleConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListStatisticsAfterMultipleConnections(jndiName, CFType.NO_TX_CF, 
+                                                      NO_TX_COMPONENT_TYPE);
+    }
+
+    /**
+     * Common code for the
+     * testConnectionFactoryListStatisticsAfterMultipleConnections* tests.
+     */
+    private void performListStatisticsAfterMultipleConnections(String jndiName,
+                                                               CFType cfType,
+                                                               ComponentType componentType) throws Exception {
+        
+        // Create some connections
+        ArrayList<Connection> connections = createConnections(6, jndiName); 
+        
+        try { 
+            
+            // Set up the expectedStatistics
+            Map<String, String> expectedStatistics = formatListStatisticsResults(jndiName, 
+                                                                                 componentType, 
+                                                                                 listStatisticsProps);
+            
+            // Additional statistics that need to be checked
+            expectedStatistics.put("criteria", "ByApplication");
+            expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name=" 
+                                   + jndiName);
+            expectedStatistics.put("subPoolCount", "1"); 
+            expectedStatistics.put("totalConnectionsInUseCount", "6");
+            expectedStatistics.put("totalMaxConnectionsInUseCount", "6");
+              
+            performResourceOperationAndCheckTable(CF_NAV_LABEL, cfType.getLabel(), jndiName,
+                                                  LIST_STATISTICS, Boolean.FALSE, expectedStatistics);
+        } finally {
+            
+            // Clean up
+            closeConnections(connections);
+            deleteConnFactory(cfType, jndiName);
+        }
+    }
+    
+    /**
+     * Test Name: testTxConnectionFactoryListStatisticsAfterClosingConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a Tx Connection Factory after 
+     * requesting multiple connections and then closing some of them.
+     */
+    public void testTxConnectionFactoryListStatisticsAfterClosingConnections() throws Exception {
+        String jndiName = "ListStatisticsAfterClosingConnectionsTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createTxConnFactory(jndiName);
+
+        performListStatisticsAfterClosingConnections(jndiName, CFType.LOCAL_TX_CF, 
+                                                     LOCAL_TX_COMPONENT_TYPE); 
+    } 
+    
+    /**
+     * Test Name: testTxConnectionFactoryListStatisticsAfterClosingConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a Tx Connection Factory after requesting 
+     * multiple connections and then closing some of them. Use an existing -ds.xml file.
+     */
+    public void testTxConnectionFactoryListStatisticsAfterClosingConnectionsUsingExistingDSFile() throws Exception {
+        String jndiName = "ListStatisticsTxCFAfterClosingConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListStatisticsAfterClosingConnections(jndiName, CFType.LOCAL_TX_CF, 
+                                                     LOCAL_TX_COMPONENT_TYPE);
+    }
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListStatisticsAfterClosingConnections
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a No Tx Connection Factory after 
+     * requesting multiple connections and then closing some of them.
+     */
+    public void testNoTxConnectionFactoryListStatisticsAfterClosingConnections() throws Exception {
+        String jndiName = "ListStatisticsAfterClosingConnectionsNoTxCF";
+        
+        // Min pool size will be 5, max pool size will be 20
+        createNoTxConnFactory(jndiName);
+
+        performListStatisticsAfterClosingConnections(jndiName, CFType.NO_TX_CF, 
+                                                     NO_TX_COMPONENT_TYPE); 
+    } 
+    
+    /**
+     * Test Name: testNoTxConnectionFactoryListStatisticsAfterClosingConnectionsUsingExistingDSFile
+     * Assertion: Verify that the results are correct after executing 
+     * the "List Statistics" operation for a No Tx Connection Factory after requesting 
+     * multiple connections and then closing some of them. Use an existing -ds.xml file.
+     */
+    public void testNoTxConnectionFactoryListStatisticsAfterClosingConnectionsUsingExistingDSFile() throws Exception {
+        String jndiName = "ListStatisticsNoTxCFAfterClosingConnectionsExistingFile";
+        
+        expandNavTreeArrow(CF_NAV_LABEL);
+        
+        // Min pool size will be 5, max pool size will be 20
+        performListStatisticsAfterClosingConnections(jndiName, CFType.NO_TX_CF, 
+                                                     NO_TX_COMPONENT_TYPE);
+    }
+
+    /**
+     * Common code for the
+     * testConnectionFactoryListStatisticsAfterClosingConnections* tests.
+     */
+    private void performListStatisticsAfterClosingConnections(String jndiName,
+                                                              CFType cfType,
+                                                              ComponentType componentType) throws Exception {
+        
+        // Create some connections
+        ArrayList<Connection> connections = createConnections(10, jndiName); 
+        
+        try { 
+            
+            // Close some connections
+            for(int i = 0; i < 2; i++) {
+                connections.get(i).close();
+                connections.set(i, null);
+            }
+            
+            // Set up the expectedStatistics
+            Map<String, String> expectedStatistics = formatListStatisticsResults(jndiName, 
+                                                                                 componentType, 
+                                                                                 listStatisticsProps);
+            
+            // Additional statistics that need to be checked
+            expectedStatistics.put("criteria", "ByApplication");
+            expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name=" 
+                                   + jndiName);
+            expectedStatistics.put("subPoolCount", "1"); 
+            expectedStatistics.put("totalConnectionsInUseCount", "8");
+            expectedStatistics.put("totalMaxConnectionsInUseCount", "10");
+            
+            performResourceOperationAndCheckTable(CF_NAV_LABEL, cfType.getLabel(), jndiName,
+                                                  LIST_STATISTICS, Boolean.FALSE, expectedStatistics);
+        } finally {
+            
+            // Clean up
+            closeConnections(connections);
+            deleteConnFactory(cfType, jndiName);
+        }
+    }
+    
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite() {
+        return new TestSuite(ConnFactoryOperationsTest.class);
+    }
+}

Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryTest.java	                        (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,339 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit.as5.connfactories;
+
+import com.gargoylesoftware.htmlunit.html.*;
+import org.jboss.jopr.jsfunit.*;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.jopr.jsfunit.exceptions.*;
+import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
+import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.*;
+import org.jboss.jopr.jsfunit.as5.ResourceTestBase;
+import org.jboss.deployers.spi.management.KnownComponentTypes;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.IOException;
+import javax.resource.cci.ConnectionFactory;
+import javax.resource.cci.Connection;
+import javax.resource.ResourceException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * This class is the base test class for configuring Connection Factories 
+ * with JBoss AS 5.
+ */
+
+/**
+ * 
+ * @author Shelly McGowan
+ * @author Farah Juma
+ *
+ */
+public abstract class ConnFactoryTest extends ResourceTestBase {
+
+    public enum CFType {
+
+        NO_TX_CF("No Tx ConnectionFactories", NO_TXCF_DEFAULT_TEMPLATE, 
+                 "No Tx ConnectionFactory", "no-tx-connection-factory"),
+        LOCAL_TX_CF("Tx ConnectionFactories", TXCF_LOCAL_TEMPLATE, 
+                    "Tx ConnectionFactory", "tx-connection-factory"),
+        XA_TX_CF("Tx ConnectionFactories", TXCF_XA_TEMPLATE, 
+                 "Tx ConnectionFactory", "tx-connection-factory"),
+        DEFAULT_TX_CF("Tx ConnectionFactories", TXCF_DEFAULT_TEMPLATE, 
+                      "Tx ConnectionFactory", "tx-connection-factory");
+
+        public final String label;
+        public final String templateName;
+        public final String name;
+        public final String xmlElementName;
+
+        CFType(String label, String templateName, String name, String xmlElementName)
+        {
+            this.label = label;
+            this.templateName = templateName;
+            this.name = name;
+            this.xmlElementName = xmlElementName;
+        }
+
+        public String getLabel()
+        {
+            return this.label;
+        }
+
+        public String getTemplateName()
+        {
+            return this.templateName;
+        }
+        
+        public String getName()
+        {
+            return this.name;
+        }
+        
+        public String getXmlElementName()
+        {
+            return this.xmlElementName;
+        }
+
+    }
+
+    // Component Types 
+    public static final ComponentType LOCAL_TX_COMPONENT_TYPE = KnownComponentTypes.ConnectionFactoryTypes.Tx.getType();
+    public static final ComponentType NO_TX_COMPONENT_TYPE = KnownComponentTypes.ConnectionFactoryTypes.NoTx.getType();
+    public static final ComponentType XA_COMPONENT_TYPE = KnownComponentTypes.ConnectionFactoryTypes.Tx.getType();
+
+
+    // Constants 
+    public static final String TXCF_DEFAULT_TEMPLATE="default__Tx ConnectionFactory";
+    public static final String TXCF_LOCAL_TEMPLATE="Local Transaction__Tx ConnectionFactory";
+    public static final String TXCF_XA_TEMPLATE="XA Transaction__Tx ConnectionFactory";
+    public static final String NO_TXCF_DEFAULT_TEMPLATE="default__No Tx ConnectionFactory";
+
+    public static final String CF_NAV_LABEL="Connection Factories";
+    
+    public static final String EMBJOPR_TEST_ADAPTER = "embjoprtestadapter.rar";
+    public static final String TEST_CONNECTION_DEFINITION = "javax.resource.cci.ConnectionFactory";
+    
+    // The root element in a connection factory -ds.xml file
+    public static final String CF_ROOT_ELEMENT = "connection-factories";
+
+    /**
+     * Create a new connection factory using the given type and properties.
+     */
+    protected void createConnFactory(CFType cfType,
+                                     Map<String, MetaValue> propertiesMap)
+					 throws IOException, EmbJoprTestException {
+        expandNavTreeArrow(CF_NAV_LABEL);
+        createResource(cfType.getLabel(), cfType.getTemplateName(),
+                       propertiesMap);
+    }
+
+    /**
+     * Delete the connection factory given by name.
+     */
+    protected void deleteConnFactory(CFType cfType,
+                                     String connFactoryName) throws IOException,
+                                     HtmlElementNotFoundException, EmbJoprTestException {
+        clickNavTreeLink(cfType.getLabel());
+        deleteResource(RESOURCE_SUMMARY_FORM, connFactoryName);
+    }
+    
+    /**
+     * Create a basic No Tx Connection Factory.
+     */
+    protected Map<String, MetaValue> createNoTxConnFactory(String jndiName) throws IOException, 
+                                                                                   EmbJoprTestException {
+        return createNoTxConnFactoryWithPrefill(jndiName, Boolean.TRUE);
+    }
+    
+    /**
+     * Create a basic Tx Connection Factory.
+     */
+    protected Map<String, MetaValue> createTxConnFactory(String jndiName) throws IOException, 
+                                                                                 EmbJoprTestException {
+        return createTxConnFactoryWithPrefill(jndiName, Boolean.TRUE);
+    }
+    
+    /**
+     * Create a basic Tx Connection Factory. Set "prefill" to the given boolean
+     * value. This method is used during the metrics/operations tests.
+     */
+    protected Map<String, MetaValue> createTxConnFactoryWithPrefill(String jndiName,
+                                                                    boolean prefill) 
+                                                                    throws IOException, 
+                                                                    EmbJoprTestException {
+        Map<String, MetaValue> propertiesMap = new HashMap<String, MetaValue>();
+        
+        propertiesMap.put("jndi-name", SimpleValueSupport.wrap(jndiName));
+        propertiesMap.put("rar-name", SimpleValueSupport.wrap(EMBJOPR_TEST_ADAPTER));
+        propertiesMap.put("connection-definition", SimpleValueSupport.wrap(TEST_CONNECTION_DEFINITION));
+        propertiesMap.put("min-pool-size", SimpleValueSupport.wrap(new Integer(5)));
+        propertiesMap.put("max-pool-size", SimpleValueSupport.wrap(new Integer(20)));
+        propertiesMap.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(0)));
+        propertiesMap.put("prefill", SimpleValueSupport.wrap(prefill));
+        propertiesMap.put("idle-timeout-minutes", SimpleValueSupport.wrap(new Integer(60)));
+        propertiesMap.put("allocation-retry", SimpleValueSupport.wrap(new Integer(10)));
+        propertiesMap.put("track-connection-by-tx", SimpleValueSupport.wrap(Boolean.TRUE));
+        propertiesMap.put("use-java-context", SimpleValueSupport.wrap(Boolean.TRUE));
+        propertiesMap.put("no-tx-separate-pools", SimpleValueSupport.wrap(Boolean.FALSE));
+        propertiesMap.put("blocking-timeout-millis", SimpleValueSupport.wrap(new Integer(30000)));
+        propertiesMap.put("securityDeploymentType", SimpleValueSupport.wrap("APPLICATION"));
+        
+        createConnFactory(CFType.LOCAL_TX_CF, propertiesMap);
+        client.click(SAVE_BUTTON);
+        
+        return propertiesMap;
+    }
+    
+    /**
+     * Create a basic No Tx Connection Factory.
+     */
+    protected Map<String, MetaValue> createNoTxConnFactoryWithPrefill(String jndiName,
+                                                                      boolean prefill) 
+                                                                      throws IOException, 
+                                                                             EmbJoprTestException {
+        Map<String, MetaValue> propertiesMap = new HashMap<String, MetaValue>();
+        
+        propertiesMap.put("jndi-name", SimpleValueSupport.wrap(jndiName));
+        propertiesMap.put("rar-name", SimpleValueSupport.wrap(EMBJOPR_TEST_ADAPTER));
+        propertiesMap.put("connection-definition", SimpleValueSupport.wrap(TEST_CONNECTION_DEFINITION));
+        propertiesMap.put("min-pool-size", SimpleValueSupport.wrap(new Integer(5)));
+        propertiesMap.put("max-pool-size", SimpleValueSupport.wrap(new Integer(20)));
+        propertiesMap.put("idle-timeout-minutes", SimpleValueSupport.wrap(new Integer(20)));
+        propertiesMap.put("prefill", SimpleValueSupport.wrap(prefill));
+        propertiesMap.put("use-java-context", SimpleValueSupport.wrap(Boolean.TRUE));
+        propertiesMap.put("securityDeploymentType", SimpleValueSupport.wrap("APPLICATION"));
+        
+        createConnFactory(CFType.NO_TX_CF, propertiesMap);
+        client.click(SAVE_BUTTON);
+        
+        return propertiesMap;
+    }
+     
+    /**
+     * Lookup the given ConnectionFactory and then create the
+     * given number of connections.
+     */
+    public ArrayList<Connection> createConnections(int numConnections, 
+                                                   String jndiName) throws NamingException, ResourceException {
+        ArrayList<Connection> connections = new ArrayList<Connection>();
+        
+        InitialContext ctx = new InitialContext();
+        ConnectionFactory cf = (ConnectionFactory)ctx.lookup("java:" + jndiName);
+        
+        for(int i = 0; i < numConnections; i++) {
+            Connection con = cf.getConnection();
+        
+            // Actually exercise the connection
+            con.getMetaData();
+            
+            assertNotNull("Null connection", con);
+            connections.add(con);
+        }
+        
+        return connections;
+    }
+
+    /**
+     * Close each Connection in the given ArrayList of Connections.
+     */
+    public void closeConnections(ArrayList<Connection> connections) throws ResourceException {
+        if(connections != null) {
+            for(int i = 0; i < connections.size(); i++) {
+                if(connections.get(i) != null) {
+                    connections.get(i).close();
+                }
+            }
+        }
+    }
+    
+    /**
+     * Creates the default properties for the connection factory.
+     * Returns a map of String names to MetaValues.
+     */
+    protected Map<String, MetaValue> createConnFactoryPropertiesAsMetaValues(String jndiName) {
+
+        Map<String, MetaValue> propertiesMap = new LinkedHashMap<String, MetaValue>();
+
+        propertiesMap.put("jndi-name", SimpleValueSupport.wrap(jndiName));
+        propertiesMap.put("rar-name", SimpleValueSupport.wrap(EMBJOPR_TEST_ADAPTER));
+        propertiesMap.put("connection-definition", SimpleValueSupport.wrap(TEST_CONNECTION_DEFINITION));
+        propertiesMap.put("min-pool-size", SimpleValueSupport.wrap(new Integer(5)));
+        propertiesMap.put("max-pool-size", SimpleValueSupport.wrap(new Integer(20)));
+        propertiesMap.put("prefill", SimpleValueSupport.wrap(Boolean.TRUE));
+        propertiesMap.put("idle-timeout-minutes", SimpleValueSupport.wrap(new Integer(60)));
+        propertiesMap.put("allocation-retry", SimpleValueSupport.wrap(new Integer(10)));
+        propertiesMap.put("use-java-context", SimpleValueSupport.wrap(Boolean.TRUE));
+        propertiesMap.put("no-tx-separate-pools", SimpleValueSupport.wrap(Boolean.FALSE));
+
+        return propertiesMap;
+    }
+    
+    /**
+     * Get the list of metrics that appear on the summary
+     * page for connection factories.
+     */
+    protected ArrayList<String> getConnFactorySummaryMetrics() {
+        ArrayList<String> connFactorySummaryMetrics = new ArrayList<String>();
+        
+        // The metrics we need to check on the summary tab
+        // TODO: add the summary page metrics that need to be checked -
+        // currently no summary metrics are displayed on the page (EMBJOPR-90)
+        
+        return connFactorySummaryMetrics;
+    }
+    
+    /**
+     * Check that the metrics for the given connection factory are correct.
+     */
+    protected void checkConnFactoryMetrics(String jndiName,
+                                           Map<String, String> expectedMetrics,
+                                           CFType cfType,
+                                           ArrayList<Connection> connections) throws Exception {
+        try {
+            checkResourceMetrics(CF_NAV_LABEL, cfType.getLabel(), 
+                                 jndiName, expectedMetrics, getConnFactorySummaryMetrics());
+        } finally {
+            
+            // Clean up
+            closeConnections(connections);
+            deleteConnFactory(cfType, jndiName); 
+        }
+    }
+    
+    /**
+     * Perform the given operation on the given connection factory and then
+     * verify that the metrics are correct.
+     */
+    protected void performConnFactoryOperationAndCheckMetrics(CFType cfType, 
+                                                              String jndiName,
+                                                              String operationName,
+                                                              Map<String, String> expectedMetrics,
+                                                              ArrayList<Connection> connections) throws Exception {
+        try {
+            performResourceOperationAndCheckMetrics(CF_NAV_LABEL, cfType.getLabel(), 
+                                                    jndiName, operationName, expectedMetrics,
+                                                    getConnFactorySummaryMetrics(), Boolean.FALSE);  
+        } finally {
+            
+            // Clean up
+            closeConnections(connections);
+            deleteConnFactory(cfType, jndiName);
+        }
+    }
+    
+    /**
+     * Get the name of the -ds.xml file that corresponds to the connection 
+     * factory given by jndiName.
+     */
+    protected String getConnFactoryConfigFile(String jndiName) {
+        return System.getProperty("jsfunit.deploy.dir") + "/" + jndiName + "-ds.xml";
+    }
+}

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceConfigurationTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceConfigurationTest.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceConfigurationTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -140,7 +140,6 @@
         enableOrDisableFormInput("user-name", Boolean.FALSE, RESOURCE_CONFIGURATION_FORM);
         enableOrDisableFormInput("idle-timeout-minutes", Boolean.FALSE, RESOURCE_CONFIGURATION_FORM);
         enableOrDisableFormInput("track-connection-by-tx", Boolean.FALSE, RESOURCE_CONFIGURATION_FORM);
-        enableOrDisableFormInput("domain", Boolean.FALSE, RESOURCE_CONFIGURATION_FORM);
         client.click(SAVE_BUTTON);
 
         // Check for the appropriate success messages

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceDeletionTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceDeletionTest.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceDeletionTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -123,8 +123,9 @@
         
         // The entry should still be found in the -ds.xml file
         assertTrue("The datasource was removed from the -ds.xml file",
-                   containsElement(propertiesMap.get("jndi-name"),
-                                   datasourceType.getXmlElementName()));
+                   containsElement(getDatasourceConfigFile(propertiesMap.get("jndi-name")),
+                                   datasourceType.getXmlElementName(),
+                                   DS_ROOT_ELEMENT));
     }
     
     /**

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceMetricsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceMetricsTest.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceMetricsTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -222,7 +222,7 @@
     private void checkMetricsAfterClosingConnections(Map<String, String> propertiesMap) throws Exception {
         
         // Establish some connections
-        ArrayList<Connection> connections = createConnections(5, propertiesMap.get("jndi-name"),
+        ArrayList<Connection> connections = createConnections(10, propertiesMap.get("jndi-name"),
                                                               propertiesMap.get("user-name"), 
                                                               propertiesMap.get("password"));
 
@@ -236,12 +236,12 @@
       
             // Set up the expected values
             Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
-            expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "17"); 
-            expectedMetrics.put(CONNECTION_COUNT, "5");          
-            expectedMetrics.put(CONNECTION_CREATED_COUNT, "5");    
+            expectedMetrics.put(AVAILABLE_CONNECTION_COUNT, "12"); 
+            expectedMetrics.put(CONNECTION_COUNT, "10");          
+            expectedMetrics.put(CONNECTION_CREATED_COUNT, "10");    
             expectedMetrics.put(CONNECTION_DESTROYED_COUNT, "0");   
-            expectedMetrics.put(IN_USE_CONNECTION_COUNT, "3");     
-            expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "5");
+            expectedMetrics.put(IN_USE_CONNECTION_COUNT, "8");     
+            expectedMetrics.put(MAX_CONNECTIONS_IN_USE_COUNT, "10");
             expectedMetrics.put(MAX_SIZE, "20");
             expectedMetrics.put(MIN_SIZE, "5");
 

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceOperationsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceOperationsTest.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceOperationsTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -137,32 +137,23 @@
         // Min pool size will be 5, max pool size will be 20
         Map<String, String> propertiesMap = createNoTXDatasource("ListFormattedSubPoolStatisticsAfterDatasourceCreationDS");
 
-        performDatasourceOperation(propertiesMap.get("jndi-name"), 
-                                   DatasourceType.NO_TX_DATASOURCE, 
-                                   LIST_FORMATTED_SUB_POOL_STATISTICS);
-        
-        // Use the default formatter
-        client.click(PARAMETERS_FORM_OK_BUTTON);
-
-        // Get the result of the operation
-        HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_RESULTS);
-        HtmlTextArea resultTextBox = (HtmlTextArea)historyPanel.getFirstByXPath(".//textarea[@class='property-value-input']"); 
-
-        assertNotNull("Could not get the result of the operation", resultTextBox);
-        
-        String actualResult = resultTextBox.getText();
-        
         // Set up the expected results
         StringBuffer expectedBuffer = new StringBuffer();
         expectedBuffer.append("Sub Pool Statistics: \n");
         expectedBuffer.append("Sub Pool Count: 0\n");
         expectedBuffer.append(POOL_SEPARATOR);
         expectedBuffer.append("\n\n");
-     
-        assertTrue("Incorrect sub pool statistics - \nexpected:\n\n" + expectedBuffer.toString() 
-                   + "\n\nbut was:\n\n" + actualResult,
-                   actualResult.contains(expectedBuffer.toString()));
+        
+        String errorMessage = "Incorrect sub pool statistics";
 
+        performResourceOperationAndCheckValueBox(DS_NAV_LABEL,
+                                                 DatasourceType.NO_TX_DATASOURCE.getLabel(),
+                                                 propertiesMap.get("jndi-name"),
+                                                 LIST_FORMATTED_SUB_POOL_STATISTICS,
+                                                 Boolean.TRUE,
+                                                 expectedBuffer,
+                                                 errorMessage);
+        
         // Clean up
         deleteDatasource(propertiesMap.get("jndi-name"), DatasourceType.NO_TX_DATASOURCE);   
     }
@@ -206,21 +197,7 @@
                                                               propertiesMap.get("user-name"), 
                                                               propertiesMap.get("password")); 
         try { 
-            performDatasourceOperation(propertiesMap.get("jndi-name"), 
-                                       DatasourceType.LOCAL_TX_DATASOURCE, 
-                                       LIST_FORMATTED_SUB_POOL_STATISTICS);
-
-            // Use the default formatter
-            client.click(PARAMETERS_FORM_OK_BUTTON);
-
-            // Get the result of the operation
-            HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_RESULTS);
-            HtmlTextArea resultTextBox = (HtmlTextArea)historyPanel.getFirstByXPath(".//textarea[@class='property-value-input']"); 
-
-            assertNotNull("Could not get the result of the operation", resultTextBox);
             
-            String actualResult = resultTextBox.getText();
-            
             // Set up the expected results
             StringBuffer expectedBuffer = new StringBuffer();
             expectedBuffer.append("Sub Pool Statistics: \n");
@@ -232,11 +209,16 @@
             expectedBuffer.append("Max Connections In Use Count:4\n");
             expectedBuffer.append("Connections Destroyed Count:0\n");
             expectedBuffer.append("Connections In Use Count:4\n");
+            
+            String errorMessage = "Incorrect sub pool statistics";
 
-            assertTrue("Incorrect sub pool statistics - \nexpected the result to contain:\n\n" 
-                       + expectedBuffer.toString() 
-                       + "\n\nbut was:\n\n" + actualResult,
-                       actualResult.contains(expectedBuffer.toString()));
+            performResourceOperationAndCheckValueBox(DS_NAV_LABEL,
+                                                     DatasourceType.LOCAL_TX_DATASOURCE.getLabel(),
+                                                     propertiesMap.get("jndi-name"),
+                                                     LIST_FORMATTED_SUB_POOL_STATISTICS,
+                                                     Boolean.TRUE,
+                                                     expectedBuffer,
+                                                     errorMessage);
         } finally {
             
             // Clean up
@@ -289,22 +271,7 @@
                 disconnectDB(connections.get(i));
                 connections.set(i, null);
             }
-        
-            performDatasourceOperation(propertiesMap.get("jndi-name"), 
-                                       DatasourceType.LOCAL_TX_DATASOURCE, 
-                                       LIST_FORMATTED_SUB_POOL_STATISTICS);
-
-            // Use the default formatter
-            client.click(PARAMETERS_FORM_OK_BUTTON);
-
-            // Get the result of the operation
-            HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_RESULTS);
-            HtmlTextArea resultTextBox = (HtmlTextArea)historyPanel.getFirstByXPath(".//textarea[@class='property-value-input']"); 
-
-            assertNotNull("Could not get the result of the operation", resultTextBox);
             
-            String actualResult = resultTextBox.getText();
-            
             // Set up the expected results
             StringBuffer expectedBuffer = new StringBuffer();
             expectedBuffer.append("Sub Pool Statistics: \n");
@@ -316,11 +283,16 @@
             expectedBuffer.append("Max Connections In Use Count:10\n");
             expectedBuffer.append("Connections Destroyed Count:0\n");
             expectedBuffer.append("Connections In Use Count:8");
+        
+            String errorMessage = "Incorrect sub pool statistics";
 
-            assertTrue("Incorrect sub pool statistics - \nexpected the result to contain:\n\n" 
-                        + expectedBuffer.toString() 
-                        + "\n\nbut was:\n\n" + actualResult,
-                        actualResult.contains(expectedBuffer.toString()));
+            performResourceOperationAndCheckValueBox(DS_NAV_LABEL,
+                                                     DatasourceType.LOCAL_TX_DATASOURCE.getLabel(),
+                                                     propertiesMap.get("jndi-name"),
+                                                     LIST_FORMATTED_SUB_POOL_STATISTICS,
+                                                     Boolean.TRUE,
+                                                     expectedBuffer,
+                                                     errorMessage);
         } finally {
             
             // Clean up

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSTest.java	2009-05-15 16:06:50 UTC (rev 426)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSTest.java	2009-05-15 18:17:55 UTC (rev 427)
@@ -206,7 +206,7 @@
                                      String destinationName) throws Exception {
         //refreshTreeNode(JMS_NAV_LABEL);
         clickNavTreeLink(destinationType.getNavLabel());
-        deleteResource("resourceSummaryForm", destinationName);
+        deleteResource(RESOURCE_SUMMARY_FORM, destinationName);
     }
          
     /**

Added: trunk/jsfunit/testdata/connfactories/DeleteNoTxCFExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/DeleteNoTxCFExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/DeleteNoTxCFExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>DeleteNoTxCFExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/DeleteTxCFExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/DeleteTxCFExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/DeleteTxCFExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>DeleteTxCFExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/FlushNoTxCFAfterMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/FlushNoTxCFAfterMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/FlushNoTxCFAfterMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>FlushNoTxCFAfterMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/FlushTxCFAfterMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/FlushTxCFAfterMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/FlushTxCFAfterMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>FlushTxCFAfterMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterClosingConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterClosingConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>ListFormattedNoTxCFAfterClosingConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListFormattedNoTxCFAfterMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>ListFormattedNoTxCFAfterMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterClosingConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterClosingConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>ListFormattedTxCFAfterClosingConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListFormattedTxCFAfterMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>ListFormattedTxCFAfterMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterClosingConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterClosingConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>ListStatisticsNoTxCFAfterClosingConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListStatisticsNoTxCFAfterMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>ListStatisticsNoTxCFAfterMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterClosingConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterClosingConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>ListStatisticsTxCFAfterClosingConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ListStatisticsTxCFAfterMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>ListStatisticsTxCFAfterMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/MetricsNoTxCFClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/MetricsNoTxCFClosingConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/MetricsNoTxCFClosingConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>MetricsNoTxCFClosingConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/MetricsNoTxCFInitialConnectionExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/MetricsNoTxCFInitialConnectionExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/MetricsNoTxCFInitialConnectionExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>MetricsNoTxCFInitialConnectionExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>false</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/MetricsNoTxCFMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/MetricsNoTxCFMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/MetricsNoTxCFMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <no-tx-connection-factory>
+        <jndi-name>MetricsNoTxCFMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <interleaving/>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+    </no-tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/MetricsTxCFClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/MetricsTxCFClosingConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/MetricsTxCFClosingConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>MetricsTxCFClosingConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/MetricsTxCFInitialConnectionExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/MetricsTxCFInitialConnectionExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/MetricsTxCFInitialConnectionExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>MetricsTxCFInitialConnectionExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>false</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/connfactories/MetricsTxCFMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/MetricsTxCFMultipleConnectionsExistingFile-ds.xml	                        (rev 0)
+++ trunk/jsfunit/testdata/connfactories/MetricsTxCFMultipleConnectionsExistingFile-ds.xml	2009-05-15 18:17:55 UTC (rev 427)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+    <tx-connection-factory>
+        <jndi-name>MetricsTxCFMultipleConnectionsExistingFile</jndi-name>
+        <rar-name>embjoprtestadapter.rar</rar-name>
+        <use-java-context>true</use-java-context>
+        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+        <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
+        <min-pool-size>5</min-pool-size>
+        <max-pool-size>20</max-pool-size>
+        <blocking-timeout-millis>30000</blocking-timeout-millis>
+        <idle-timeout-minutes>30</idle-timeout-minutes>
+        <prefill>true</prefill>
+        <background-validation>false</background-validation>
+        <background-validation-millis>0</background-validation-millis>
+        <validate-on-match>true</validate-on-match>
+        <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
+        <isSameRM-override-value>false</isSameRM-override-value>
+        <allocation-retry>0</allocation-retry>
+        <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
+        <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
+        <metadata/>
+        <xa-resource-timeout>0</xa-resource-timeout>
+    </tx-connection-factory>
+</connection-factories>

Added: trunk/jsfunit/testdata/rar/embjoprtestadapter.rar
===================================================================
(Binary files differ)


Property changes on: trunk/jsfunit/testdata/rar/embjoprtestadapter.rar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the embjopr-commits mailing list