예제 #1
0
  /**
   * Links are stripped.
   *
   * @throws Exception Environment
   */
  @Test
  public void links() throws Exception {
    String expected = "hello";

    String actual = StripHtml.stripped("<a href='Hi'>hello</b>");

    assertEquals(expected, actual);
  }
예제 #2
0
  /**
   * Bold tags are stripped.
   *
   * @throws Exception Environment
   */
  @Test
  public void bold() throws Exception {
    String expected = "hello";

    String actual = StripHtml.stripped("<b>hello</b>");

    assertEquals(expected, actual);
  }
예제 #3
0
  /** Escape code are handled correctly. */
  @Test
  public void escapeCodeHandled() {
    String expected = "&";

    String actual = StripHtml.stripped("&amp;");

    assertEquals(expected, actual);
  }
예제 #4
0
  /** Ps are converted into new lines. */
  @Test
  public void paraConvertedIntoNewlines() {
    String expected = "\none\ntwo\nthree";

    String actual = StripHtml.stripped("<p>one</p><p>two</p><p>three</p>");

    assertEquals(expected, actual);
  }
예제 #5
0
  /** BRs should be converted into new lines. */
  @Test
  public void brConvertedIntoNewlines() {
    String expected = "one\ntwo\nthree";

    String actual = StripHtml.stripped("one<br>two<br>three");

    assertEquals(expected, actual);
  }
예제 #6
0
  /** Plain text is passed through unchanged. */
  @Test
  public void plainTextUnchanged() {
    String expected = "one two three";

    String actual = StripHtml.stripped(expected);

    assertEquals(expected, actual);
  }