예제 #1
0
  @Test
  public void testJobTaskletKill() throws Exception {
    Job victimJob = ctx.getBean("tasklet-victim-job", Job.class);

    // start async job execution
    JobExecution batchJob = JobsTrigger.startJob(ctx, "mainJob");

    // wait a bit for the job to be started
    while (!JobUtils.getStatus(victimJob).isRunning()) {
      Thread.sleep(WAIT_FOR_JOB_TO_START);
    }

    batchJob.stop();

    checkHadoopJobWasKilled(victimJob);
  }