tests
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@108 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
28
pmd/regress/test/net/sourceforge/pmd/MockRule.java
Normal file
28
pmd/regress/test/net/sourceforge/pmd/MockRule.java
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* User: tom
|
||||
* Date: Jun 28, 2002
|
||||
* Time: 11:05:13 AM
|
||||
*/
|
||||
package test.net.sourceforge.pmd;
|
||||
|
||||
import net.sourceforge.pmd.Rule;
|
||||
import net.sourceforge.pmd.RuleContext;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MockRule implements Rule {
|
||||
|
||||
private String name;
|
||||
private String desc;
|
||||
|
||||
public MockRule(String name, String desc) {
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getName() {return name;}
|
||||
public String getDescription() {return desc;}
|
||||
|
||||
public void apply(List astCompilationUnits, RuleContext ctx) {
|
||||
}
|
||||
}
|
@ -11,32 +11,16 @@ public class RuleViolationTest extends TestCase {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void testStub() {
|
||||
}
|
||||
/*
|
||||
public void testBasic() {
|
||||
RuleViolation r = new RuleViolation(new Rule() {
|
||||
public String getName() {return "name";}
|
||||
public String getDescription() {return "desc";}
|
||||
}, 2);
|
||||
Rule rule = new MockRule("name", "desc");
|
||||
RuleViolation r = new RuleViolation(rule, 2);
|
||||
assertTrue(r.getText().indexOf("name") != -1);
|
||||
}
|
||||
|
||||
public void testGetText() {
|
||||
RuleViolation r = new RuleViolation(new Rule() {
|
||||
public String getName() {return "name";}
|
||||
public String getDescription() {return "desc";}
|
||||
}, 2, "foo");
|
||||
assertTrue(r.getText().indexOf("foo") != -1);
|
||||
}
|
||||
|
||||
public void testXML() {
|
||||
RuleViolation r = new RuleViolation(new Rule() {
|
||||
public String getName() {return "name";}
|
||||
public String getDescription() {return "desc";}
|
||||
}, 2, "foo");
|
||||
assertTrue(r.getXML().indexOf("foo") != -1);
|
||||
assertTrue(r.getText().indexOf("desc") != -1);
|
||||
assertTrue(r.getText().indexOf("2") != -1);
|
||||
System.out.println("r.getXML() = " + r.getXML());
|
||||
assertTrue(r.getXML().indexOf("desc") != -1);
|
||||
assertTrue(r.getXML().indexOf("2") != -1);
|
||||
assertTrue(r.getHTML().indexOf("desc") != -1);
|
||||
assertTrue(r.getHTML().indexOf("2") != -1);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
Reference in New Issue
Block a user