Examples of JavaScriptStripper


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

  /**   */
  @Test
  public void regexp4()
  {
    String before = " attr: /**/ //xyz\n /\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*((['\"])([^\\4]*?)\\4|([^'\"][^\\]]*?)))?\\]/    after     regex";
    String after = new JavaScriptStripper().stripCommentsAndWhitespace(before);
    String expected = " attr:   /\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*((['\"])([^\\4]*?)\\4|([^'\"][^\\]]*?)))?\\]/ after regex";
    assertEquals(expected, after);
    System.out.println(after);
  }
View Full Code Here

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

  /**   */
  @Test
  public void WICKET1806()
  {
    String before = "a = [ /^(\\[) *@?([\\w-]+) *([!*$^~=]*) *('?\"?)(.*?)\\4 *\\]/ ];    b()";
    String after = new JavaScriptStripper().stripCommentsAndWhitespace(before);
    String expected = "a = [ /^(\\[) *@?([\\w-]+) *([!*$^~=]*) *('?\"?)(.*?)\\4 *\\]/ ]; b()";

    assertEquals(expected, after);
  }
View Full Code Here

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

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

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 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.util.string.JavaScriptStripper

  /**
   * @see org.apache.wicket.javascript.IJavaScriptCompressor#compress(java.lang.String)
   */
  public String compress(String original)
  {
    return new JavaScriptStripper().stripCommentsAndWhitespace(original);
  }
View Full Code Here

Examples of org.apache.wicket.util.string.JavascriptStripper

  /**
   * @see org.apache.wicket.javascript.IJavascriptCompressor#compress(java.lang.String)
   */
  public String compress(String original)
  {
    return new JavascriptStripper().stripCommentsAndWhitespace(original);
  }
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.