@@ -0,0 +1,1873 @@
+/*%0A * Copyright 2014 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage de.codecentric.batch.test;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.batch.core.BatchStatus;%0Aimport org.springframework.batch.core.JobParameters;%0Aimport org.springframework.batch.core.launch.JobOperator;%0Aimport org.springframework.batch.core.repository.JobRepository;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport de.codecentric.batch.TestConfiguration;%0A%0A@SpringApplicationConfiguration(classes=TestConfiguration.class)%0A@RunWith(SpringJUnit4ClassRunner.class)%0Apublic class PartitionedFlatFileJobTest %7B%0A%0A%09@Autowired%0A%09private JobOperator jobOperator;%0A%0A%09@Autowired%0A%09private JobRepository jobRepository;%0A%0A%09@Test%0A%09public void runXmlJob() throws Exception %7B%0A%09%09jobOperator.start(%22partitionedFlatFileJobXml%22, %22%22);%0A%09%09while (jobRepository.getLastJobExecution(%22partitionedFlatFileJobXml%22, new JobParameters()).getStatus().isRunning()) %7B%0A%09%09%09Thread.sleep(100);%0A%09%09%7D%0A%09%09assertEquals(BatchStatus.COMPLETED, jobRepository.getLastJobExecution(%22partitionedFlatFileJobXml%22, new JobParameters()).getStatus());%0A%09%7D%0A%0A%7D%0A

Add Multithreading Example