@Test
	public void testJobDeployUndeployFlow() throws InterruptedException {
		logger.info("Create batch job");
		JobParametersHolder.reset();
		final JobParametersHolder jobParametersHolder = new JobParametersHolder();
		String jobName = generateJobName();
		executeJobCreate(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, false);

		checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, false);
		CommandResult cr = deployJob(jobName);
		checkForSuccess(cr);
		checkDeployedJobMessage(cr, jobName);
		triggerJob(jobName);
		assertTrue("Job did not complete within time alotted", jobParametersHolder.isDone());

		checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, true);

		cr = undeployJob(jobName);
		checkForSuccess(cr);
		checkUndeployedJobMessage(cr, jobName);

		cr = deployJob(jobName);
		checkForSuccess(cr);
		assertEquals("Deployed job '" + jobName + "'", cr.getResult());

		checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR, true);
	}
Test {@link JobCommands}.

@author Glenn Renfro
@author Gunnar Hillert
@author Ilayaperumal Gopinathan
@author Michael Minella
@since 1.0
spring-xd-shell/src/test/java/org/springframework/xd/shell/command/AbstractJobCommandsTests.java