Skip to content

Commit 39944a1

Browse files
committed
[#2407] Added test
1 parent 337a748 commit 39944a1

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
}

0 commit comments

Comments
 (0)