Skip to content

Commit

Permalink
Added test to check all parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed May 27, 2024
1 parent a1fccaa commit cdd9fd3
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/test/java/rife/bld/extension/CheckstyleOperationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,59 @@ void branchMatchingXpath() {
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);
Expand Down

0 comments on commit cdd9fd3

Please sign in to comment.