From fd8ab152385d19498093bbb28ae997ca8bb2190d Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Mon, 15 Apr 2019 09:00:07 -0400 Subject: [PATCH] Updated all dependencies for M1 RELEASE Updated to Spring Cloud Build 2.2.0.M1 --- pom.xml | 10 +++++----- .../task/SimpleTaskAutoConfigurationTests.java | 2 +- .../cloud/task/TaskCoreTests.java | 3 +++ .../listener/TaskLifecycleListenerTests.java | 3 +++ .../TaskListenerExecutorObjectFactoryTests.java | 12 ++++++++++++ .../support/SimpleTaskExplorerTests.java | 3 +++ .../support/TaskDatabaseInitializerTests.java | 3 +++ .../cloud/task/util/TaskExecutionCreator.java | 6 +++++- .../cloud/task/util/TestDBUtils.java | 5 ++++- .../cloud/task/util/TestListener.java | 11 +++++++++++ .../cloud/task/util/TestVerifierUtils.java | 17 ++++++++++++----- spring-cloud-task-samples/batch-events/pom.xml | 8 ++++---- spring-cloud-task-samples/batch-job/pom.xml | 2 +- spring-cloud-task-samples/jpa-sample/pom.xml | 2 +- .../java/io/spring/JpaApplicationTests.java | 2 +- .../multiple-datasources/pom.xml | 2 +- .../partitioned-batch-job/pom.xml | 2 +- spring-cloud-task-samples/task-events/pom.xml | 4 ++-- spring-cloud-task-samples/taskprocessor/pom.xml | 6 +++--- spring-cloud-task-samples/tasksink/pom.xml | 6 +++--- spring-cloud-task-samples/timestamp/pom.xml | 2 +- .../batch/listener/JobInstanceEventTests.java | 4 ++-- .../task/launcher/TaskLaunchRequestTests.java | 4 ++-- .../configuration/TaskConfiguration.java | 2 +- .../util/TaskLauncherSinkApplication.java | 2 ++ 25 files changed, 87 insertions(+), 36 deletions(-) diff --git a/pom.xml b/pom.xml index de674f6c..adc4bdcd 100755 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-build - 2.2.0.BUILD-SNAPSHOT + 2.2.0.M1 @@ -111,11 +111,11 @@ - 2.2.0.BUILD-SNAPSHOT - 2.0.1.BUILD-SNAPSHOT - 2.0.1.BUILD-SNAPSHOT + 2.2.0.RC1 + 2.0.1.RELEASE + 2.0.1.RELEASE - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 1.1 8.0 diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/SimpleTaskAutoConfigurationTests.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/SimpleTaskAutoConfigurationTests.java index 3b499163..47d42745 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/SimpleTaskAutoConfigurationTests.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/SimpleTaskAutoConfigurationTests.java @@ -131,7 +131,7 @@ public class SimpleTaskAutoConfigurationTests { + "Could not obtain sequence value; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: " + "Syntax error in SQL statement \"SELECT FOOBARLESSSEQ.NEXTVAL FROM[*] DUAL \"; " + "expected \"identifier\"; SQL statement:\n" - + "select foobarlessSEQ.nextval from dual [42001-199]", + + "select foobarlessSEQ.nextval from dual [42001-198]", applicationContextRunner); } diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/TaskCoreTests.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/TaskCoreTests.java index 9cce4340..f10b0c0f 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/TaskCoreTests.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/TaskCoreTests.java @@ -58,6 +58,9 @@ public class TaskCoreTests { private static final String ERROR_MESSAGE = "errorMessage='java.lang.IllegalStateException: " + "Failed to execute CommandLineRunner"; + /** + * Used to capture the log output from the test task. + */ @Rule public OutputCapture outputCapture = new OutputCapture(); diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskLifecycleListenerTests.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskLifecycleListenerTests.java index 42fde0ab..f6985976 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskLifecycleListenerTests.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskLifecycleListenerTests.java @@ -62,6 +62,9 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class TaskLifecycleListenerTests { + /** + * Used to capture the log output from the test task. + */ @Rule public OutputCapture outputCapture = new OutputCapture(); diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskListenerExecutorObjectFactoryTests.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskListenerExecutorObjectFactoryTests.java index ffa5ef33..732f6513 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskListenerExecutorObjectFactoryTests.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/listener/TaskListenerExecutorObjectFactoryTests.java @@ -51,12 +51,24 @@ import static org.assertj.core.api.Assertions.assertThat; @DirtiesContext public class TaskListenerExecutorObjectFactoryTests { + /** + * Task name constant for the Before TaskListener tests. + */ public static final String BEFORE_LISTENER = "BEFORE LISTENER"; + /** + * Task name constant for the After TaskListener tests. + */ public static final String AFTER_LISTENER = "AFTER LISTENER"; + /** + * Task name constant for the Fail TaskListener tests. + */ public static final String FAIL_LISTENER = "FAIL LISTENER"; + /** + * Collection of the task execution listeners that were fired. + */ public static List taskExecutionListenerResults = new ArrayList<>(3); @Autowired diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/SimpleTaskExplorerTests.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/SimpleTaskExplorerTests.java index dff65806..cbb95a34 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/SimpleTaskExplorerTests.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/SimpleTaskExplorerTests.java @@ -65,6 +65,9 @@ public class SimpleTaskExplorerTests { private final static String EXTERNAL_EXECUTION_ID = "123ABC"; + /** + * Establishes that a Exception is not expected. + */ @Rule public ExpectedException expected = ExpectedException.none(); diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/TaskDatabaseInitializerTests.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/TaskDatabaseInitializerTests.java index 48558417..b7d468cc 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/TaskDatabaseInitializerTests.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/repository/support/TaskDatabaseInitializerTests.java @@ -43,6 +43,9 @@ import static org.mockito.Mockito.mock; */ public class TaskDatabaseInitializerTests { + /** + * Establishes that a Exception is not expected. + */ @Rule public ExpectedException expected = ExpectedException.none(); diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TaskExecutionCreator.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TaskExecutionCreator.java index a7f6fd2a..71a9db60 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TaskExecutionCreator.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TaskExecutionCreator.java @@ -28,7 +28,10 @@ import org.springframework.cloud.task.repository.TaskRepository; * * @author Glenn Renfro */ -public class TaskExecutionCreator { +public final class TaskExecutionCreator { + + private TaskExecutionCreator() { + } /** * Creates a sample TaskExecution and stores it in the taskRepository. @@ -71,6 +74,7 @@ public class TaskExecutionCreator { /** * Updates a sample TaskExecution in the taskRepository. * @param taskRepository the taskRepository where the taskExecution should be updated. + * @param expectedTaskExecution the expected task execution. * @return the taskExecution created. */ public static TaskExecution completeExecution(TaskRepository taskRepository, diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestDBUtils.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestDBUtils.java index 0bba5f50..7faa62b7 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestDBUtils.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestDBUtils.java @@ -52,7 +52,10 @@ import static org.mockito.Mockito.when; * @author Glenn Renfro * @author Ilayaperumal Gopinathan */ -public class TestDBUtils { +public final class TestDBUtils { + + private TestDBUtils() { + } /** * Retrieves the TaskExecution from the datasource. diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestListener.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestListener.java index 06042881..8ed1ab3f 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestListener.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestListener.java @@ -25,10 +25,19 @@ import org.springframework.cloud.task.repository.TaskExecution; */ public abstract class TestListener { + /** + * Default end message to use for the start message. + */ public static final String START_MESSAGE = "FOO"; + /** + * Default end message to use for the error message. + */ public static final String ERROR_MESSAGE = "BAR"; + /** + * Default end message to use for the end message. + */ public static final String END_MESSAGE = "BAZ"; protected boolean isTaskStartup; @@ -67,6 +76,7 @@ public abstract class TestListener { /** * Task Execution that was updated during listener call. + * @return instance of TaskExecution. */ public TaskExecution getTaskExecution() { return this.taskExecution; @@ -74,6 +84,7 @@ public abstract class TestListener { /** * The throwable that was sent with the task if task failed. + * @return instance of Throwable. */ public Throwable getThrowable() { return this.throwable; diff --git a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestVerifierUtils.java b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestVerifierUtils.java index 1bb1016c..4f93e7e0 100644 --- a/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestVerifierUtils.java +++ b/spring-cloud-task-core/src/test/java/org/springframework/cloud/task/util/TestVerifierUtils.java @@ -42,10 +42,16 @@ import static org.mockito.Mockito.when; * * @author Glenn Renfro */ -public class TestVerifierUtils { +public final class TestVerifierUtils { + /** + * The default number of arguments to use for the test TaskExecutions. + */ public static final int ARG_SIZE = 5; + private TestVerifierUtils() { + } + /** * Creates a mock {@link Appender} to be added to the root logger. * @return reference to the mock appender. @@ -78,7 +84,7 @@ public class TestVerifierUtils { /** * Creates a fully populated TaskExecution (except args) for testing. - * @return + * @return instance of a TaskExecution */ public static TaskExecution createSampleTaskExecutionNoArg() { Random randomGenerator = new Random(); @@ -92,7 +98,7 @@ public class TestVerifierUtils { /** * Creates a fully populated TaskExecution (except args) for testing. - * @return + * @return instance of a TaskExecution. */ public static TaskExecution endSampleTaskExecutionNoArg() { Random randomGenerator = new Random(); @@ -109,7 +115,8 @@ public class TestVerifierUtils { /** * Creates a fully populated TaskExecution for testing. - * @return + * @param executionId the taskExecutionId to be created. + * @return instance of the TaskExecution. */ public static TaskExecution createSampleTaskExecution(long executionId) { Date startTime = new Date(); @@ -124,7 +131,7 @@ public class TestVerifierUtils { } /** - * Verifies that all the fields in between the expected and actual are the same; + * Verifies that all the fields in between the expected and actual are the same. * @param expectedTaskExecution The expected value for the task execution. * @param actualTaskExecution The actual value for the task execution. */ diff --git a/spring-cloud-task-samples/batch-events/pom.xml b/spring-cloud-task-samples/batch-events/pom.xml index 06eb359f..39917787 100644 --- a/spring-cloud-task-samples/batch-events/pom.xml +++ b/spring-cloud-task-samples/batch-events/pom.xml @@ -15,7 +15,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 @@ -49,19 +49,19 @@ org.springframework.cloud spring-cloud-starter-stream-rabbit - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 compile org.springframework.cloud spring-cloud-stream-binder-rabbit-test-support - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 test org.springframework.cloud spring-cloud-stream-test-support-internal - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 test diff --git a/spring-cloud-task-samples/batch-job/pom.xml b/spring-cloud-task-samples/batch-job/pom.xml index 6102a2a3..269af5df 100644 --- a/spring-cloud-task-samples/batch-job/pom.xml +++ b/spring-cloud-task-samples/batch-job/pom.xml @@ -15,7 +15,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 diff --git a/spring-cloud-task-samples/jpa-sample/pom.xml b/spring-cloud-task-samples/jpa-sample/pom.xml index 73d70cc6..023e3333 100644 --- a/spring-cloud-task-samples/jpa-sample/pom.xml +++ b/spring-cloud-task-samples/jpa-sample/pom.xml @@ -30,7 +30,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 diff --git a/spring-cloud-task-samples/jpa-sample/src/test/java/io/spring/JpaApplicationTests.java b/spring-cloud-task-samples/jpa-sample/src/test/java/io/spring/JpaApplicationTests.java index 92bba6b3..7d746720 100644 --- a/spring-cloud-task-samples/jpa-sample/src/test/java/io/spring/JpaApplicationTests.java +++ b/spring-cloud-task-samples/jpa-sample/src/test/java/io/spring/JpaApplicationTests.java @@ -75,7 +75,7 @@ public class JpaApplicationTests { this.dataSource = dataSource; try { this.server = Server - .createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", String + .createTcpServer("-tcp", "-ifNotExists", "-tcpAllowOthers", "-tcpPort", String .valueOf(randomPort)) .start(); } diff --git a/spring-cloud-task-samples/multiple-datasources/pom.xml b/spring-cloud-task-samples/multiple-datasources/pom.xml index 0edbd729..ba4b8d9f 100644 --- a/spring-cloud-task-samples/multiple-datasources/pom.xml +++ b/spring-cloud-task-samples/multiple-datasources/pom.xml @@ -16,7 +16,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 diff --git a/spring-cloud-task-samples/partitioned-batch-job/pom.xml b/spring-cloud-task-samples/partitioned-batch-job/pom.xml index 776fbf50..fe09f5d8 100644 --- a/spring-cloud-task-samples/partitioned-batch-job/pom.xml +++ b/spring-cloud-task-samples/partitioned-batch-job/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 diff --git a/spring-cloud-task-samples/task-events/pom.xml b/spring-cloud-task-samples/task-events/pom.xml index f444d473..975e9ad0 100644 --- a/spring-cloud-task-samples/task-events/pom.xml +++ b/spring-cloud-task-samples/task-events/pom.xml @@ -15,7 +15,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 @@ -45,7 +45,7 @@ org.springframework.cloud spring-cloud-starter-stream-rabbit - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 compile diff --git a/spring-cloud-task-samples/taskprocessor/pom.xml b/spring-cloud-task-samples/taskprocessor/pom.xml index 95ae4e77..41c2918f 100644 --- a/spring-cloud-task-samples/taskprocessor/pom.xml +++ b/spring-cloud-task-samples/taskprocessor/pom.xml @@ -16,7 +16,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 @@ -45,7 +45,7 @@ org.springframework.cloud spring-cloud-starter-stream-rabbit - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 compile @@ -55,7 +55,7 @@ org.springframework.cloud spring-cloud-stream-test-support - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 test diff --git a/spring-cloud-task-samples/tasksink/pom.xml b/spring-cloud-task-samples/tasksink/pom.xml index c45bb752..f7daea50 100644 --- a/spring-cloud-task-samples/tasksink/pom.xml +++ b/spring-cloud-task-samples/tasksink/pom.xml @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 @@ -46,13 +46,13 @@ org.springframework.cloud spring-cloud-starter-stream-rabbit - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 compile org.springframework.cloud spring-cloud-stream-test-support - 2.2.0.BUILD-SNAPSHOT + 2.2.0.RC1 test diff --git a/spring-cloud-task-samples/timestamp/pom.xml b/spring-cloud-task-samples/timestamp/pom.xml index be27ef91..3f11808a 100644 --- a/spring-cloud-task-samples/timestamp/pom.xml +++ b/spring-cloud-task-samples/timestamp/pom.xml @@ -15,7 +15,7 @@ org.springframework.boot spring-boot-starter-parent - 2.1.3.RELEASE + 2.2.0.M1 diff --git a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/batch/listener/JobInstanceEventTests.java b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/batch/listener/JobInstanceEventTests.java index b5d1a4fc..531a3c91 100644 --- a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/batch/listener/JobInstanceEventTests.java +++ b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/batch/listener/JobInstanceEventTests.java @@ -27,9 +27,9 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class JobInstanceEventTests { - public static final long INSTANCE_ID = 1; + private static final long INSTANCE_ID = 1; - public static final String JOB_NAME = "FOOBAR"; + private static final String JOB_NAME = "FOOBAR"; @Test public void testConstructor() { diff --git a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/TaskLaunchRequestTests.java b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/TaskLaunchRequestTests.java index 7ec71304..56b99b02 100644 --- a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/TaskLaunchRequestTests.java +++ b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/TaskLaunchRequestTests.java @@ -31,9 +31,9 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class TaskLaunchRequestTests { - public static final String URI = "https://myURI"; + private static final String URI = "https://myURI"; - public static final String APP_NAME = "MY_APP_NAME"; + private static final String APP_NAME = "MY_APP_NAME"; @Test public void testEquals() { diff --git a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/configuration/TaskConfiguration.java b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/configuration/TaskConfiguration.java index ca1598b4..3451a9fd 100644 --- a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/configuration/TaskConfiguration.java +++ b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/configuration/TaskConfiguration.java @@ -40,7 +40,7 @@ public class TaskConfiguration { public static class TestTaskLauncher implements TaskLauncher { - public static final String LAUNCH_ID = "TEST_LAUNCH_ID"; + private static final String LAUNCH_ID = "TEST_LAUNCH_ID"; private LaunchState state = LaunchState.unknown; diff --git a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/util/TaskLauncherSinkApplication.java b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/util/TaskLauncherSinkApplication.java index 1b642705..b6a39fb2 100644 --- a/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/util/TaskLauncherSinkApplication.java +++ b/spring-cloud-task-stream/src/test/java/org/springframework/cloud/task/launcher/util/TaskLauncherSinkApplication.java @@ -23,6 +23,7 @@ import org.springframework.cloud.task.launcher.annotation.EnableTaskLauncher; /** * @author Glenn Renfro */ +// @checkstyle:on @SpringBootApplication @EnableTaskLauncher public class TaskLauncherSinkApplication { @@ -32,3 +33,4 @@ public class TaskLauncherSinkApplication { } } +// @checkstyle:off