Package com.pogofish.jadt.ast

Examples of com.pogofish.jadt.ast.JavaComment


    private void testStripTags(String expected, List<String> inputs, Set<String> tags) {
        final JavaDocParser parser = new JavaDocParser();
        final List<JavaComment> outputs = new ArrayList<JavaComment>(inputs.size());
        final CommentProcessor commentProcessor = new CommentProcessor();
        for (String input : inputs) {
            final JavaComment comment = parser.parse(new StringReader(input));
            outputs.add(comment);
        }
        final List<JavaComment> stripped = commentProcessor.stripTags(tags, outputs);
        final String actual = ASTPrinter.printComments("", stripped);
        assertEquals(expected, actual);   
View Full Code Here


   }
   
    @Test
    public void testJavaDocOnly() {
        final CommentProcessor commentProcessor = new CommentProcessor();
        JavaComment javaDocComment = _JavaDocComment("/**", list(ONEWS), NO_TAG_SECTIONS, "*/");
        @SuppressWarnings("unchecked")
        List<JavaComment> comments = list(javaDocComment, _JavaEOLComment("//whatever"), _JavaBlockComment(list(list(_BlockWord("/*"), _BlockWhiteSpace(" "), _BlockWord("*/")))));
        assertEquals(list(javaDocComment), commentProcessor.javaDocOnly(comments));
    }
View Full Code Here

    private void testBlockAlign(String expected, List<String> inputs) {
        final BlockCommentParser parser = new BlockCommentParser();
        final List<JavaComment> outputs = new ArrayList<JavaComment>(inputs.size());
        final CommentProcessor commentProcessor = new CommentProcessor();
        for (String input : inputs) {
            final JavaComment comment = parser.parse(new StringReader(input));
            outputs.add(comment);
        }
        final List<JavaComment> aligned = commentProcessor.leftAlign(outputs);
        final String actual = ASTPrinter.printComments("", aligned);
        assertEquals(expected, actual);
View Full Code Here

    private void testJavaDocAlign(String expected, List<String> inputs) {
        final JavaDocParser parser = new JavaDocParser();
        final List<JavaComment> outputs = new ArrayList<JavaComment>(inputs.size());
        final CommentProcessor commentProcessor = new CommentProcessor();
        for (String input : inputs) {
            final JavaComment comment = parser.parse(new StringReader(input));
            outputs.add(comment);
        }
        final List<JavaComment> aligned = commentProcessor.leftAlign(outputs);
        final String actual = ASTPrinter.printComments("", aligned);
        assertEquals(expected, actual);
View Full Code Here

    private void testParamDoc(String expected, String paramName, List<String> inputs) {
        final JavaDocParser parser = new JavaDocParser();
        final List<JavaComment> outputs = new ArrayList<JavaComment>(inputs.size());
        final CommentProcessor commentProcessor = new CommentProcessor();
        for (String input : inputs) {
            final JavaComment comment = parser.parse(new StringReader(input));
            outputs.add(comment);
        }
        final List<JavaComment> paramDoc = commentProcessor.paramDoc(paramName, outputs);
        final String actual = ASTPrinter.printComments("", paramDoc);
        assertEquals(expected, actual);
View Full Code Here

TOP

Related Classes of com.pogofish.jadt.ast.JavaComment

Copyright © 2018 www.massapicom. 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.