Package org.springframework.xd.shell.util

Examples of org.springframework.xd.shell.util.TableRow


    List<TableRow> rows = modules.getRows();
    assertThat(rows, hasSize(2));

    Iterator<TableRow> iterator = rows.iterator();
    TableRow firstRow = iterator.next();
    assertThat(firstRow.getValue(1), equalTo("    jms"));
    assertThat(firstRow.getValue(2), equalTo("    aggregator"));
    assertThat(firstRow.getValue(3), equalTo("    avro"));

    TableRow secondRow = iterator.next();
    assertThat(secondRow.getValue(1), equalTo("(c) myfile"));
    assertThat(secondRow.getValue(2), equalTo(""));
    assertThat(secondRow.getValue(3), equalTo(""));
  }
View Full Code Here


  public void verifyExists(String streamName, String definition, boolean deployed) {
    CommandResult cr = getShell().executeCommand("stream list");
    assertTrue("Failure.  CommandResult = " + cr.toString(), cr.isSuccess());
    Table t = (Table) cr.getResult();
    assertTrue(t.getRows().contains(
        new TableRow().addValue(1, streamName).addValue(2, definition).addValue(3, deployed ? "deployed" : "undeployed")));
  }
View Full Code Here

  }

  protected void checkForJobInList(String jobName, String jobDescriptor, boolean shouldBeDeployed) {
    Table t = listJobs();
    assertTrue(t.getRows().contains(
        new TableRow().addValue(1, jobName).addValue(2, jobDescriptor).addValue(3,
            shouldBeDeployed ? "deployed" : "undeployed")));
  }
View Full Code Here

        .addHeader(4, new TableHeader("PID"))
        .addHeader(5, new TableHeader("Groups"))
        .addHeader(6, new TableHeader("Custom Attributes"));
    for (DetailedContainerResource container : containers) {
      Map<String, String> copy = new HashMap<String, String>(container.getAttributes());
      final TableRow row = table.newRow();
      row.addValue(1, copy.remove("id"))
          .addValue(2, copy.remove("host"))
          .addValue(3, copy.remove("ip"))
          .addValue(4, copy.remove("pid"));
      String groups = copy.remove("groups");
      row.addValue(5, groups == null ? "" : groups);
      row.addValue(6, copy.isEmpty() ? "" : copy.toString());
    }
    return table;
  }
View Full Code Here

    final Table table = new Table();
    table.addHeader(1, new TableHeader("Module Id")).addHeader(2,
        new TableHeader("Container Id")).addHeader(3, new TableHeader("Options")).addHeader(4,
        new TableHeader("Deployment Properties")).addHeader(5, new TableHeader("Unit status"));
    for (ModuleMetadataResource module : runtimeModules) {
      final TableRow row = table.newRow();
      String unitStatus = (module.getDeploymentStatus() != null) ? module.getDeploymentStatus().name() : "";
      row.addValue(1, String.format("%s.%s.%s", module.getUnitName(), module.getModuleType(), module.getName()))
          .addValue(2, module.getContainerId()).addValue(3, module.getModuleOptions().toString()).addValue(4,
              module.getDeploymentProperties().toString()).addValue(5, unitStatus);
    }
    return table;
  }
View Full Code Here

        .addHeader(5, new TableHeader("Execution Status"))
        .addHeader(6, new TableHeader("Deployment Status"))
        .addHeader(7, new TableHeader("Definition Status"));

    for (JobExecutionInfoResource jobExecutionInfoResource : jobExecutions) {
      final TableRow row = new TableRow();
      final String startTimeAsString = this.configuration.getLocalTime(jobExecutionInfoResource.getJobExecution().getStartTime());

      row.addValue(1, String.valueOf(jobExecutionInfoResource.getExecutionId()))
          .addValue(2, jobExecutionInfoResource.getName())
          .addValue(3, startTimeAsString)
          .addValue(4, String.valueOf(jobExecutionInfoResource.getStepExecutionCount()))
          .addValue(5, jobExecutionInfoResource.getJobExecution().getStatus().name())
          .addValue(6, (jobExecutionInfoResource.isDeployed()) ? "Deployed" : "Undeployed")
View Full Code Here

    for (StepExecutionInfoResource stepExecutionInfoResource : stepExecutions) {

      final String localStartTime = this.configuration.getLocalTime(stepExecutionInfoResource.getStepExecution().getStartTime());
      final Date endTimeDate = stepExecutionInfoResource.getStepExecution().getEndTime();
      final String localEndTime = (endTimeDate == null) ? "" : this.configuration.getLocalTime(endTimeDate);
      final TableRow row = new TableRow();

      row.addValue(1, String.valueOf(stepExecutionInfoResource.getStepExecution().getId()))
          .addValue(2, stepExecutionInfoResource.getStepExecution().getStepName())
          .addValue(3, String.valueOf(stepExecutionInfoResource.getJobExecutionId()))
          .addValue(4, localStartTime)
          .addValue(5, localEndTime)
          .addValue(6, stepExecutionInfoResource.getStepExecution().getStatus().name());
View Full Code Here

    Table table = new Table();
    table.addHeader(1, new TableHeader("Id"))
        .addHeader(2, new TableHeader("Step Name"))
        .addHeader(3, new TableHeader("Percentage Complete"))
        .addHeader(4, new TableHeader("Duration"));
    final TableRow tableRow = new TableRow();
    tableRow.addValue(1, String.valueOf(progressInfoResource.getStepExecution().getId()))
        .addValue(2, String.valueOf(progressInfoResource.getStepExecution().getStepName()))
        .addValue(3, String.format("%.0f%%", progressInfoResource.getPercentageComplete() * 100))
        .addValue(4, String.format("%.0f ms", progressInfoResource.getDuration()));
    table.getRows().add(tableRow);
    return table;
View Full Code Here

    Map<String, Integer> currentRowByType = new HashMap<String, Integer>();
    for (String type : typeToColumn.keySet()) {
      table.addHeader(i++, new TableHeader("    " + StringUtils.capitalize(type)));
    }
    for (ModuleDefinitionResource module : modules) {
      TableRow row = rowForType(module.getType(), table, currentRowByType);
      row.addValue(typeToColumn.get(module.getType()), cellValue(module));
    }
    return table;
  }
View Full Code Here

    Integer value = currentRowByType.get(type);
    if (value == null) {
      value = 0;
    }
    currentRowByType.put(type, value + 1);
    TableRow result = null;
    if (value >= table.getRows().size()) {
      result = new TableRow();
      for (int i = 1; i <= typeToColumn.size(); i++) {
        result.addValue(i, "");
      }
      table.getRows().add(result);
    }
    else {
      result = table.getRows().get(value);
View Full Code Here

TOP

Related Classes of org.springframework.xd.shell.util.TableRow

Copyright © 2018 www.massapicom. 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.