Added test to check all parameters

This commit is contained in:
Erik C. Thauvin 2024-05-26 19:53:07 -07:00
parent a1fccaabc3
commit cdd9fd345a
Signed by: erik
GPG key ID: 776702A6A2DA330E

View file

@ -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);