You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2009/12/13 18:56:44 UTC

svn commit: r890084 - /wicket/trunk/wicket/src/test/java/org/apache/wicket/util/string/JavascriptStripperTest.java

Author: jdonnerstag
Date: Sun Dec 13 17:56:44 2009
New Revision: 890084

URL: http://svn.apache.org/viewvc?rev=890084&view=rev
Log: (empty)

Modified:
    wicket/trunk/wicket/src/test/java/org/apache/wicket/util/string/JavascriptStripperTest.java

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/util/string/JavascriptStripperTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/util/string/JavascriptStripperTest.java?rev=890084&r1=890083&r2=890084&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/util/string/JavascriptStripperTest.java (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/util/string/JavascriptStripperTest.java Sun Dec 13 17:56:44 2009
@@ -27,37 +27,37 @@
 {
 	public void testUNIXWICKET501()
 	{
-		String s = JavascriptStripper.stripCommentsAndWhitespace("    // Handle the common XPath // expression\n    if ( !t.indexOf(\"//\") ) {");
+		String s = new JavascriptStripper().stripCommentsAndWhitespace("    // Handle the common XPath // expression\n    if ( !t.indexOf(\"//\") ) {");
 		assertEquals("  if ( !t.indexOf(\"//\") ) {", s);
 	}
 
 	public void testDOSWICKET501()
 	{
-		String s = JavascriptStripper.stripCommentsAndWhitespace("    // Handle the common XPath // expression\r\n    if ( !t.indexOf(\"//\") ) {");
+		String s = new JavascriptStripper().stripCommentsAndWhitespace("    // Handle the common XPath // expression\r\n    if ( !t.indexOf(\"//\") ) {");
 		assertEquals(" \nif ( !t.indexOf(\"//\") ) {", s);
 	}
 
 	public void testMACWICKET501()
 	{
-		String s = JavascriptStripper.stripCommentsAndWhitespace("    // Handle the common XPath // expression\r    if ( !t.indexOf(\"//\") ) {");
+		String s = new JavascriptStripper().stripCommentsAndWhitespace("    // Handle the common XPath // expression\r    if ( !t.indexOf(\"//\") ) {");
 		assertEquals("  if ( !t.indexOf(\"//\") ) {", s);
 	}
 
 	public void testRegexp()
 	{
-		String s = JavascriptStripper.stripCommentsAndWhitespace("    t = jQuery.trim(t).replace( /^\\/\\//i, \"\" );");
+		String s = new JavascriptStripper().stripCommentsAndWhitespace("    t = jQuery.trim(t).replace( /^\\/\\//i, \"\" );");
 		assertEquals(" t = jQuery.trim(t).replace( /^\\/\\//i, \"\" );", s);
 	}
 
 	public void testRegexp2()
 	{
-		String s = JavascriptStripper.stripCommentsAndWhitespace("foo.replace(/\"//*strip me*/, \"\"); // strip me\rdoFoo();");
+		String s = new JavascriptStripper().stripCommentsAndWhitespace("foo.replace(/\"//*strip me*/, \"\"); // strip me\rdoFoo();");
 		assertEquals("foo.replace(/\"/, \"\"); doFoo();", s);
 	}
 
 	public void testRegexp3()
 	{
-		String s = JavascriptStripper.stripCommentsAndWhitespace("parseFloat( elem.filter.match(/alpha\\(opacity=(.*)\\)/)[1] ) / 100 : 1;\r//foo");
+		String s = new JavascriptStripper().stripCommentsAndWhitespace("parseFloat( elem.filter.match(/alpha\\(opacity=(.*)\\)/)[1] ) / 100 : 1;\r//foo");
 		assertEquals("parseFloat( elem.filter.match(/alpha\\(opacity=(.*)\\)/)[1] ) / 100 : 1;\r",
 			s);
 	}
@@ -65,7 +65,7 @@
 	public void testRegexp4()
 	{
 		String before = " attr: /**/ //xyz\n /\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*((['\"])([^\\4]*?)\\4|([^'\"][^\\]]*?)))?\\]/    after     regex";
-		String after = JavascriptStripper.stripCommentsAndWhitespace(before);
+		String after = new JavascriptStripper().stripCommentsAndWhitespace(before);
 		String expected = " attr:   /\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*((['\"])([^\\4]*?)\\4|([^'\"][^\\]]*?)))?\\]/ after regex";
 		assertEquals(expected, after);
 		System.out.println(after);
@@ -74,7 +74,7 @@
 	public void testWICKET1806()
 	{
 		String before = "a = [ /^(\\[) *@?([\\w-]+) *([!*$^~=]*) *('?\"?)(.*?)\\4 *\\]/ ];    b()";
-		String after = JavascriptStripper.stripCommentsAndWhitespace(before);
+		String after = new JavascriptStripper().stripCommentsAndWhitespace(before);
 		String expected = "a = [ /^(\\[) *@?([\\w-]+) *([!*$^~=]*) *('?\"?)(.*?)\\4 *\\]/ ]; b()";
 
 		assertEquals(expected, after);
@@ -83,7 +83,7 @@
 	public void testWICKET2060_1()
 	{
 		String before = "   a   b   c";
-		String after = JavascriptStripper.stripCommentsAndWhitespace(before);
+		String after = new JavascriptStripper().stripCommentsAndWhitespace(before);
 		String expected = " a b c";
 		assertEquals(expected, after);
 	}
@@ -91,7 +91,7 @@
 	public void testWICKET2060_2()
 	{
 		String before = "   a \n  b   c\n\n";
-		String after = JavascriptStripper.stripCommentsAndWhitespace(before);
+		String after = new JavascriptStripper().stripCommentsAndWhitespace(before);
 		String expected = " a\nb c\n";
 		assertEquals(expected, after);
 	}
@@ -99,7 +99,7 @@
 	public void testWICKET2060_3()
 	{
 		String before = "return  this.__unbind__(type, fn);";
-		String after = JavascriptStripper.stripCommentsAndWhitespace(before);
+		String after = new JavascriptStripper().stripCommentsAndWhitespace(before);
 		String expected = "return this.__unbind__(type, fn);";
 		assertEquals(expected, after);
 	}