类 JsrTestUtils


  • public class JsrTestUtils
    extends java.lang.Object
    Provides testing utilities to execute JSR-352 jobs and block until they are complete (since all JSR-352 based jobs are executed asynchronously).
    从以下版本开始:
    3.0
    作者:
    Michael Minella, Mahmoud Ben Hassine
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型方法说明
      static javax.batch.runtime.MetricgetMetric​(javax.batch.runtime.StepExecution stepExecution, javax.batch.runtime.Metric.MetricType type) 
      static javax.batch.runtime.JobExecutionrestartJob​(long executionId, java.util.Properties properties, long timeout)
      Restarts a job and waits for it's status to be any of BatchStatus.STOPPED, BatchStatus.COMPLETED, or BatchStatus.FAILED.
      static javax.batch.runtime.JobExecutionrunJob​(java.lang.String jobName, java.util.Properties properties, long timeout)
      Executes a job and waits for it's status to be any of BatchStatus.STOPPED, BatchStatus.COMPLETED, or BatchStatus.FAILED.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • runJob

        public static javax.batch.runtime.JobExecution runJob​(java.lang.String jobName,
                                                              java.util.Properties properties,
                                                              long timeout)
                                                       throws java.util.concurrent.TimeoutException
        Executes a job and waits for it's status to be any of BatchStatus.STOPPED, BatchStatus.COMPLETED, or BatchStatus.FAILED. If the job does not reach one of those statuses within the given timeout, a TimeoutException is thrown.
        参数:
        jobName - the name of the job.
        properties - job parameters to be associated with the job.
        timeout - maximum amount of time to wait in milliseconds.
        返回:
        the JobExecution for the final state of the job
        抛出:
        java.util.concurrent.TimeoutException - if the timeout occurs
      • restartJob

        public static javax.batch.runtime.JobExecution restartJob​(long executionId,
                                                                  java.util.Properties properties,
                                                                  long timeout)
                                                           throws java.util.concurrent.TimeoutException
        Restarts a job and waits for it's status to be any of BatchStatus.STOPPED, BatchStatus.COMPLETED, or BatchStatus.FAILED. If the job does not reach one of those statuses within the given timeout, a TimeoutException is thrown.
        参数:
        executionId - the id of the job execution to restart.
        properties - job parameters to be associated with the job.
        timeout - maximum amount of time to wait in milliseconds.
        返回:
        the JobExecution for the final state of the job
        抛出:
        java.util.concurrent.TimeoutException - if the timeout occurs
      • getMetric

        @Nullable
        public static javax.batch.runtime.Metric getMetric​(javax.batch.runtime.StepExecution stepExecution,
                                                           javax.batch.runtime.Metric.MetricType type)