Read parameters from resource file
This commit is contained in:
parent
4de2b0b3f1
commit
7aa0319d4d
3 changed files with 24 additions and 22 deletions
|
@ -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"
|
||||
|
|
|
@ -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())
|
||||
|
|
16
src/test/resources/checkstyle-args.txt
Normal file
16
src/test/resources/checkstyle-args.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
-b
|
||||
-c
|
||||
-d
|
||||
-e
|
||||
-E
|
||||
-f
|
||||
-g
|
||||
-j
|
||||
-J
|
||||
-o
|
||||
-p
|
||||
-s
|
||||
-t
|
||||
-T
|
||||
-w
|
||||
-x
|
Loading…
Add table
Add a link
Reference in a new issue