use of net.sourceforge.argparse4j.inf.Subparser in project helios by spotify.
the class HostRegisterCommandTest method setUp.
@Before
public void setUp() {
// use a real, dummy Subparser impl to avoid having to mock out every single call
final ArgumentParser parser = ArgumentParsers.newArgumentParser("test");
final Subparser subparser = parser.addSubparsers().addParser("register");
command = new HostRegisterCommand(subparser);
}
use of net.sourceforge.argparse4j.inf.Subparser in project helios by spotify.
the class JobCreateCommandTest method setUp.
@Before
public void setUp() {
// use a real, dummy Subparser impl to avoid having to mock out every single call
final ArgumentParser parser = ArgumentParsers.newArgumentParser("test");
final Subparser subparser = parser.addSubparsers().addParser("create");
final Supplier<Map<String, String>> envVarSupplier = new Supplier<Map<String, String>>() {
@Override
public Map<String, String> get() {
return ImmutableMap.copyOf(envVars);
}
};
command = new JobCreateCommand(subparser, envVarSupplier);
when(client.createJob(argThat(matchesName(JOB_NAME)))).thenReturn(immediateFuture(new CreateJobResponse(CreateJobResponse.Status.OK, Collections.<String>emptyList(), "12345")));
}
use of net.sourceforge.argparse4j.inf.Subparser in project helios by spotify.
the class HostListCommandTest method runCommand.
private int runCommand(String... commandArgs) throws ExecutionException, InterruptedException, ArgumentParserException {
final String[] args = new String[1 + commandArgs.length];
args[0] = "hosts";
System.arraycopy(commandArgs, 0, args, 1, commandArgs.length);
// use a real, dummy Subparser impl to avoid having to mock out every single call
final ArgumentParser parser = ArgumentParsers.newArgumentParser("test");
final Subparser subparser = parser.addSubparsers().addParser("hosts");
final HostListCommand command = new HostListCommand(subparser);
final Namespace options = parser.parseArgs(args);
return command.run(options, client, out, false, null);
}
use of net.sourceforge.argparse4j.inf.Subparser in project helios by spotify.
the class JobInspectCommandTest method setUp.
@Before
public void setUp() {
// use a real, dummy Subparser impl to avoid having to mock out every single call
final ArgumentParser parser = ArgumentParsers.newArgumentParser("test");
final Subparser subparser = parser.addSubparsers().addParser("inspect");
command = new JobInspectCommand(subparser, TimeZone.getTimeZone("UTC"));
when(client.jobs(JOB_NAME_VERSION)).thenReturn(Futures.immediateFuture(jobs));
}
use of net.sourceforge.argparse4j.inf.Subparser in project helios by spotify.
the class JobStatusCommandTest method setUp.
@Before
public void setUp() {
// use a real, dummy Subparser impl to avoid having to mock out every single call
final ArgumentParser parser = ArgumentParsers.newArgumentParser("test");
final Subparser subparser = parser.addSubparsers().addParser("list");
command = new JobStatusCommand(subparser);
// defaults for flags
when(options.getString("job")).thenReturn(null);
when(options.getString("host")).thenReturn("");
}
Aggregations