org.springframework.cloud.task.repository.support.SimpleTaskRepository Java Examples

The following examples show how to use org.springframework.cloud.task.repository.support.SimpleTaskRepository. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TaskLauncherTaskletTests.java    From composed-task-runner with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() throws Exception{
	this.taskRepositoryInitializer.setDataSource(this.dataSource);

	this.taskRepositoryInitializer.afterPropertiesSet();
	this.taskOperations = mock(TaskOperations.class);
	TaskExecutionDaoFactoryBean taskExecutionDaoFactoryBean =
			new TaskExecutionDaoFactoryBean(this.dataSource);
	this.taskRepository = new SimpleTaskRepository(taskExecutionDaoFactoryBean);
	this.taskExplorer = new SimpleTaskExplorer(taskExecutionDaoFactoryBean);
	this.composedTaskProperties.setIntervalTimeBetweenChecks(500);
}
 
Example #2
Source File: TaskLauncherTaskletTests.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
@BeforeEach
public void setup() throws Exception{
	this.taskRepositoryInitializer.setDataSource(this.dataSource);

	this.taskRepositoryInitializer.afterPropertiesSet();
	this.taskOperations = mock(TaskOperations.class);
	TaskExecutionDaoFactoryBean taskExecutionDaoFactoryBean =
			new TaskExecutionDaoFactoryBean(this.dataSource);
	this.taskRepository = new SimpleTaskRepository(taskExecutionDaoFactoryBean);
	this.taskExplorer = new SimpleTaskExplorer(taskExecutionDaoFactoryBean);
	this.composedTaskProperties.setIntervalTimeBetweenChecks(500);
}
 
Example #3
Source File: TaskStartTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Autowired
public void setDataSource(DataSource dataSource) {
	this.dataSource = dataSource;
	TaskExecutionDaoFactoryBean factoryBean = new TaskExecutionDaoFactoryBean(
			dataSource);
	this.taskExplorer = new SimpleTaskExplorer(factoryBean);
	this.taskRepository = new SimpleTaskRepository(factoryBean);
}
 
Example #4
Source File: SimpleTaskAutoConfigurationTests.java    From spring-cloud-task with Apache License 2.0 5 votes vote down vote up
@Test
public void testRepository() {
	ApplicationContextRunner applicationContextRunner = new ApplicationContextRunner()
			.withConfiguration(
					AutoConfigurations.of(PropertyPlaceholderAutoConfiguration.class,
							SimpleTaskAutoConfiguration.class,
							SingleTaskConfiguration.class));
	applicationContextRunner.run((context) -> {

		TaskRepository taskRepository = context.getBean(TaskRepository.class);
		assertThat(taskRepository).isNotNull();
		Class<?> targetClass = AopProxyUtils.ultimateTargetClass(taskRepository);
		assertThat(targetClass).isEqualTo(SimpleTaskRepository.class);
	});
}
 
Example #5
Source File: TestDependencies.java    From spring-cloud-dataflow with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskRepository taskRepository(DataSource dataSource) {
	return new SimpleTaskRepository(new TaskExecutionDaoFactoryBean(dataSource));
}
 
Example #6
Source File: TaskServiceDependencies.java    From spring-cloud-dataflow with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskRepository taskRepository(TaskExecutionDaoFactoryBean daoFactoryBean) {
	return new SimpleTaskRepository(daoFactoryBean);
}
 
Example #7
Source File: JobDependencies.java    From spring-cloud-dataflow with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskRepository taskRepository() {
	return new SimpleTaskRepository(new TaskExecutionDaoFactoryBean());
}
 
Example #8
Source File: TestConfiguration.java    From spring-cloud-task with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskRepository taskRepository() {
	return new SimpleTaskRepository(this.taskExecutionDaoFactoryBean);
}
 
Example #9
Source File: TestDefaultConfiguration.java    From spring-cloud-task with Apache License 2.0 4 votes vote down vote up
@Bean
public TaskRepository taskRepository() {
	return new SimpleTaskRepository(this.factoryBean);
}