List of usage examples for org.springframework.batch.core JobInterruptedException getMessage
public String getMessage()
From source file:org.springframework.batch.core.step.tasklet.SystemCommandTaskletIntegrationTests.java
@Test public void testInterruption() throws Exception { String command = System.getProperty("os.name").toLowerCase().contains("win") ? "ping 1.1.1.1 -n 1 -w 5000" : "sleep 5"; tasklet.setCommand(command);// w w w .j ava2 s. co m tasklet.setTerminationCheckInterval(10); tasklet.afterPropertiesSet(); stepExecution.setTerminateOnly(); try { tasklet.execute(null, null); fail(); } catch (JobInterruptedException e) { System.out.println(e.getMessage()); assertTrue(e.getMessage().contains("Job interrupted while executing system command")); assertTrue(e.getMessage().contains(command)); } }