Read parameters from resource file

This commit is contained in:
Erik C. Thauvin 2024-05-27 20:38:53 -07:00
parent 4de2b0b3f1
commit 7aa0319d4d
Signed by: erik
GPG key ID: 776702A6A2DA330E
3 changed files with 24 additions and 22 deletions

View file

@ -2,6 +2,5 @@
java -cp "lib/test/*" com.puppycrawl.tools.checkstyle.Main --help |\
grep "^ -.*" |\
sed -e "s/ -/-/" -e "s/[,=].*//" -e "s/-/\"-/" -e "s/$/\",/" |\
sed -e '$s/,//' -e '/-V/d' -e '/-h/d' |\
sort
sed -e "s/ -/-/" -e "s/[,=].*//" -e '/-V/d' -e '/-h/d' |\
sort > "src/test/resources/checkstyle-args.txt"

View file

@ -24,6 +24,8 @@ import rife.bld.operations.exceptions.ExitStatusException;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
@ -43,25 +45,10 @@ class CheckstyleOperationTest {
}
@Test
void checkAllParameters() {
var params = List.of(
"-b",
"-c",
"-d",
"-e",
"-E",
"-f",
"-g",
"-j",
"-J",
"-o",
"-p",
"-s",
"-t",
"-T",
"-w",
"-x"
);
void checkAllParameters() throws IOException {
var params = Files.readAllLines(Paths.get("src", "test", "resources", "checkstyle-args.txt"));
assertThat(params).isNotEmpty();
var args = new CheckstyleOperation()
.fromProject(new Project())

View file

@ -0,0 +1,16 @@
-b
-c
-d
-e
-E
-f
-g
-j
-J
-o
-p
-s
-t
-T
-w
-x