Skip to content

Commit

Permalink
[#1472] add test
Browse files Browse the repository at this point in the history
  • Loading branch information
remkop committed Jan 18, 2022
1 parent 432b21d commit 092da48
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,34 @@ public void testOptionDisableProxy() {
expectGeneratedWithNotes(compilation, allParams);
}

@Test
public void testOptionVerbose() {
runOptionVerboseTest("-A" + AbstractGenerator.OPTION_VERBOSE);
}

@Test
public void testOptionVerboseEqTrue() {
runOptionVerboseTest("-A" + AbstractGenerator.OPTION_VERBOSE + "=true");
}

private void runOptionVerboseTest(String option) {
NativeImageConfigGeneratorProcessor processor = new NativeImageConfigGeneratorProcessor();
Compilation compilation =
javac()
.withProcessors(processor)
.withOptions(option)
.compile(JavaFileObjects.forResource(
"picocli/examples/subcommands/ParentCommandDemo.java"));

assertThat(compilation).succeeded();
String[][] allParams = {
{ ReflectConfigGen.class.getSimpleName(), "reflect-config.json", "true", "true"},
{ ResourceConfigGen.class.getSimpleName(), "resource-config.json", "true", "true"},
{ ProxyConfigGen.class.getSimpleName(), "proxy-config.json", "true", "true" },
};
expectGeneratedWithNotes(compilation, allParams);
}

@Test
public void testOptionDisableProxyVerbose() {
NativeImageConfigGeneratorProcessor processor = new NativeImageConfigGeneratorProcessor();
Expand Down

0 comments on commit 092da48

Please sign in to comment.