Java Code Examples for org.springframework.cloud.task.repository.TaskExplorer#findTaskExecutionsByName()
The following examples show how to use
org.springframework.cloud.task.repository.TaskExplorer#findTaskExecutionsByName() .
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: TaskBatchExecutionListenerTests.java From spring-cloud-task with Apache License 2.0 | 6 votes |
@Test public void testMultipleDataSources() { this.applicationContext = SpringApplication .run(JobConfigurationMultipleDataSources.class, ARGS); TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class); Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1)); Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId( page.iterator().next().getExecutionId()); assertThat(jobExecutionIds.size()).isEqualTo(1); assertThat(taskExplorer.getTaskExecution(jobExecutionIds.iterator().next()) .getExecutionId()).isEqualTo(1); }
Example 2
Source File: TaskBatchExecutionListenerTests.java From spring-cloud-task with Apache License 2.0 | 6 votes |
@Test public void testMapBased() { this.applicationContext = SpringApplication.run(JobConfiguration.class, ARGS); TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class); Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1)); Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId( page.iterator().next().getExecutionId()); assertThat(jobExecutionIds.size()).isEqualTo(1); assertThat((long) taskExplorer .getTaskExecutionIdByJobExecutionId(jobExecutionIds.iterator().next())) .isEqualTo(1); }
Example 3
Source File: TaskBatchExecutionListenerTests.java From spring-cloud-task with Apache License 2.0 | 6 votes |
@Test public void testMultipleJobs() { this.applicationContext = SpringApplication.run(MultipleJobConfiguration.class, ARGS); TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class); Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1)); Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId( page.iterator().next().getExecutionId()); assertThat(jobExecutionIds.size()).isEqualTo(2); Iterator<Long> jobExecutionIdsIterator = jobExecutionIds.iterator(); assertThat((long) taskExplorer .getTaskExecutionIdByJobExecutionId(jobExecutionIdsIterator.next())) .isEqualTo(1); assertThat((long) taskExplorer .getTaskExecutionIdByJobExecutionId(jobExecutionIdsIterator.next())) .isEqualTo(1); }
Example 4
Source File: TaskBatchExecutionListenerTests.java From spring-cloud-task with Apache License 2.0 | 5 votes |
private void validateContext() { TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class); Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1)); Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId( page.iterator().next().getExecutionId()); assertThat(jobExecutionIds.size()).isEqualTo(1); assertThat(taskExplorer.getTaskExecution(jobExecutionIds.iterator().next()) .getExecutionId()).isEqualTo(1); }
Example 5
Source File: TaskBatchExecutionListenerTests.java From spring-cloud-task with Apache License 2.0 | 5 votes |
@Test public void testAutobuiltDataSourceNoJob() { this.applicationContext = SpringApplication.run(NoJobConfiguration.class, ARGS); TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class); Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1)); Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId( page.iterator().next().getExecutionId()); assertThat(jobExecutionIds.size()).isEqualTo(0); }
Example 6
Source File: TaskJobLauncherCommandLineRunnerTests.java From spring-cloud-task with Apache License 2.0 | 5 votes |
private void validateContext() { TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class); Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1)); Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId( page.iterator().next().getExecutionId()); assertThat(jobExecutionIds.size()).isEqualTo(1); assertThat(taskExplorer.getTaskExecution(jobExecutionIds.iterator().next()) .getExecutionId()).isEqualTo(1); }