[java] Split the rule tests for documentation

This commit is contained in:
Andreas Dangel
2018-09-09 10:51:25 +02:00
parent 3185956f75
commit 9b51fa802d
6 changed files with 39 additions and 9 deletions

View File

@ -0,0 +1,9 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.rule.documentation;
public class CommentContentTest extends DocumentationRulesTest {
// no additional unit tests
}

View File

@ -15,8 +15,7 @@ import org.junit.Test;
import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.properties.PropertyDescriptor;
public class CommentRequiredRuleTest {
public class CommentRequiredTest extends DocumentationRulesTest {
@Test
public void allCommentTypesIgnored() {
CommentRequiredRule rule = new CommentRequiredRule();

View File

@ -0,0 +1,9 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.rule.documentation;
public class CommentSizeTest extends DocumentationRulesTest {
// no additional unit tests
}

View File

@ -9,17 +9,12 @@ import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
/**
* Rule tests for the documentation category
*/
public class DocumentationRulesTest extends SimpleAggregatorTst {
public abstract class DocumentationRulesTest extends SimpleAggregatorTst {
private static final String RULESET = "category/java/documentation.xml";
@Override
public void setUp() {
addRule(RULESET, "CommentContent");
addRule(RULESET, "CommentRequired");
addRule(RULESET, "CommentSize");
addRule(RULESET, "UncommentedEmptyConstructor");
addRule(RULESET, "UncommentedEmptyMethodBody");
addRule(RULESET, getClass().getSimpleName().replaceFirst("Test$", ""));
}
}

View File

@ -0,0 +1,9 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.rule.documentation;
public class UncommentedEmptyConstructorTest extends DocumentationRulesTest {
// no additional unit tests
}

View File

@ -0,0 +1,9 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.rule.documentation;
public class UncommentedEmptyMethodBodyTest extends DocumentationRulesTest {
// no additional unit tests
}