Examples of JavaScriptStripper


Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void WICKET2060_2()
  {
    String before = "   a \n  b   c\n\n";
    String after = new JavaScriptStripper().stripCommentsAndWhitespace(before);
    String expected = " a\nb c\n";
    assertEquals(expected, after);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void WICKET2060_3()
  {
    String before = "return  this.__unbind__(type, fn);";
    String after = new JavaScriptStripper().stripCommentsAndWhitespace(before);
    String expected = "return this.__unbind__(type, fn);";
    assertEquals(expected, after);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**     */
  @Test
  public void WICKET4760()
  {
    String before = "x++ //\nx++";
    String after = new JavaScriptStripper().stripCommentsAndWhitespace(before);
    String expected = "x++ \nx++";
    assertEquals(expected, after);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void regExThatStartsWithExclamationMark()
  {
    String result = new JavaScriptStripper().stripCommentsAndWhitespace(TESTSTRING2);
    assertFalse(result.contains("This code will be stripped"));
    assertTrue(result.contains("something bad will happen"));
    assertTrue(result.contains("really important function"));

    System.out.println(result);
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

{
  /**   */
  @Test
  public void unixWICKET501()
  {
    String s = new JavaScriptStripper().stripCommentsAndWhitespace("    // Handle the common XPath // expression\n    if ( !t.indexOf(\"//\") ) {");
    assertEquals("  if ( !t.indexOf(\"//\") ) {", s);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void dosWICKET501()
  {
    String s = new JavaScriptStripper().stripCommentsAndWhitespace("    // Handle the common XPath // expression\r\n    if ( !t.indexOf(\"//\") ) {");
    assertEquals(" \nif ( !t.indexOf(\"//\") ) {", s);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void macWICKET501()
  {
    String s = new JavaScriptStripper().stripCommentsAndWhitespace("    // Handle the common XPath // expression\r    if ( !t.indexOf(\"//\") ) {");
    assertEquals("  if ( !t.indexOf(\"//\") ) {", s);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void regexp()
  {
    String s = new JavaScriptStripper().stripCommentsAndWhitespace("    t = jQuery.trim(t).replace( /^\\/\\//i, \"\" );");
    assertEquals(" t = jQuery.trim(t).replace( /^\\/\\//i, \"\" );", s);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void regexp2()
  {
    String s = new JavaScriptStripper().stripCommentsAndWhitespace("foo.replace(/\"//*strip me*/, \"\"); // strip me\rdoFoo();");
    assertEquals("foo.replace(/\"/, \"\"); doFoo();", s);
  }
View Full Code Here

Examples of org.apache.wicket.core.util.string.JavaScriptStripper

  /**   */
  @Test
  public void regexp3()
  {
    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);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.