Package org.springframework.shell.core

Examples of org.springframework.shell.core.CommandResult


      jobStateVerifier.waitForDestroy(jobName);
    }
  }

  protected CommandResult jobDestroy(String jobName) {
    CommandResult result = getShell().executeCommand("job destroy --name " + jobName);
    jobStateVerifier.waitForDestroy(jobName);
    return result;
  }
View Full Code Here


    return result;
  }

  protected void executeStreamDestroy(String... streamNames) {
    for (String streamName : streamNames) {
      CommandResult cr = executeCommand("stream destroy --name " + streamName);
      assertTrue("Failure to destroy stream " + streamName + ".  CommandResult = " + cr.toString(),
          cr.isSuccess());
      jobStateVerifier.waitForDestroy(streamName);
    }
  }
View Full Code Here

  /**
   * Execute job create for the supplied job name/definition, and verify the command result.
   */
  protected void executeJobCreate(String jobName, String jobDefinition, boolean deploy) {
    CommandResult cr = executeCommand("job create --definition \"" + jobDefinition + "\" --name " + jobName
        + (deploy ? " --deploy" : ""));
    String prefix = (deploy) ? "Successfully created and deployed job '" : "Successfully created job '";
    assertEquals(prefix + jobName + "'", cr.getResult());
    jobs.add(jobName);
    if (deploy) {
      bindJobTap(jobName);
      jobStateVerifier.waitForDeploy(jobName);
    }
View Full Code Here

  /**
   * Execute job deploy without any assertions
   */
  protected CommandResult deployJob(String jobName) {
    CommandResult result = getShell().executeCommand("job deploy " + jobName);
    bindJobTap(jobName);
    jobStateVerifier.waitForDeploy(jobName);
    return result;
  }
View Full Code Here

  /**
   * Execute job undeploy without any assertions
   */
  protected CommandResult undeployJob(String jobName) {
    CommandResult result = getShell().executeCommand("job undeploy " + jobName);
    unbindJobTap(jobName);
    jobStateVerifier.waitForUndeploy(jobName);
    return result;
  }
View Full Code Here

  /**
   * Launch a job that is already deployed
   */
  protected void executeJobLaunch(String jobName, String jobParameters) {
    CommandResult cr = executeCommand("job launch --name " + jobName + " --params " + jobParameters);
    String prefix = "Successfully submitted launch request for job '";
    assertEquals(prefix + jobName + "'", cr.getResult());
    waitForJobCompletion(jobName);
  }
View Full Code Here

  /**
   * Launch a job that is already deployed
   */
  protected void executeJobLaunch(String jobName) {
    CommandResult cr = executeCommand("job launch --name " + jobName);
    String prefix = "Successfully submitted launch request for job '";
    assertEquals(prefix + jobName + "'", cr.getResult());
    waitForJobCompletion(jobName);
  }
View Full Code Here

    checkErrorMessages(cr, "Batch Job with the name " + jobName + " already exists");
  }

  protected void triggerJob(String jobName) {
    String streamName = generateStreamName();
    CommandResult cr = getShell().executeCommand(
        "stream create --name " + streamName + " --definition \"trigger > "
            + getJobLaunchQueue(jobName) + "\" --deploy true");
    streams.add(streamName);
    waitForJobCompletion(jobName);
    checkForSuccess(cr);
View Full Code Here

    checkForSuccess(cr);
  }

  protected void triggerJobWithParams(String jobName, String parameters) {
    String streamName = generateStreamName();
    CommandResult cr = getShell().executeCommand(
        String.format("stream create --name " + streamName
            + " --definition \"trigger --payload='%s' > " + getJobLaunchQueue(jobName)
            + "\" --deploy true", parameters.replaceAll("\"", "\\\\\"")));
    streams.add(streamName);
    waitForJobCompletion(jobName);
View Full Code Here

    checkForSuccess(cr);
  }

  protected void triggerJobWithDelay(String jobName, String fixedDelay) {
    String streamName = generateStreamName();
    CommandResult cr = getShell().executeCommand(
        "stream create --name " + streamName + " --definition \"trigger --fixedDelay=" + fixedDelay
            + " > " + getJobLaunchQueue(jobName) + "\" --deploy true");
    streams.add(streamName);
    waitForJobCompletion(jobName);
    checkForSuccess(cr);
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.