velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r679532 - /velocity/tools/trunk/src/test/java/org/apache/velocity/tools/test/blackbox/ViewToolsTests.java
Date Thu, 24 Jul 2008 20:39:24 GMT
Author: nbubna
Date: Thu Jul 24 13:39:23 2008
New Revision: 679532

URL: http://svn.apache.org/viewvc?rev=679532&view=rev
Log:
ignore new lines when testing to simplify regexs

Modified:
    velocity/tools/trunk/src/test/java/org/apache/velocity/tools/test/blackbox/ViewToolsTests.java

Modified: velocity/tools/trunk/src/test/java/org/apache/velocity/tools/test/blackbox/ViewToolsTests.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/test/java/org/apache/velocity/tools/test/blackbox/ViewToolsTests.java?rev=679532&r1=679531&r2=679532&view=diff
==============================================================================
--- velocity/tools/trunk/src/test/java/org/apache/velocity/tools/test/blackbox/ViewToolsTests.java
(original)
+++ velocity/tools/trunk/src/test/java/org/apache/velocity/tools/test/blackbox/ViewToolsTests.java
Thu Jul 24 13:39:23 2008
@@ -120,7 +120,9 @@
         HTMLElement element = resp.getElementWithID(id);
         assertNotNull(element);
         Pattern pattern = Pattern.compile(regex);
-        Matcher matcher = pattern.matcher(element.getText());
+        // strip new lines from string to be tested
+        String text = element.getText().replace("\n","");
+        Matcher matcher = pattern.matcher(text);
         if (!matcher.matches())
         {
             fail(element.getText()+" did not match "+regex);



Mime
View raw message