@Override protected JobExecutionDao createJobExecutionDao() throws Exception { jobExecutionDao = new MapJobExecutionDao(); return jobExecutionDao; }
@Override protected JobExecutionDao getJobExecutionDao() { return new MapJobExecutionDao(); }
@Override protected JobExecutionDao getJobExecutionDao() { return new MapJobExecutionDao(); }
final JobExecutionDao tested = new MapJobExecutionDao();
@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() { JobExecutionDao tested = new MapJobExecutionDao(); JobExecution jobExecution = new JobExecution(new JobInstance((long) 1, "mapJob"), new JobParameters()); assertNull(jobExecution.getStartTime()); tested.saveJobExecution(jobExecution); jobExecution.setStartTime(new Date()); JobExecution retrieved = tested.getJobExecution(jobExecution.getId()); assertNull(retrieved.getStartTime()); tested.updateJobExecution(jobExecution); jobExecution.setEndTime(new Date()); assertNull(retrieved.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); } }
jobExecutionDao = new MapJobExecutionDao(); stepExecutionDao = new MapStepExecutionDao(); ecDao = new MapExecutionContextDao();
@Override protected JobExecutionDao createJobExecutionDao() throws Exception { jobExecutionDao = new MapJobExecutionDao(); return jobExecutionDao; }
@Override protected JobExecutionDao createJobExecutionDao() throws Exception { jobExecutionDao = new MapJobExecutionDao(); return jobExecutionDao; }
@Override protected JobExecutionDao createJobExecutionDao() throws Exception { jobExecutionDao = new MapJobExecutionDao(); return jobExecutionDao; }
@Override protected JobExecutionDao createJobExecutionDao() throws Exception { jobExecutionDao = new MapJobExecutionDao(); return jobExecutionDao; }
@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(); }