EMBJOPR SVN: r484 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.
by embjopr-commits@lists.jboss.org
Author: smcgowan(a)redhat.com
Date: 2009-05-30 09:36:34 -0400 (Sat, 30 May 2009)
New Revision: 484
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
Log:
more test updates due to EMBJOPR-177
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-05-28 19:38:38 UTC (rev 483)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-05-30 13:36:34 UTC (rev 484)
@@ -202,7 +202,7 @@
};
// Status Messages
- public static final String EJB2_DEL_MSG = "Successfully deleted EJB 2.x Application (EJB JAR)";
- public static final String EJB3_DEL_MSG = "Successfully deleted EJB 3.x Application (EJB JAR)";
+ public static final String EJB2_DEL_MSG = "Successfully deleted EJB2 JAR";
+ public static final String EJB3_DEL_MSG = "Successfully deleted EJB3 JAR";
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java 2009-05-28 19:38:38 UTC (rev 483)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java 2009-05-30 13:36:34 UTC (rev 484)
@@ -103,7 +103,7 @@
EmbJoprTestToolkit ejtt = new EmbJoprTestToolkit(client, server);
// Click the nav tree.
- String linkLabel = "Web Application (WAR)s";
+ String linkLabel = "WARs";
//HtmlAnchor warLink = getNavTreeLink(linkLabel);
HtmlAnchor warLink = ejtt.navTree.getNodeLink(linkLabel);
warLink.click();
@@ -142,9 +142,7 @@
HtmlButtonInput deleteButton = getDeleteButton("hellothere.war");
deleteButton.click();
- // This assert doesn't work. jopr does remove the WAR, but for some
- // reason, JBoss doesn't undeploy the MBeans
- //assertFalse(isWarDeployed("hellothere.war"));
+ assertFalse(isWarDeployed("hellothere.war"));
}
private boolean isWarDeployed(String warName)
@@ -239,4 +237,4 @@
throw new IllegalStateException("Nav Tree link for '" + linkLabel + "' not found.");
}
-}
\ No newline at end of file
+}
15 years, 7 months
EMBJOPR SVN: r483 - in trunk/jsfunit: src/test/java/org/jboss/jopr/jsfunit/as5 and 2 other directories.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-05-28 15:38:38 -0400 (Thu, 28 May 2009)
New Revision: 483
Added:
trunk/jsfunit/testdata/destinations/ListAllMessagesMultipleMessagesExistingQueue-service.xml
trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingQueue-service.xml
trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingTopic-service.xml
trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingQueue-service.xml
trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingTopic-service.xml
Modified:
trunk/jsfunit/pom.xml
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSMetricsTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSTest.java
Log:
Adding tests for the "List All Messages", "List Durable Messages", and "List Non Durable Messages" operations for Topics and Queues.
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-05-26 22:56:25 UTC (rev 482)
+++ trunk/jsfunit/pom.xml 2009-05-28 19:38:38 UTC (rev 483)
@@ -128,6 +128,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>jboss.messaging</groupId>
+ <artifactId>jboss-messaging</artifactId>
+ <version>1.4.3.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-javaee</artifactId>
<version>5.0.1.GA</version>
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-26 22:56:25 UTC (rev 482)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java 2009-05-28 19:38:38 UTC (rev 483)
@@ -94,9 +94,9 @@
public static final String NO_PARAMETERS = "noParameters";
public static final String NO_RESULTS = "noResults";
public static final String OPERATION_RESULTS = "operationResults";
- public static final String REFRESH_OPERATIONS_TABLE = "refreshLink";
public static final String RESOURCE_SUMMARY_FORM = "resourceSummaryForm";
public static final String EDIT_RESOURCE_CONFIGURATION_FORM = "editResourceConfigurationForm";
+ public static final String PARAMETERS_FORM = "parametersForm";
public static final String ERROR_MESSAGE = "errorMessage";
// Pagination constants
@@ -109,6 +109,9 @@
public static final String LIST_FORMATTED_SUB_POOL_STATISTICS = "List Formatted Sub Pool Statistics";
public static final String LIST_STATISTICS = "List Statistics";
+ // Argument boxes on the operations parameters page
+ public static final String ARG_0 = "arg#0";
+
// Datasource and ConnectionFactory metrics
public static final String AVAILABLE_CONNECTION_COUNT = "Available Connection Count";
public static final String CONNECTION_COUNT = "Connection Count";
@@ -291,7 +294,7 @@
String resourceSubCategory,
String resourceName,
String tabName) throws Exception {
- //refreshTreeNode(resourceCategory);
+ //refreshTreeNode(resourceCategory);
NavTreeNode resourceSubCategoryNode = ejtt.getNavTree().getNodeByLabel(resourceSubCategory);
if(!resourceSubCategoryNode.isExpanded()) {
expandNavTreeArrow(resourceSubCategory);
@@ -333,6 +336,48 @@
waitForResourceOperationToFinish();
+ checkOperationStatus();
+ }
+
+ /**
+ * Perform the given operation on the given resource using the given
+ * parameters.
+ *
+ * performResourceOperation() assumes that the resource tree
+ * node (eg. "JMS Destinations", "Datasources", etc.) is already
+ * expanded when this method is called.
+ *
+ * @param parametersMap maps parameter names to parameter values
+ */
+ protected void performResourceOperationWithParameters(String resourceCategory,
+ String resourceSubCategory,
+ String resourceName,
+ String operationName,
+ Map<String, String> parametersMap) throws Exception{
+
+ navigateToPage(resourceCategory, resourceSubCategory,
+ resourceName, CONTROL_TAB);
+
+ HtmlForm form = (HtmlForm)client.getElement(OPERATIONS_FORM);
+ String xpath = ".//input[@value=\"" + operationName + "\"]";
+
+ HtmlButtonInput operationButton = (HtmlButtonInput)form.getFirstByXPath(xpath);
+ operationButton.click();
+
+ fillOutForm(parametersMap, PARAMETERS_FORM);
+ client.click(PARAMETERS_FORM_OK_BUTTON);
+
+ waitForResourceOperationToFinish();
+
+ checkOperationStatus();
+ }
+
+ /**
+ * Check the status of the latest operation. If the operation was not
+ * successful, output the error message.
+ */
+ private void checkOperationStatus() throws HtmlElementNotFoundException {
+
// Make sure the operation completed successfully
String status = getLatestOperationStatus();
@@ -354,13 +399,12 @@
*/
protected void waitForResourceOperationToFinish() throws HtmlElementNotFoundException, IOException, InterruptedException {
- for(int i = 0; i < 10; i++) {
+ for(int i = 0; i < 20; i++) {
String status = getLatestOperationStatus();
if(status.contains(INPROGRESS)) {
Thread.sleep(100);
- client.click(REFRESH_OPERATIONS_TABLE);
} else {
// The operation has completed
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSMetricsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSMetricsTest.java 2009-05-26 22:56:25 UTC (rev 482)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSMetricsTest.java 2009-05-28 19:38:38 UTC (rev 483)
@@ -35,6 +35,8 @@
import javax.jms.Queue;
import javax.jms.QueueSession;
import javax.jms.QueueReceiver;
+import javax.naming.InitialContext;
+import javax.jms.TopicConnectionFactory;
/**
* This class contains metrics tests for JMS topics and queues.
@@ -293,7 +295,15 @@
*/
private void checkTopicMetricsAfterMultipleMessages(String jndiName) throws Exception {
- TopicSession session = createTopicSession();
+ InitialContext context = new InitialContext();
+ Object tmp = context.lookup(TOPIC_FACTORY);
+
+ TopicConnectionFactory tcf = (TopicConnectionFactory)tmp;
+ topicConnection = tcf.createTopicConnection();
+ topicConnection.setClientID(CLIENT_ID);
+
+ TopicSession session = topicConnection.createTopicSession(Boolean.FALSE,
+ TopicSession.AUTO_ACKNOWLEDGE);
Topic topic = getTopic(jndiName);
// Create 1 durable subscriber, 1 non-durable subscriber
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java 2009-05-26 22:56:25 UTC (rev 482)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java 2009-05-28 19:38:38 UTC (rev 483)
@@ -30,16 +30,24 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
+import java.util.List;
+import java.io.IOException;
import org.jboss.jopr.jsfunit.*;
import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
+import javax.management.MalformedObjectNameException;
+import javax.management.JMException;
import javax.jms.Topic;
import javax.jms.TopicSession;
import javax.jms.Queue;
+import javax.jms.QueueSession;
+import javax.jms.DeliveryMode;
+import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.destination.JBossDestination;
import javax.management.ObjectName;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTableRow;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
+
/**
* This class contains operations tests for JMS topics and queues.
* This class should be run against JBAS 5.x.
@@ -1007,6 +1015,8 @@
}
/* OPERATION #12 - CREATE - APPLIES TO TOPICS AND QUEUES */
+ // These tests are now disabled since the "Create" operation has been
+ // removed.
/**
* Test Name: testTopicCreateOperation
@@ -1123,6 +1133,8 @@
}
/* OPERATION #14 - DESTROY - APPLIES TO TOPICS AND QUEUES */
+ // These tests are now disabled since the "Destroy" operation has been
+ // removed.
/**
* Test Name: testTopicDestroyOperation
@@ -1241,8 +1253,552 @@
STOP, Boolean.FALSE);
}
+
+ /* OPERATION #16 - LIST ALL MESSAGES - APPLIES TO TOPICS AND QUEUES */
+
+ /**
+ * Test Name: testListAllMessagesAfterTopicCreation
+ * Assertion: Make sure that the "List All Messages" operation for topics
+ * returns the correct results after creating a new topic.
+ */
+ public void testListAllMessagesAfterTopicCreation() throws Exception {
+ String jndiName = "ListAllMessagesAfterTopicCreation";
+
+ // Create the topic first
+ createTopic(jndiName);
+
+ // Some message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(ALL_MSG_COUNT, "0");
+ expectedMetrics.put(DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(NON_DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(ALL_SUB_COUNT, "0");
+
+ performListMessages(jndiName, DestinationType.TOPIC, LIST_ALL_MSGS,
+ 0, Boolean.FALSE, null, expectedMetrics);
+ }
+
+ /**
+ * Test Name: testTopicListAllMessagesAfterMultipleMessages
+ * Assertion: Make sure that the "List All Messages" operation for topics
+ * returns the correct results when the topic has multiple messages.
+ */
+ public void testTopicListAllMessagesAfterMultipleMessages() throws Exception {
+ String jndiName = "TopicListAllMessagesAfterMultipleMessages";
+
+ // Create the topic first
+ createTopic(jndiName);
+ performTopicListAllMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Test Name: testTopicListAllMessagesAfterMultipleMessagesUsingExistingServiceFile
+ * Assertion: Make sure that the "List All Messages" operation for topics
+ * returns the correct results when the topic has multiple messages.
+ * Use a topic that already exists.
+ */
+ public void testTopicListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ String jndiName = "ListAllMessagesMultipleMessagesExistingTopic";
+
+ expandNavTreeArrow(JMS_NAV_LABEL);
+ performTopicListAllMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Common code for the testTopicListAllMessagesAfterMultipleMessages*
+ * tests.
+ */
+ private void performTopicListAllMessagesAfterMultipleMessages(String jndiName) throws Exception {
+
+ TopicSession session = createTopicSession();
+ Topic topic = getTopic(jndiName);
+
+ // Send some messages to the topic
+ createDurableTopicSubscriber(session, topic, jndiName);
+ publishMessages(session, topic, 3);
+
+ // The operation parameters
+ Map<String, String> parametersMap = new HashMap<String, String>();
+ parametersMap.put(ARG_0, CLIENT_ID + "." + jndiName);
+
+ // Message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(ALL_MSG_COUNT, "3");
+ expectedMetrics.put(DURABLE_MSG_COUNT, "3");
+ expectedMetrics.put(NON_DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(ALL_SUB_COUNT, "1");
+
+ performListMessages(jndiName, DestinationType.TOPIC, LIST_ALL_MSGS,
+ 3, Boolean.TRUE, parametersMap, expectedMetrics);
+ }
+
+ /**
+ * Test Name: testListAllMessagesAfterQueueCreation
+ * Assertion: Make sure that the "List All Messages" operation for queues
+ * returns the correct results after creating a new queue.
+ */
+ public void testListAllMessagesAfterQueueCreation() throws Exception {
+ String jndiName = "ListAllMessagesAfterQueueCreation";
+
+ // Create the queue first
+ createQueue(jndiName);
+
+ // Some message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(CONSUMER_COUNT, "0");
+ expectedMetrics.put(MSG_COUNT, "0");
+
+ performListMessages(jndiName, DestinationType.QUEUE, LIST_ALL_MSGS,
+ 0, Boolean.FALSE, null, expectedMetrics);
+ }
+
+ /**
+ * Test Name: testQueueListAllMessagesAfterMultipleMessages
+ * Assertion: Make sure that the "List All Messages" operation for queues
+ * returns the correct results when the queue has multiple messages.
+ */
+ public void testQueueListAllMessagesAfterMultipleMessages() throws Exception {
+ String jndiName = "QueueListAllMessagesAfterMultipleMessages";
+
+ // Create the queue first
+ createQueue(jndiName);
+ performQueueListAllMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Test Name: testQueueListAllMessagesAfterMultipleMessagesUsingExistingServiceFile
+ * Assertion: Make sure that the "List All Messages" operation for queues
+ * returns the correct results when the queue has multiple messages.
+ * Use a queue that already exists.
+ */
+ public void testQueueListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ String jndiName = "ListAllMessagesMultipleMessagesExistingQueue";
+
+ expandNavTreeArrow(JMS_NAV_LABEL);
+ performQueueListAllMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Common code for the testQueueListAllMessagesAfterMultipleMessages*
+ * tests.
+ */
+ private void performQueueListAllMessagesAfterMultipleMessages(String jndiName) throws Exception {
+ QueueSession session = createQueueSession();
+ Queue queue = getQueue(jndiName);
+
+ // Send 1 durable message and 1 non-durable message
+ sendMessagesAndSpecifyDeliveryMode(session, queue, 1, DeliveryMode.PERSISTENT);
+ sendMessagesAndSpecifyDeliveryMode(session, queue, 1, DeliveryMode.NON_PERSISTENT);
+
+ // The operation parameters
+ Map<String, String> parametersMap = new HashMap<String, String>();
+ parametersMap.put(ARG_0, EMBJOPR_TEST_SELECTOR);
+
+ // Some message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(CONSUMER_COUNT, "0");
+ expectedMetrics.put(MSG_COUNT, "2");
+
+ performListMessages(jndiName, DestinationType.QUEUE, LIST_ALL_MSGS,
+ 2, Boolean.TRUE, parametersMap, expectedMetrics);
+ }
+
+ /* OPERATION #17 - LIST DURABLE MESSAGES - APPLIES TO TOPICS AND QUEUES */
+
+ /**
+ * Test Name: testListDurableMessagesAfterTopicCreation
+ * Assertion: Make sure that the "List Durable Messages" operation for topics
+ * returns the correct results after creating a new topic.
+ */
+ public void testListDurableMessagesAfterTopicCreation() throws Exception {
+ String jndiName = "ListDurableMessagesAfterTopicCreation";
+
+ // Create the topic first
+ createTopic(jndiName);
+
+ // Message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(ALL_MSG_COUNT, "0");
+ expectedMetrics.put(DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(NON_DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(ALL_SUB_COUNT, "0");
+
+ performListMessages(jndiName, DestinationType.TOPIC, LIST_DURABLE_MSGS,
+ 0, Boolean.FALSE, null, expectedMetrics);
+ }
+
+ /**
+ * Test Name: testTopicListDurableMessagesAfterMultipleMessages
+ * Assertion: Make sure that the "List Durable Messages" operation for topics
+ * returns the correct results when the topic has multiple messages.
+ */
+ public void testTopicListDurableMessagesAfterMultipleMessages() throws Exception {
+ String jndiName = "TopicListDurableMessagesAfterMultipleMessages";
+
+ // Create the topic first
+ createTopic(jndiName);
+ performTopicListDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Test Name: testTopicListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile
+ * Assertion: Make sure that the "List Durable Messages" operation for topics
+ * returns the correct results when the topic has multiple messages.
+ * Use a topic that already exists.
+ */
+ public void testTopicListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ String jndiName = "ListDurableMessagesMultipleMessagesExistingTopic";
+
+ expandNavTreeArrow(JMS_NAV_LABEL);
+ performTopicListDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Common code for the testTopicListDurableMessagesAfterMultipleMessages* tests.
+ */
+ private void performTopicListDurableMessagesAfterMultipleMessages(String jndiName) throws Exception {
+ TopicSession session = createTopicSession();
+ Topic topic = getTopic(jndiName);
+
+ // Create a durable subscriber and send some messages to the topic
+ createDurableTopicSubscriber(session, topic, jndiName);
+ publishMessages(session, topic, 2);
+
+ // The operation parameters
+ Map<String, String> parametersMap = new HashMap<String, String>();
+ parametersMap.put(ARG_0, CLIENT_ID + "." + jndiName);
+
+ // Message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(ALL_MSG_COUNT, "2");
+ expectedMetrics.put(DURABLE_MSG_COUNT, "2");
+ expectedMetrics.put(NON_DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(ALL_SUB_COUNT, "1");
+
+ performListMessages(jndiName, DestinationType.TOPIC, LIST_DURABLE_MSGS,
+ 2, Boolean.TRUE, parametersMap, expectedMetrics);
+ }
+
+ /**
+ * Test Name: testListDurableMessagesAfterQueueCreation
+ * Assertion: Make sure that the "List Durable Messages" operation for
+ * queues returns the correct results after creating a new queue.
+ */
+ public void testListDurableMessagesAfterQueueCreation() throws Exception {
+ String jndiName = "ListDurableMessagesAfterQueueCreation";
+
+ // Create the queue first
+ createQueue(jndiName);
+
+ // Some message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(CONSUMER_COUNT, "0");
+ expectedMetrics.put(MSG_COUNT, "0");
+
+ performListMessages(jndiName, DestinationType.QUEUE, LIST_DURABLE_MSGS,
+ 0, Boolean.FALSE, null, expectedMetrics);
+ }
+
+ /**
+ * Test Name: testQueueListDurableMessagesAfterMultipleMessages
+ * Assertion: Make sure that the "List Durable Messages" operation for queues
+ * returns the correct results when the queue has multiple messages.
+ */
+ public void testQueueListDurableMessagesAfterMultipleMessages() throws Exception {
+ String jndiName = "QueueListDurableMessagesAfterMultipleMessages";
+
+ // Create the queue first
+ createQueue(jndiName);
+ performQueueListDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Test Name: testQueueListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile
+ * Assertion: Make sure that the "List Durable Messages" operation for queues
+ * returns the correct results when the queue has multiple messages. Use a queue
+ * that already exists.
+ */
+ public void testQueueListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ String jndiName = "ListDurableMessagesMultipleMessagesExistingQueue";
+
+ expandNavTreeArrow(JMS_NAV_LABEL);
+ performQueueListDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Common code for the testQueueListDurableMessagesAfterMultipleMessages* tests.
+ */
+ private void performQueueListDurableMessagesAfterMultipleMessages(String jndiName) throws Exception {
+
+ // Send some durable messages to the queue
+ createQueueSessionAndSendMessages(2, jndiName);
+
+ // The operation parameters
+ Map<String, String> parametersMap = new HashMap<String, String>();
+ parametersMap.put(ARG_0, EMBJOPR_TEST_SELECTOR);
+
+ // Some message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(CONSUMER_COUNT, "0");
+ expectedMetrics.put(MSG_COUNT, "2");
+
+ performListMessages(jndiName, DestinationType.QUEUE, LIST_DURABLE_MSGS,
+ 2, Boolean.TRUE, parametersMap, expectedMetrics);
+ }
+
+ /* OPERATION #18 - LIST NON DURABLE MESSAGES - APPLIES TO TOPICS AND QUEUES */
+
+ /**
+ * Test Name: testListNonDurableMessagesAfterTopicCreation
+ * Assertion: Make sure that the "List Non Durable Messages" operation for
+ * topics returns the correct results after creating a new topic.
+ */
+ public void testListNonDurableMessagesAfterTopicCreation() throws Exception {
+ String jndiName = "ListNonDurableMessagesAfterTopicCreation";
+
+ // Create the topic first
+ createTopic(jndiName);
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(ALL_MSG_COUNT, "0");
+ expectedMetrics.put(DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(NON_DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(ALL_SUB_COUNT, "0");
+
+ performListMessages(jndiName, DestinationType.TOPIC, LIST_NON_DURABLE_MSGS,
+ 0, Boolean.FALSE, null, expectedMetrics);
+ }
+
/**
+ * Test Name: testTopicListNonDurableMessagesAfterMultipleMessages
+ * Assertion: Make sure that the "List Non Durable Messages" operation for
+ * topics returns the correct results when the topic has multiple messages.
+ */
+ public void testTopicListNonDurableMessagesAfterMultipleMessages() throws Exception {
+ String jndiName = "TopicListNonDurableMessagesAfterMultipleMessages";
+
+ // Create the topic first
+ createTopic(jndiName);
+ performTopicListNonDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Test Name: testTopicListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile
+ * Assertion: Make sure that the "List Non Durable Messages" operation for
+ * topics returns the correct results when the topic has multiple messages.
+ * Use a topic that already exists.
+ */
+ public void testTopicListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ String jndiName = "ListNonDurableMessagesMultipleMessagesExistingTopic";
+
+ expandNavTreeArrow(JMS_NAV_LABEL);
+ performTopicListNonDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Common code for the testTopicListNonDurableMessagesAfterMultipleMessages* tests.
+ */
+ private void performTopicListNonDurableMessagesAfterMultipleMessages(String jndiName) throws Exception {
+ createTopicSessionAndSendNonDurableMessages(2, jndiName);
+
+ // Get the subscription ID to pass as a parameter to "List Non Durable Messages"
+ String subID = getSubID(jndiName);
+
+ Map<String, String> parametersMap = new HashMap<String, String>();
+ parametersMap.put(ARG_0, subID);
+
+ // Message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(ALL_MSG_COUNT, "2");
+ expectedMetrics.put(DURABLE_MSG_COUNT, "0");
+ expectedMetrics.put(NON_DURABLE_MSG_COUNT, "2");
+ expectedMetrics.put(ALL_SUB_COUNT, "1");
+
+ performListMessages(jndiName, DestinationType.TOPIC, LIST_NON_DURABLE_MSGS,
+ 2, Boolean.TRUE, parametersMap, expectedMetrics);
+ }
+
+ /**
+ * Get the subscription id of a topic subscriber.
+ */
+ private String getSubID(String jndiName) throws MalformedObjectNameException, JMException, IOException {
+
+ JMXUtils jmxUtils = JMXUtils.getInstanceForLocalJBoss();
+ ObjectName deploymentMBean = new ObjectName("jboss.messaging.destination:name="
+ + jndiName + ",service="
+ + DestinationType.TOPIC.getName());
+
+ Object messageCounters = jmxUtils.getMBeanAttribute(deploymentMBean, "MessageCounters");
+
+ assertTrue(((List<MessageCounter>)messageCounters).size() == 1);
+
+ // Get the subscription ID
+ String subID = "";
+ MessageCounter mc = ((List<MessageCounter>)messageCounters).get(0);
+ String mcString = mc.getCounterAsString();
+ String temp = mcString.substring(mcString.indexOf(".") + 1);
+ subID = temp.substring(0, temp.indexOf(","));
+
+ return subID;
+ }
+
+ /**
+ * Test Name: testListNonDurableMessagesAfterQueueCreation
+ * Assertion: Make sure that the "List Non Durable Messages" operation for
+ * queues returns the correct results after creating a new queue.
+ */
+ public void testListNonDurableMessagesAfterQueueCreation() throws Exception {
+ String jndiName = "ListNonDurableMessagesAfterQueueCreation";
+
+ // Create the queue first
+ createQueue(jndiName);
+
+ // Some message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(CONSUMER_COUNT, "0");
+ expectedMetrics.put(MSG_COUNT, "0");
+
+ performListMessages(jndiName, DestinationType.QUEUE, LIST_NON_DURABLE_MSGS,
+ 0, Boolean.FALSE, null, expectedMetrics);
+ }
+
+ /**
+ * Test Name: testQueueListNonDurableMessagesAfterMultipleMessages
+ * Assertion: Make sure that the "List Non Durable Messages" operation for
+ * queues returns the correct results when the queue has multiple messages.
+ */
+ public void testQueueListNonDurableMessagesAfterMultipleMessages() throws Exception {
+ String jndiName = "QueueListNonDurableMessagesAfterMultipleMessages";
+
+ // Create the queue first
+ createQueue(jndiName);
+ performQueueListNonDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Test Name: testQueueListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile
+ * Assertion: Make sure that the "List Non Durable Messages" operation for
+ * queues returns the correct results when the queue has multiple messages.
+ * Use a queue that already exists.
+ */
+ public void testQueueListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ String jndiName = "ListNonDurableMessagesMultipleMessagesExistingQueue";
+
+ expandNavTreeArrow(JMS_NAV_LABEL);
+ performQueueListNonDurableMessagesAfterMultipleMessages(jndiName);
+ }
+
+ /**
+ * Common code for the testQueueListNonDurableMessagesAfterMultipleMessages* tests.
+ */
+ private void performQueueListNonDurableMessagesAfterMultipleMessages(String jndiName) throws Exception {
+ QueueSession session = createQueueSession();
+ Queue queue = getQueue(jndiName);
+
+ // Send some non-durable messages to the queue
+ sendMessagesAndSpecifyDeliveryMode(session, queue, 2, DeliveryMode.NON_PERSISTENT);
+
+ Map<String, String> parametersMap = new HashMap<String, String>();
+ parametersMap.put(ARG_0, EMBJOPR_TEST_SELECTOR);
+
+ // Some message counts to check before performing the operation
+ Map<String, String> expectedMetrics = new LinkedHashMap<String, String>();
+ expectedMetrics.put(CONSUMER_COUNT, "0");
+ expectedMetrics.put(MSG_COUNT, "2");
+
+ performListMessages(jndiName, DestinationType.QUEUE, LIST_NON_DURABLE_MSGS,
+ 2, Boolean.TRUE, parametersMap, expectedMetrics);
+ }
+
+ /**
+ * Common code for the List*Messages tests.
+ */
+ private void performListMessages(String jndiName,
+ DestinationType destinationType,
+ String operationName,
+ int expectedNumMessages,
+ boolean useParameters,
+ Map<String, String> parametersMap,
+ Map<String, String> expectedMetrics) throws Exception {
+
+ // Check some message metrics before performing the operation
+ ArrayList<String> summaryMetrics = new ArrayList<String>();
+
+ if(destinationType == DestinationType.TOPIC) {
+ summaryMetrics = getTopicSummaryMetrics();
+ } else {
+ summaryMetrics = getQueueSummaryMetrics();
+ }
+
+ checkResourceMetrics(JMS_NAV_LABEL, destinationType.getNavLabel(),
+ jndiName, expectedMetrics, summaryMetrics);
+
+ // Invoke the operation and check the results
+ if(useParameters) {
+ performResourceOperationWithParameters(JMS_NAV_LABEL, destinationType.getNavLabel(),
+ jndiName, operationName, parametersMap);
+ } else {
+ performResourceOperation(JMS_NAV_LABEL, destinationType.getNavLabel(),
+ jndiName, operationName, Boolean.TRUE);
+ }
+
+ checkListMessagesTable(expectedNumMessages);
+
+ // Clean up
+ disconnect();
+ deleteDestination(destinationType, jndiName);
+ }
+
+ /**
+ * Make sure the correct number of messages gets displayed in the
+ * output of the "List * Messages" operations.
+ */
+ private void checkListMessagesTable(int expectedNumMessages) {
+
+ // Get the result of the operation
+ HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_HISTORY_FORM);
+ HtmlTable resultsTable = (HtmlTable)historyPanel.getFirstByXPath(".//table[@class='property-map-summary-table']");
+ assertNotNull("Could not get the result of the operation", resultsTable);
+
+ List<HtmlTableRow> rows = resultsTable.getRows();
+
+ // Don't include the header row
+ int numMessages = rows.size() - 1;
+
+ String emptyTableMessage = "";
+ if((numMessages == 0) && (expectedNumMessages > 0)) {
+ emptyTableMessage = "An empty table was displayed - ";
+ }
+
+ assertEquals(emptyTableMessage + "Incorrect number of messages displayed in the results table: ",
+ expectedNumMessages, numMessages);
+
+ Iterator i = rows.iterator();
+
+ int rowNum = 0;
+
+ // The table should contain these columns: "JMS Correlation ID", "JMS Message ID",
+ // and "JMS Timestamp"
+ while(i.hasNext()) {
+ HtmlTableRow row = (HtmlTableRow)i.next();
+ String jmsCorrelationID = ((HtmlTableCell)row.getCell(JMS_CORRELATION_ID)).asText();
+
+ String jmsMessageID = ((HtmlTableCell)row.getCell(JMS_MESSAGE_ID)).asText();
+ assertNotNull("The JMS Message ID was null", jmsMessageID);
+
+ String jmsTimestamp = ((HtmlTableCell)row.getCell(JMS_TIMESTAMP)).asText();
+ assertNotNull("The JMS Timestamp was null", jmsTimestamp);
+
+ log.info("Row " + rowNum + ": ");
+ log.info("JMS Correlation ID: " + jmsCorrelationID);
+ log.info("JMS Message ID: " + jmsMessageID);
+ log.info("JMS Timestamp: " + jmsTimestamp);
+
+ rowNum = rowNum + 1;
+ }
+ }
+
+ /**
* Common code for the Create/Start/Stop/Destroy operations.
*/
private void performServletLifecycleOperation(String jndiName,
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-26 22:56:25 UTC (rev 482)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSTest.java 2009-05-28 19:38:38 UTC (rev 483)
@@ -52,6 +52,7 @@
import javax.jms.ConnectionFactory;
import javax.jms.TextMessage;
import javax.jms.JMSException;
+import javax.jms.DeliveryMode;
import javax.naming.NamingException;
import org.jboss.metatype.api.values.CompositeValue;
import org.jboss.metatype.api.values.CompositeValueSupport;
@@ -133,6 +134,11 @@
public static final String RESET_MSG_COUNTER = "Reset Message Counter";
public static final String RESET_MSG_COUNTER_HISTORY = "Reset Message Counter History";
+ // Column numbers for the headers in the "List * Messages" results table
+ public static final int JMS_CORRELATION_ID = 0;
+ public static final int JMS_MESSAGE_ID = 1;
+ public static final int JMS_TIMESTAMP = 2;
+
public enum DestinationType {
QUEUE(QUEUES_NAV_LABEL, "Queue"),
TOPIC(TOPICS_NAV_LABEL, "Topic");
@@ -158,6 +164,8 @@
public static final String SERVICE_FILE_ROOT_ELEMENT = "server";
public static final String SERVICE_FILE_CHILD_ELEMENT = "mbean";
public static final String CLIENT_ID = "EmbjoprTest";
+ public static final String EMBJOPR_TEST_PROPERTY = "EmbjoprTestProperty";
+ public static final String EMBJOPR_TEST_SELECTOR = EMBJOPR_TEST_PROPERTY + "=0";
public static final long SCHEDULED_TIME = 3600000;
public static final String DLQ = "jboss.messaging.destination:name=DLQ,service=Queue";
public static final String EXPIRY_QUEUE = "jboss.messaging.destination:name=ExpiryQueue,service=Queue";
@@ -465,10 +473,27 @@
Queue queue,
int numMessages) throws JMSException {
+ // Send durable messages
+ sendMessagesAndSpecifyDeliveryMode(session, queue,
+ numMessages, DeliveryMode.PERSISTENT);
+ }
+
+ /**
+ * Create a QueueSender for the given queue and send the given
+ * number of messages.
+ *
+ * @param deliveryMode is the delivery mode for the QueueSender
+ */
+ protected void sendMessagesAndSpecifyDeliveryMode(QueueSession session,
+ Queue queue,
+ int numMessages,
+ int deliveryMode) throws JMSException {
QueueSender sender = session.createSender(queue);
+ sender.setDeliveryMode(deliveryMode);
for(int i = 0; i < numMessages; i++) {
TextMessage message = session.createTextMessage("Message " + i);
+ message.setIntProperty(EMBJOPR_TEST_PROPERTY, 0);
sender.send(message);
}
@@ -651,6 +676,28 @@
return topicSession;
}
+
+ /**
+ * Create a topic session and a non-durable subscriber. Then, send the
+ * specified number of messages to the given topic.
+ */
+ protected void createTopicSessionAndSendNonDurableMessages(int numMessages,
+ String jndiName) throws Exception {
+ InitialContext context = new InitialContext();
+ Object tmp = context.lookup(TOPIC_FACTORY);
+
+ TopicConnectionFactory tcf = (TopicConnectionFactory)tmp;
+ topicConnection = tcf.createTopicConnection();
+ topicConnection.setClientID(CLIENT_ID);
+
+ TopicSession session = topicConnection.createTopicSession(Boolean.FALSE,
+ TopicSession.AUTO_ACKNOWLEDGE);
+ Topic topic = getTopic(jndiName);
+
+ createNonDurableTopicSubscriber(session, topic);
+
+ publishMessages(session, topic, numMessages);
+ }
/**
* Create a queue session and specify the given username and password
Added: trunk/jsfunit/testdata/destinations/ListAllMessagesMultipleMessagesExistingQueue-service.xml
===================================================================
--- trunk/jsfunit/testdata/destinations/ListAllMessagesMultipleMessagesExistingQueue-service.xml (rev 0)
+++ trunk/jsfunit/testdata/destinations/ListAllMessagesMultipleMessagesExistingQueue-service.xml 2009-05-28 19:38:38 UTC (rev 483)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<server>
+ <mbean xmbean-dd="xmdesc/Queue-xmbean.xml" name="jboss.messaging.destination:service=Queue,name=ListAllMessagesMultipleMessagesExistingQueue" code="org.jboss.jms.server.destination.QueueService">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)</annotation>
+ <attribute name="JNDIName">ListAllMessagesMultipleMessagesExistingQueue</attribute>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingQueue-service.xml
===================================================================
--- trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingQueue-service.xml (rev 0)
+++ trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingQueue-service.xml 2009-05-28 19:38:38 UTC (rev 483)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<server>
+ <mbean xmbean-dd="xmdesc/Queue-xmbean.xml" name="jboss.messaging.destination:service=Queue,name=ListDurableMessagesMultipleMessagesExistingQueue" code="org.jboss.jms.server.destination.QueueService">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)</annotation>
+ <attribute name="JNDIName">ListDurableMessagesMultipleMessagesExistingQueue</attribute>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingTopic-service.xml
===================================================================
--- trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingTopic-service.xml (rev 0)
+++ trunk/jsfunit/testdata/destinations/ListDurableMessagesMultipleMessagesExistingTopic-service.xml 2009-05-28 19:38:38 UTC (rev 483)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<server>
+ <mbean xmbean-dd="xmdesc/Topic-xmbean.xml" name="jboss.messaging.destination:service=Topic,name=ListDurableMessagesMultipleMessagesExistingTopic" code="org.jboss.jms.server.destination.TopicService">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.TopicServiceMO)</annotation>
+ <attribute name="JNDIName">ListDurableMessagesMultipleMessagesExistingTopic</attribute>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingQueue-service.xml
===================================================================
--- trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingQueue-service.xml (rev 0)
+++ trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingQueue-service.xml 2009-05-28 19:38:38 UTC (rev 483)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<server>
+ <mbean xmbean-dd="xmdesc/Queue-xmbean.xml" name="jboss.messaging.destination:service=Queue,name=ListNonDurableMessagesMultipleMessagesExistingQueue" code="org.jboss.jms.server.destination.QueueService">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)</annotation>
+ <attribute name="JNDIName">ListNonDurableMessagesMultipleMessagesExistingQueue</attribute>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingTopic-service.xml
===================================================================
--- trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingTopic-service.xml (rev 0)
+++ trunk/jsfunit/testdata/destinations/ListNonDurableMessagesMultipleMessagesExistingTopic-service.xml 2009-05-28 19:38:38 UTC (rev 483)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<server>
+ <mbean xmbean-dd="xmdesc/Topic-xmbean.xml" name="jboss.messaging.destination:service=Topic,name=ListNonDurableMessagesMultipleMessagesExistingTopic" code="org.jboss.jms.server.destination.TopicService">
+ <annotation>@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.TopicServiceMO)</annotation>
+ <attribute name="JNDIName">ListNonDurableMessagesMultipleMessagesExistingTopic</attribute>
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
15 years, 7 months
EMBJOPR SVN: r482 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: smcgowan(a)redhat.com
Date: 2009-05-26 18:56:25 -0400 (Tue, 26 May 2009)
New Revision: 482
Modified:
trunk/jsfunit/pom.xml
Log:
pom updates which should work with branches JBPAPP_5_0 and Branch_5x
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-05-25 19:16:12 UTC (rev 481)
+++ trunk/jsfunit/pom.xml 2009-05-26 22:56:25 UTC (rev 482)
@@ -112,13 +112,13 @@
<dependency>
<groupId>org.jboss.integration</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
- <version>5.1.0.CR3</version>
+ <version>5.1.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.man</groupId>
<artifactId>jboss-metatype</artifactId>
- <version>2.1.0.CR8</version>
+ <version>2.1.0.SP1</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -349,7 +349,7 @@
<!-- Raise permgen size, allow classes unloading and permgen sweep -->
<!-- xb.builder.useUnorderedSequence=true is the same what run.sh does. -->
<!-- See http://www.nabble.com/changes-in-parsing-with-xb-td22478176.html -->
- <cargo.jvmargs>${jvm.args.debug} -Dcom.sun.management.jmxremote -Xmx1024m -Dxb.builder.useUnorderedSequence=true -XX:PermSize=256m -XX:MaxPermSize=512m</cargo.jvmargs>
+ <cargo.jvmargs>${jvm.args.debug} -Xmx1024m -Dxb.builder.useUnorderedSequence=true -XX:PermSize=256m -XX:MaxPermSize=512m</cargo.jvmargs>
<!-- -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -->
<!-- JBoss configuration - default, all, standard -->
<cargo.jboss.configuration>${cargo.jboss.configuration}</cargo.jboss.configuration>
15 years, 7 months
EMBJOPR SVN: r481 - in trunk/jsfunit: testdata/datasources/testFiles and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-05-25 15:16:12 -0400 (Mon, 25 May 2009)
New Revision: 481
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java
trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml
trunk/jsfunit/testdata/datasources/testFiles/MetricsCloseConnectionsExistingFile-ds.xml
trunk/jsfunit/testdata/datasources/testFiles/MetricsMultipleConnectionsExistingFile-ds.xml
Log:
Minor modification to the datasource metrics and operations tests.
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-25 15:43:11 UTC (rev 480)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java 2009-05-25 19:16:12 UTC (rev 481)
@@ -436,7 +436,6 @@
}
-
/**
* Create a basic No TX Datasource. Return the mapping of property
* names to property values.
@@ -444,7 +443,7 @@
protected Map<String, String> createNoTXDatasource(String datasourceName) throws IOException, EmbJoprTestException {
Map<String, String> propertiesMap = new HashMap<String, String>();
propertiesMap.put("jndi-name", datasourceName);
- propertiesMap.put("prefill", "true");
+ propertiesMap.put("prefill", "false");
propertiesMap.put("track-connection-by-tx", "false");
propertiesMap.put("max-pool-size", "20");
propertiesMap.put("min-pool-size", "5");
@@ -466,7 +465,6 @@
return propertiesMap;
}
-
/**
* Create a basic XA Datasource. Return the mapping of property
* name to property values.
Modified: trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml 2009-05-25 15:43:11 UTC (rev 480)
+++ trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml 2009-05-25 19:16:12 UTC (rev 481)
@@ -10,7 +10,7 @@
<max-pool-size>20</max-pool-size>
<blocking-timeout-millis>55000</blocking-timeout-millis>
<idle-timeout-minutes>60</idle-timeout-minutes>
- <prefill>true</prefill>
+ <prefill>false</prefill>
<background-validation>false</background-validation>
<background-validation-millis>0</background-validation-millis>
<validate-on-match>true</validate-on-match>
Modified: trunk/jsfunit/testdata/datasources/testFiles/MetricsCloseConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/datasources/testFiles/MetricsCloseConnectionsExistingFile-ds.xml 2009-05-25 15:43:11 UTC (rev 480)
+++ trunk/jsfunit/testdata/datasources/testFiles/MetricsCloseConnectionsExistingFile-ds.xml 2009-05-25 19:16:12 UTC (rev 481)
@@ -10,7 +10,7 @@
<max-pool-size>20</max-pool-size>
<blocking-timeout-millis>55000</blocking-timeout-millis>
<idle-timeout-minutes>60</idle-timeout-minutes>
- <prefill>true</prefill>
+ <prefill>false</prefill>
<background-validation>false</background-validation>
<background-validation-millis>0</background-validation-millis>
<validate-on-match>true</validate-on-match>
Modified: trunk/jsfunit/testdata/datasources/testFiles/MetricsMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/datasources/testFiles/MetricsMultipleConnectionsExistingFile-ds.xml 2009-05-25 15:43:11 UTC (rev 480)
+++ trunk/jsfunit/testdata/datasources/testFiles/MetricsMultipleConnectionsExistingFile-ds.xml 2009-05-25 19:16:12 UTC (rev 481)
@@ -10,7 +10,7 @@
<max-pool-size>20</max-pool-size>
<blocking-timeout-millis>55000</blocking-timeout-millis>
<idle-timeout-minutes>60</idle-timeout-minutes>
- <prefill>true</prefill>
+ <prefill>false</prefill>
<background-validation>false</background-validation>
<background-validation-millis>0</background-validation-millis>
<validate-on-match>true</validate-on-match>
15 years, 7 months
EMBJOPR SVN: r480 - in trunk/jsfunit: src/test/java/org/jboss/jopr/jsfunit/as5/datasources and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-05-25 11:43:11 -0400 (Mon, 25 May 2009)
New Revision: 480
Added:
trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml
trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsMultipleConnectionsExistingFile-ds.xml
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceOperationsTest.java
Log:
Adding tests for the "List Statistics" operation for datasources.
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-22 19:37:42 UTC (rev 479)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java 2009-05-25 15:43:11 UTC (rev 480)
@@ -419,6 +419,7 @@
propertiesMap.put("min-pool-size", "5");
propertiesMap.put("user-name", "sa");
propertiesMap.put("password", "");
+ propertiesMap.put("securityDeploymentType", "DOMAIN");
propertiesMap.put("domain", "HsqlDbRealm");
propertiesMap.put("blocking-timeout-millis", "35000");
propertiesMap.put("idle-timeout-minutes", "20");
@@ -444,13 +445,14 @@
Map<String, String> propertiesMap = new HashMap<String, String>();
propertiesMap.put("jndi-name", datasourceName);
propertiesMap.put("prefill", "true");
- propertiesMap.put("track-connection-by-tx", "true");
+ propertiesMap.put("track-connection-by-tx", "false");
propertiesMap.put("max-pool-size", "20");
propertiesMap.put("min-pool-size", "5");
propertiesMap.put("blocking-timeout-millis", "55000");
propertiesMap.put("idle-timeout-minutes", "60");
propertiesMap.put("user-name", "sa");
propertiesMap.put("password", "");
+ propertiesMap.put("securityDeploymentType", "DOMAIN");
propertiesMap.put("domain", "HsqlDbRealm");
propertiesMap.put("driver-class", "org.hsqldb.jdbcDriver");
propertiesMap.put("connection-url", "jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB");
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-22 19:37:42 UTC (rev 479)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/datasources/DatasourceOperationsTest.java 2009-05-25 15:43:11 UTC (rev 480)
@@ -31,6 +31,7 @@
import java.sql.Connection;
import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
import java.io.IOException;
+import org.jboss.managed.api.ComponentType;
/**
* This class contains operations tests for datasources.
@@ -40,6 +41,8 @@
*/
public class DatasourceOperationsTest extends DatasourceTest {
+ /* FLUSH OPERATION */
+
/**
* Test the "Flush" operation after creating a new datasource.
*/
@@ -128,6 +131,8 @@
deleteDatasource(propertiesMap.get("jndi-name"), DatasourceType.LOCAL_TX_DATASOURCE);
}
+ /* LIST FORMATTED SUB POOL STATISTICS OPERATION */
+
/**
* Test the "List Formatted Sub Pool Statistics" after creating a new
* datasource.
@@ -301,7 +306,195 @@
}
}
+ /* LIST STATISTICS OPERATION */
+
/**
+ * Test Name: testListStatisticsAfterCreation
+ * Assertion: Verify that the results are correct after executing
+ * the "List Statistics" operation on a newly created datasource.
+ */
+ public void testDatasourceListStatisticsAfterCreation() throws Exception {
+ String jndiName = "ListStatisticsAfterDatasourceCreationDS";
+
+ // Min pool size will be 5, max pool size will be 20
+ createNoTXDatasource(jndiName);
+
+ // Set up the expectedStatistics
+ Map<String, String> expectedStatistics = formatListStatisticsResults(jndiName,
+ NO_TX_COMPONENT_TYPE,
+ listStatisticsProps);
+
+ // Additional statistics that need to be checked
+ expectedStatistics.put("criteria", "ByContainer");
+ expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name="
+ + jndiName);
+ expectedStatistics.put("subPoolCount", "0");
+ expectedStatistics.put("totalConnectionsInUseCount", "0");
+ expectedStatistics.put("totalMaxConnectionsInUseCount", "0");
+
+ performResourceOperationAndCheckTable(DS_NAV_LABEL, DatasourceType.NO_TX_DATASOURCE.getLabel(),
+ jndiName, LIST_STATISTICS, Boolean.FALSE,
+ expectedStatistics);
+
+ deleteDatasource(jndiName, DatasourceType.NO_TX_DATASOURCE);
+ }
+
+ /**
+ * Test Name: testListStatisticsAfterMultipleConnections
+ * Assertion: Verify that the results are correct after executing
+ * the "List Statistics" operation for a datasource when there are
+ * multiple connections.
+ */
+ public void testDatasourceListStatisticsAfterMultipleConnections() throws Exception {
+ String jndiName = "ListStatisticsAfterMultipleConnectionsDS";
+
+ // Min pool size will be 5, max pool size will be 20
+ Map<String, String> propertiesMap = createLocalTXDatasource(jndiName);
+
+ performListStatisticsAfterMultipleConnections(jndiName, DatasourceType.LOCAL_TX_DATASOURCE,
+ LOCAL_TX_COMPONENT_TYPE, propertiesMap);
+ }
+
+ /**
+ * Test Name: testListStatisticsAfterMultipleConnectionsUsingExistingDSFile
+ * Assertion: Verify that the results are correct after executing
+ * the "List Statistics" operation for a datasource when there are
+ * multiple connections. Use an existing -ds.xml file.
+ */
+ public void testDatasourceListStatisticsAfterMultipleConnectionsUsingExistingDSFile() throws Exception {
+ String jndiName = "ListStatisticsMultipleConnectionsExistingFile";
+
+ // Use an existing datasource
+ Map<String, String> propertiesMap = getPropertyValuesMap(jndiName,
+ DatasourceType.LOCAL_TX_DATASOURCE);
+
+ expandNavTreeArrow(DS_NAV_LABEL);
+
+ performListStatisticsAfterMultipleConnections(jndiName, DatasourceType.LOCAL_TX_DATASOURCE,
+ LOCAL_TX_COMPONENT_TYPE, propertiesMap);
+ }
+
+ /**
+ * Common code for the
+ * testListStatisticsAfterMultipleConnections* tests.
+ */
+ private void performListStatisticsAfterMultipleConnections(String jndiName,
+ DatasourceType datasourceType,
+ ComponentType componentType,
+ Map<String, String> propertiesMap) throws Exception {
+
+ // Create some connections
+ ArrayList<Connection> connections = createConnections(6, propertiesMap.get("jndi-name"),
+ propertiesMap.get("user-name"),
+ propertiesMap.get("password"));
+
+ try {
+
+ // Set up the expected statistics
+ Map<String, String> expectedStatistics = formatListStatisticsResults(jndiName,
+ componentType,
+ listStatisticsProps);
+
+ // Additional statistics that need to be checked
+ expectedStatistics.put("criteria", "ByContainer");
+ expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name="
+ + jndiName);
+ expectedStatistics.put("subPoolCount", "1");
+ expectedStatistics.put("totalConnectionsInUseCount", "6");
+ expectedStatistics.put("totalMaxConnectionsInUseCount", "6");
+
+ performResourceOperationAndCheckTable(DS_NAV_LABEL, datasourceType.getLabel(), jndiName,
+ LIST_STATISTICS, Boolean.FALSE, expectedStatistics);
+ } finally {
+
+ // Clean up
+ closeConnections(connections);
+ deleteDatasource(jndiName, DatasourceType.LOCAL_TX_DATASOURCE);
+ }
+ }
+
+ /**
+ * Test Name: testListStatisticsAfterClosingConnections
+ * Assertion: Verify that the results are correct after executing
+ * the "List Statistics" operation for a datasource after
+ * requesting multiple connections and then closing some of them.
+ */
+ public void testDatasourceListStatisticsAfterClosingConnections() throws Exception {
+ String jndiName = "ListStatisticsAfterClosingConnectionsDS";
+
+ // Min pool size will be 5, max pool size will be 20
+ Map<String, String> propertiesMap = createNoTXDatasource(jndiName);
+
+ performListStatisticsAfterClosingConnections(jndiName, DatasourceType.NO_TX_DATASOURCE,
+ NO_TX_COMPONENT_TYPE, propertiesMap);
+ }
+
+ /**
+ * Test Name: testListStatisticsAfterClosingConnectionsUsingExistingDSFile
+ * Assertion: Verify that the results are correct after executing
+ * the "List Statistics" operation for a datasource after
+ * requesting multiple connections and then closing some of them. Use an
+ * existing -ds.xml file.
+ */
+ public void testDatasourceListStatisticsAfterClosingConnectionsUsingExistingDSFile() throws Exception {
+ String jndiName = "ListStatisticsClosingConnectionsExistingFile";
+
+ // Use an existing datasource
+ Map<String, String> propertiesMap = getPropertyValuesMap(jndiName,
+ DatasourceType.NO_TX_DATASOURCE);
+
+ expandNavTreeArrow(DS_NAV_LABEL);
+
+ performListStatisticsAfterClosingConnections(jndiName, DatasourceType.NO_TX_DATASOURCE,
+ NO_TX_COMPONENT_TYPE, propertiesMap);
+ }
+
+ /**
+ * Common code for the
+ * testListStatisticsAfterClosingConnections* tests.
+ */
+ private void performListStatisticsAfterClosingConnections(String jndiName,
+ DatasourceType datasourceType,
+ ComponentType componentType,
+ Map<String, String> propertiesMap) throws Exception {
+
+ // Create some connections
+ ArrayList<Connection> connections = createConnections(10, propertiesMap.get("jndi-name"),
+ propertiesMap.get("user-name"),
+ propertiesMap.get("password"));
+
+ try {
+
+ // Close some connections
+ for(int i = 0; i < 2; i++) {
+ disconnectDB(connections.get(i));
+ 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", "ByContainer");
+ expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name="
+ + jndiName);
+ expectedStatistics.put("subPoolCount", "1");
+ expectedStatistics.put("totalConnectionsInUseCount", "8");
+ expectedStatistics.put("totalMaxConnectionsInUseCount", "10");
+
+ performResourceOperationAndCheckTable(DS_NAV_LABEL, datasourceType.getLabel(), jndiName,
+ LIST_STATISTICS, Boolean.FALSE, expectedStatistics);
+ } finally {
+
+ // Clean up
+ closeConnections(connections);
+ deleteDatasource(propertiesMap.get("jndi-name"), DatasourceType.NO_TX_DATASOURCE);
+ }
+ }
+
+ /**
* @return the suite of tests being tested
*/
public static Test suite() {
Added: trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml (rev 0)
+++ trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsClosingConnectionsExistingFile-ds.xml 2009-05-25 15:43:11 UTC (rev 480)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<datasources>
+ <no-tx-datasource>
+ <jndi-name>ListStatisticsClosingConnectionsExistingFile</jndi-name>
+ <rar-name>jboss-local-jdbc.rar</rar-name>
+ <use-java-context>true</use-java-context>
+ <connection-definition>javax.sql.DataSource</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>55000</blocking-timeout-millis>
+ <idle-timeout-minutes>60</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>
+ <security-domain xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">HsqlDbRealm</security-domain>
+ <metadata>
+ <type-mapping>FirstSQL/J</type-mapping>
+ </metadata>
+ <user-name>sa</user-name>
+ <password></password>
+ <prepared-statement-cache-size>0</prepared-statement-cache-size>
+ <share-prepared-statements>false</share-prepared-statements>
+ <set-tx-query-timeout>false</set-tx-query-timeout>
+ <query-timeout>0</query-timeout>
+ <use-try-lock>60000</use-try-lock>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
+ </no-tx-datasource>
+</datasources>
Added: trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsMultipleConnectionsExistingFile-ds.xml
===================================================================
--- trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsMultipleConnectionsExistingFile-ds.xml (rev 0)
+++ trunk/jsfunit/testdata/datasources/testFiles/ListStatisticsMultipleConnectionsExistingFile-ds.xml 2009-05-25 15:43:11 UTC (rev 480)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>ListStatisticsMultipleConnectionsExistingFile</jndi-name>
+ <rar-name>jboss-local-jdbc.rar</rar-name>
+ <use-java-context>true</use-java-context>
+ <connection-definition>javax.sql.DataSource</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>35000</blocking-timeout-millis>
+ <idle-timeout-minutes>20</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>
+ <security-domain xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">HsqlDbRealm</security-domain>
+ <metadata>
+ <type-mapping>FirstSQL/J</type-mapping>
+ </metadata>
+ <local-transaction/>
+ <user-name>sa</user-name>
+ <password></password>
+ <prepared-statement-cache-size>0</prepared-statement-cache-size>
+ <share-prepared-statements>false</share-prepared-statements>
+ <set-tx-query-timeout>false</set-tx-query-timeout>
+ <query-timeout>0</query-timeout>
+ <use-try-lock>60000</use-try-lock>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
+ </local-tx-datasource>
+</datasources>
15 years, 7 months
EMBJOPR SVN: r479 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-05-22 15:37:42 -0400 (Fri, 22 May 2009)
New Revision: 479
Modified:
trunk/jsfunit/pom.xml
Log:
Updating the version of jopr-embedded-parent in jsfunit/pom.xml.
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-05-21 22:19:31 UTC (rev 478)
+++ trunk/jsfunit/pom.xml 2009-05-22 19:37:42 UTC (rev 479)
@@ -13,7 +13,7 @@
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.jopr</groupId>
15 years, 7 months
EMBJOPR SVN: r478 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-05-21 18:19:31 -0400 (Thu, 21 May 2009)
New Revision: 478
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EJTT - changed temp dir in getTempDir()
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-05-21 20:38:41 UTC (rev 477)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-05-21 22:19:31 UTC (rev 478)
@@ -98,7 +98,7 @@
}
public String getTempDir() {
- return System.getProperty(AppConstants.SYSPROP_TESTDATA_DIR);
+ return System.getProperty(AppConstants.SYSPROP_TEMP_DIR);
}
public String getDeployDir() {
15 years, 7 months
EMBJOPR SVN: r477 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5/connectors and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-05-21 16:38:41 -0400 (Thu, 21 May 2009)
New Revision: 477
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connectors/
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connectors/ConnectorsTest.java
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EJTT updated - added few methods to NavTreeLabel class.
Created ConnectorTests.
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connectors/ConnectorsTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connectors/ConnectorsTest.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connectors/ConnectorsTest.java 2009-05-21 20:38:41 UTC (rev 477)
@@ -0,0 +1,77 @@
+package org.jboss.jopr.jsfunit.as5.connectors;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.jboss.jopr.jsfunit.*;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
+import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.*;
+
+
+
+
+public class ConnectorsTest extends EmbjoprTestCase implements AppConstants {
+
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite() {
+ return new TestSuite(ConnectorsTest.class);
+ }
+
+
+ /**
+ * This test asummes that HTTP and AJP connectors are present, like in the default AS config.
+ */
+ public void testConnectorHttp() throws IOException, EmbJoprTestException
+ {
+ // Expand the Connectors node and click it.
+ ejtt.navTree.getNodeByLabel(NAV_JBOSS_WEB).getArrowLink().click();
+ ejtt.navTree.waitUntilNodeLoadedByAjax(NAV_CONNECTORS, 1000, 6);
+ ejtt.navTree.getNodeByLabel(NAV_CONNECTORS).getLabelLink().click();
+
+ ContentTable connList = ejtt.tabMenu.getTabContentBox().getFirstTable();
+
+ // HTTP
+ ContentTableRow rowHttp = connList.getFirstRowContainingText("http://");
+ if( null == rowHttp )
+ throw new EmbJoprTestException("HTTP connector not listed.", this);
+ String status = rowHttp.getCellTextByColumnName("Status");
+ if( ! "UP".equals(status) )
+ throw new EmbJoprTestException("HTTP connector is not UP, but: "+status);
+
+ // AJP
+ ContentTableRow rowAjp = connList.getFirstRowContainingText("ajp://");
+ if( null == rowAjp )
+ throw new EmbJoprTestException("AJP connector not listed.", this);
+ status = rowAjp.getCellTextByColumnName("Status");
+ if( ! "UP".equals(status) )
+ throw new EmbJoprTestException("AJP connector is not UP, but: "+status);
+
+
+ // Get all children nodes
+ ejtt.navTree.getNodeByLabel(NAV_CONNECTORS).expand();
+ List<NavTreeNode> childNodes = ejtt.navTree.getNodeByLabel(NAV_CONNECTORS).getChildren();
+
+ // They all should have a name in the form of URL.
+ // So take the protocol part and put it in a set.
+ Set<String> presentNodeNames = new HashSet(childNodes.size());
+ for (NavTreeNode navTreeNode : childNodes) {
+ String nodeLabel = navTreeNode.getLabelLink().getTextContent().trim();
+ URL url = new URL(nodeLabel);
+ presentNodeNames.add(url.getProtocol());
+ }
+
+ assertTrue( "Connectors node should contain a subnode for AJP protocol.", presentNodeNames.contains("ajp") );
+ assertTrue( "Connectors node should contain a subnode for HTTP protocol.", presentNodeNames.contains("http") );
+
+ }
+
+
+}// class
+
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-05-21 15:51:42 UTC (rev 476)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-05-21 20:38:41 UTC (rev 477)
@@ -398,6 +398,18 @@
}
+ /**
+ * If the node is collapsed, expand it.
+ * @returns true if the node already was expanded.
+ */
+ public boolean expand() throws EmbJoprTestException, IOException{
+ boolean isExpanded = isExpanded();
+ if( !isExpanded ){
+ this.getArrowLink().click();
+ }
+ return isExpanded;
+ }
+
/** Returns the text link of this node. */
public HtmlAnchor getLabelLink(){
// Until I come up with something smarter, let it be so:
@@ -405,21 +417,57 @@
return (HtmlAnchor) this.elem.getFirstByXPath( xPath );
}
+
+ private final String XPATH_ARROW_LINK = ".//td[contains(@id,':handles')]//a[contains(@id,':handle')]";
+
/** Returns the arrow's link. */
+ public HtmlAnchor findArrowLink(){
+ HtmlAnchor arrowLink = (HtmlAnchor) this.elem.getFirstByXPath( XPATH_ARROW_LINK );
+ return arrowLink;
+ }
public HtmlAnchor getArrowLink() throws HtmlElementNotFoundException{
- String xPath = ".//td[contains(@id,':handles')]//a[contains(@id,':handle')]";
- HtmlAnchor arrowLink = (HtmlAnchor) this.elem.getFirstByXPath( xPath );
- if( null == arrowLink )
- throw new HtmlElementNotFoundException("Arrow link not found using XPath: "+xPath, currentTest);
+ HtmlAnchor arrowLink = this.findArrowLink();
+ if( null == arrowLink ){
+ throw new HtmlElementNotFoundException("Arrow link not found using XPath: "+XPATH_ARROW_LINK, currentTest);
+ }
return arrowLink;
}
+
/** Clicks the link of the this node. */
public void click() throws IOException {
this.getLabelLink().click();
}
+
+ public boolean isExpandable() {
+ if( null == this.findArrowLink() )
+ return false;
+ else
+ return true;
+ }
+ // Note: The div is present even for empty nodes.
+ private final String XPATH_CHILDREN_DIV = "./following-sibling::div[contains(@id, ':childs')]";
+
+ public boolean hasChildren() throws EmbJoprTestException, IOException {
+ // Let's rely on the arrow, which's presence is a sign of having children.
+ return this.isExpandable();
+ }
+
+
+ private final String XPATH_CHILD_NODES = "./following-sibling::div[contains(@id, ':childs') and position()=1]/table";
+
+ public List<NavTreeNode> getChildren() throws EmbJoprTestException, IOException{
+ if( ! this.isExpandable() )
+ return Collections.EMPTY_LIST;
+ this.expand();
+
+ List<NavTreeNode> childNodes = (List<NavTreeNode>) this.elem.getByXPath(XPATH_CHILD_NODES);
+ return childNodes;
+ }
+
+
}// class NavTreeNode()
15 years, 7 months
EMBJOPR SVN: r476 - in trunk/jsfunit: testdata/connfactories and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-05-21 11:51:42 -0400 (Thu, 21 May 2009)
New Revision: 476
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryConfigurationTest.java
trunk/jsfunit/testdata/connfactories/ChangePropertiesExistingNoTxCF-ds.xml
trunk/jsfunit/testdata/connfactories/ChangePropertiesExistingTxCF-ds.xml
trunk/jsfunit/testdata/connfactories/UnsetPropertiesExistingNoTxCF-ds.xml
trunk/jsfunit/testdata/connfactories/UnsetPropertiesExistingTxCF-ds.xml
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryTest.java
Log:
Adding configuration tests for connection factories.
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryConfigurationTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryConfigurationTest.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryConfigurationTest.java 2009-05-21 15:51:42 UTC (rev 476)
@@ -0,0 +1,251 @@
+/*
+ * 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;
+import java.util.LinkedHashMap;
+
+
+/**
+ * This class contains tests for configuring Connection Factories with JBoss AS 5.
+ *
+ * @author Farah Juma
+ *
+ */
+
+public class ConnFactoryConfigurationTest extends ConnFactoryTest {
+
+ /*
+ * CONFIGURATION TESTS
+ */
+
+ /**
+ * Test Name: testConfigureTxConnectionFactoryChangeProperties
+ * Assertion: Verify the ability to change Tx Connection Factory property
+ * values.
+ */
+ public void testConfigureTxConnectionFactoryChangeProperties() throws Exception {
+ String jndiName = "ChangePropertiesTxCF";
+
+ Map<String, MetaValue> propertiesMap = createTxConnFactory(jndiName);
+
+ // Change some property values that are already set
+ Map<String, MetaValue> propertiesMapChanges = new LinkedHashMap<String, MetaValue>();
+ propertiesMapChanges.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(60000)));
+ propertiesMapChanges.put("no-tx-separate-pools", SimpleValueSupport.wrap(Boolean.TRUE));
+
+ changeConnFactoryProperties(jndiName, CFType.LOCAL_TX_CF, LOCAL_TX_COMPONENT_TYPE,
+ propertiesMapChanges, propertiesMap);
+ }
+
+ /**
+ * Test Name: testConfigureTxConnectionFactoryChangePropertiesUsingExistingDSFile
+ * Assertion: Verify the ability to change Tx Connection Factory property
+ * values. Use an existing -ds.xml file.
+ */
+ public void testConfigureTxConnectionFactoryChangePropertiesUsingExistingDSFile() throws Exception {
+ String jndiName = "ChangePropertiesExistingTxCF";
+ Map<String, MetaValue> propertiesMap = getComponentProperties(jndiName, LOCAL_TX_COMPONENT_TYPE);
+
+ // Change some property values that are already set
+ Map<String, MetaValue> propertiesMapChanges = new LinkedHashMap<String, MetaValue>();
+ propertiesMapChanges.put("xa-resource-timeout", SimpleValueSupport.wrap(new Integer(60000)));
+ propertiesMapChanges.put("prefill", SimpleValueSupport.wrap(Boolean.FALSE));
+
+ expandNavTreeArrow(CF_NAV_LABEL);
+
+ changeConnFactoryProperties(jndiName, CFType.LOCAL_TX_CF, LOCAL_TX_COMPONENT_TYPE,
+ propertiesMapChanges, propertiesMap);
+ }
+
+ /**
+ * Test Name: testConfigureNoTxConnectionFactoryChangeProperties
+ * Assertion: Verify the ability to change No Tx Connection Factory property
+ * values.
+ */
+ public void testConfigureNoTxConnectionFactoryChangeProperties() throws Exception {
+ String jndiName = "ChangePropertiesNoTxCF";
+
+ Map<String, MetaValue> propertiesMap = createNoTxConnFactoryWithPrefill(jndiName, Boolean.TRUE);
+
+ // Change some property values that are already set
+ Map<String, MetaValue> propertiesMapChanges = new LinkedHashMap<String, MetaValue>();
+ propertiesMapChanges.put("max-pool-size", SimpleValueSupport.wrap(new Integer(25)));
+ propertiesMapChanges.put("prefill", SimpleValueSupport.wrap(Boolean.FALSE));
+
+ changeConnFactoryProperties(jndiName, CFType.NO_TX_CF, NO_TX_COMPONENT_TYPE,
+ propertiesMapChanges, propertiesMap);
+ }
+
+ /**
+ * Test Name: testConfigureNoTxConnectionFactoryChangePropertiesUsingExistingDSFile
+ * Assertion: Verify the ability to change No Tx Connection Factory property
+ * values. Use an existing -ds.xml file.
+ */
+ public void testConfigureNoTxConnectionFactoryChangePropertiesUsingExistingDSFile() throws Exception {
+ String jndiName = "ChangePropertiesExistingNoTxCF";
+ Map<String, MetaValue> propertiesMap = getComponentProperties(jndiName, NO_TX_COMPONENT_TYPE);
+
+ // Change some property values that are already set
+ Map<String, MetaValue> propertiesMapChanges = new LinkedHashMap<String, MetaValue>();
+ propertiesMapChanges.put("idle-timeout-minutes", SimpleValueSupport.wrap(new Integer(35)));
+ propertiesMapChanges.put("prefill", SimpleValueSupport.wrap(Boolean.FALSE));
+
+ expandNavTreeArrow(CF_NAV_LABEL);
+
+ changeConnFactoryProperties(jndiName, CFType.NO_TX_CF, NO_TX_COMPONENT_TYPE,
+ propertiesMapChanges, propertiesMap);
+ }
+
+
+ /**
+ * Common code for changing the property values of a connection factory.
+ */
+ private void changeConnFactoryProperties(String jndiName,
+ CFType cfType,
+ ComponentType componentType,
+ Map<String, MetaValue> propertiesMapChanges,
+ Map<String, MetaValue> propertiesMap) throws Exception {
+
+ // The success message we should see
+ String expectedMessage = UPDATE_MESSAGE + cfType.getName() + " '"
+ + jndiName + "'";
+
+ // Change some property values and check that the properties of
+ // the ManagedComponent were updated appropriately
+ configureResource(CF_NAV_LABEL, cfType.getLabel(), jndiName,
+ propertiesMap, propertiesMapChanges, componentType,
+ expectedMessage);
+
+ assertTrue("The connection factory is not deployed ",
+ isDeployed(jndiName + "-ds.xml"));
+
+ // Clean up
+ deleteConnFactory(cfType, jndiName);
+ }
+
+ /**
+ * Test Name: testConfigureTxConnectionFactoryUnsetProperties
+ * Assertion: Verify the ability to unset Tx Connection Factory property values.
+ *
+ * Strategy: Create a new Tx Connection Factory. Unset some property values for the
+ * connection factory. Make sure other properties for the ManagedComponent
+ * remain unchanged.
+ */
+ public void testConfigureTxConnectionFactoryUnsetProperties() throws Exception {
+ String jndiName = "UnsetPropertiesTxCF";
+
+ // Create the connection factory first
+ createTxConnFactory(jndiName);
+
+ unsetConnFactoryProperties(CFType.LOCAL_TX_CF, jndiName, LOCAL_TX_COMPONENT_TYPE);
+ }
+
+ /**
+ * Test Name: testConfigureTxConnectionFactoryUnsetPropertiesUsingExistingDSFile
+ * Assertion: Verify the ability to unset Tx Connection Factory property values.
+ *
+ * Strategy: Unset some property values for an existing Tx Connection Factory.
+ * Make sure other properties for the ManagedComponent remain unchanged.
+ */
+ public void testConfigureTxConnectionFactoryUnsetPropertiesUsingExistingDSFile() throws Exception {
+ String jndiName = "UnsetPropertiesExistingTxCF";
+
+ expandNavTreeArrow(CF_NAV_LABEL);
+ unsetConnFactoryProperties(CFType.LOCAL_TX_CF, jndiName, LOCAL_TX_COMPONENT_TYPE);
+ }
+
+ /**
+ * Test Name: testConfigureNoTxConnectionFactoryUnsetProperties
+ * Assertion: Verify the ability to unset No Tx Connection Factory property values.
+ *
+ * Strategy: Create a new No Tx Connection Factory. Unset some property values for the
+ * connection factory. Make sure other properties for the ManagedComponent
+ * remain unchanged.
+ */
+ public void testConfigureNoTxConnectionFactoryUnsetProperties() throws Exception {
+ String jndiName = "UnsetPropertiesNoTxCF";
+
+ // Create the connection factory first
+ createNoTxConnFactory(jndiName);
+
+ unsetConnFactoryProperties(CFType.NO_TX_CF, jndiName, NO_TX_COMPONENT_TYPE);
+ }
+
+ /**
+ * Test Name: testConfigureNoTxConnectionFactoryUnsetPropertiesUsingExistingDSFile
+ * Assertion: Verify the ability to unset No Tx Connection Factory property values.
+ *
+ * Strategy: Unset some property values for an existing No Tx Connection Factory.
+ * Make sure other properties for the ManagedComponent remain unchanged.
+ */
+ public void testConfigureNoTxConnectionFactoryUnsetPropertiesUsingExistingDSFile() throws Exception {
+ String jndiName = "UnsetPropertiesExistingNoTxCF";
+
+ expandNavTreeArrow(CF_NAV_LABEL);
+ unsetConnFactoryProperties(CFType.NO_TX_CF, jndiName, NO_TX_COMPONENT_TYPE);
+ }
+
+ /**
+ * Common code for the testConfigure*UnsetProperties* tests.
+ */
+ private void unsetConnFactoryProperties(CFType cfType,
+ String jndiName,
+ ComponentType componentType) throws Exception {
+ Map<String, MetaValue> propertiesMap = getSpecificComponentProperties(jndiName, componentType);
+
+ String[] propertiesToUnset = new String[] { "min-pool-size" };
+ propertiesMap.remove("min-pool-size");
+
+ // The success message we should see
+ String expectedMessage = UPDATE_MESSAGE + cfType.getName() + " '"
+ + jndiName + "'";
+
+ unsetResourceProperties(CF_NAV_LABEL, cfType.getLabel(),
+ jndiName, propertiesMap, propertiesToUnset,
+ componentType, expectedMessage);
+
+ assertTrue("The connection factory is not deployed ",
+ isDeployed(jndiName + "-ds.xml"));
+
+ // Clean up
+ deleteConnFactory(cfType, jndiName);
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite() {
+ return new TestSuite(ConnFactoryConfigurationTest.class);
+ }
+}
Modified: 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 2009-05-21 14:47:23 UTC (rev 475)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryTest.java 2009-05-21 15:51:42 UTC (rev 476)
@@ -336,4 +336,21 @@
protected String getConnFactoryConfigFile(String jndiName) {
return System.getProperty("jsfunit.deploy.dir") + "/" + jndiName + "-ds.xml";
}
+
+ /**
+ * Create a map of property names to property values for a particular
+ * connection factory. The desired property names are given by specificProperties.
+ * (This is useful when we need to check the values of some specific properties
+ * only - eg. the configuration tests)
+ */
+ protected Map<String, MetaValue> getSpecificComponentProperties(String componentName,
+ ComponentType type) throws Exception {
+
+ String[] specificProperties = new String[] {"jndi-name", "rar-name", "connection-definition",
+ "min-pool-size", "max-pool-size",
+ "prefill", "idle-timeout-minutes",
+ "allocation-retry", "use-java-context",
+ "no-tx-separate-pools", "blocking-timeout-millis" };
+ return super.getSpecificComponentProperties(componentName, type, specificProperties);
+ }
}
Added: trunk/jsfunit/testdata/connfactories/ChangePropertiesExistingNoTxCF-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ChangePropertiesExistingNoTxCF-ds.xml (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ChangePropertiesExistingNoTxCF-ds.xml 2009-05-21 15:51:42 UTC (rev 476)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+ <no-tx-connection-factory>
+ <jndi-name>ChangePropertiesExistingNoTxCF</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/ChangePropertiesExistingTxCF-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/ChangePropertiesExistingTxCF-ds.xml (rev 0)
+++ trunk/jsfunit/testdata/connfactories/ChangePropertiesExistingTxCF-ds.xml 2009-05-21 15:51:42 UTC (rev 476)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+ <tx-connection-factory>
+ <jndi-name>ChangePropertiesExistingTxCF</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/UnsetPropertiesExistingNoTxCF-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/UnsetPropertiesExistingNoTxCF-ds.xml (rev 0)
+++ trunk/jsfunit/testdata/connfactories/UnsetPropertiesExistingNoTxCF-ds.xml 2009-05-21 15:51:42 UTC (rev 476)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+ <no-tx-connection-factory>
+ <jndi-name>UnsetPropertiesExistingNoTxCF</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/UnsetPropertiesExistingTxCF-ds.xml
===================================================================
--- trunk/jsfunit/testdata/connfactories/UnsetPropertiesExistingTxCF-ds.xml (rev 0)
+++ trunk/jsfunit/testdata/connfactories/UnsetPropertiesExistingTxCF-ds.xml 2009-05-21 15:51:42 UTC (rev 476)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<connection-factories>
+ <tx-connection-factory>
+ <jndi-name>UnsetPropertiesExistingTxCF</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>
15 years, 7 months
EMBJOPR SVN: r475 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-05-21 10:47:23 -0400 (Thu, 21 May 2009)
New Revision: 475
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java
Log:
testWarWithVirtualHosts() updated
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java 2009-05-21 14:04:17 UTC (rev 474)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java 2009-05-21 14:47:23 UTC (rev 475)
@@ -158,17 +158,25 @@
ejtt.navTree.waitUntilNodeLoadedByAjax(NAV_VIRTUAL_HOSTS, 1000, 6);
ejtt.navTree.getNodeByLabel(NAV_VIRTUAL_HOSTS).getLabelLink().click();
+
+ final String VHOST_1 = "snert.home.pilhuhn.de";
+ final String VHOST_2 = "snert.home.bsd.de";
+
// Check that vhosts from the WARare listed.
ContentTableRow row = ejtt.tabMenu.getTabContentBox().
- getDefaultTable().getFirstRowContainingLink("snert.home.pilhuhn.de");
+ getDefaultTable().getFirstRowContainingLink(VHOST_1);
if( null == row )
- throw new EmbJoprTestException("Vhost 'snert.home.pilhuhn.de' is not listed.", this);
+ throw new EmbJoprTestException("Vhost '"+VHOST_1+"' is not listed.", this);
row = ejtt.tabMenu.getTabContentBox().
- getDefaultTable().getFirstRowContainingLink("snert.home.bsd.de");
+ getDefaultTable().getFirstRowContainingLink(VHOST_2);
if( null == row )
- throw new EmbJoprTestException("Vhost 'snert.home.bsd.de' is not listed.", this);
+ throw new EmbJoprTestException("Vhost '"+VHOST_2+"' is not listed.", this);
+ // Expand the Virtual Hosts node
+ ejtt.navTree.getNodeByLabel(NAV_VIRTUAL_HOSTS).getArrowLink().click();
+ ejtt.navTree.getNodeByLabel(VHOST_1, true); // Throws if not found
+ ejtt.navTree.getNodeByLabel(VHOST_2, true); // Throws if not found
}
15 years, 7 months