Added test to check all parameters
This commit is contained in:
parent
a1fccaabc3
commit
cdd9fd345a
1 changed files with 53 additions and 0 deletions
|
@ -42,6 +42,59 @@ class CheckstyleOperationTest {
|
|||
assertThat(op.options.get("-b")).isEqualTo(FOO);
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkAllParameters() {
|
||||
var params = List.of(
|
||||
"-b",
|
||||
"-c",
|
||||
"-d",
|
||||
"-e",
|
||||
"-E",
|
||||
"-f",
|
||||
"-g",
|
||||
"-j",
|
||||
"-J",
|
||||
"-o",
|
||||
"-p",
|
||||
"-s",
|
||||
"-t",
|
||||
"-T",
|
||||
"-w",
|
||||
"-x"
|
||||
);
|
||||
|
||||
var args = new CheckstyleOperation()
|
||||
.fromProject(new Project())
|
||||
.branchMatchingXpath("xpath")
|
||||
.configurationFile("config")
|
||||
.debug(true)
|
||||
.exclude("path")
|
||||
.excludeRegex("regex")
|
||||
.executeIgnoredModules(true)
|
||||
.format(CheckstyleFormatOption.XML)
|
||||
.generateXpathSuppression(true)
|
||||
.javadocTree(true)
|
||||
.outputPath("optionPath")
|
||||
.propertiesFile("properties")
|
||||
.suppressionLineColumnNumber("12")
|
||||
.tabWith(1)
|
||||
.tree(true)
|
||||
.treeWithComments(true)
|
||||
.treeWithJavadoc(true)
|
||||
.executeConstructProcessCommandList();
|
||||
|
||||
for (var p : params) {
|
||||
var found = false;
|
||||
for (var a : args) {
|
||||
if (a.startsWith(p)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assertThat(found).as(p + " not found.").isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void configurationFile() {
|
||||
var op = new CheckstyleOperation().fromProject(new Project()).configurationFile(FOO);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue