From a3700284afd1afca18ebcfb46f9c57da50553dc5 Mon Sep 17 00:00:00 2001 From: Ilayaperumal Gopinathan Date: Fri, 30 Aug 2019 12:00:18 +0530 Subject: [PATCH] Refactor scheduler packages into org.springframework.cloud.deployer.spi Resolves #309 --- .../CloudFoundryAppScheduler.java | 20 +++++++++---------- .../CloudFoundryScheduleSSLException.java | 2 +- .../CloudFoundrySchedulerProperties.java | 2 +- .../expression/QuartzCronExpression.java | 2 +- .../CloudFoundryAppSchedulerTests.java | 12 +++++------ ...CloudFoundryScheduleSSLExceptionTests.java | 2 +- .../CloudFoundrySchedulerPropertiesTest.java | 2 +- .../SpringCloudSchedulerIntegrationTests.java | 8 ++++---- .../expression/QuartzCronExpressionTests.java | 4 +++- 9 files changed, 28 insertions(+), 26 deletions(-) rename src/main/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/CloudFoundryAppScheduler.java (95%) rename src/main/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/CloudFoundryScheduleSSLException.java (93%) rename src/main/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/CloudFoundrySchedulerProperties.java (97%) rename src/main/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/expression/QuartzCronExpression.java (99%) rename src/test/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/CloudFoundryAppSchedulerTests.java (97%) rename src/test/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/CloudFoundryScheduleSSLExceptionTests.java (95%) rename src/test/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/CloudFoundrySchedulerPropertiesTest.java (96%) rename src/test/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/SpringCloudSchedulerIntegrationTests.java (95%) rename src/test/java/org/springframework/cloud/deployer/{scheduler/spi => spi/scheduler}/cloudfoundry/expression/QuartzCronExpressionTests.java (98%) diff --git a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryAppScheduler.java b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryAppScheduler.java similarity index 95% rename from src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryAppScheduler.java rename to src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryAppScheduler.java index 1bfb2145..3729cb92 100644 --- a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryAppScheduler.java +++ b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryAppScheduler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry; import java.text.ParseException; import java.time.Duration; @@ -46,17 +46,17 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import org.springframework.cloud.deployer.scheduler.spi.cloudfoundry.expression.QuartzCronExpression; -import org.springframework.cloud.deployer.scheduler.spi.core.CreateScheduleException; -import org.springframework.cloud.deployer.scheduler.spi.core.ScheduleInfo; -import org.springframework.cloud.deployer.scheduler.spi.core.ScheduleRequest; -import org.springframework.cloud.deployer.scheduler.spi.core.Scheduler; -import org.springframework.cloud.deployer.scheduler.spi.core.SchedulerException; -import org.springframework.cloud.deployer.scheduler.spi.core.SchedulerPropertyKeys; -import org.springframework.cloud.deployer.scheduler.spi.core.UnScheduleException; -import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryTaskLauncher; import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryConnectionProperties; +import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryTaskLauncher; import org.springframework.cloud.deployer.spi.core.AppDeploymentRequest; +import org.springframework.cloud.deployer.spi.scheduler.CreateScheduleException; +import org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo; +import org.springframework.cloud.deployer.spi.scheduler.ScheduleRequest; +import org.springframework.cloud.deployer.spi.scheduler.Scheduler; +import org.springframework.cloud.deployer.spi.scheduler.SchedulerException; +import org.springframework.cloud.deployer.spi.scheduler.SchedulerPropertyKeys; +import org.springframework.cloud.deployer.spi.scheduler.UnScheduleException; +import org.springframework.cloud.deployer.spi.scheduler.cloudfoundry.expression.QuartzCronExpression; import org.springframework.retry.RecoveryCallback; import org.springframework.retry.RetryCallback; import org.springframework.retry.RetryContext; diff --git a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryScheduleSSLException.java b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryScheduleSSLException.java similarity index 93% rename from src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryScheduleSSLException.java rename to src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryScheduleSSLException.java index 872f9328..d9a31b1d 100644 --- a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryScheduleSSLException.java +++ b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryScheduleSSLException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry; /** * A {@link RuntimeException} that wraps SSL based exceptions. diff --git a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundrySchedulerProperties.java b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundrySchedulerProperties.java similarity index 97% rename from src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundrySchedulerProperties.java rename to src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundrySchedulerProperties.java index 58563f4a..93c42166 100644 --- a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundrySchedulerProperties.java +++ b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundrySchedulerProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry; import javax.validation.constraints.NotNull; diff --git a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/expression/QuartzCronExpression.java b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/expression/QuartzCronExpression.java similarity index 99% rename from src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/expression/QuartzCronExpression.java rename to src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/expression/QuartzCronExpression.java index 12b6052b..b8a8213c 100644 --- a/src/main/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/expression/QuartzCronExpression.java +++ b/src/main/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/expression/QuartzCronExpression.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry.expression; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry.expression; import java.text.ParseException; import java.util.Calendar; diff --git a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryAppSchedulerTests.java b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryAppSchedulerTests.java similarity index 97% rename from src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryAppSchedulerTests.java rename to src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryAppSchedulerTests.java index a2c188db..db165cd9 100644 --- a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryAppSchedulerTests.java +++ b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryAppSchedulerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry; import java.util.ArrayList; import java.util.Collections; @@ -67,14 +67,14 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import org.springframework.cloud.deployer.scheduler.spi.core.CreateScheduleException; -import org.springframework.cloud.deployer.scheduler.spi.core.ScheduleInfo; -import org.springframework.cloud.deployer.scheduler.spi.core.ScheduleRequest; -import org.springframework.cloud.deployer.scheduler.spi.core.SchedulerException; import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryConnectionProperties; import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryTaskLauncher; import org.springframework.cloud.deployer.spi.core.AppDefinition; import org.springframework.cloud.deployer.spi.core.AppDeploymentRequest; +import org.springframework.cloud.deployer.spi.scheduler.CreateScheduleException; +import org.springframework.cloud.deployer.spi.scheduler.ScheduleInfo; +import org.springframework.cloud.deployer.spi.scheduler.ScheduleRequest; +import org.springframework.cloud.deployer.spi.scheduler.SchedulerException; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; @@ -82,7 +82,7 @@ import static org.junit.Assert.assertEquals; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.verify; -import static org.springframework.cloud.deployer.scheduler.spi.core.SchedulerPropertyKeys.CRON_EXPRESSION; +import static org.springframework.cloud.deployer.spi.scheduler.SchedulerPropertyKeys.CRON_EXPRESSION; /** * Test the core features of the Spring Cloud Scheduler implementation. diff --git a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryScheduleSSLExceptionTests.java b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryScheduleSSLExceptionTests.java similarity index 95% rename from src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryScheduleSSLExceptionTests.java rename to src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryScheduleSSLExceptionTests.java index e361dd14..4409d815 100644 --- a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundryScheduleSSLExceptionTests.java +++ b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundryScheduleSSLExceptionTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry; import org.junit.Test; diff --git a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundrySchedulerPropertiesTest.java b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundrySchedulerPropertiesTest.java similarity index 96% rename from src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundrySchedulerPropertiesTest.java rename to src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundrySchedulerPropertiesTest.java index 28be0361..5d9c7269 100644 --- a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/CloudFoundrySchedulerPropertiesTest.java +++ b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/CloudFoundrySchedulerPropertiesTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry; import org.junit.Test; diff --git a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/SpringCloudSchedulerIntegrationTests.java b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/SpringCloudSchedulerIntegrationTests.java similarity index 95% rename from src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/SpringCloudSchedulerIntegrationTests.java rename to src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/SpringCloudSchedulerIntegrationTests.java index 99e54c5e..40c50b3e 100644 --- a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/SpringCloudSchedulerIntegrationTests.java +++ b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/SpringCloudSchedulerIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry; import java.util.Collections; import java.util.List; @@ -38,12 +38,12 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.deployer.CloudFoundryTestSupport; import org.springframework.cloud.deployer.resource.maven.MavenProperties; -import org.springframework.cloud.deployer.scheduler.spi.core.Scheduler; -import org.springframework.cloud.deployer.scheduler.spi.core.SchedulerPropertyKeys; -import org.springframework.cloud.deployer.scheduler.spi.test.AbstractSchedulerIntegrationTests; +import org.springframework.cloud.deployer.spi.scheduler.test.AbstractSchedulerIntegrationTests; import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryConnectionProperties; import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryDeploymentProperties; import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryTaskLauncher; +import org.springframework.cloud.deployer.spi.scheduler.Scheduler; +import org.springframework.cloud.deployer.spi.scheduler.SchedulerPropertyKeys; import org.springframework.cloud.deployer.spi.task.TaskLauncher; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/expression/QuartzCronExpressionTests.java b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/expression/QuartzCronExpressionTests.java similarity index 98% rename from src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/expression/QuartzCronExpressionTests.java rename to src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/expression/QuartzCronExpressionTests.java index 7a7fd78c..d45d57c3 100644 --- a/src/test/java/org/springframework/cloud/deployer/scheduler/spi/cloudfoundry/expression/QuartzCronExpressionTests.java +++ b/src/test/java/org/springframework/cloud/deployer/spi/scheduler/cloudfoundry/expression/QuartzCronExpressionTests.java @@ -14,12 +14,14 @@ * limitations under the License. */ -package org.springframework.cloud.deployer.scheduler.spi.cloudfoundry.expression; +package org.springframework.cloud.deployer.spi.scheduler.cloudfoundry.expression; import java.text.ParseException; import junit.framework.TestCase; +import org.springframework.cloud.deployer.spi.scheduler.cloudfoundry.expression.QuartzCronExpression; + public class QuartzCronExpressionTests extends TestCase { /*