@Override public String toString() { return super.toString() + ", jobExecutionContext=" + getJobExecutionContext() + ", jobParameters=" + getJobParameters(); }
@Test public void testJobExecutionContext() throws Exception { ExecutionContext executionContext = jobExecution.getExecutionContext(); executionContext.put("foo", "bar"); assertEquals("bar", context.getJobExecutionContext().get("foo")); }
@Override public String call() throws Exception { ExecutionContext executionContext = jobExecution.getExecutionContext(); executionContext.put("foo", value); JobContext context = JobSynchronizationManager.register(jobExecution); logger.debug("Registered: " + context.getJobExecutionContext()); try { return simple.getName(); } finally { JobSynchronizationManager.close(); } } });
@Override public String call() throws Exception { JobExecution jobExecution = new JobExecution(id); ExecutionContext executionContext = jobExecution.getExecutionContext(); executionContext.put("foo", value); JobContext context = JobSynchronizationManager.register(jobExecution); logger.debug("Registered: " + context.getJobExecutionContext()); try { return simple.getName(); } finally { JobSynchronizationManager.close(); } } });
private void testExecutionContext(Object target) throws Exception { TestContext testContext = getTestContext(target); listener.prepareTestInstance(testContext); try { listener.beforeTestMethod(testContext); JobContext context = JobSynchronizationManager.getContext(); assertNotNull(context); assertEquals("bar", context.getJobExecutionContext().get("foo")); } finally { listener.afterTestMethod(testContext); } assertNull(JobSynchronizationManager.getContext()); }
@Override public String toString() { return super.toString() + ", jobExecutionContext=" + getJobExecutionContext() + ", jobParameters=" + getJobParameters(); }
@Override public String toString() { return super.toString() + ", jobExecutionContext=" + getJobExecutionContext() + ", jobParameters=" + getJobParameters(); }
@Override public String toString() { return super.toString() + ", jobExecutionContext=" + getJobExecutionContext() + ", jobParameters=" + getJobParameters(); }