Package org.springframework.shell.core

Examples of org.springframework.shell.core.CommandResult


  @Test
  public void testListRuntimeModulesByModuleId() {
    logger.info("List runtime modules");
    String streamName = generateStreamName();
    stream().create(streamName, "time | log");
    CommandResult cmdResult = executeCommand("runtime modules --moduleId " + streamName + ".sink.log.1");
    Table table = (Table) cmdResult.getResult();
    assertEquals(1, table.getRows().size());
  }
View Full Code Here


    List<TableRow> runtimeModules = getRuntimeModulesForStream(streamName);

    // Get containerId for a runtime module
    String containerId = runtimeModules.get(0).getValue(2);
    CommandResult cmdResult = executeCommand("runtime modules --containerId " + containerId);
    Table table = (Table) cmdResult.getResult();
    List<TableRow> fooStreamModules = new ArrayList<TableRow>();
    for (TableRow row : table.getRows()) {
      // Verify all the rows have the same containerId
      assertTrue(row.getValue(2).equals(containerId));
      // match by group name
View Full Code Here

  @Test
  public void testListRuntimeModulesByInvalidContainerId() {
    logger.info("Test listing of runtime modules by invalid containerId");
    String streamName = generateStreamName();
    stream().create(streamName, "time | log");
    CommandResult cmdResult = executeCommand("runtime modules --containerId 10000");
    Table table = (Table) cmdResult.getResult();
    assertEquals(0, table.getRows().size());
  }
View Full Code Here

    logger.info("Create tictock stream");
    String streamName = generateStreamName();
    String streamDefinition = "time | log";
    stream().create(streamName, streamDefinition);

    CommandResult cr = getShell().executeCommand(
        "stream create --definition \"" + streamDefinition + "\" --name " + streamName);
    assertTrue("Failure.  CommandResult = " + cr.toString(), !cr.isSuccess());
    assertTrue("Failure.  CommandResult = " + cr.toString(),
        cr.getException().getMessage().contains("There is already a stream named '" + streamName + "'"));
  }
View Full Code Here

  }

  @Test
  public void testCreatingTapWithSameNameAsExistingStream_xd299() {
    String streamName = generateStreamName();
    CommandResult cr = getShell().executeCommand(
        "stream create --name " + streamName + " --definition \"" + getTapName(streamName) + " > counter\"");
    assertTrue("Failure. CommandResult = " + cr.toString(), !cr.isSuccess());
    assertTrue("Failure. CommandResult = " + cr.toString(),
        cr.getException().getMessage().contains("unrecognized stream reference '" + streamName + "'"));
  }
View Full Code Here

  @Test
  public void testStreamDestroyMissing() {
    logger.info("Destroy a stream that doesn't exist");
    String streamName = generateStreamName();
    CommandResult cr = getShell().executeCommand("stream destroy --name " + streamName);
    assertTrue("Failure.  CommandResult = " + cr.toString(), !cr.isSuccess());
    assertTrue("Failure.  CommandResult = " + cr.toString(),
        cr.getException().getMessage().contains("There is no stream definition named '" + streamName + "'"));
  }
View Full Code Here

    logger.info("Create 2 tictok streams with --deploy = false");
    String streamName = generateStreamName();
    String streamDefinition = "time | log";
    stream().createDontDeploy(streamName, streamDefinition);

    CommandResult cr = getShell().executeCommand(
        "stream create --definition \"" + streamDefinition + "\" --name " + streamName + " --deploy false");
    assertTrue("Failure.  CommandResult = " + cr.toString(), !cr.isSuccess());
    assertTrue("Failure.  CommandResult = " + cr.toString(),
        cr.getException().getMessage().contains("There is already a stream named '" + streamName + "'"));

    stream().verifyExists(streamName, streamDefinition, false);
  }
View Full Code Here

    String jobName = executeJobCreate(JOB_WITH_PARAMETERS_DESCRIPTOR);
    logger.info("Created Job " + jobName);
    checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, true);
    triggerJob(jobName);
    assertTrue("Job did not complete within time alotted", jobParametersHolder.isDone());
    CommandResult cr = getShell().executeCommand("job undeploy --name " + jobName);
    checkForSuccess(cr);
    checkUndeployedJobMessage(cr, jobName);
  }
View Full Code Here

    triggerJob(jobName);

    checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, true);
    assertTrue("Job did not complete within time alotted", jobParametersHolder.isDone());

    CommandResult cr = createJob(jobName, "job");
    checkForFail(cr);
    checkBatchJobExistsErrorMessage(cr, jobName);
  }
View Full Code Here

  @Test
  public void testStreamDestroyMissing() {
    logger.info("Destroy a job that doesn't exist");
    String jobName = generateJobName();
    CommandResult cr = jobDestroy(jobName);
    checkForFail(cr);
    checkErrorMessages(cr, "There is no job definition named '" + jobName + "'");
  }
View Full Code Here

TOP

Related Classes of org.springframework.shell.core.CommandResult

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.