Updated dependencies and refactored code.

* Updated spring cloud streams to 1.1.0.RELEASE
* Updated cloud dependencies parent to 1.2.1.RELEASE
* Updated samples to 1.4.1
* Updated Tests to take advantage of 1.4 boot test annotations
* Removed @Bindings as they are deprecated
* Updated BatchApplication test to pass.  Boot no longer logs environment values.  So count was reduced from 3 to 1

resolves #218, #221

renamed spring-cloud-task-starter to spring-cloud-starter-task
This commit is contained in:
Glenn Renfro
2016-10-05 15:10:39 -04:00
committed by Michael Minella
parent 441bbfe492
commit d657b22b79
19 changed files with 46 additions and 50 deletions

View File

@@ -125,16 +125,16 @@
<module>spring-cloud-task-docs</module>
<module>spring-cloud-task-batch</module>
<module>spring-cloud-task-stream</module>
<module>spring-cloud-task-starter</module>
<module>spring-cloud-starter-task</module>
<module>spring-cloud-task-samples</module>
<module>spring-cloud-task-integration-tests</module>
</modules>
<properties>
<spring-cloud-stream.version>1.0.2.RELEASE</spring-cloud-stream.version>
<spring-cloud-stream.version>1.1.0.RELEASE</spring-cloud-stream.version>
<spring-cloud-deployer-spi.version>1.0.2.RELEASE</spring-cloud-deployer-spi.version>
<spring-cloud-deployer-local.version>1.0.2.RELEASE</spring-cloud-deployer-local.version>
<spring-cloud-stream-binder-rabbit.version>1.0.2.RELEASE</spring-cloud-stream-binder-rabbit.version>
<spring-cloud-stream-binder-rabbit.version>1.1.0.RELEASE</spring-cloud-stream-binder-rabbit.version>
<spring-cloud-deployer-resource-support.version>1.0.2.RELEASE</spring-cloud-deployer-resource-support.version>
<spring-cloud-deployer-resource-maven.version>1.0.2.RELEASE</spring-cloud-deployer-resource-maven.version>
<spring-batch.version>3.0.7.RELEASE</spring-batch.version>

View File

@@ -9,7 +9,7 @@
<version>1.1.0.BUILD-SNAPSHOT</version>
</parent>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
<packaging>jar</packaging>
<name>Spring Cloud Task Starter</name>
<description>Spring Boot starter for Spring Cloud Task</description>

View File

@@ -10,7 +10,7 @@
<parent>
<artifactId>spring-cloud-dependencies-parent</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.1.1.RELEASE</version>
<version>1.2.1.RELEASE</version>
<relativePath />
</parent>
@@ -18,7 +18,7 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@@ -44,6 +44,12 @@
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-rabbit-test-support</artifactId>
<version>${spring-cloud-stream-binder-rabbit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>

View File

@@ -34,9 +34,8 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.deployer.spi.local.LocalDeployerProperties;
import org.springframework.cloud.deployer.spi.local.LocalTaskLauncher;
import org.springframework.cloud.deployer.spi.task.TaskLauncher;
import org.springframework.cloud.stream.annotation.Bindings;
import org.springframework.cloud.stream.binder.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.task.launcher.util.TaskLauncherSinkApplication;
import org.springframework.cloud.task.repository.TaskExecution;
import org.springframework.cloud.task.repository.TaskExplorer;
@@ -84,7 +83,6 @@ public class TaskLauncherSinkTests {
public static RabbitTestSupport rabbitTestSupport = new RabbitTestSupport();
@Autowired
@Bindings(TaskLauncherSink.class)
private Sink sink;
private DataSource dataSource;

View File

@@ -31,8 +31,8 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.binder.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration;
import org.springframework.cloud.task.batch.listener.support.JobExecutionEvent;
import org.springframework.cloud.task.batch.listener.support.StepExecutionEvent;

View File

@@ -29,8 +29,8 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.binder.rabbit.config.RabbitServiceAutoConfiguration;
import org.springframework.cloud.stream.binder.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.cloud.task.repository.TaskExecution;
import org.springframework.context.ConfigurableApplicationContext;

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/>
</parent>
@@ -51,18 +51,24 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>1.0.2.RELEASE</version>
<version>1.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support-internal</artifactId>
<version>1.0.2.RELEASE</version>
<artifactId>spring-cloud-stream-binder-rabbit-test-support</artifactId>
<version>1.1.0.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-stream-test-support-internal</artifactId>
<version>1.1.0.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>

View File

@@ -29,8 +29,8 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.binder.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.task.batch.listener.support.JobExecutionEvent;
import org.springframework.context.annotation.PropertySource;

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/>
</parent>
@@ -41,7 +41,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>

View File

@@ -77,7 +77,7 @@ public class BatchJobApplicationTests {
while (matcher.find()) {
count++;
}
assertEquals("The number of task titles did not match expected: ", 3, count);
assertEquals("The number of task titles did not match expected: ", 1, count);
}
}

View File

@@ -12,7 +12,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/>
</parent>
@@ -41,7 +41,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/>
</parent>
@@ -42,13 +42,13 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>1.0.2.RELEASE</version>
<version>1.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/>
</parent>
@@ -41,12 +41,12 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>1.0.2.RELEASE</version>
<version>1.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -56,7 +56,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
<version>1.0.2.RELEASE</version>
<version>1.1.0.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/>
</parent>
@@ -46,18 +46,18 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>1.0.2.RELEASE</version>
<version>1.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
<version>1.0.2.RELEASE</version>
<version>1.1.0.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<version>1.4.1.RELEASE</version>
<relativePath/>
</parent>
@@ -46,7 +46,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-starter</artifactId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@@ -24,7 +24,6 @@ import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.springframework.batch.core.JobExecution;
@@ -36,7 +35,6 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration;
import org.springframework.cloud.stream.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.task.batch.listener.support.JobExecutionEvent;
import org.springframework.cloud.task.batch.listener.support.StepExecutionEvent;
import org.springframework.cloud.task.configuration.EnableTask;
@@ -64,9 +62,6 @@ public class EventJobExecutionTests {
private JobParameters jobParameters;
private JobInstance jobInstance;
@ClassRule
public static RabbitTestSupport rabbitTestSupport = new RabbitTestSupport();
@Before
public void setup() {
jobInstance = new JobInstance(JOB_INSTANCE_ID, JOB_NAME);

View File

@@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -31,7 +30,6 @@ import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.cloud.deployer.spi.task.LaunchState;
import org.springframework.cloud.stream.annotation.Bindings;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.task.launcher.configuration.TaskConfiguration;
import org.springframework.cloud.task.launcher.util.TaskLauncherSinkApplication;
import org.springframework.context.ApplicationContext;
@@ -57,9 +55,6 @@ public class TaskLauncherSinkTests {
private Map<String, String> properties;
@ClassRule
public static RabbitTestSupport rabbitTestSupport = new RabbitTestSupport();
private final static String DEFAULT_STATUS = "test_status";
@Autowired

View File

@@ -15,13 +15,11 @@
*/
package org.springframework.cloud.task.listener;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration;
import org.springframework.cloud.stream.test.junit.rabbit.RabbitTestSupport;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
@@ -31,12 +29,10 @@ import static org.junit.Assert.assertNotNull;
/**
* @author Michael Minella
* @author Ilayaperumal Gopinathan
* @author Glenn Renfro
*/
public class TaskEventTests {
@Rule
public RabbitTestSupport rabbitTestSupport = new RabbitTestSupport();
private static final String TASK_NAME = "taskEventTest";
@Test