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 |\
|
java -cp "lib/test/*" com.puppycrawl.tools.checkstyle.Main --help |\
|
||||||
grep "^ -.*" |\
|
grep "^ -.*" |\
|
||||||
sed -e "s/ -/-/" -e "s/[,=].*//" -e "s/-/\"-/" -e "s/$/\",/" |\
|
sed -e "s/ -/-/" -e "s/[,=].*//" -e '/-V/d' -e '/-h/d' |\
|
||||||
sed -e '$s/,//' -e '/-V/d' -e '/-h/d' |\
|
sort > "src/test/resources/checkstyle-args.txt"
|
||||||
sort
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ import rife.bld.operations.exceptions.ExitStatusException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
@ -43,25 +45,10 @@ class CheckstyleOperationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void checkAllParameters() {
|
void checkAllParameters() throws IOException {
|
||||||
var params = List.of(
|
var params = Files.readAllLines(Paths.get("src", "test", "resources", "checkstyle-args.txt"));
|
||||||
"-b",
|
|
||||||
"-c",
|
assertThat(params).isNotEmpty();
|
||||||
"-d",
|
|
||||||
"-e",
|
|
||||||
"-E",
|
|
||||||
"-f",
|
|
||||||
"-g",
|
|
||||||
"-j",
|
|
||||||
"-J",
|
|
||||||
"-o",
|
|
||||||
"-p",
|
|
||||||
"-s",
|
|
||||||
"-t",
|
|
||||||
"-T",
|
|
||||||
"-w",
|
|
||||||
"-x"
|
|
||||||
);
|
|
||||||
|
|
||||||
var args = new CheckstyleOperation()
|
var args = new CheckstyleOperation()
|
||||||
.fromProject(new Project())
|
.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