From aac1e8a6e6c2e34a211bda35d4faac43eecbc550 Mon Sep 17 00:00:00 2001 From: John Blum Date: Mon, 10 Jun 2019 18:49:04 -0700 Subject: [PATCH] Move the Books application into example.app.books. Move the LibraryService into example.app.library. --- .../example/app/{ => books}/NonBeanType.java | 2 +- .../example/app/{ => books}/model/Author.java | 2 +- .../example/app/{ => books}/model/Book.java | 6 +++--- .../example/app/{ => books}/model/ISBN.java | 2 +- .../app/{ => books}/repo/BookRepository.java | 12 ++++++------ .../app/{ => books}/service/BookService.java | 18 +++++++++--------- .../service/support/CachingBookService.java | 18 +++++++++--------- .../library/service/LibraryService.java | 13 ++++++++----- .../AutoConfiguredCachingIntegrationTests.java | 16 +++++++++------- ...tionWithAuthenticationIntegrationTests.java | 4 ++-- .../GemFirePropertiesIntegrationTests.java | 7 ++++--- ...plateAutoConfigurationIntegrationTests.java | 8 ++++---- ...plateAutoConfigurationIntegrationTests.java | 6 +++--- .../application-gemfire-config-test.properties | 2 +- .../src/docs/asciidoc/repositories.adoc | 4 ++-- 15 files changed, 63 insertions(+), 57 deletions(-) rename spring-geode-autoconfigure/src/test/java/example/app/{ => books}/NonBeanType.java (96%) rename spring-geode-autoconfigure/src/test/java/example/app/{ => books}/model/Author.java (97%) rename spring-geode-autoconfigure/src/test/java/example/app/{ => books}/model/Book.java (93%) rename spring-geode-autoconfigure/src/test/java/example/app/{ => books}/model/ISBN.java (98%) rename spring-geode-autoconfigure/src/test/java/example/app/{ => books}/repo/BookRepository.java (84%) rename spring-geode-autoconfigure/src/test/java/example/app/{ => books}/service/BookService.java (84%) rename spring-geode-autoconfigure/src/test/java/example/app/{ => books}/service/support/CachingBookService.java (81%) rename spring-geode-autoconfigure/src/test/java/example/{ => app}/library/service/LibraryService.java (76%) diff --git a/spring-geode-autoconfigure/src/test/java/example/app/NonBeanType.java b/spring-geode-autoconfigure/src/test/java/example/app/books/NonBeanType.java similarity index 96% rename from spring-geode-autoconfigure/src/test/java/example/app/NonBeanType.java rename to spring-geode-autoconfigure/src/test/java/example/app/books/NonBeanType.java index 4811584f..6d53a130 100644 --- a/spring-geode-autoconfigure/src/test/java/example/app/NonBeanType.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/books/NonBeanType.java @@ -14,7 +14,7 @@ * permissions and limitations under the License. */ -package example.app; +package example.app.books; /** * The {@link NonBeanType} class is a non-Spring bean, placeholder reference type for classpath component scanning. diff --git a/spring-geode-autoconfigure/src/test/java/example/app/model/Author.java b/spring-geode-autoconfigure/src/test/java/example/app/books/model/Author.java similarity index 97% rename from spring-geode-autoconfigure/src/test/java/example/app/model/Author.java rename to spring-geode-autoconfigure/src/test/java/example/app/books/model/Author.java index 0b5e3475..255be64c 100644 --- a/spring-geode-autoconfigure/src/test/java/example/app/model/Author.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/books/model/Author.java @@ -13,7 +13,7 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ -package example.app.model; +package example.app.books.model; import lombok.Data; import lombok.NonNull; diff --git a/spring-geode-autoconfigure/src/test/java/example/app/model/Book.java b/spring-geode-autoconfigure/src/test/java/example/app/books/model/Book.java similarity index 93% rename from spring-geode-autoconfigure/src/test/java/example/app/model/Book.java rename to spring-geode-autoconfigure/src/test/java/example/app/books/model/Book.java index 8b998cdb..6c47790d 100644 --- a/spring-geode-autoconfigure/src/test/java/example/app/model/Book.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/books/model/Book.java @@ -13,7 +13,7 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ -package example.app.model; +package example.app.books.model; import java.time.LocalDate; @@ -32,8 +32,8 @@ import lombok.RequiredArgsConstructor; * @see lombok * @see org.springframework.data.annotation.Id * @see org.springframework.data.gemfire.mapping.annotation.Region - * @see example.app.model.Author - * @see example.app.model.ISBN + * @see example.app.books.model.Author + * @see example.app.books.model.ISBN * @since 1.0.0 */ @Data diff --git a/spring-geode-autoconfigure/src/test/java/example/app/model/ISBN.java b/spring-geode-autoconfigure/src/test/java/example/app/books/model/ISBN.java similarity index 98% rename from spring-geode-autoconfigure/src/test/java/example/app/model/ISBN.java rename to spring-geode-autoconfigure/src/test/java/example/app/books/model/ISBN.java index f89ac918..e15b0915 100644 --- a/spring-geode-autoconfigure/src/test/java/example/app/model/ISBN.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/books/model/ISBN.java @@ -13,7 +13,7 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ -package example.app.model; +package example.app.books.model; import java.util.UUID; diff --git a/spring-geode-autoconfigure/src/test/java/example/app/repo/BookRepository.java b/spring-geode-autoconfigure/src/test/java/example/app/books/repo/BookRepository.java similarity index 84% rename from spring-geode-autoconfigure/src/test/java/example/app/repo/BookRepository.java rename to spring-geode-autoconfigure/src/test/java/example/app/books/repo/BookRepository.java index bafbee8a..09ac6a4c 100644 --- a/spring-geode-autoconfigure/src/test/java/example/app/repo/BookRepository.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/books/repo/BookRepository.java @@ -14,23 +14,23 @@ * permissions and limitations under the License. */ -package example.app.repo; +package example.app.books.repo; import java.util.List; import org.springframework.data.repository.CrudRepository; -import example.app.model.Author; -import example.app.model.Book; -import example.app.model.ISBN; +import example.app.books.model.Author; +import example.app.books.model.Book; +import example.app.books.model.ISBN; /** * The {@link BookRepository} interface is a Spring Data {@link CrudRepository} defining basic CRUD * and simple query data access operations on {@link Book} objects to the backing data store. * * @author John Blum - * @see example.app.model.Book - * @see example.app.model.ISBN + * @see example.app.books.model.Book + * @see example.app.books.model.ISBN * @see org.springframework.data.repository.CrudRepository * @since 1.0.0 */ diff --git a/spring-geode-autoconfigure/src/test/java/example/app/service/BookService.java b/spring-geode-autoconfigure/src/test/java/example/app/books/service/BookService.java similarity index 84% rename from spring-geode-autoconfigure/src/test/java/example/app/service/BookService.java rename to spring-geode-autoconfigure/src/test/java/example/app/books/service/BookService.java index 63edfeed..24373dad 100644 --- a/spring-geode-autoconfigure/src/test/java/example/app/service/BookService.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/books/service/BookService.java @@ -13,7 +13,7 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ -package example.app.service; +package example.app.books.service; import java.util.List; @@ -21,19 +21,19 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.Assert; -import example.app.model.Author; -import example.app.model.Book; -import example.app.model.ISBN; -import example.app.repo.BookRepository; +import example.app.books.model.Author; +import example.app.books.model.Book; +import example.app.books.model.ISBN; +import example.app.books.repo.BookRepository; /** * The {@link BookService} class is an application {@link Service service} class for managing {@link Book Books}. * * @author John Blum - * @see example.app.model.Author - * @see example.app.model.Book - * @see example.app.model.ISBN - * @see example.app.repo.BookRepository + * @see example.app.books.model.Author + * @see example.app.books.model.Book + * @see example.app.books.model.ISBN + * @see example.app.books.repo.BookRepository * @see org.springframework.stereotype.Service * @since 1.0.0 */ diff --git a/spring-geode-autoconfigure/src/test/java/example/app/service/support/CachingBookService.java b/spring-geode-autoconfigure/src/test/java/example/app/books/service/support/CachingBookService.java similarity index 81% rename from spring-geode-autoconfigure/src/test/java/example/app/service/support/CachingBookService.java rename to spring-geode-autoconfigure/src/test/java/example/app/books/service/support/CachingBookService.java index bf1c3904..955080f3 100644 --- a/spring-geode-autoconfigure/src/test/java/example/app/service/support/CachingBookService.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/books/service/support/CachingBookService.java @@ -14,7 +14,7 @@ * permissions and limitations under the License. */ -package example.app.service.support; +package example.app.books.service.support; import java.util.concurrent.atomic.AtomicBoolean; @@ -22,20 +22,20 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; -import example.app.model.Book; -import example.app.model.ISBN; -import example.app.repo.BookRepository; -import example.app.service.BookService; +import example.app.books.model.Book; +import example.app.books.model.ISBN; +import example.app.books.repo.BookRepository; +import example.app.books.service.BookService; /** * The {@link CachingBookService} class is an implementation and extension of {@link BookService} * with caching capabilities. * * @author John Blum - * @see example.app.model.Book - * @see example.app.model.ISBN - * @see example.app.repo.BookRepository - * @see example.app.service.BookService + * @see example.app.books.model.Book + * @see example.app.books.model.ISBN + * @see example.app.books.repo.BookRepository + * @see example.app.books.service.BookService * @see org.springframework.cache.annotation.Cacheable * @see org.springframework.stereotype.Service * @since 1.0.0 diff --git a/spring-geode-autoconfigure/src/test/java/example/library/service/LibraryService.java b/spring-geode-autoconfigure/src/test/java/example/app/library/service/LibraryService.java similarity index 76% rename from spring-geode-autoconfigure/src/test/java/example/library/service/LibraryService.java rename to spring-geode-autoconfigure/src/test/java/example/app/library/service/LibraryService.java index b8c231f8..003bd98b 100644 --- a/spring-geode-autoconfigure/src/test/java/example/library/service/LibraryService.java +++ b/spring-geode-autoconfigure/src/test/java/example/app/library/service/LibraryService.java @@ -13,8 +13,7 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ - -package example.library.service; +package example.app.library.service; import java.util.Collections; import java.util.List; @@ -22,13 +21,17 @@ import java.util.List; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; -import example.app.model.Author; -import example.app.model.Book; +import example.app.books.model.Author; +import example.app.books.model.Book; /** - * The LibraryService class... + * The {@link LibraryService} class models a Library. * * @author John Blum + * @see org.springframework.cache.annotation.Cacheable + * @see org.springframework.stereotype.Service + * @see example.app.books.model.Author + * @see example.app.books.model.Book * @since 1.0.0 */ @Service diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java index 5f3d2b9d..4f41d3bd 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/caching/AutoConfiguredCachingIntegrationTests.java @@ -13,20 +13,20 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ - package org.springframework.geode.boot.autoconfigure.caching; import static org.assertj.core.api.Assertions.assertThat; import javax.annotation.Resource; -import org.apache.geode.cache.Region; -import org.apache.geode.cache.client.ClientRegionShortcut; -import org.assertj.core.api.Assertions; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; + +import org.apache.geode.cache.Region; +import org.apache.geode.cache.client.ClientRegionShortcut; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -37,9 +37,11 @@ import org.springframework.data.gemfire.util.RegionUtils; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; -import example.app.NonBeanType; -import example.app.model.Book; -import example.app.service.support.CachingBookService; +import org.assertj.core.api.Assertions; + +import example.app.books.NonBeanType; +import example.app.books.model.Book; +import example.app.books.service.support.CachingBookService; /** * Integration tests testing the auto-configuration of Spring's Cache Abstraction with Apache Geode diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cluster/ClusterConfigurationWithAuthenticationIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cluster/ClusterConfigurationWithAuthenticationIntegrationTests.java index e6d0e540..df387481 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cluster/ClusterConfigurationWithAuthenticationIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cluster/ClusterConfigurationWithAuthenticationIntegrationTests.java @@ -53,8 +53,8 @@ import org.springframework.data.gemfire.tests.integration.ForkingClientServerInt import org.springframework.geode.security.TestSecurityManager; import org.springframework.test.context.junit4.SpringRunner; -import example.app.model.Book; -import example.app.model.ISBN; +import example.app.books.model.Book; +import example.app.books.model.ISBN; /** * Integration tests testing the SDG {@link EnableClusterConfiguration} annotation functionality diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/configuration/GemFirePropertiesIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/configuration/GemFirePropertiesIntegrationTests.java index 71b17e3c..a33636f1 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/configuration/GemFirePropertiesIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/configuration/GemFirePropertiesIntegrationTests.java @@ -13,14 +13,15 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ - package org.springframework.geode.boot.autoconfigure.configuration; import static org.assertj.core.api.Assertions.assertThat; -import org.apache.geode.cache.RegionShortcut; import org.junit.Test; import org.junit.runner.RunWith; + +import org.apache.geode.cache.RegionShortcut; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; @@ -219,7 +220,7 @@ public class GemFirePropertiesIntegrationTests extends IntegrationTestsSupport { EntityProperties entityProperties = this.gemfireProperties.getEntities(); assertThat(entityProperties).isNotNull(); - assertThat(entityProperties.getBasePackages()).isEqualTo("example.app.model"); + assertThat(entityProperties.getBasePackages()).isEqualTo("example.app.books.model"); } @Test diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/CachingDefinedRegionTemplateAutoConfigurationIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/CachingDefinedRegionTemplateAutoConfigurationIntegrationTests.java index 2e09380f..9a28cc4f 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/CachingDefinedRegionTemplateAutoConfigurationIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/CachingDefinedRegionTemplateAutoConfigurationIntegrationTests.java @@ -41,10 +41,10 @@ import org.springframework.geode.boot.autoconfigure.ContinuousQueryAutoConfigura import org.springframework.geode.boot.autoconfigure.RegionTemplateAutoConfiguration; import org.springframework.test.context.junit4.SpringRunner; -import example.app.NonBeanType; -import example.app.model.Author; -import example.app.model.Book; -import example.library.service.LibraryService; +import example.app.books.NonBeanType; +import example.app.books.model.Author; +import example.app.books.model.Book; +import example.app.library.service.LibraryService; /** * Integration tests for {@link RegionTemplateAutoConfiguration} using SDG's {@link EnableCachingDefinedRegions} diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/EntityDefinedRegionTemplateAutoConfigurationIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/EntityDefinedRegionTemplateAutoConfigurationIntegrationTests.java index 18e7a88c..72a596c2 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/EntityDefinedRegionTemplateAutoConfigurationIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/template/EntityDefinedRegionTemplateAutoConfigurationIntegrationTests.java @@ -35,9 +35,9 @@ import org.springframework.geode.boot.autoconfigure.ContinuousQueryAutoConfigura import org.springframework.geode.boot.autoconfigure.RegionTemplateAutoConfiguration; import org.springframework.test.context.junit4.SpringRunner; -import example.app.model.Author; -import example.app.model.Book; -import example.app.model.ISBN; +import example.app.books.model.Author; +import example.app.books.model.Book; +import example.app.books.model.ISBN; /** * Integration tests for {@link RegionTemplateAutoConfiguration} using SDG's {@link EnableEntityDefinedRegions} diff --git a/spring-geode-autoconfigure/src/test/resources/application-gemfire-config-test.properties b/spring-geode-autoconfigure/src/test/resources/application-gemfire-config-test.properties index a0714d4f..ea6c0412 100644 --- a/spring-geode-autoconfigure/src/test/resources/application-gemfire-config-test.properties +++ b/spring-geode-autoconfigure/src/test/resources/application-gemfire-config-test.properties @@ -53,7 +53,7 @@ spring.data.gemfire.disk.store.max-oplog-size=4096 spring.data.gemfire.disk.store.queue-size=1000 spring.data.gemfire.disk.store.time-interval=2000 spring.data.gemfire.disk.store.write-buffer-size=65535 -spring.data.gemfire.entities.base-packages=example.app.model +spring.data.gemfire.entities.base-packages=example.app.books.model spring.data.gemfire.locator.host=mailbox spring.data.gemfire.locator.port=20668 spring.data.gemfire.logging.level=CONFIG diff --git a/spring-geode-docs/src/docs/asciidoc/repositories.adoc b/spring-geode-docs/src/docs/asciidoc/repositories.adoc index 9b826d05..2897a662 100644 --- a/spring-geode-docs/src/docs/asciidoc/repositories.adoc +++ b/spring-geode-docs/src/docs/asciidoc/repositories.adoc @@ -22,7 +22,7 @@ annotation: .`Customer` entity class [source,java] ---- -package example.app.model; +package example.app.books.model; import ...; @Region("Customers") @@ -42,7 +42,7 @@ Declare your _Repository_ (a.k.a. {wikipedia-docs}/Data_access_object[Data Acces .`CustomerRepository` for peristing and accessing `Customers` [source,java] ---- -package example.app.repo; +package example.app.books.repo; import ...;