committed by
Michael Minella
parent
54bce9a590
commit
d95f46002f
18
pom.xml
18
pom.xml
@@ -5,13 +5,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
<version>1.3.3.RELEASE</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-parent</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Task Build</name>
|
||||
<description>Spring Cloud Task Build</description>
|
||||
@@ -137,13 +137,13 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-stream.version>1.2.1.RELEASE</spring-cloud-stream.version>
|
||||
<spring-cloud-deployer-spi.version>1.2.1.RELEASE</spring-cloud-deployer-spi.version>
|
||||
<spring-cloud-deployer-local.version>1.2.1.RELEASE</spring-cloud-deployer-local.version>
|
||||
<spring-cloud-stream-binder-rabbit.version>1.2.0.RELEASE</spring-cloud-stream-binder-rabbit.version>
|
||||
<spring-cloud-deployer-resource-support.version>1.2.1.RELEASE</spring-cloud-deployer-resource-support.version>
|
||||
<spring-cloud-deployer-resource-maven.version>1.2.1.RELEASE</spring-cloud-deployer-resource-maven.version>
|
||||
<spring-batch.version>3.0.7.RELEASE</spring-batch.version>
|
||||
<spring-cloud-stream.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version>
|
||||
<spring-cloud-deployer-spi.version>1.2.0.RELEASE</spring-cloud-deployer-spi.version>
|
||||
<spring-cloud-deployer-local.version>1.2.0.RELEASE</spring-cloud-deployer-local.version>
|
||||
<spring-cloud-stream-binder-rabbit.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-stream-binder-rabbit.version>
|
||||
<spring-cloud-deployer-resource-support.version>1.2.0.RELEASE</spring-cloud-deployer-resource-support.version>
|
||||
<spring-cloud-deployer-resource-maven.version>1.2.0.RELEASE</spring-cloud-deployer-resource-maven.version>
|
||||
<spring-batch.version>4.0.0.BUILD-SNAPSHOT</spring-batch.version>
|
||||
<commons-logging.version>1.1</commons-logging.version>
|
||||
<java-ee-api.version>7.0</java-ee-api.version>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-parent</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-starter-task</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-parent</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-task-batch</artifactId>
|
||||
|
||||
@@ -78,7 +78,7 @@ public class TaskBatchExecutionListenerTests {
|
||||
|
||||
@Test
|
||||
public void testAutobuiltDataSource() {
|
||||
this.applicationContext = SpringApplication.run(new Object[] {JobConfiguration.class,
|
||||
this.applicationContext = SpringApplication.run(new Class[] {JobConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
EmbeddedDataSourceConfiguration.class,
|
||||
BatchAutoConfiguration.class,
|
||||
@@ -88,7 +88,7 @@ public class TaskBatchExecutionListenerTests {
|
||||
|
||||
@Test
|
||||
public void testFactoryBean() {
|
||||
this.applicationContext = SpringApplication.run(new Object[]{JobFactoryBeanConfiguration.class,
|
||||
this.applicationContext = SpringApplication.run(new Class[]{JobFactoryBeanConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
EmbeddedDataSourceConfiguration.class,
|
||||
BatchAutoConfiguration.class,
|
||||
@@ -109,7 +109,7 @@ public class TaskBatchExecutionListenerTests {
|
||||
}
|
||||
@Test
|
||||
public void testMultipleDataSources() {
|
||||
this.applicationContext = SpringApplication.run(new Object[] {JobConfigurationMultipleDataSources.class,
|
||||
this.applicationContext = SpringApplication.run(new Class[] {JobConfigurationMultipleDataSources.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
EmbeddedDataSourceConfiguration.class,
|
||||
BatchAutoConfiguration.class,
|
||||
@@ -127,7 +127,7 @@ public class TaskBatchExecutionListenerTests {
|
||||
|
||||
@Test
|
||||
public void testAutobuiltDataSourceNoJob() {
|
||||
this.applicationContext = SpringApplication.run(new Object[] {NoJobConfiguration.class,
|
||||
this.applicationContext = SpringApplication.run(new Class[] {NoJobConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
EmbeddedDataSourceConfiguration.class,
|
||||
BatchAutoConfiguration.class,
|
||||
@@ -135,7 +135,7 @@ public class TaskBatchExecutionListenerTests {
|
||||
|
||||
TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class);
|
||||
|
||||
Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", new PageRequest(0, 1));
|
||||
Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1));
|
||||
|
||||
Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId(page.iterator().next().getExecutionId());
|
||||
|
||||
@@ -144,38 +144,38 @@ public class TaskBatchExecutionListenerTests {
|
||||
|
||||
@Test
|
||||
public void testMapBased() {
|
||||
this.applicationContext = SpringApplication.run(new Object[] {JobConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
this.applicationContext = SpringApplication.run(new Class[] {JobConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class, EmbeddedDataSourceConfiguration.class,
|
||||
BatchAutoConfiguration.class,
|
||||
TaskBatchAutoConfiguration.class}, ARGS);
|
||||
|
||||
TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class);
|
||||
|
||||
Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", new PageRequest(0, 1));
|
||||
Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1));
|
||||
|
||||
Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId(page.iterator().next().getExecutionId());
|
||||
|
||||
assertEquals(1, jobExecutionIds.size());
|
||||
assertEquals(0, (long) taskExplorer.getTaskExecutionIdByJobExecutionId(jobExecutionIds.iterator().next()));
|
||||
assertEquals(1, (long) taskExplorer.getTaskExecutionIdByJobExecutionId(jobExecutionIds.iterator().next()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultipleJobs() {
|
||||
this.applicationContext = SpringApplication.run(new Object[] {MultipleJobConfiguration.class,
|
||||
this.applicationContext = SpringApplication.run(new Class[] {EmbeddedDataSourceConfiguration.class, MultipleJobConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
BatchAutoConfiguration.class,
|
||||
TaskBatchAutoConfiguration.class}, ARGS);
|
||||
|
||||
TaskExplorer taskExplorer = this.applicationContext.getBean(TaskExplorer.class);
|
||||
|
||||
Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", new PageRequest(0, 1));
|
||||
Page<TaskExecution> page = taskExplorer.findTaskExecutionsByName("application", PageRequest.of(0, 1));
|
||||
|
||||
Set<Long> jobExecutionIds = taskExplorer.getJobExecutionIdsByTaskExecutionId(page.iterator().next().getExecutionId());
|
||||
|
||||
assertEquals(2, jobExecutionIds.size());
|
||||
Iterator<Long> jobExecutionIdsIterator = jobExecutionIds.iterator();
|
||||
assertEquals(0, (long) taskExplorer.getTaskExecutionIdByJobExecutionId(jobExecutionIdsIterator.next()));
|
||||
assertEquals(0, (long) taskExplorer.getTaskExecutionIdByJobExecutionId(jobExecutionIdsIterator.next()));
|
||||
assertEquals(1, (long) taskExplorer.getTaskExecutionIdByJobExecutionId(jobExecutionIdsIterator.next()));
|
||||
assertEquals(1, (long) taskExplorer.getTaskExecutionIdByJobExecutionId(jobExecutionIdsIterator.next()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -214,8 +214,8 @@ public class TaskBatchExecutionListenerTests {
|
||||
|
||||
private TaskBatchExecutionListenerBeanPostProcessor beanPostProcessor(
|
||||
List<String> jobNames) {
|
||||
this.applicationContext = SpringApplication.run(new Object[] {JobConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
this.applicationContext = SpringApplication.run(new Class[] {JobConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class, EmbeddedDataSourceConfiguration.class,
|
||||
BatchAutoConfiguration.class,
|
||||
TaskBatchAutoConfiguration.class}, ARGS);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-parent</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-task-core</artifactId>
|
||||
|
||||
@@ -245,10 +245,10 @@ public class MapTaskExecutionDao implements TaskExecutionDao {
|
||||
}
|
||||
|
||||
private Page getPageFromList(List<TaskExecution> executionList, Pageable pageable, long maxSize){
|
||||
int toIndex = (pageable.getOffset() + pageable.getPageSize() > executionList.size()) ?
|
||||
long toIndex = (pageable.getOffset() + pageable.getPageSize() > executionList.size()) ?
|
||||
executionList.size() : pageable.getOffset() + pageable.getPageSize();
|
||||
return new PageImpl<>(
|
||||
executionList.subList(pageable.getOffset(), toIndex),
|
||||
executionList.subList((int)pageable.getOffset(), (int)toIndex),
|
||||
pageable, maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Db2PagingQueryProvider extends AbstractSqlPagingQueryProvider {
|
||||
|
||||
@Override
|
||||
public String getPageQuery(Pageable pageable) {
|
||||
int offset = pageable.getOffset() + 1;
|
||||
long offset = pageable.getOffset() + 1;
|
||||
return generateRowNumSqlQueryWithNesting(getSelectClause(), false,
|
||||
"TMP_ROW_NUM BETWEEN " + offset + " AND " + (offset + pageable.getPageSize()));
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class OraclePagingQueryProvider extends AbstractSqlPagingQueryProvider {
|
||||
|
||||
@Override
|
||||
public String getPageQuery(Pageable pageable) {
|
||||
int offset = pageable.getOffset()+1;
|
||||
long offset = pageable.getOffset()+1;
|
||||
return generateRowNumSqlQueryWithNesting(getSelectClause(), false, "TMP_ROW_NUM >= "
|
||||
+ offset + " AND TMP_ROW_NUM < " + (offset+pageable.getPageSize()));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class SqlServerPagingQueryProvider extends AbstractSqlPagingQueryProvider
|
||||
|
||||
@Override
|
||||
public String getPageQuery(Pageable pageable) {
|
||||
int offset = pageable.getOffset()+1;
|
||||
long offset = pageable.getOffset()+1;
|
||||
return generateRowNumSqlQueryWithNesting(getSelectClause(), false, "TMP_ROW_NUM >= "
|
||||
+ offset + " AND TMP_ROW_NUM < " + (offset+pageable.getPageSize()));
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.cloud.task;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.junit.After;
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.task.configuration.EnableTask;
|
||||
@@ -48,7 +48,7 @@ public class TaskCoreTests {
|
||||
|
||||
@Test
|
||||
public void successfulTaskTest() {
|
||||
applicationContext = new SpringApplicationBuilder().sources(new Object[]{TaskConfiguration.class,
|
||||
applicationContext = new SpringApplicationBuilder().sources(new Class[]{TaskConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class}).build().run(new String[]{
|
||||
"--spring.cloud.task.closecontext.enable=false",
|
||||
"--spring.cloud.task.name=" + TASK_NAME,
|
||||
@@ -67,8 +67,8 @@ public class TaskCoreTests {
|
||||
public void exceptionTaskTest() {
|
||||
boolean exceptionFired = false;
|
||||
try {
|
||||
applicationContext = new SpringApplicationBuilder().sources(new Object[]{TaskExceptionConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class}).build().run(new String[]{
|
||||
applicationContext = new SpringApplicationBuilder().sources(TaskExceptionConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class).build().run(new String[]{
|
||||
"--spring.cloud.task.closecontext.enable=false",
|
||||
"--spring.cloud.task.name=" + TASK_NAME,
|
||||
"--spring.main.web-environment=false"});
|
||||
@@ -95,8 +95,8 @@ public class TaskCoreTests {
|
||||
public void invalidExecutionId() {
|
||||
boolean exceptionFired = false;
|
||||
try {
|
||||
applicationContext = new SpringApplicationBuilder().sources(new Object[]{TaskExceptionConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class}).build().run(new String[]{
|
||||
applicationContext = new SpringApplicationBuilder().sources(TaskExceptionConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class).build().run(new String[]{
|
||||
"--spring.cloud.task.closecontext.enable=false",
|
||||
"--spring.cloud.task.name=" + TASK_NAME,
|
||||
"--spring.main.web-environment=false",
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.context.event.ApplicationFailedEvent;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.cloud.task.listener.annotation.AfterTask;
|
||||
|
||||
@@ -30,11 +30,10 @@ import org.junit.Test;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ExitCodeEvent;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.context.event.ApplicationFailedEvent;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.cloud.task.configuration.TaskProperties;
|
||||
import org.springframework.cloud.task.repository.TaskExecution;
|
||||
import org.springframework.cloud.task.repository.TaskExplorer;
|
||||
import org.springframework.cloud.task.util.TestDefaultConfiguration;
|
||||
@@ -139,7 +138,7 @@ public class TaskLifecycleListenerTests {
|
||||
|
||||
@Test
|
||||
public void testNoClosingOfContext() {
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(new Object[] {TestDefaultConfiguration.class, PropertyPlaceholderAutoConfiguration.class},
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(new Class[]{TestDefaultConfiguration.class, PropertyPlaceholderAutoConfiguration.class},
|
||||
new String[] {"--spring.cloud.task.closecontext_enable=false"});
|
||||
|
||||
try {
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
||||
import org.springframework.cloud.task.configuration.TestConfiguration;
|
||||
import org.springframework.cloud.task.repository.TaskExecution;
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
||||
import org.springframework.cloud.task.configuration.TestConfiguration;
|
||||
import org.springframework.cloud.task.repository.TaskExecution;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
||||
import org.springframework.cloud.task.configuration.SimpleTaskConfiguration;
|
||||
import org.springframework.cloud.task.repository.TaskExecution;
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
||||
import org.springframework.cloud.task.configuration.SimpleTaskConfiguration;
|
||||
import org.springframework.cloud.task.configuration.TestConfiguration;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Task Dependencies</name>
|
||||
<description>Spring Cloud Task Dependencies</description>
|
||||
@@ -19,22 +19,22 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-task</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-core</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-batch</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-stream</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-parent</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-task-docs</artifactId>
|
||||
<name>Spring Cloud Task Docs</name>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>spring-cloud-task-parent</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<name>Spring Cloud Task Integration Tests</name>
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.junit.Test;
|
||||
|
||||
import org.springframework.batch.core.scope.context.ChunkContext;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.annotation.StreamListener;
|
||||
@@ -248,8 +249,8 @@ public class BatchExecutionEventTests {
|
||||
}
|
||||
}
|
||||
|
||||
private Object[] getConfigurations(Class sinkClazz, Class jobConfigurationClazz) {
|
||||
return new Object[]{
|
||||
private Class[] getConfigurations(Class sinkClazz, Class jobConfigurationClazz) {
|
||||
return new Class[]{PropertyPlaceholderAutoConfiguration.class,
|
||||
jobConfigurationClazz,
|
||||
sinkClazz };
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
@@ -59,7 +59,7 @@ public class TaskEventTests {
|
||||
|
||||
@Test
|
||||
public void testTaskEventListener() throws Exception {
|
||||
ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder().sources(new Object[] {TaskEventsConfiguration.class,
|
||||
ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder().sources(new Class[] {TaskEventsConfiguration.class,
|
||||
TaskEventAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
RabbitServiceAutoConfiguration.class}).build().run(new String[] {"--spring.cloud.task.closecontext_enable=false",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>io.spring.cloud</groupId>
|
||||
<artifactId>batch-events</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Batch Events Sample Application</name>
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<groupId>io.spring.cloud</groupId>
|
||||
<artifactId>batch-job</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<description>Spring Cloud Task Batch Example</description>
|
||||
|
||||
<name>Batch Job Sample Application</name>
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-dependencies</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-task-parent</artifactId>
|
||||
<version>1.2.2.BUILD-SNAPSHOT</version>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -35,7 +35,8 @@ import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration;
|
||||
import org.springframework.cloud.task.batch.listener.support.JobExecutionEvent;
|
||||
import org.springframework.cloud.task.batch.listener.support.JobInstanceEvent;
|
||||
@@ -275,7 +276,7 @@ public class JobExecutionEventTests {
|
||||
@Test
|
||||
public void testOrderConfiguration() {
|
||||
ConfigurableApplicationContext applicationContext =
|
||||
SpringApplication.run(new Object[]{BatchEventAutoConfiguration.JobExecutionListenerConfiguration.class,
|
||||
SpringApplication.run(new Class[]{BatchEventAutoConfiguration.JobExecutionListenerConfiguration.class,
|
||||
EventJobExecutionConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
TestSupportBinderAutoConfiguration.class},
|
||||
@@ -299,7 +300,7 @@ public class JobExecutionEventTests {
|
||||
boolean exceptionThrown = false;
|
||||
String disabledPropertyArg = (property != null) ? "--" + property + "=false" : "";
|
||||
ConfigurableApplicationContext applicationContext =
|
||||
SpringApplication.run(new Object[]{BatchEventAutoConfiguration.JobExecutionListenerConfiguration.class,
|
||||
SpringApplication.run(new Class[]{BatchEventAutoConfiguration.JobExecutionListenerConfiguration.class,
|
||||
EventJobExecutionConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
TestSupportBinderAutoConfiguration.class},
|
||||
|
||||
@@ -18,7 +18,8 @@ package org.springframework.cloud.task.listener;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
||||
import org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration;
|
||||
import org.springframework.cloud.task.configuration.EnableTask;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@@ -38,9 +39,8 @@ public class TaskEventTests {
|
||||
@Test
|
||||
public void testDefaultConfiguration() {
|
||||
ConfigurableApplicationContext applicationContext =
|
||||
SpringApplication.run(new Object[]{ TaskEventsConfiguration.class,
|
||||
SpringApplication.run(new Class[]{PropertyPlaceholderAutoConfiguration.class,EmbeddedDataSourceConfiguration.class,TaskEventsConfiguration.class,
|
||||
TaskEventAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class,
|
||||
TestSupportBinderAutoConfiguration.class},
|
||||
new String[]{ "--spring.cloud.task.closecontext_enable=false",
|
||||
"--spring.main.web-environment=false"});
|
||||
|
||||
Reference in New Issue
Block a user