[embjopr-commits] EMBJOPR SVN: r713 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Thu Aug 27 23:06:02 EDT 2009


Author: ozizka at redhat.com
Date: 2009-08-27 23:06:01 -0400 (Thu, 27 Aug 2009)
New Revision: 713

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java
Log:
 * JMSOperationsTest updated.

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-08-28 02:58:40 UTC (rev 712)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/jmsDestinations/JMSOperationsTest.java	2009-08-28 03:06:01 UTC (rev 713)
@@ -959,6 +959,14 @@
                                             String operationName,
                                             Boolean takesParameters,
                                             ArrayList<String> expectedValues) throws Exception {
+			performListAsHtmlOperation(jndiName, destinationType, operationName, takesParameters, expectedValues, false);
+		}
+    private void performListAsHtmlOperation(String jndiName,
+                                            DestinationType destinationType,
+                                            String operationName,
+                                            Boolean takesParameters,
+                                            ArrayList<String> expectedValues,
+																						boolean isRegEx) throws Exception {
         
         performResourceOperation(JMS_NAV_LABEL, destinationType.getNavLabel(), 
                                  jndiName, operationName, takesParameters);
@@ -978,9 +986,13 @@
         
         assertFalse("The result of the operation was an empty string", result.equals(""));
         for(int i = 0; i < expectedValues.size(); i++) {
-					//if( !shortenedResult.contains(expectedValues.get(i)) )
-					if( !shortenedResult.matches(expectedValues.get(i)) )
-						fail("Expected the result to match:\n\n" + expectedValues.get(i) + "\n\nbut was:\n\n" + shortenedResult);
+					boolean isSuccess = isRegEx
+						? shortenedResult.matches(expectedValues.get(i))
+						: shortenedResult.contains(expectedValues.get(i)) ;
+					String condVerb = isRegEx ? "match" : "contain";
+
+					if( !isSuccess )
+						fail("Expected the result to "+condVerb+":\n\n" + expectedValues.get(i) + "\n\nbut was:\n\n" + shortenedResult);
         }
         
         // Clean up



More information about the embjopr-commits mailing list