File tree Expand file tree Collapse file tree
picocli-codegen-tests-java9plus/src/test
java/picocli/annotation/processing/tests
resources/picocli/issue2407 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package picocli .annotation .processing .tests ;
2+
3+ import com .google .testing .compile .Compilation ;
4+ import com .google .testing .compile .JavaFileObjects ;
5+ import org .junit .Test ;
6+
7+ import javax .annotation .processing .Processor ;
8+
9+ import static com .google .testing .compile .CompilationSubject .assertThat ;
10+ import static com .google .testing .compile .Compiler .javac ;
11+
12+ public class Issue2407Test
13+ {
14+ //@Ignore("https://github.com/remkop/picocli/issues/2407")
15+ @ Test
16+ public void testIssue2407 () {
17+ Processor processor = new AnnotatedCommandSourceGeneratorProcessor ();
18+ Compilation compilation =
19+ javac ()
20+ .withProcessors (processor )
21+ .compile (JavaFileObjects .forResource (
22+ "picocli/issue2407/Main.java" ));
23+
24+ assertThat (compilation ).succeeded ();
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ package picocli .issue2407 ;
2+
3+ import picocli .CommandLine .ArgGroup ;
4+ import picocli .CommandLine .Command ;
5+ import picocli .CommandLine .Option ;
6+
7+ @ Command (name = "top" , subcommands = {Main .Edit .class , Main .Update .class })
8+ static class Main {
9+
10+ static class UsernameAndPassword {
11+ @ Option (names = "--user" , required = false )
12+ String username ;
13+ @ Option (names = "--pwd" , required = false )
14+ String password ;
15+ }
16+
17+ @ Command (name = "edit" )
18+ static class Update {
19+ @ ArgGroup
20+ UsernameAndPassword usernamePassword ;
21+ }
22+
23+ @ Command (name = "update" )
24+ static class Edit {
25+ @ ArgGroup
26+ UsernameAndPassword usernamePassword ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments