We have a existing project which is using Java Batch and we need to write JUnit for that. While searching I am getting examples for Spring Batch but not for Java Batch. Can someone please share an example?
Asked
Active
Viewed 1,041 times
1 Answers
3
If you are talking about Java batch processing based on JSR-352, then a test can be as simple as the following:
- obtain
JobOperator
; - create job parameters (optional);
- start the job execution by calling `JobOperator.start(jobName, jobParams);
- wait for the job to finish;
- verify job execution status and result, by calling methods on
JobOperator
An example JUnit test in JBeret: ClosingReaderWriterTest

cheng
- 1,076
- 6
- 6