Examples of parseCommandLine()


Examples of by.stub.cli.CommandLineInterpreter.parseCommandLine()

    * @throws Exception
    */
   public void startJetty(final int stubsPort, final int tlsPort, final int adminPort, final String addressToBind, final String yamlConfigurationFilename) throws Exception {
      final String[] args = new String[]{"-m", "-l", addressToBind, "-s", String.valueOf(stubsPort), "-a", String.valueOf(adminPort), "-t", String.valueOf(tlsPort), "-d", yamlConfigurationFilename};
      final CommandLineInterpreter commandLineInterpreter = new CommandLineInterpreter();
      commandLineInterpreter.parseCommandLine(args);
      stubbyManager = new StubbyManagerFactory().construct(yamlConfigurationFilename, commandLineInterpreter.getCommandlineParams());
      stubbyManager.startJetty();
   }

   /**
 
View Full Code Here

Examples of org.apache.qpid.junit.extensions.util.CommandLineParser.parseCommandLine()

        // Capture the command line arguments or display errors and correct usage and then exit.
        ParsedProperties options = null;

        try
        {
            options = new ParsedProperties(commandLine.parseCommandLine(args));
        }
        catch (IllegalArgumentException e)
        {
            System.out.println(commandLine.getErrors());
            System.out.println(commandLine.getUsage());
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

        CommandLine cl;
        CommandInfo cmdInfo;
        Command cmd;

        cl = new CommandLine(new Token("cmd"), new Token[] {}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);

        cl =
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);

        cl =
                new CommandLine(new Token("cmd"), new Token[] {new Token("-f"), new Token("F1")},
                        null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals("F1", cmd.getArgumentBundle().getArgument("fileArg").getValue()
                .toString());
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

                .toString());

        cl =
                new CommandLine(new Token("cmd"), new Token[] {new Token("-f"), new Token("F1"),
                    new Token("-x"), new Token("-yz")}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg1").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg1").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg3").getValues().length);

        cl = new CommandLine(new Token("cmd"), new Token[] {new Token("-yz")}, null);
        cmdInfo = cl.parseCommandLine(shell);
        cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("fileArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("intArg").getValues().length);
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("flagArg1").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg2").getValues().length);
        Assert.assertEquals(1, cmd.getArgumentBundle().getArgument("flagArg3").getValues().length);

        try {
            cl = new CommandLine(new Token("cmd"), new Token[] {new Token("-xya")}, null);
            cl.parseCommandLine(shell);
            Assert.fail("no exception");
        } catch (CommandSyntaxException ex) {
            // expected
        }
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

            // expected
        }

        try {
            cl = new CommandLine(new Token("cmd"), new Token[] {new Token("-")}, null);
            cl.parseCommandLine(shell);
            Assert.fail("no exception");
        } catch (CommandSyntaxException ex) {
            // expected
        }
    }
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

        TestShell shell = new TestShell();
        shell.addAlias("command", "org.jnode.test.shell.syntax.CommandLineTest$TestCommand");
        shell.addSyntax("command", new ArgumentSyntax("arg1"));
        CommandLine cl =
                new CommandLine(new Token("command"), new Token[] {new Token("fish")}, null);
        CommandInfo cmdInfo = cl.parseCommandLine(shell);
        Command cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals("fish", cmd.getArgumentBundle().getArgument("arg1").getValue());
    }
}
View Full Code Here

Examples of org.jnode.shell.CommandLine.parseCommandLine()

        TestShell shell = new TestShell();
        shell.addAlias("cmd", "org.jnode.test.shell.syntax.RepeatSyntaxTest$Test");
        shell.addSyntax("cmd", new RepeatSyntax(new ArgumentSyntax("arg1")));

        CommandLine cl = new CommandLine(new Token("cmd"), new Token[] {}, null);
        CommandInfo cmdInfo = cl.parseCommandLine(shell);
        Command cmd = cmdInfo.createCommandInstance();
        Assert.assertEquals(0, cmd.getArgumentBundle().getArgument("arg1").getValues().length);

        cl = new CommandLine(new Token("cmd"), new Token[] {new Token("F1")}, null);
        cmdInfo = cl.parseCommandLine(shell);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.