#1414 Command line parameter to disable "failOnViolation" behavior

This commit is contained in:
Andreas Dangel
2015-09-26 17:08:20 +02:00
parent 38741d4638
commit bbd0bf98fd
9 changed files with 80 additions and 4 deletions

View File

@ -50,6 +50,21 @@ public class CPDCommandLineInterfaceTest {
Assert.assertEquals(4, Integer.parseInt(System.getProperty(CPDCommandLineInterface.STATUS_CODE_PROPERTY)));
}
/**
* Test ignore identifiers argument with failOnViolation=false
*/
@Test
public void testIgnoreIdentifiersFailOnViolationFalse() throws Exception {
runCPD("--minimum-tokens", "34", "--language", "java",
"--files", "src/test/resources/net/sourceforge/pmd/cpd/clitest/",
"--ignore-identifiers",
"--failOnViolation", "false");
String out = bufferStdout.toString("UTF-8");
Assert.assertTrue(out.contains("Found a 7 line (36 tokens) duplication"));
Assert.assertEquals(0, Integer.parseInt(System.getProperty(CPDCommandLineInterface.STATUS_CODE_PROPERTY)));
}
/**
* Test excludes option.
*/