| | |
| | | */ |
| | | @Test |
| | | public void testAllowsTrailingArgumentsFalse1() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX")); |
| | | Assert.assertFalse(sc.allowsTrailingArguments()); |
| | |
| | | */ |
| | | @Test |
| | | public void testAllowsTrailingArgumentsFalse2() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX")); |
| | | Assert.assertFalse(sc.allowsTrailingArguments()); |
| | |
| | | */ |
| | | @Test |
| | | public void testAllowsTrailingArgumentsTrue() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]", |
| | | LocalizableMessage.raw("XXX")); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetMaxTrailingArguments1() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX")); |
| | | Assert.assertEquals(sc.getMaxTrailingArguments(), 0); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetMaxTrailingArguments2() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX")); |
| | | Assert.assertEquals(sc.getMaxTrailingArguments(), 0); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetMaxTrailingArguments3() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]", |
| | | LocalizableMessage.raw("XXX")); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetMinTrailingArguments1() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX")); |
| | | Assert.assertEquals(sc.getMinTrailingArguments(), 0); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetMinTrailingArguments2() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX")); |
| | | Assert.assertEquals(sc.getMinTrailingArguments(), 0); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetMinTrailingArguments3() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]", |
| | | LocalizableMessage.raw("XXX")); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetTrailingArgumentsDisplayName1() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX")); |
| | | Assert.assertNull(sc.getTrailingArgumentsDisplayName()); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetTrailingArgumentsDisplayName2() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX")); |
| | | Assert.assertNull(sc.getTrailingArgumentsDisplayName()); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetTrailingArgumentsDisplayName3() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]", |
| | | LocalizableMessage.raw("XXX")); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetTrailingArguments1() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX")); |
| | | parser.parseArguments(new String[] { "sub-command1" }); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetTrailingArguments2() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX")); |
| | | parser.parseArguments(new String[] { "sub-command2" }); |
| | |
| | | */ |
| | | @Test |
| | | public void testGetTrailingArguments3() throws Exception { |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(), |
| | | SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(), |
| | | LocalizableMessage.raw("test description"), true); |
| | | SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]", |
| | | LocalizableMessage.raw("XXX")); |