forked from phoedos/pmd
@@ -29,10 +29,13 @@ String pmdXml = readFile(pmdXmlReport);
|
||||
if (!pmdXml.contains("<violation beginline=\"5\" endline=\"5\" begincolumn=\"16\" endcolumn=\"37\" rule=\"UnusedLocalVariable\" ruleset=\"Best Practices\" package=\"org.example\" class=\"Main\" method=\"main\" variable=\"thisIsAUnusedLocalVar\"")) {
|
||||
throw new RuntimeException("Expected violation has not been reported");
|
||||
}
|
||||
File mainFile = new File("pmd-for-java/src/main/java/org/example/Main.java");
|
||||
File mainFile = new File(basedir, "src/main/java/org/example/Main.java");
|
||||
if (!pmdXml.contains(mainFile + "\">")) {
|
||||
throw new RuntimeException("Expected violation has not been reported");
|
||||
}
|
||||
if (!pmdXml.contains("<error filename=\"" + mainFile.getAbsolutePath()) || !pmdXml.contains(mainFile + "\" msg=\"PmdXPathException")) {
|
||||
throw new RuntimeException("Processing error has not been reported");
|
||||
}
|
||||
|
||||
File pmdCsvReport = new File(basedir, "target/pmd.csv");
|
||||
if (!pmdCsvReport.exists()) {
|
||||
@@ -51,7 +54,3 @@ String textReport = readFile(pmdTextReport);
|
||||
if (!textReport.contains(mainFile + ":5:\tUnusedLocalVariable")) {
|
||||
throw new RuntimeException("Expected violation has not been reported in TXT");
|
||||
}
|
||||
|
||||
if (!pmdXml.contains("<error filename=\"" + mainFile.getAbsolutePath()) || !pmdXml.contains(mainFile + "\" msg=\"PmdXPathException")) {
|
||||
throw new RuntimeException("Processing error has not been reported");
|
||||
}
|
||||
|
Reference in New Issue
Block a user