| java.lang.Object test.net.sourceforge.pmd.testframework.RuleTst
All known Subclasses: test.net.sourceforge.pmd.renderers.XMLRendererTest, test.net.sourceforge.pmd.ReportTest, test.net.sourceforge.pmd.SuppressWarningsTest, test.net.sourceforge.pmd.ExcludeLinesTest, test.net.sourceforge.pmd.testframework.SimpleAggregatorTst, test.net.sourceforge.pmd.rules.XPathRuleTest, test.net.sourceforge.pmd.renderers.AbstractRendererTst, test.net.sourceforge.pmd.jaxen.DocumentNavigatorTest, test.net.sourceforge.pmd.rules.codesize.CyclomaticComplexityTest, test.net.sourceforge.pmd.jsp.ast.XPathJspRuleTest,
RuleTst | abstract public class RuleTst (Code) | | Advanced methods for test cases
|
Method Summary | |
public TestDescriptor[] | extractTestsFromXml(Rule rule) Extract a set of tests from an XML file. | public TestDescriptor[] | extractTestsFromXml(Rule rule, String testsFileName) | public TestDescriptor[] | extractTestsFromXml(Rule rule, String testsFileName, String baseDirectory) Extract a set of tests from an XML file with the given name. | public Rule | findRule(String ruleSet, String ruleName) | protected String | getCleanRuleName(Rule rule) getResourceAsStream tries to find the XML file in weird locations if the
ruleName includes the package, so we strip it here. | public void | runTest(TestDescriptor test) Run the rule on the given code, and check the expected number of violations. | public void | runTestFromString(String code, Rule rule, Report report, SourceType sourceType) Run the rule on the given code and put the violations in the report. | public void | runTestFromString(String code, Rule rule, Report report) Run the test using the DEFAULT_SOURCE_TYPE and put the violations in the report. |
extractTestsFromXml | public TestDescriptor[] extractTestsFromXml(Rule rule)(Code) | | Extract a set of tests from an XML file. The file should be
./xml/RuleName.xml relative to the test class. The format is defined in
test-data.xsd.
|
extractTestsFromXml | public TestDescriptor[] extractTestsFromXml(Rule rule, String testsFileName, String baseDirectory)(Code) | | Extract a set of tests from an XML file with the given name. The file should be
./xml/[testsFileName].xml relative to the test class. The format is defined in
test-data.xsd.
|
getCleanRuleName | protected String getCleanRuleName(Rule rule)(Code) | | getResourceAsStream tries to find the XML file in weird locations if the
ruleName includes the package, so we strip it here.
|
runTest | public void runTest(TestDescriptor test)(Code) | | Run the rule on the given code, and check the expected number of violations.
|
runTestFromString | public void runTestFromString(String code, Rule rule, Report report) throws PMDException(Code) | | Run the test using the DEFAULT_SOURCE_TYPE and put the violations in the report.
Convenience method.
|
|
|