|
15 | 15 | */
|
16 | 16 | package org.springframework.batch.core.jsr.launch;
|
17 | 17 |
|
18 |
| -import static org.junit.Assert.assertEquals; |
19 |
| -import static org.junit.Assert.assertNotNull; |
20 |
| -import static org.junit.Assert.assertNull; |
21 |
| -import static org.junit.Assert.assertTrue; |
22 |
| -import static org.junit.Assert.fail; |
23 |
| -import static org.mockito.Mockito.verify; |
24 |
| -import static org.mockito.Mockito.when; |
25 |
| -import static org.springframework.batch.core.jsr.JsrTestUtils.restartJob; |
26 |
| -import static org.springframework.batch.core.jsr.JsrTestUtils.runJob; |
27 |
| - |
28 |
| -import java.util.ArrayList; |
29 |
| -import java.util.Date; |
30 |
| -import java.util.HashSet; |
31 |
| -import java.util.List; |
32 |
| -import java.util.Properties; |
33 |
| -import java.util.Set; |
34 |
| - |
35 |
| -import javax.batch.api.AbstractBatchlet; |
36 |
| -import javax.batch.api.Batchlet; |
37 |
| -import javax.batch.operations.JobExecutionIsRunningException; |
38 |
| -import javax.batch.operations.JobOperator; |
39 |
| -import javax.batch.operations.JobRestartException; |
40 |
| -import javax.batch.operations.JobStartException; |
41 |
| -import javax.batch.operations.NoSuchJobException; |
42 |
| -import javax.batch.operations.NoSuchJobExecutionException; |
43 |
| -import javax.batch.operations.NoSuchJobInstanceException; |
44 |
| -import javax.batch.runtime.BatchRuntime; |
45 |
| -import javax.batch.runtime.BatchStatus; |
46 |
| - |
47 | 18 | import org.junit.Before;
|
48 | 19 | import org.junit.Test;
|
49 | 20 | import org.mockito.ArgumentCaptor;
|
|
64 | 35 | import org.springframework.core.task.AsyncTaskExecutor;
|
65 | 36 | import org.springframework.core.task.SyncTaskExecutor;
|
66 | 37 |
|
| 38 | +import javax.batch.api.AbstractBatchlet; |
| 39 | +import javax.batch.api.Batchlet; |
| 40 | +import javax.batch.operations.JobExecutionIsRunningException; |
| 41 | +import javax.batch.operations.JobOperator; |
| 42 | +import javax.batch.operations.JobRestartException; |
| 43 | +import javax.batch.operations.JobStartException; |
| 44 | +import javax.batch.operations.NoSuchJobException; |
| 45 | +import javax.batch.operations.NoSuchJobExecutionException; |
| 46 | +import javax.batch.operations.NoSuchJobInstanceException; |
| 47 | +import javax.batch.runtime.BatchRuntime; |
| 48 | +import javax.batch.runtime.BatchStatus; |
| 49 | +import java.util.ArrayList; |
| 50 | +import java.util.Date; |
| 51 | +import java.util.HashSet; |
| 52 | +import java.util.List; |
| 53 | +import java.util.Properties; |
| 54 | +import java.util.Set; |
| 55 | + |
| 56 | +import static org.junit.Assert.assertEquals; |
| 57 | +import static org.junit.Assert.assertNotNull; |
| 58 | +import static org.junit.Assert.assertNull; |
| 59 | +import static org.junit.Assert.assertTrue; |
| 60 | +import static org.junit.Assert.fail; |
| 61 | +import static org.mockito.Mockito.verify; |
| 62 | +import static org.mockito.Mockito.when; |
| 63 | +import static org.springframework.batch.core.jsr.JsrTestUtils.restartJob; |
| 64 | +import static org.springframework.batch.core.jsr.JsrTestUtils.runJob; |
| 65 | + |
67 | 66 | public class JsrJobOperatorTests {
|
68 | 67 |
|
69 | 68 | private JobOperator jsrJobOperator;
|
@@ -550,6 +549,9 @@ public void testApplicationContextClosingAfterJobSuccessful() throws Exception {
|
550 | 549 | javax.batch.runtime.JobExecution execution = runJob("contextClosingTests", new Properties(), TIMEOUT);
|
551 | 550 |
|
552 | 551 | assertEquals(BatchStatus.COMPLETED, execution.getBatchStatus());
|
| 552 | + |
| 553 | + // Added to allow time for the context to finish closing before running the job again |
| 554 | + Thread.sleep(1000l); |
553 | 555 | }
|
554 | 556 | }
|
555 | 557 |
|
|
0 commit comments