Updated the JsrStepExecutionSplitter to provide a copy of the JobExecution per partition

This commit is contained in:
Michael Minella
2013-12-16 14:07:44 -06:00
parent 874a171601
commit b9b23e639d
4 changed files with 30 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ import javax.batch.api.partition.PartitionPlanImpl;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.context.JobContext;
import javax.batch.runtime.context.StepContext;
import javax.inject.Inject;
import org.junit.Before;
@@ -300,12 +301,21 @@ public class PartitionParserTests {
@BatchProperty
String artifactName;
@Inject
StepContext stepContext;
@Inject
JobContext jobContext;
@Override
public String process() throws Exception {
artifactNames.add(artifactName);
threadNames.add(Thread.currentThread().getName());
processed++;
stepContext.setExitStatus("bad step exit status");
jobContext.setExitStatus("bad job exit status");
return null;
}

View File

@@ -180,7 +180,7 @@ public class JobContextTests {
@Test(expected = IllegalStateException.class)
public void testIllegalContextId() throws Exception {
context = new JobContext(new JobExecution(null));
context = new JobContext(new JobExecution((Long) null));
context.getId();
}