List of usage examples for org.springframework.batch.core ExitStatus isRunning
public boolean isRunning()
From source file:de.codecentric.batch.FlatFileJobIntegrationTest.java
protected ExitStatus runJobAndWaitForCompletion(String hostname, String port, String jobName, String jobParameters) throws InterruptedException { MultiValueMap<String, String> parameters = new LinkedMultiValueMap<String, String>(); parameters.add("jobParameters", jobParameters); String jobExecutionId = restTemplate.postForObject( "http://" + hostname + ":" + port + "/batch/operations/jobs/" + jobName + "", parameters, String.class); ExitStatus exitStatus = getStatus(hostname, port, jobExecutionId); // Wait for end of job while (exitStatus.isRunning()) { Thread.sleep(100);//from ww w . jav a 2s.co m exitStatus = getStatus(hostname, port, jobExecutionId); } return exitStatus; }