SimpleSpringHadoopTasklet implements Tasklet { public void setContext(FileSystemXmlApplicationContext context) { this.context = context; }  @Override RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext); FileSystemXmlApplicationContext getContext(); void setContext(FileSystemXmlApplicationContext context);  }
@Test public void testSetContext() { ApplicationContext rootContext = new ClassPathXmlApplicationContext(new String[] { "classpath:org/springframework/data/hadoop/admin/env-context.xml", "classpath:org/springframework/data/hadoop/admin/data-source-context.xml", "classpath:org/springframework/data/hadoop/admin/execution-context.xml", }); FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext( new String[] { "src/test/resources/org/springframework/data/hadoop/admin/workflow/context.xml" }, false, rootContext); tasklet.setContext(context); Assert.assertSame(context, tasklet.getContext()); }