Package org.springframework.xd.shell.util

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


    super(shell, name, "rich-gauge");
  }

  public Table constructRichGaugeDisplay(double value, double alpha, double average, double max, double min,
      long count) {
    Table t = new Table();
    NumberFormat pattern = new DecimalFormat();
    t.addHeader(1, new TableHeader("Name")).addHeader(2, new TableHeader(getName()));
    t.newRow().addValue(1, "value").addValue(2, pattern.format(value));
    t.newRow().addValue(1, "alpha").addValue(2, pattern.format(alpha));
    t.newRow().addValue(1, "average").addValue(2, pattern.format(average));
    t.newRow().addValue(1, "max").addValue(2, pattern.format(max));
    t.newRow().addValue(1, "min").addValue(2, pattern.format(min));
    t.newRow().addValue(1, "count").addValue(2, pattern.format(count));
    return t;
  }
View Full Code Here


   * @param definition definition of the stream
   */
  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

    httpSource.ensureReady();
    httpSource.postData("5");
    httpSource.postData("10");
    httpSource.postData("15");
    Table t = sink.constructRichGaugeDisplay(15d, -1d, 10d, 15d, 5d, 3L);

    assertThat(sink, eventually(exists()));
    assertThat(sink, eventually(hasValue(t)));
  }
View Full Code Here

    tailTweets(tailSource);

    FieldValueCounterSink sink = metrics().newFieldValueCounterSink("fromUser");
    stream().create(generateStreamName(), "%s | %s", tailSource, sink);

    Table t = sink.constructFVCDisplay(fvcMap);
    assertThat(sink, eventually(hasValue(t)));
  }
View Full Code Here

  public void testListStepExecutionsForSpecificJobExecution() {
    String jobName = generateJobName();
    executeJobCreate(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR);
    checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, true);
    executeJobLaunch(jobName);
    final Table stepExecutions = listStepExecutions(getJobExecutionId(jobName));
    assertNotNull(stepExecutions.getRows().get(0).getValue(1));
  }
View Full Code Here

    }
    // Stop the execution by the given executionId.
    executeCommand("job execution stop " + executionId);
    // sleep for stop() until the step2 is invoked.
    Thread.sleep(3000);
    Table table;
    int n = 0;
    do {
      table = (Table) executeCommand("job execution list").getResult();
      for (TableRow tr : table.getRows()) {
        // Match by above executionId
        if (tr.getValue(1).equals(executionId)) {
          executionStatus = tr.getValue(5);
          break;
        }
View Full Code Here

    assertTrue(executionStatus.equals("STARTING") || executionStatus.equals("STARTED"));
    // Stop the execution by the given executionId.
    executeCommand("job execution all stop --force true");
    // sleep for stop() until the step2 is invoked.
    Thread.sleep(3000);
    Table table = (Table) executeCommand("job execution list").getResult();
    for (TableRow tr : table.getRows()) {
      // Match by above executionId
      if (tr.getValue(1).equals(executionId)) {
        executionStatus = tr.getValue(5);
        break;
      }
View Full Code Here

    executeJobCreate(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR);
    checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, true);
    executeJobLaunch(jobName);
    String jobExecutionId = getJobExecutionId(jobName);

    final Table stepExecutions = listStepExecutions(jobExecutionId);
    String stepExecutionId = stepExecutions.getRows().get(0).getValue(1);

    final Table stepExecutionProgress = getStepExecutionProgress(jobExecutionId, stepExecutionId);
    String id = stepExecutionProgress.getRows().get(0).getValue(1);
    String percentageComplete = stepExecutionProgress.getRows().get(0).getValue(3);
    String duration = stepExecutionProgress.getRows().get(0).getValue(4);
    assertEquals(stepExecutionId, id);
    assertNotNull(percentageComplete);
    assertNotNull(duration);
  }
View Full Code Here

    final String jobName = generateJobName();
    executeJobCreate(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR);
    checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, true);
    executeJobLaunch(jobName);
    final String jobExecutionId = getJobExecutionId(jobName);
    final Table stepExecutions = listStepExecutions(jobExecutionId);
    String stepExecutionId = stepExecutions.getRows().get(0).getValue(1);

    final Table stepExecution = getDisplayStepExecution(jobExecutionId, stepExecutionId);
    final String stepExecutionIdFromTable = stepExecution.getRows().get(0).getValue(2);
    final String jobExecutionIdFromTable = stepExecution.getRows().get(1).getValue(2);

    final String stepNameFromTable = stepExecution.getRows().get(2).getValue(2);
    // start time
    final String duration = stepExecution.getRows().get(3).getValue(2);
    assertEquals(stepExecutionId, stepExecutionIdFromTable);
    assertEquals(jobExecutionId, jobExecutionIdFromTable);
    assertNotEquals(stepNameFromTable, "N/A");
    assertFalse(duration.isEmpty());
    assertNotEquals(duration, "N/A");
View Full Code Here

      int port = server.getPort();
      executeJobCreate("myftphdfs", "ftphdfs --partitionResultsTimeout=120000 --port=" + port);
      checkForJobInList("myftphdfs", "ftphdfs --partitionResultsTimeout=120000 --port=" + port, true);
      executeJobLaunch("myftphdfs", "{\"-remoteDirectory\":\"ftpSource\",\"hdfsDirectory\":\"foo\"}");

      Table jobExecutions = listJobExecutions();
      int n = 0;
      while (!"COMPLETED".equals(jobExecutions.getRows().get(0).getValue(5))) {
        Thread.sleep(100);
        assertTrue(n++ < 100);
        jobExecutions = listJobExecutions();
      }
View Full Code Here

TOP

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

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.