@Override protected StepExecutionDao createStepExecutionDao() throws Exception { stepExecutionDao = new MapStepExecutionDao(); return stepExecutionDao; }
@Override protected StepExecutionDao getStepExecutionDao() { return new MapStepExecutionDao(); }
@Override protected StepExecutionDao getStepExecutionDao() { return new MapStepExecutionDao(); }
@Override protected JobRepository getJobRepository() { return new SimpleJobRepository(new MapJobInstanceDao(), new MapJobExecutionDao(), new MapStepExecutionDao(), new MapExecutionContextDao()); }
@Before public void setUp() throws Exception { jobRepository = new SimpleJobRepository(new MapJobInstanceDao(), new MapJobExecutionDao(), new MapStepExecutionDao(), new MapExecutionContextDao()); }
@Test public void testRepository() throws Exception { SimpleJobRepository repository = new SimpleJobRepository(new MapJobInstanceDao(), new MapJobExecutionDao(), new MapStepExecutionDao(), new MapExecutionContextDao()); step.setJobRepository(repository); JobExecution jobExecution = repository.createJobExecution(job.getName(), jobParameters); StepExecution stepExecution = new StepExecution(step.getName(), jobExecution); repository.add(stepExecution); step.execute(stepExecution); assertEquals(1, processed.size()); }
/** * Modifications to saved entity do not affect the persisted object. */ @Test public void testPersistentCopy() { StepExecutionDao tested = new MapStepExecutionDao(); JobExecution jobExecution = new JobExecution(77L); StepExecution stepExecution = new StepExecution("stepName", jobExecution); assertNull(stepExecution.getEndTime()); tested.saveStepExecution(stepExecution); stepExecution.setEndTime(new Date()); StepExecution retrieved = tested.getStepExecution(jobExecution, stepExecution.getId()); assertNull(retrieved.getEndTime()); stepExecution.setEndTime(null); tested.updateStepExecution(stepExecution); stepExecution.setEndTime(new Date()); StepExecution stored = tested.getStepExecution(jobExecution, stepExecution.getId()); assertNull(stored.getEndTime()); }
@Before public void setUp() { jobRepository = new SimpleJobRepository(new MapJobInstanceDao(), new MapJobExecutionDao(), new MapStepExecutionDao(), new MapExecutionContextDao()); factory.setJobRepository(jobRepository); factory.setTransactionManager(new ResourcelessTransactionManager()); factory.setBeanName("step"); factory.setItemWriter(writer); factory.setCommitInterval(4); MessagingTemplate gateway = new MessagingTemplate(); writer.setMessagingOperations(gateway); gateway.setDefaultChannel(requests); writer.setReplyChannel(replies); gateway.setReceiveTimeout(100); TestItemWriter.count = 0; // Drain queues Message<?> message = replies.receive(10); while (message != null) { System.err.println(message); message = replies.receive(10); } }
stepExecutionDao = new MapStepExecutionDao(); ecDao = new MapExecutionContextDao(); jobRepository = new SimpleJobRepository(jobInstanceDao, jobExecutionDao, stepExecutionDao, ecDao);
@Test public void testAddStepExecutions() { StepExecutionDao tested = new MapStepExecutionDao();
@Override protected StepExecutionDao createStepExecutionDao() throws Exception { stepExecutionDao = new MapStepExecutionDao(); return stepExecutionDao; }
@Override protected StepExecutionDao createStepExecutionDao() throws Exception { stepExecutionDao = new MapStepExecutionDao(); return stepExecutionDao; }
@Override protected StepExecutionDao createStepExecutionDao() throws Exception { stepExecutionDao = new MapStepExecutionDao(); return stepExecutionDao; }
@Override protected StepExecutionDao createStepExecutionDao() throws Exception { stepExecutionDao = new MapStepExecutionDao(); return stepExecutionDao; }
@Bean public JobRepository jobRepository() { return new SimpleJobRepository( new MapJobInstanceDao(), new MapJobExecutionDao(), new MapStepExecutionDao(), new MapExecutionContextDao() ); }
protected void createMapComponents() throws Exception { if (this.transactionManager == null) { this.transactionManager = new ResourcelessTransactionManager(); } // jobRepository final MapJobRepositoryFactoryBean jobRepositoryFactory = new MapJobRepositoryFactoryBean( this.transactionManager); jobRepositoryFactory.afterPropertiesSet(); this.jobRepository = jobRepositoryFactory.getObject(); // jobExplorer final MapJobExplorerFactoryBean jobExplorerFactory = new MapJobExplorerFactoryBean( jobRepositoryFactory); jobExplorerFactory.afterPropertiesSet(); this.jobExplorer = jobExplorerFactory.getObject(); // jobExecutionDao this.jobExecutionDao = new MapJobExecutionDao(); // jobInstanceDao this.jobInstanceDao = new MapJobInstanceDao(); // stepExecutionDao this.stepExecutionDao = new MapStepExecutionDao(); }