EMBJOPR SVN: r644 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5/sbm and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-08-04 20:03:31 -0400 (Tue, 04 Aug 2009)
New Revision: 644
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesValidator.java
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheCacheTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheInterceptorTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
* Implemented the rest of JBoss Cache tests. Currently failing because of JOPR-334 and bad EJB package in use (TBD)
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheCacheTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheCacheTest.java 2009-08-05 00:02:03 UTC (rev 643)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheCacheTest.java 2009-08-05 00:03:31 UTC (rev 644)
@@ -1,27 +1,19 @@
package org.jboss.jopr.jsfunit.as5.jbcache;
-import com.gargoylesoftware.htmlunit.html.HtmlTable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit;
-import org.jboss.qa.jbcache.testear.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
-import org.jboss.jopr.jsfunit.ApplicationTestBaseAS5;
-import org.jboss.jopr.jsfunit.DebugUtils;
import org.jboss.jopr.jsfunit.exceptions.ActionOutOfSyncException;
import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
import org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTable;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTableRow;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.NavTreeNode;
-import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.NodeFinder;
/**
*
@@ -155,7 +147,7 @@
Properties props = new Properties();
props.setProperty("Name", "Cache");
- ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValues(props);
+ ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValuesEqual(props);
@@ -166,7 +158,7 @@
*/
props = new Properties();
props.setProperty("Number of Nodes", "1");
- ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(props);
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValuesEqual(props);
}
@@ -201,7 +193,7 @@
props.setProperty("Sync Commit Phase?", "false");
props.setProperty("State", "3");
props.setProperty("Transaction Manager Lookup Class", "org.jboss.cache.transaction.BatchModeTransactionManagerLookup");
- ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_TRAITS).checkValues(props);
+ ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_TRAITS).checkValuesEqual(props);
// Numeric metrics
@@ -214,7 +206,7 @@
props.setProperty("Number of Nodes", "1");
props.setProperty("Sync Replication Timeout", "17,500");
props.setProperty("State Retrieval Timeout", "60,000");
- ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(props);
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValuesEqual(props);
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheInterceptorTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheInterceptorTest.java 2009-08-05 00:02:03 UTC (rev 643)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jbcache/JBossCacheInterceptorTest.java 2009-08-05 00:03:31 UTC (rev 644)
@@ -6,12 +6,17 @@
import javax.naming.NamingException;
import org.jboss.qa.jbcache.testear.*;
import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
+import org.jboss.jopr.jsfunit.util.ValuesValidator;
/**
*
* @author Ondrej Zizka
*
* JBoss Cache is only present in 'all' JBoss AS profile.
+ *
+ *
+ * These tests are failing because of JOPR-334 .
+ *
*/
public class JBossCacheInterceptorTest extends JBossCacheTestBase {
@@ -24,38 +29,107 @@
if( isJBossConfigWithoutCache() ) return;
-
ejtt.deployment.deployViaEmbJopr( DeployableTypes.EAR, ejtt.getTestFilePath(this.APP_TYPE, JBCACHE_TEST_EAR));
+ try {
+ ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
+ ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+ // Gen Props - nothing useful.
+ Properties props = new Properties();
+ props.setProperty("Name", "Interceptor");
+ ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValuesEqual(props);
+
+
+ /*
+ Numeric Metrics
+ Hit/Miss Ratio 0 Hit/Miss Ratio
+ Read/Write Ratio 0 Read/Write Ratio
+ Number Of Attributes 0 the number of cache attributes
+ Average Write Time 0.0ms the average amount of time per write operation
+ Average Read Time 0.0ms the average amount of time per read operation
+ */
+ props = new Properties();
+ props.setProperty("Hit/Miss Ratio", "0");
+ props.setProperty("Read/Write Ratio", "0");
+ props.setProperty("Number Of Attributes", "0.0ms");
+ props.setProperty("Average Write Time", "0.0ms");
+ //props.setProperty("Average Read Time", "0.0ms");
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValuesEqual(props);
+
+ }
+ finally {
+ ejtt.deployment.undeployViaEmbJopr( DeployableTypes.EAR, JBCACHE_TEST_EAR );
+ }
+
+ }
+
+
+
+
+
+
+ /**
+ * Interceptor Summary tab after querying Hibernate.
+ */
+ public void testJBossCacheInterceptorSummary_AfterQuery() throws IOException, EmbJoprTestException, NamingException {
+ if( isJBossConfigWithoutCache() ) return;
+
+
+ // Go to the Interceptor's Summary tab and store the properties before query.
ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+ Properties propsFirst = ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).getProperties();
- // Gen Props - nothing useful.
- Properties props = new Properties();
- props.setProperty("Name", "Interceptor");
- ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValues(props);
- /*
- Numeric Metrics
- Hit/Miss Ratio 0 Hit/Miss Ratio
- Read/Write Ratio 0 Read/Write Ratio
- Number Of Attributes 0 the number of cache attributes
- Average Write Time 0.0ms the average amount of time per write operation
- Average Read Time 0.0ms the average amount of time per read operation
- */
- props = new Properties();
- props.setProperty("Hit/Miss Ratio", "0");
- props.setProperty("Read/Write Ratio", "0");
- props.setProperty("Number Of Attributes", "0.0ms");
- props.setProperty("Average Write Time", "0.0ms");
- props.setProperty("Average Read Time", "0.0ms");
- ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(props);
+ // Deploy an EAR.
+ ejtt.deployment.deployViaEmbJopr( DeployableTypes.EAR, ejtt.getTestFilePath(this.APP_TYPE, JBCACHE_TEST_EAR));
+ try {
- ejtt.deployment.undeployViaEmbJopr( DeployableTypes.EAR, JBCACHE_TEST_EAR );
+ // Run the test() method of the bean - performs few Hibernate operations.
+ performBeanRequest();
+
+
+ // Go back to the Interceptor's Summary tab.
+ ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
+ ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+
+ // Gen Props - nothing useful.
+ Properties props = new Properties();
+ props.setProperty("Name", "Interceptor");
+ ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValuesEqual(props);
+
+
+
+ // Check that the latter values are diffrent from the former.
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(propsFirst, ValuesValidator.NOT_EQUAL);
+
+
+ // Check that these metrics didn't stay at their init values.
+ /*
+ Numeric Metrics
+ Hit/Miss Ratio 0 Hit/Miss Ratio
+ Read/Write Ratio 0 Read/Write Ratio
+ Number Of Attributes 0 the number of cache attributes
+ Average Write Time 0.0ms the average amount of time per write operation
+ Average Read Time 0.0ms the average amount of time per read operation
+ */
+ props = new Properties();
+ props.setProperty("Hit/Miss Ratio", "0");
+ props.setProperty("Read/Write Ratio", "0");
+ props.setProperty("Number Of Attributes", "0.0ms");
+ props.setProperty("Average Write Time", "0.0ms");
+ props.setProperty("Average Read Time", "0.0ms");
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(props, ValuesValidator.NOT_EQUAL);
+
+ }
+ finally {
+ ejtt.deployment.undeployViaEmbJopr( DeployableTypes.EAR, JBCACHE_TEST_EAR );
+ }
+
}
@@ -63,56 +137,89 @@
+
+
/**
- * Interceptor Summary tab after querying Hibernate.
+ * Interceptor Metrics tab.
*/
- public void testJBossCacheInterceptorSummary_AfterQuery() throws IOException, EmbJoprTestException, NamingException {
+ public void testJBossCacheInterceptorMetrics() throws IOException, EmbJoprTestException {
if( isJBossConfigWithoutCache() ) return;
ejtt.deployment.deployViaEmbJopr( DeployableTypes.EAR, ejtt.getTestFilePath(this.APP_TYPE, JBCACHE_TEST_EAR));
+ try {
+ ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
+ ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+ ejtt.tabMenu.clickMetricsTab();
- final String BEAN_JNDI = "TestOperationBean/remote";
+ // Traits.
+ Properties props = new Properties();
+ props.setProperty("Statistics Enabled", "true");
+ ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_TRAITS).checkValuesEqual(props);
- // Query the bean.
- log.info("Looking up "+BEAN_JNDI+"...");
- InitialContext ctx = new InitialContext();
- TestOperation bean = (TestOperation) ctx.lookup(BEAN_JNDI);
+ // Numeric Metrics
+ props = getInitialMetricsProperties();
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValuesEqual(props);
- log.info("Sending request...");
- bean.test();
+ }
+ finally {
+ ejtt.deployment.undeployViaEmbJopr( DeployableTypes.EAR, JBCACHE_TEST_EAR );
+ }
+ }
+
+ /**
+ * Interceptor Metrics tab after querying Hibernate.
+ */
+ public void testJBossCacheInterceptorMetrics_AfterQuery() throws IOException, EmbJoprTestException, NamingException {
+ if( isJBossConfigWithoutCache() ) return;
+
+
+ // Go to the Interceptor's Metrics tab and store the properties before query.
ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+ ejtt.tabMenu.clickMetricsTab();
+ Properties propsFirst = ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).getProperties();
- // Gen Props - nothing useful.
- Properties props = new Properties();
- props.setProperty("Name", "Interceptor");
- ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValues(props);
- /*
- Numeric Metrics
- Hit/Miss Ratio 0 Hit/Miss Ratio
- Read/Write Ratio 0 Read/Write Ratio
- Number Of Attributes 0 the number of cache attributes
- Average Write Time 0.0ms the average amount of time per write operation
- Average Read Time 0.0ms the average amount of time per read operation
- */
- props = new Properties();
- props.setProperty("Hit/Miss Ratio", "0");
- props.setProperty("Read/Write Ratio", "0");
- props.setProperty("Number Of Attributes", "0.0ms");
- props.setProperty("Average Write Time", "0.0ms");
- props.setProperty("Average Read Time", "0.0ms");
- ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(props);
+ // Deploy an EAR.
+ ejtt.deployment.deployViaEmbJopr( DeployableTypes.EAR, ejtt.getTestFilePath(this.APP_TYPE, JBCACHE_TEST_EAR));
- ejtt.deployment.undeployViaEmbJopr( DeployableTypes.EAR, JBCACHE_TEST_EAR );
-
+ try {
+
+
+ // Run the test() method of the bean - performs few Hibernate operations.
+ performBeanRequest();
+
+
+ // Go back to the Interceptor's Metrics tab.
+ ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
+ ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+
+ // Gen Props - nothing useful.
+ Properties props = new Properties();
+ props.setProperty("Name", "Interceptor");
+ ejtt.getTabMenu().getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValuesEqual(props);
+
+
+ // Check that the latter values are diffrent from the former.
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(propsFirst, ValuesValidator.NOT_EQUAL);
+
+
+ // Check that these metrics didn't stay at their init values.
+ props = getInitialMetricsProperties();
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(props, ValuesValidator.NOT_EQUAL);
+
+ }
+ finally {
+ ejtt.deployment.undeployViaEmbJopr( DeployableTypes.EAR, JBCACHE_TEST_EAR );
+ }
+
}
@@ -122,5 +229,127 @@
+ /**
+ * Interceptor Control tab after querying Hibernate.
+ */
+ public void testJBossCacheInterceptorControl_AfterQuery() throws IOException, EmbJoprTestException, NamingException {
+ if( isJBossConfigWithoutCache() ) return;
+
+ // Go to the Interceptor's Control tab and store the properties before query.
+ ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
+ ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+ ejtt.tabMenu.clickMetricsTab();
+ Properties propsFirst = ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).getProperties();
+
+
+ // Deploy an EAR.
+ ejtt.deployment.deployViaEmbJopr( DeployableTypes.EAR, ejtt.getTestFilePath(this.APP_TYPE, JBCACHE_TEST_EAR));
+
+ try {
+
+
+ // Run the test() method of the bean - performs few Hibernate operations.
+ performBeanRequest();
+
+
+ // Go back to the Interceptor's Control tab and reset the statistics.
+ ejtt.navTree.getNodeByLabel(JBCACHE_HA_PARTITION).expand();
+ ejtt.navTree.getNodeByLabel(SUBNODE_INTERCEPTOR).click();
+ ejtt.tabMenu.clickMetricsTab();
+ Properties propsSecond = ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).getProperties();
+
+ ejtt.tabMenu.clickControlTab();
+
+ ejtt.tabMenu.getTabContentBox().getButtonByLabel("Reset Statistics");
+
+ // Check that these metrics didn't stay at their previous values.
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues(propsSecond, ValuesValidator.NOT_EQUAL);
+
+ // Check that these metrics are back at their initial values.
+ ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_NUMERIC_METRICS).checkValues( this.getInitialMetricsProperties(), ValuesValidator.EQUAL);
+
+ }
+ finally {
+ ejtt.deployment.undeployViaEmbJopr( DeployableTypes.EAR, JBCACHE_TEST_EAR );
+ }
+
+ }
+
+
+
+
+
+ // ------ Helper methods ------ //
+
+
+
+ /** Initial metrics values - should be there after start or reset. */
+ private Properties getInitialMetricsProperties(){
+ /*
+ Numeric Metrics
+ Name Value Description
+ Category: performance
+ Evictions 0 the number of cache eviction operations
+ Hit/Miss Ratio 0 Hit/Miss Ratio
+ Read/Write Ratio 0 Read/Write Ratio
+ NumberOfNodes 1 the number of nodes in the cache
+ Hits 0 the number of cache attribute hits
+ Number Of Attributes 0 the number of cache attributes
+ Misses 1 the number of cache attribute misses
+ Average Write Time 0.0ms the average amount of time per write operation
+ Stores 0 the number of cache attribute put operations
+ Average Read Time 18.0ms the average amount of time per read operation
+ Category: utilization
+ Elapsed Time 9.1m the time elapsed since the cache was started
+ Time Since Reset 9.1m the time elapsed since the cache statistics were last reset
+ */
+ Properties props = new Properties();
+ props.setProperty("Evictions", "0");
+ props.setProperty("NumberOfNodes", "1");
+ props.setProperty("Hits", "0");
+ props.setProperty("Misses", "1");
+ props.setProperty("Stores", "0");
+ props.setProperty("Hit/Miss Ratio", "0");
+ props.setProperty("Read/Write Ratio", "0");
+ props.setProperty("Number Of Attributes", "0");
+ props.setProperty("Average Write Time", "0.0ms");
+ //props.setProperty("Average Read Time", "18.0"); // Not zero after startup.
+
+ props.setProperty("Elapsed Time", "0.0");
+ props.setProperty("Time Since Reset", "0.0m");
+
+ return props;
+ }
+
+
+
+
+
+
+
+
+
+
+ /**
+ * Calls the test bean's methods which do some JPA entities manipulation.
+ * @throws javax.naming.NamingException
+ */
+ private void performBeanRequest() throws NamingException{
+ final String BEAN_JNDI = "TestOperationBean/remote";
+
+ // Query the bean.
+ log.info("Looking up "+BEAN_JNDI+"...");
+ InitialContext ctx = new InitialContext();
+ TestOperation bean = (TestOperation) ctx.lookup(BEAN_JNDI);
+
+ log.info("Sending request...");
+ bean.test();
+ }
+
+
+
+
+
+
}// class
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java 2009-08-05 00:02:03 UTC (rev 643)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/sbm/ServiceBindingManagerTest.java 2009-08-05 00:03:31 UTC (rev 644)
@@ -32,7 +32,7 @@
// Go to Service Binding Managers node.
ejtt.navTree.getNodeByLabel(NAV_SBM).click();
- ejtt.tabMenu.getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValues( new SingleProperties("Name", NAV_SBM) );
+ ejtt.tabMenu.getTabContentBox().getTableUnformatted(LABEL_GENERAL_PROPERTIES).checkValuesEqual( new SingleProperties("Name", NAV_SBM) );
}
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-08-05 00:02:03 UTC (rev 643)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-08-05 00:03:31 UTC (rev 644)
@@ -1357,7 +1357,7 @@
* Checks that name/value pairs in this table mach the given values.
* @throws EmbJoprTestException if any of given values does not match with the value in this table.
*/
- public void checkValues( Properties propsExpected ) throws EmbJoprTestException {
+ public void checkValuesEqual( Properties propsExpected ) throws EmbJoprTestException {
// Get this tables properties. Different table types can override this.
Properties propsActual = this.getProperties();
@@ -1394,13 +1394,56 @@
}
}
+ /**
+ * Checks that name/value pairs in this table mach the given values.
+ * @throws EmbJoprTestException if any of given values does not match with the value in this table.
+ */
+ public void checkValues( Properties propsExpected, ValuesValidator validator ) throws EmbJoprTestException {
+ // Get this tables properties. Different table types can override this.
+ Properties propsActual = this.getProperties();
+ // List the actual properties.
+ for( Object key : propsActual.keySet() ){
+ String propName = (String)key;
+ log.info("Actual property: '"+propName+"': '"+propsActual.getProperty(propName)+"'");
+ }
+
+ // List of non-equal properties.
+ List<String> failures = new ArrayList<String>();
+
+ // Check all the properties.
+ for( Object key : propsExpected.keySet() ){
+ String propName = (String)key;
+ log.info("Checking '"+propName+"'...");
+ String exp = propsExpected.getProperty(propName);
+ String act = propsActual.getProperty(propName);
+
+ exp = EmbjoprTestCase.normalizeIfNumber(exp);
+ act = EmbjoprTestCase.normalizeIfNumber(act);
+
+ String validationError = validator.validate( exp, act );
+ if( null != validationError ){
+ // If this table has a name, use it in the exception message.
+ String msgFormat = (null == this.getTableName() ? "%2$s: " : "%s - %s: ");
+ failures.add( String.format(msgFormat, this.getTableName(), propName) + validationError );
+ }
+
+ // If some did not match, throw an exception with their list.
+ if( failures.size() != 0 ){
+ throw new EmbJoprTestException( String.format("Non-matching properties: (%d of %d expected):\n", failures.size(), propsExpected.size()) + StringUtils.join(failures, "\n") );
+ }
+ }
+ }
+
+
}// inner class ContentTable
+
+
/**
* Creates a data table wrapper for first found element with one of these IDs:
* ID_CATEGORY_DATA_TABLE, ID_RESOURCE_DATA_TABLE
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesValidator.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesValidator.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesValidator.java 2009-08-05 00:03:31 UTC (rev 644)
@@ -0,0 +1,38 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.jboss.jopr.jsfunit.util;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Value validators.
+ * @author Ondrej Zizka
+ */
+public interface ValuesValidator {
+ /** Returns null if values are OK, or validation error description when validation fails. */
+ public String validate( String a, String b );
+
+ public static final ValuesValidator EQUAL = new ValuesValidator() {
+ public String validate( String exp, String act ){
+ if( !StringUtils.equals( exp, act ) ){
+ return String.format( "Expected '%s', actual '%s'.", exp, act );
+ }
+ return null;
+ }
+ };
+
+
+ public static final ValuesValidator NOT_EQUAL = new ValuesValidator() {
+ public String validate( String exp, String act ){
+ if( StringUtils.equals( exp, act ) ){
+ return String.format( "Expected different values, but both were '%s'.", act );
+ }
+ return null;
+ }
+ };
+
+}
+
15 years, 4 months
EMBJOPR SVN: r643 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-08-04 20:02:03 -0400 (Tue, 04 Aug 2009)
New Revision: 643
Modified:
trunk/jsfunit/pom.xml
Log:
* Updated POM - documented the properties that configure the test run.
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-08-04 17:10:06 UTC (rev 642)
+++ trunk/jsfunit/pom.xml 2009-08-05 00:02:03 UTC (rev 643)
@@ -3,14 +3,15 @@
<modelVersion>4.0.0</modelVersion>
<properties>
<jopr.version>1.2.0-SNAPSHOT</jopr.version>
- <cargo.jboss.configuration>default</cargo.jboss.configuration>
- <cargo.jboss.bind.address>localhost</cargo.jboss.bind.address>
- <cargo.plugin.version>1.0.1-SNAPSHOT</cargo.plugin.version><!-- Was: 1.0-SNAPSHOT -->
- <jvm.args.debug></jvm.args.debug>
+ <cargo.plugin.version>1.0.1-SNAPSHOT</cargo.plugin.version>
+ <jvm.args.debug></jvm.args.debug> <!-- Used by the -Pdebug profile. -->
+
+ <cargo.jboss.configuration>default</cargo.jboss.configuration><!-- JBoss AS configuration. -->
+ <cargo.jboss.bind.address>localhost</cargo.jboss.bind.address><!-- Address for JBoss AS to bind to. -->
<htmlunit.browser>ff3</htmlunit.browser><!-- ff2 | ff3 | ie6 | ie7 -->
- <jboss.isSecured>true</jboss.isSecured><!-- true | false ; True if JBoss AS/EAP is secured. -->
+ <jboss.isSecured>true</jboss.isSecured><!-- true | false ; True if JBoss AS/EAP is secured. Only informative for EJTT - has no effect on AS. -->
</properties>
-
+
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
15 years, 4 months
EMBJOPR SVN: r642 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: util and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-08-04 13:10:06 -0400 (Tue, 04 Aug 2009)
New Revision: 642
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
* JMS Operation tests enabled back.
* EJTT's getRows() temporarily changed to cope with EMBJOPR-228
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-07-31 20:24:59 UTC (rev 641)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java 2009-08-04 17:10:06 UTC (rev 642)
@@ -63,7 +63,7 @@
* after executing the "Remove All Messages" operation for a topic
* when there are no messages.
*/
- public void XtextRemoveAllMessagesAfterTopicCreation() throws Exception {
+ public void testRemoveAllMessagesAfterTopicCreation() throws Exception {
String jndiName = "RemoveAllMessagesAfterTopicCreation";
// Create the topic first
@@ -142,7 +142,7 @@
* after executing the "Remove All Messages" operation for a queue
* when there are no messages.
*/
- public void XtextRemoveAllMessagesAfterQueueCreation() throws Exception {
+ public void testRemoveAllMessagesAfterQueueCreation() throws Exception {
String jndiName = "RemoveAllMessagesMAfterQueueCreation";
@@ -229,7 +229,7 @@
* after executing the "Reset Message Counter" operation for a queue
* right after creation.
*/
- public void XtextResetMessageCounterAfterQueueCreation() throws Exception {
+ public void testResetMessageCounterAfterQueueCreation() throws Exception {
String jndiName = "ResetMessageCounterAfterQueueCreation";
// Create the queue first
@@ -258,7 +258,7 @@
* after executing the "Reset Message Counter" operation for a queue
* when there are multiple messages in the queue.
*/
- public void XtextQueueResetMessageCounterAfterMultipleMessages() throws Exception {
+ public void testQueueResetMessageCounterAfterMultipleMessages() throws Exception {
String jndiName = "QueueResetMessageCounterAfterMultipleMessages";
// Create the queue first
@@ -273,7 +273,7 @@
* when there are multiple messages in the queue. Use a queue that
* already exists.
*/
- public void XtextQueueResetMessageCounterAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testQueueResetMessageCounterAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ResetMessageCounterMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -313,7 +313,7 @@
* executing the "Reset Message Counter History" operation for a queue
* after creation.
*/
- public void XtextResetMessageCounterHistoryAfterQueueCreation() throws Exception {
+ public void testResetMessageCounterHistoryAfterQueueCreation() throws Exception {
String jndiName = "ResetMessageCounterHistoryAfterQueueCreation";
// Create the queue first
@@ -342,7 +342,7 @@
* executing the "Reset Message Counter History" operation for a queue
* that has multiple messages.
*/
- public void XtextQueueResetMessageCounterHistoryAfterMultipleMessages() throws Exception {
+ public void testQueueResetMessageCounterHistoryAfterMultipleMessages() throws Exception {
String jndiName = "QueueResetMessageCounterHistoryAfterMultipleMessages";
// Create the queue first
@@ -356,7 +356,7 @@
* executing the "Reset Message Counter History" operation for a queue
* that has multiple messages. Use a queue that already exists.
*/
- public void XtextQueueResetMessageCounterHistoryAfterMultipleMessagesUsingExsitingServiceFile() throws Exception {
+ public void testQueueResetMessageCounterHistoryAfterMultipleMessagesUsingExsitingServiceFile() throws Exception {
String jndiName = "ResetMessageCounterHistoryMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -395,7 +395,7 @@
* after the "List All Subscriptions" operation is invoked for
* a topic right after creation.
*/
- public void XtextListAllSubscriptionsAfterTopicCreation() throws Exception {
+ public void testListAllSubscriptionsAfterTopicCreation() throws Exception {
String jndiName = "ListAllSubscriptionsAfterTopicCreation";
// Create the topic first
@@ -425,7 +425,7 @@
* the "List All Subscriptions" operation for a topic that has multiple subscribers.
* Use a topic that already exists.
*/
- public void XtextTopicListAllSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
+ public void testTopicListAllSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
String jndiName = "ListAllSubscriptionsMultipleSubscribersExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -457,7 +457,7 @@
* after the "List Durable Subscriptions" operation is invoked for
* a topic right after creation.
*/
- public void XtextListDurableSubscriptionsAfterTopicCreation() throws Exception {
+ public void testListDurableSubscriptionsAfterTopicCreation() throws Exception {
String jndiName = "ListDurableSubscriptionsAfterTopicCreation";
// Create the topic first
@@ -472,7 +472,7 @@
* the "List Durable Subscriptions" operation for a topic that has multiple
* durable subscribers.
*/
- public void XtextTopicListDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
+ public void testTopicListDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
String jndiName = "ListDurableSubscriptionsAfterMultipleSubscribers";
// Create the topic first
@@ -487,7 +487,7 @@
* the "List Durable Subscriptions" operation for a topic that has multiple
* durable subscribers. Use a topic that already exists.
*/
- public void XtextTopicListDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
+ public void testTopicListDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
String jndiName = "ListDurableSubscriptionsMultipleSubscribersExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -512,7 +512,7 @@
* after the "List Non Durable Subscriptions" operation is invoked for
* a topic right after creation.
*/
- public void XtextListNonDurableSubscriptionsAfterTopicCreation() throws Exception {
+ public void testListNonDurableSubscriptionsAfterTopicCreation() throws Exception {
String jndiName = "ListNonDurableSubscriptionsAfterTopicCreation";
// Create the topic first
@@ -527,7 +527,7 @@
* the "List Non Durable Subscriptions" operation for a topic that has multiple
* non-durable subscribers.
*/
- public void XtextTopicListNonDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
+ public void testTopicListNonDurableSubscriptionsAfterMultipleSubscribers() throws Exception {
String jndiName = "ListNonDurableSubscriptionsAfterMultipleSubscribers";
// Create the topic first
@@ -542,7 +542,7 @@
* the "List Non Durable Subscriptions" operation for a topic that has multiple
* non-durable subscribers. Use a topic that already exists.
*/
- public void XtextTopicListNonDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
+ public void testTopicListNonDurableSubscriptionsAfterMultipleSubscribersUsingExistingServiceFile() throws Exception {
String jndiName = "ListNonDurableSubscriptionsMultipleSubscribersExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -568,7 +568,7 @@
* operation for queues is executed successfully after creating
* a new queue.
*/
- public void XtextListMessageCounterAsHTMLAfterQueueCreation() throws Exception {
+ public void testListMessageCounterAsHTMLAfterQueueCreation() throws Exception {
ArrayList<String> expectedValues = new ArrayList<String>();
String jndiName = "ListMessageCounterAfterQueueCreation";
@@ -603,7 +603,7 @@
* operation for queues returns the correct results when the queue has
* multiple messages.
*/
- public void XtextListMessageCounterAsHTMLAfterMultipleMessagess() throws Exception {
+ public void testListMessageCounterAsHTMLAfterMultipleMessagess() throws Exception {
String jndiName = "ListMessageCounterAfterMultipleMessages";
// Create the queue first
@@ -618,7 +618,7 @@
* operation for queues returns the correct results when the queue has
* multiple messages. Use a queue that already exists.
*/
- public void XtextListMessageCounterAsHTMLAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testListMessageCounterAsHTMLAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListMessageCounterMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -663,7 +663,7 @@
* operation for queues returns the correct results after creating
* a new queue.
*/
- public void XtextListMessageCounterHistoryAsHTMLAfterQueueCreation() throws Exception {
+ public void testListMessageCounterHistoryAsHTMLAfterQueueCreation() throws Exception {
String jndiName = "ListMessageCounterHistoryAfterQueueCreation";
ArrayList<String> expectedValue = new ArrayList<String>();
@@ -685,7 +685,7 @@
* operation for queues returns the correct results. Use a queue that already
* exists.
*/
- public void XtextListMessageCounterHistoryAsHTMLUsingExistingServiceFile() throws Exception {
+ public void testListMessageCounterHistoryAsHTMLUsingExistingServiceFile() throws Exception {
String jndiName = "ListMessageCounterHistoryExistingQueue";
ArrayList<String> expectedValue = new ArrayList<String>();
@@ -708,7 +708,7 @@
* operation for topics returns the correct results after creating
* a new topic.
*/
- public void XtextListDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
+ public void testListDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
String jndiName = "ListDurableSubscriptionsHtmlAfterTopicCreation";
// Create the topic first
@@ -726,7 +726,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers.
*/
- public void XtextListDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
+ public void testListDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
throws Exception {
String jndiName = "ListDurableSubscriptionsHtmlAfterMultipleSubscribers";
@@ -741,7 +741,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers. Use a topic that already exists.
*/
- public void XtextListDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
+ public void testListDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
throws Exception {
String jndiName = "ListDurableSubscriptionsHtmlMultipleSubscribersExistingTopic";
@@ -795,7 +795,7 @@
* operation for topics returns the correct results after creating
* a new topic.
*/
- public void XtextListNonDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
+ public void testListNonDurableSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
String jndiName = "ListNonDurableSubscriptionsHtmlAfterTopicCreation";
// Create the topic first
@@ -813,7 +813,7 @@
* operation for topics returns the correct results when the topic
* has multiple non durable subscribers.
*/
- public void XtextListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
+ public void testListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribers()
throws Exception {
String jndiName = "ListNonDurableSubscriptionsHtmlAfterMultipleSubscribers";
@@ -828,7 +828,7 @@
* operation for topics returns the correct results when the topic
* has multiple non durable subscribers. Use a topic that already exists.
*/
- public void XtextListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
+ public void testListNonDurableSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
throws Exception {
String jndiName = "ListNonDurableSubscriptionsHtmlMultipleSubscribersExistingTopic";
@@ -871,7 +871,7 @@
* operation for topics returns the correct results after creating
* a new topic.
*/
- public void XtextListAllSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
+ public void testListAllSubscriptionsAsHTMLAfterTopicCreation() throws Exception {
String jndiName = "ListAllSubscriptionsHtmlAfterTopicCreation";
// Create the topic first
@@ -889,7 +889,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers.
*/
- public void XtextListAllSubscriptionsAsHTMLAfterMultipleSubscribers()
+ public void testListAllSubscriptionsAsHTMLAfterMultipleSubscribers()
throws Exception {
String jndiName = "ListAllSubscriptionsHtmlAfterMultipleSubscribers";
@@ -904,7 +904,7 @@
* operation for topics returns the correct results when the topic
* has multiple durable subscribers. Use a topic that already exists.
*/
- public void XtextListAllSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
+ public void testListAllSubscriptionsAsHTMLAfterMultipleSubscribersUsingExistingServiceFile()
throws Exception {
String jndiName = "ListAllSubscriptionsHtmlMultipleSubscribersExistingTopic";
@@ -1078,7 +1078,7 @@
* Assertion: Make sure that the "Start" operation for topics is executed
* successfully.
*/
- public void XtextTopicStartOperation() throws Exception {
+ public void testTopicStartOperation() throws Exception {
String jndiName = "TopicStart";
// Create the topic first
@@ -1093,7 +1093,7 @@
* Assertion: Make sure that the "Start" operation for topics is executed
* successfully. Use a topic that already exists.
*/
- public void XtextTopicStartOperationUsingExistingServiceFile() throws Exception {
+ public void testTopicStartOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StartOperationExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1107,7 +1107,7 @@
* Assertion: Make sure that the "Start" operation for queues is executed
* successfully.
*/
- public void XtextQueueStartOperation() throws Exception {
+ public void testQueueStartOperation() throws Exception {
String jndiName = "QueueStart";
// Create the queue first
@@ -1122,7 +1122,7 @@
* Assertion: Make sure that the "Start" operation for queues is executed
* successfully. Use a queue that already exists.
*/
- public void XtextQueueStartOperationUsingExistingServiceFile() throws Exception {
+ public void testQueueStartOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StartOperationExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1200,7 +1200,7 @@
* Assertion: Make sure that the "Stop" operation for topics is executed
* successfully.
*/
- public void XtextTopicStopOperation() throws Exception {
+ public void testTopicStopOperation() throws Exception {
String jndiName = "TopicStop";
// Create the topic first
@@ -1215,7 +1215,7 @@
* Assertion: Make sure that the "Stop" operation for topics is executed
* successfully. Use a topic that already exists.
*/
- public void XtextTopicStopOperationUsingExistingServiceFile() throws Exception {
+ public void testTopicStopOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StopOperationExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1229,7 +1229,7 @@
* Assertion: Make sure that the "Stop" operation for queues is executed
* successfully.
*/
- public void XtextQueueStopOperation() throws Exception {
+ public void testQueueStopOperation() throws Exception {
String jndiName = "QueueStop";
// Create the queue first
@@ -1244,7 +1244,7 @@
* Assertion: Make sure that the "Stop" operation for queues is executed
* successfully. Use a queue that already exists.
*/
- public void XtextQueueStopOperationUsingExistingServiceFile() throws Exception {
+ public void testQueueStopOperationUsingExistingServiceFile() throws Exception {
String jndiName = "StopOperationExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1260,7 +1260,7 @@
* Assertion: Make sure that the "List All Messages" operation for topics
* returns the correct results after creating a new topic.
*/
- public void XtextListAllMessagesAfterTopicCreation() throws Exception {
+ public void testListAllMessagesAfterTopicCreation() throws Exception {
String jndiName = "ListAllMessagesAfterTopicCreation";
// Create the topic first
@@ -1282,7 +1282,7 @@
* Assertion: Make sure that the "List All Messages" operation for topics
* returns the correct results when the topic has multiple messages.
*/
- public void XtextTopicListAllMessagesAfterMultipleMessages() throws Exception {
+ public void testTopicListAllMessagesAfterMultipleMessages() throws Exception {
String jndiName = "TopicListAllMessagesAfterMultipleMessages";
// Create the topic first
@@ -1296,7 +1296,7 @@
* returns the correct results when the topic has multiple messages.
* Use a topic that already exists.
*/
- public void XtextTopicListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testTopicListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListAllMessagesMultipleMessagesExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1336,7 +1336,7 @@
* Assertion: Make sure that the "List All Messages" operation for queues
* returns the correct results after creating a new queue.
*/
- public void XtextListAllMessagesAfterQueueCreation() throws Exception {
+ public void testListAllMessagesAfterQueueCreation() throws Exception {
String jndiName = "ListAllMessagesAfterQueueCreation";
// Create the queue first
@@ -1356,7 +1356,7 @@
* Assertion: Make sure that the "List All Messages" operation for queues
* returns the correct results when the queue has multiple messages.
*/
- public void XtextQueueListAllMessagesAfterMultipleMessages() throws Exception {
+ public void testQueueListAllMessagesAfterMultipleMessages() throws Exception {
String jndiName = "QueueListAllMessagesAfterMultipleMessages";
// Create the queue first
@@ -1370,7 +1370,7 @@
* returns the correct results when the queue has multiple messages.
* Use a queue that already exists.
*/
- public void XtextQueueListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testQueueListAllMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListAllMessagesMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1409,7 +1409,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for topics
* returns the correct results after creating a new topic.
*/
- public void XtextListDurableMessagesAfterTopicCreation() throws Exception {
+ public void testListDurableMessagesAfterTopicCreation() throws Exception {
String jndiName = "ListDurableMessagesAfterTopicCreation";
// Create the topic first
@@ -1431,7 +1431,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for topics
* returns the correct results when the topic has multiple messages.
*/
- public void XtextTopicListDurableMessagesAfterMultipleMessages() throws Exception {
+ public void testTopicListDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "TopicListDurableMessagesAfterMultipleMessages";
// Create the topic first
@@ -1445,7 +1445,7 @@
* returns the correct results when the topic has multiple messages.
* Use a topic that already exists.
*/
- public void XtextTopicListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testTopicListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListDurableMessagesMultipleMessagesExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1483,7 +1483,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for
* queues returns the correct results after creating a new queue.
*/
- public void XtextListDurableMessagesAfterQueueCreation() throws Exception {
+ public void testListDurableMessagesAfterQueueCreation() throws Exception {
String jndiName = "ListDurableMessagesAfterQueueCreation";
// Create the queue first
@@ -1503,7 +1503,7 @@
* Assertion: Make sure that the "List Durable Messages" operation for queues
* returns the correct results when the queue has multiple messages.
*/
- public void XtextQueueListDurableMessagesAfterMultipleMessages() throws Exception {
+ public void testQueueListDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "QueueListDurableMessagesAfterMultipleMessages";
// Create the queue first
@@ -1517,7 +1517,7 @@
* returns the correct results when the queue has multiple messages. Use a queue
* that already exists.
*/
- public void XtextQueueListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testQueueListDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListDurableMessagesMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1552,7 +1552,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* topics returns the correct results after creating a new topic.
*/
- public void XtextListNonDurableMessagesAfterTopicCreation() throws Exception {
+ public void testListNonDurableMessagesAfterTopicCreation() throws Exception {
String jndiName = "ListNonDurableMessagesAfterTopicCreation";
// Create the topic first
@@ -1573,7 +1573,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* topics returns the correct results when the topic has multiple messages.
*/
- public void XtextTopicListNonDurableMessagesAfterMultipleMessages() throws Exception {
+ public void testTopicListNonDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "TopicListNonDurableMessagesAfterMultipleMessages";
// Create the topic first
@@ -1587,7 +1587,7 @@
* topics returns the correct results when the topic has multiple messages.
* Use a topic that already exists.
*/
- public void XtextTopicListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testTopicListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListNonDurableMessagesMultipleMessagesExistingTopic";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1646,7 +1646,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* queues returns the correct results after creating a new queue.
*/
- public void XtextListNonDurableMessagesAfterQueueCreation() throws Exception {
+ public void testListNonDurableMessagesAfterQueueCreation() throws Exception {
String jndiName = "ListNonDurableMessagesAfterQueueCreation";
// Create the queue first
@@ -1666,7 +1666,7 @@
* Assertion: Make sure that the "List Non Durable Messages" operation for
* queues returns the correct results when the queue has multiple messages.
*/
- public void XtextQueueListNonDurableMessagesAfterMultipleMessages() throws Exception {
+ public void testQueueListNonDurableMessagesAfterMultipleMessages() throws Exception {
String jndiName = "QueueListNonDurableMessagesAfterMultipleMessages";
// Create the queue first
@@ -1680,7 +1680,7 @@
* queues returns the correct results when the queue has multiple messages.
* Use a queue that already exists.
*/
- public void XtextQueueListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
+ public void testQueueListNonDurableMessagesAfterMultipleMessagesUsingExistingServiceFile() throws Exception {
String jndiName = "ListNonDurableMessagesMultipleMessagesExistingQueue";
expandNavTreeArrow(JMS_NAV_LABEL);
@@ -1900,11 +1900,15 @@
// Find the result values table.
HtmlDivision opResDiv = (HtmlDivision) client.getElement("operationResults");
+ log.debug("opRes div: "+opResDiv.getTextContent());
+
final String xPath = ".//table[ contains( @class, 'properties-table' ) ]//table[ contains( @class, 'property-map-summary-table' ) ]";
ContentTable opResultTable = ejtt.getTable((HtmlTable) opResDiv.getFirstByXPath(xPath) );
if( null == opResultTable )
throw new org.jboss.jopr.jsfunit.exceptions.HtmlElementNotFoundException("Can't find operation result table: "+xPath, this);
+ log.debug("property-map-summary-table: "+opResultTable.getElement().getTextContent());
+
// Get the rows and list them.
List<ContentTableRow> rows = opResultTable.getRows();
int subscCount = rows.size() -1;
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-07-31 20:24:59 UTC (rev 641)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-08-04 17:10:06 UTC (rev 642)
@@ -1206,7 +1206,26 @@
if( 0 == element.getRowCount() )
return Collections.EMPTY_LIST;
- String xPath = "./tbody/tr[not( contains( @class , 'categoryRow') )]";
+ /// debug
+ // This was caused by EMBJOPR-228
+ /*
+ String xPath_ = "./tbody/tr";
+ List<HtmlTableRow> trList_ = (List) element.getByXPath(xPath_);
+ xPath_ = ".//tr";
+ trList_ = (List) element.getByXPath(xPath_);
+
+ // Other way:
+ {
+ List<HtmlTableRow> rowElems = element.getRows();
+ List<ContentTableRow> rows = new ArrayList(rowElems.size());
+ for (HtmlTableRow tr : rowElems) {
+ rows.add( new ContentTableRow(tr, this));
+ }
+ }*/
+
+ //String xPath = "./tbody/tr[not( contains( @class , 'categoryRow') )]";
+ // TODO: Put back the line above once EMBJOPR-228 is fixed.
+ String xPath = "./tbody/tr[not( contains( @class , 'categoryRow') )] | ./tbody/div/tr[not( contains( @class , 'categoryRow') )]";
List<HtmlTableRow> trList = (List) element.getByXPath(xPath);
List<ContentTableRow> rows = new ArrayList(trList.size());
for (HtmlTableRow tr : trList) {
15 years, 4 months