@Test public void testExecute() { 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); try { tasklet.execute(null, null); } catch (Exception e) { Assert.fail("run test with exception"); } }
@Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { try { context.refresh(); } catch (Throwable t) { logger.error("luanch Spring Hadoop job failed.", t); } return RepeatStatus.FINISHED; }
SimpleSpringHadoopTasklet implements Tasklet { @Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { try { context.refresh(); } catch (Throwable t) { logger.error("luanch Spring Hadoop job failed.", t); } return RepeatStatus.FINISHED; } }
SimpleSpringHadoopTasklet implements Tasklet { @Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { try { context.refresh(); } catch (Throwable t) { logger.error("luanch Spring Hadoop job failed.", t); } return RepeatStatus.FINISHED; }  }
SimpleSpringHadoopTasklet implements Tasklet { @Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { try { context.refresh(); } catch (Throwable t) { logger.error("luanch Spring Hadoop job failed.", t); } return RepeatStatus.FINISHED; }  @Override RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext); FileSystemXmlApplicationContext getContext(); void setContext(FileSystemXmlApplicationContext context); }
SimpleSpringHadoopTasklet implements Tasklet { @Override public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { try { context.refresh(); } catch (Throwable t) { logger.error("luanch Spring Hadoop job failed.", t); } return RepeatStatus.FINISHED; }  @Override RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext); FileSystemXmlApplicationContext getContext(); void setContext(FileSystemXmlApplicationContext context);  }