Search in sources :

Example 1 with MultiLineComment

use of net.sourceforge.pmd.lang.java.ast.MultiLineComment in project pmd by pmd.

the class AbstractCommentRuleTest method testFilteredCommentIn.

/**
 * Blank lines in comments should not raise an exception. See bug #1048.
 */
@Test
public void testFilteredCommentIn() {
    Token token = new Token();
    token.image = "/* multi line comment with blank lines\n\n\n */";
    String filtered = testSubject.filteredCommentIn(new MultiLineComment(token));
    assertEquals("multi line comment with blank lines", filtered);
    token.image = "/** a formal comment with blank lines\n\n\n */";
    filtered = testSubject.filteredCommentIn(new FormalComment(token));
    assertEquals("a formal comment with blank lines", filtered);
}
Also used : FormalComment(net.sourceforge.pmd.lang.java.ast.FormalComment) MultiLineComment(net.sourceforge.pmd.lang.java.ast.MultiLineComment) Token(net.sourceforge.pmd.lang.java.ast.Token) Test(org.junit.Test)

Aggregations

FormalComment (net.sourceforge.pmd.lang.java.ast.FormalComment)1 MultiLineComment (net.sourceforge.pmd.lang.java.ast.MultiLineComment)1 Token (net.sourceforge.pmd.lang.java.ast.Token)1 Test (org.junit.Test)1