@Test public void testDeploymentGroupStatusWithError() throws Exception { final List<DeploymentGroupStatusResponse.HostStatus> hostStatuses = Lists.newArrayList(); hostStatuses.add(new DeploymentGroupStatusResponse.HostStatus( "host1", JOB_ID, TaskStatus.State.RUNNING)); hostStatuses.add(new DeploymentGroupStatusResponse.HostStatus( "host2", JOB_ID, TaskStatus.State.PULLING_IMAGE)); hostStatuses.add(new DeploymentGroupStatusResponse.HostStatus( "host3", null, null)); final DeploymentGroupStatusResponse status = new DeploymentGroupStatusResponse( DEPLOYMENT_GROUP, DeploymentGroupStatusResponse.Status.ROLLING_OUT, "Oops!", hostStatuses, null); when(client.deploymentGroupStatus(GROUP_NAME)).thenReturn(Futures.immediateFuture(status)); when(options.getString("name")).thenReturn(GROUP_NAME); final int ret = command.run(options, client, out, false, null); assertEquals(0, ret); final String output = baos.toString().replaceAll("\\s+", ""); final String expected = format("Name: %s" + "Job Id: %s" + "Status: ROLLING_OUT" + "Host selectors:" + " a = b" + " foo = bar" + "Error: Oops!" + "HOST UP-TO-DATE JOB STATE" + "host1. X %s RUNNING" + "host2. X %s PULLING_IMAGE" + "host3. - -", GROUP_NAME, JOB_ID, JOB_ID, JOB_ID).replace(" ", ""); assertEquals(expected, output); }
@Override int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException { final String name = options.getString(nameArg.getDest()); final boolean full = options.getBoolean(fullArg.getDest()); return run0(client, out, json, name, full); }
DeploymentGroupStatusCommand extends ControlCommand { @Override int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException { final String name = options.getString(nameArg.getDest()); final boolean full = options.getBoolean(fullArg.getDest()); return run0(client, out, json, name, full); } }
DeploymentGroupStatusCommand extends ControlCommand { @Override int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException { final String name = options.getString(nameArg.getDest()); final boolean full = options.getBoolean(fullArg.getDest()); return run0(client, out, json, name, full); } DeploymentGroupStatusCommand(final Subparser parser); }
DeploymentGroupStatusCommand extends ControlCommand { @Override int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException { final String name = options.getString(nameArg.getDest()); final boolean full = options.getBoolean(fullArg.getDest()); return run0(client, out, json, name, full); } DeploymentGroupStatusCommand(final Subparser parser);  }
DeploymentGroupStatusCommand extends ControlCommand { @Override int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException { final String name = options.getString(nameArg.getDest()); final boolean full = options.getBoolean(fullArg.getDest()); return run0(client, out, json, name, full); } DeploymentGroupStatusCommand(final Subparser parser);   }