Skip to content

Commit

Permalink
Updated Spring Cloud Task to latest releases
Browse files Browse the repository at this point in the history
Updated to remove all commons-logging-api dependencies to resolve  logging issue.

Updated to handle 2.0.0.M3 Spring Cloud Stream

resovles spring-cloud#347

Changes based on code review
  • Loading branch information
cppwfs committed Nov 1, 2017
1 parent 15acc0c commit e279846
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 40 deletions.
15 changes: 5 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>2.0.0.M2</version>
<version>2.0.0.M4</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -117,11 +117,6 @@
<artifactId>spring-cloud-stream-test-support</artifactId>
<version>${spring-cloud-stream.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
<version>${commons-logging.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -137,15 +132,15 @@
</modules>

<properties>
<spring-cloud-stream.version>2.0.0.M1</spring-cloud-stream.version>
<spring-cloud-stream.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-stream.version>
<spring-cloud-deployer-spi.version>2.0.0.M1</spring-cloud-deployer-spi.version>
<spring-cloud-deployer-local.version>2.0.0.M1</spring-cloud-deployer-local.version>
<spring-cloud-stream-binder-rabbit.version>2.0.0.M1</spring-cloud-stream-binder-rabbit.version>
<spring-cloud-stream-binder-rabbit.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-stream-binder-rabbit.version>
<spring-cloud-deployer-resource-support.version>2.0.0.M1</spring-cloud-deployer-resource-support.version>
<spring-cloud-deployer-resource-maven.version>2.0.0.M1</spring-cloud-deployer-resource-maven.version>
<spring-batch.version>4.0.0.M3</spring-batch.version>
<spring-batch.version>4.0.0.M5</spring-batch.version>
<commons-logging.version>1.1</commons-logging.version>
<java-ee-api.version>7.0</java-ee-api.version>
<java-ee-api.version>8.0</java-ee-api.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco-ut.exec</sonar.jacoco.reportPath>
Expand Down
4 changes: 0 additions & 4 deletions spring-cloud-task-batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
<artifactId>spring-batch-integration</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
Expand Down
5 changes: 3 additions & 2 deletions spring-cloud-task-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@
<artifactId>spring-orm</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
8 changes: 4 additions & 4 deletions spring-cloud-task-samples/batch-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -51,19 +51,19 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-rabbit-test-support</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support-internal</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-task-samples/batch-job/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-task-samples/jpa-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down
4 changes: 2 additions & 2 deletions spring-cloud-task-samples/partitioned-batch-job/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -47,7 +47,7 @@
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-integration</artifactId>
<version>4.0.0.M3</version>
<version>4.0.0.M5</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions spring-cloud-task-samples/task-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions spring-cloud-task-samples/taskprocessor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -56,7 +56,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

package io.spring;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -27,6 +29,7 @@
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.cloud.stream.test.binder.MessageCollector;
import org.springframework.cloud.task.launcher.TaskLaunchRequest;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.test.context.junit4.SpringRunner;

Expand All @@ -49,16 +52,20 @@ public class TaskProcessorApplicationTests {
@Autowired
protected MessageCollector collector;

private ObjectMapper mapper = new ObjectMapper();

@Test
public void test() throws InterruptedException{
public void test() throws InterruptedException, IOException {
channels.input().send(new GenericMessage<Object>(DEFAULT_PAYLOAD));
Map<String, String> properties = new HashMap();
properties.put("payload", DEFAULT_PAYLOAD);
TaskLaunchRequest expectedRequest = new TaskLaunchRequest(
"maven://org.springframework.cloud.task.app:"
+ "timestamp-task:jar:1.0.1.RELEASE", null, properties,
null, null);
assertThat(collector.forChannel(channels.output()), receivesPayloadThat(is(expectedRequest)));
Message<String> result = (Message<String>)collector.forChannel(channels.output()).take();
TaskLaunchRequest tlq = mapper.readValue(result.getPayload(),TaskLaunchRequest.class);
assertThat(tlq, is(expectedRequest));
}

}
6 changes: 3 additions & 3 deletions spring-cloud-task-samples/tasksink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -46,13 +46,13 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
<version>2.0.0.M1</version>
<version>2.0.0.BUILD-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-task-samples/timestamp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
<version>2.0.0.M5</version>
<relativePath />
</parent>

Expand Down
4 changes: 0 additions & 4 deletions spring-cloud-task-stream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
<artifactId>spring-cloud-deployer-local</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-deployer-spi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class TaskLaunchRequest implements Serializable{
private String applicationName;

/**
* Constructor for the TaskLaunchRequest;
* Constructor for the TaskLaunchRequest.
* @param uri the URI to the task artifact to be launched.
* @param commandlineArguments list of commandlineArguments to be used by the task
* @param environmentProperties are the environment variables for this task.
Expand All @@ -66,6 +66,14 @@ public TaskLaunchRequest(String uri, List<String> commandlineArguments,
setApplicationName(applicationName);
}

/**
* Constructor for the TaskLaunchRequest.
*
* @since 2.0.0
*/
public TaskLaunchRequest() {
}

/**
* Returns the current uri to the artifact for this launch request.
*/
Expand Down

0 comments on commit e279846

Please sign in to comment.