forked from phoedos/pmd
Fix merge
This commit is contained in:
parent
65725c13aa
commit
bf2c69921e
@ -4,6 +4,7 @@
|
||||
|
||||
package net.sourceforge.pmd.it;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
@ -25,7 +26,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
|
||||
|
||||
// Ensure we have violations and a non-empty cache file
|
||||
assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
|
||||
result.assertExecutionResult(4, "", srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
|
||||
result.assertExitCode(4).assertReport(containsString(srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t"));
|
||||
|
||||
// rerun from cache
|
||||
ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
|
||||
@ -45,7 +46,8 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
|
||||
|
||||
// Ensure we have violations and a non-empty cache file
|
||||
assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
|
||||
result.assertExecutionResult(4, "", srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
|
||||
result.assertExitCode(4)
|
||||
.assertReport(containsString(srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t"));
|
||||
|
||||
// rerun from cache with relativized paths
|
||||
ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", Paths.get(".").toAbsolutePath().relativize(Paths.get(srcDir)).toString(), "-R", "src/test/resources/rulesets/sample-ruleset.xml",
|
||||
@ -54,7 +56,8 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
|
||||
resultFromCache.assertErrorOutputContains("Incremental Analysis cache HIT");
|
||||
|
||||
// An error with the relative path should exist, but no with the absolute one
|
||||
resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/', File.separatorChar));
|
||||
result.assertExitCode(4)
|
||||
.assertReport(containsString("src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/', File.separatorChar)));
|
||||
resultFromCache.assertNoErrorInReport(srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user