List of usage examples for org.springframework.batch.core.step.tasklet SystemCommandException getMessage
public String getMessage()
From source file:org.springframework.batch.core.step.tasklet.SystemCommandTaskletIntegrationTests.java
@Test public void testExecuteTimeout() throws Exception { String command = System.getProperty("os.name").toLowerCase().contains("win") ? "ping 1.1.1.1 -n 1 -w 3000" : "sleep 3"; tasklet.setCommand(command);//from www . j ava 2 s .c o m tasklet.setTimeout(10); tasklet.afterPropertiesSet(); log.info("Executing command: " + command); try { tasklet.execute(null, null); fail(); } catch (SystemCommandException e) { assertTrue(e.getMessage().contains("did not finish within the timeout")); } }