@Test
	public void testLaunchJobTwiceWhereMakeUniqueIsFalse() throws Exception {
		logger.info("Launch batch job (makeUnique=false) twice");
		String jobName = generateJobName();
		// Batch 3.0 requires at least one parameter to reject duplicate executions of an instance
		String myJobParams = "{\"-param(long)\":\"12345\"}";
		JobParametersHolder.reset();
		final JobParametersHolder jobParametersHolder = new JobParametersHolder();

		executeJobCreate(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR + " --makeUnique=false");
		checkForJobInList(jobName, JOB_WITH_PARAMETERS_DESCRIPTOR + " --makeUnique=false", true);
		executeJobLaunch(jobName, myJobParams);
		assertTrue("The countdown latch expired and did not count down.", jobParametersHolder.isDone());

		final SynchronousQueue<Message<?>> rendezvous = new SynchronousQueue<Message<?>>();
		MessageHandler handler = new MessageHandler() {

			@Override
			public void handleMessage(Message<?> message) throws MessagingException {
				rendezvous.add(message);
			}
		};
		getErrorChannel().subscribe(handler);
		executeCommand("job launch --name " + jobName + " --params " + myJobParams);
		Message<?> error = rendezvous.poll(5, TimeUnit.SECONDS);
		getErrorChannel().unsubscribe(handler);
		assertNotNull("expected an error message", error);
		Object payload = error.getPayload();
		assertTrue("payload should be a MessagingException", payload instanceof MessagingException);
		assertEquals(JobInstanceAlreadyCompleteException.class,
				((MessagingException) payload).getCause().getClass());
	}
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