From dbc97d8993455ce5c2bd6a3c0e8f1cd24c9ba6de Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 28 Apr 2020 09:47:16 +0200 Subject: [PATCH] simplified structure of store builders --- .../sonia/scm/store/BlobStoreFactory.java | 69 +----------- .../store/ConfigurationEntryStoreFactory.java | 70 +----------- .../scm/store/ConfigurationStoreFactory.java | 70 +----------- .../sonia/scm/store/DataStoreFactory.java | 70 +----------- .../java/sonia/scm/store/StoreParameters.java | 4 +- .../scm/store/StoreParametersBuilder.java | 90 ++++++++++++++++ .../sonia/scm/store/TypedStoreParameters.java | 9 +- .../store/TypedStoreParametersBuilder.java | 102 ++++++++++++++++++ .../scm/store/TypedStoreParametersImpl.java | 58 ---------- .../sonia/scm/store/JAXBDataStoreTest.java | 6 +- .../ConfigurationEntryStoreTestBase.java | 20 ++-- 11 files changed, 223 insertions(+), 345 deletions(-) create mode 100644 scm-core/src/main/java/sonia/scm/store/StoreParametersBuilder.java create mode 100644 scm-core/src/main/java/sonia/scm/store/TypedStoreParametersBuilder.java delete mode 100644 scm-core/src/main/java/sonia/scm/store/TypedStoreParametersImpl.java diff --git a/scm-core/src/main/java/sonia/scm/store/BlobStoreFactory.java b/scm-core/src/main/java/sonia/scm/store/BlobStoreFactory.java index 05e7fd5033..e2477f1752 100644 --- a/scm-core/src/main/java/sonia/scm/store/BlobStoreFactory.java +++ b/scm-core/src/main/java/sonia/scm/store/BlobStoreFactory.java @@ -21,10 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - -package sonia.scm.store; -import sonia.scm.repository.Repository; +package sonia.scm.store; /** * The BlobStoreFactory can be used to create a new or get an existing {@link BlobStore}s. @@ -46,7 +44,7 @@ import sonia.scm.repository.Repository; * * @author Sebastian Sdorra * @since 1.23 - * + * * @apiviz.landmark * @apiviz.uses sonia.scm.store.BlobStore */ @@ -66,66 +64,7 @@ public interface BlobStoreFactory { * @param name The name for the {@link BlobStore}. * @return Floating API to either specify a repository or directly build a global {@link BlobStore}. */ - default FloatingStoreParameters.Builder withName(String name) { - return new FloatingStoreParameters(this).new Builder(name); - } -} - -final class FloatingStoreParameters implements StoreParameters { - - private String name; - private String repositoryId; - - private final BlobStoreFactory factory; - - FloatingStoreParameters(BlobStoreFactory factory) { - this.factory = factory; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getRepositoryId() { - return repositoryId; - } - - public class Builder { - - Builder(String name) { - FloatingStoreParameters.this.name = name; - } - - /** - * Use this to create or get a {@link BlobStore} for a specific repository. This step is optional. If you want to - * have a global {@link BlobStore}, omit this. - * @param repository The optional repository for the {@link BlobStore}. - * @return Floating API to finish the call. - */ - public FloatingStoreParameters.Builder forRepository(Repository repository) { - FloatingStoreParameters.this.repositoryId = repository.getId(); - return this; - } - - /** - * Use this to create or get a {@link BlobStore} for a specific repository. This step is optional. If you want to - * have a global {@link BlobStore}, omit this. - * @param repositoryId The id of the optional repository for the {@link BlobStore}. - * @return Floating API to finish the call. - */ - public FloatingStoreParameters.Builder forRepository(String repositoryId) { - FloatingStoreParameters.this.repositoryId = repositoryId; - return this; - } - - /** - * Creates or gets the {@link BlobStore} with the given name and (if specified) the given repository. If no - * repository is given, the {@link BlobStore} will be global. - */ - public BlobStore build(){ - return factory.getStore(FloatingStoreParameters.this); - } + default StoreParametersBuilder withName(String name) { + return new StoreParametersBuilder<>(name, this::getStore); } } diff --git a/scm-core/src/main/java/sonia/scm/store/ConfigurationEntryStoreFactory.java b/scm-core/src/main/java/sonia/scm/store/ConfigurationEntryStoreFactory.java index 96cca1da3d..09f1217815 100644 --- a/scm-core/src/main/java/sonia/scm/store/ConfigurationEntryStoreFactory.java +++ b/scm-core/src/main/java/sonia/scm/store/ConfigurationEntryStoreFactory.java @@ -21,10 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - -package sonia.scm.store; -import sonia.scm.repository.Repository; +package sonia.scm.store; /** * The ConfigurationEntryStoreFactory can be used to create new or get existing {@link ConfigurationEntryStore}s. @@ -51,7 +49,7 @@ import sonia.scm.repository.Repository; * * @author Sebastian Sdorra * @since 1.31 - * + * * @apiviz.landmark * @apiviz.uses sonia.scm.store.ConfigurationEntryStore */ @@ -72,67 +70,7 @@ public interface ConfigurationEntryStoreFactory { * @return Floating API to set the name and either specify a repository or directly build a global * {@link ConfigurationEntryStore}. */ - default TypedFloatingConfigurationEntryStoreParameters.Builder withType(Class type) { - return new TypedFloatingConfigurationEntryStoreParameters(this).new Builder(type); - } -} - -final class TypedFloatingConfigurationEntryStoreParameters { - - private final TypedStoreParametersImpl parameters = new TypedStoreParametersImpl<>(); - private final ConfigurationEntryStoreFactory factory; - - TypedFloatingConfigurationEntryStoreParameters(ConfigurationEntryStoreFactory factory) { - this.factory = factory; - } - - public class Builder { - - Builder(Class type) { - parameters.setType(type); - } - - /** - * Use this to set the name for the {@link ConfigurationEntryStore}. - * @param name The name for the {@link ConfigurationEntryStore}. - * @return Floating API to either specify a repository or directly build a global {@link ConfigurationEntryStore}. - */ - public OptionalRepositoryBuilder withName(String name) { - parameters.setName(name); - return new OptionalRepositoryBuilder(); - } - } - - public class OptionalRepositoryBuilder { - - /** - * Use this to create or get a {@link ConfigurationEntryStore} for a specific repository. This step is optional. If - * you want to have a global {@link ConfigurationEntryStore}, omit this. - * @param repository The optional repository for the {@link ConfigurationEntryStore}. - * @return Floating API to finish the call. - */ - public OptionalRepositoryBuilder forRepository(Repository repository) { - parameters.setRepositoryId(repository.getId()); - return this; - } - - /** - * Use this to create or get a {@link ConfigurationEntryStore} for a specific repository. This step is optional. If - * you want to have a global {@link ConfigurationEntryStore}, omit this. - * @param repositoryId The id of the optional repository for the {@link ConfigurationEntryStore}. - * @return Floating API to finish the call. - */ - public OptionalRepositoryBuilder forRepository(String repositoryId) { - parameters.setRepositoryId(repositoryId); - return this; - } - - /** - * Creates or gets the {@link ConfigurationEntryStore} with the given name and (if specified) the given repository. - * If no repository is given, the {@link ConfigurationEntryStore} will be global. - */ - public ConfigurationEntryStore build(){ - return factory.getStore(parameters); - } + default TypedStoreParametersBuilder> withType(Class type) { + return new TypedStoreParametersBuilder<>(type, this::getStore); } } diff --git a/scm-core/src/main/java/sonia/scm/store/ConfigurationStoreFactory.java b/scm-core/src/main/java/sonia/scm/store/ConfigurationStoreFactory.java index 6e8d2b18ff..8202f8425b 100644 --- a/scm-core/src/main/java/sonia/scm/store/ConfigurationStoreFactory.java +++ b/scm-core/src/main/java/sonia/scm/store/ConfigurationStoreFactory.java @@ -21,12 +21,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.store; -import sonia.scm.repository.Repository; - /** * The ConfigurationStoreFactory can be used to create new or get existing {@link ConfigurationStore} objects. *
@@ -51,7 +49,7 @@ import sonia.scm.repository.Repository; * * * @author Sebastian Sdorra - * + * * @apiviz.landmark * @apiviz.uses sonia.scm.store.ConfigurationStore */ @@ -72,67 +70,7 @@ public interface ConfigurationStoreFactory { * @return Floating API to set the name and either specify a repository or directly build a global * {@link ConfigurationStore}. */ - default TypedFloatingConfigurationStoreParameters.Builder withType(Class type) { - return new TypedFloatingConfigurationStoreParameters(this).new Builder(type); - } -} - -final class TypedFloatingConfigurationStoreParameters { - - private final TypedStoreParametersImpl parameters = new TypedStoreParametersImpl<>(); - private final ConfigurationStoreFactory factory; - - TypedFloatingConfigurationStoreParameters(ConfigurationStoreFactory factory) { - this.factory = factory; - } - - public class Builder { - - Builder(Class type) { - parameters.setType(type); - } - - /** - * Use this to set the name for the {@link ConfigurationStore}. - * @param name The name for the {@link ConfigurationStore}. - * @return Floating API to either specify a repository or directly build a global {@link ConfigurationStore}. - */ - public OptionalRepositoryBuilder withName(String name) { - parameters.setName(name); - return new OptionalRepositoryBuilder(); - } - } - - public class OptionalRepositoryBuilder { - - /** - * Use this to create or get a {@link ConfigurationStore} for a specific repository. This step is optional. If you - * want to have a global {@link ConfigurationStore}, omit this. - * @param repository The optional repository for the {@link ConfigurationStore}. - * @return Floating API to finish the call. - */ - public OptionalRepositoryBuilder forRepository(Repository repository) { - parameters.setRepositoryId(repository.getId()); - return this; - } - - /** - * Use this to create or get a {@link ConfigurationStore} for a specific repository. This step is optional. If you - * want to have a global {@link ConfigurationStore}, omit this. - * @param repositoryId The id of the optional repository for the {@link ConfigurationStore}. - * @return Floating API to finish the call. - */ - public OptionalRepositoryBuilder forRepository(String repositoryId) { - parameters.setRepositoryId(repositoryId); - return this; - } - - /** - * Creates or gets the {@link ConfigurationStore} with the given name and (if specified) the given repository. If no - * repository is given, the {@link ConfigurationStore} will be global. - */ - public ConfigurationStore build(){ - return factory.getStore(parameters); - } + default TypedStoreParametersBuilder> withType(Class type) { + return new TypedStoreParametersBuilder<>(type, this::getStore); } } diff --git a/scm-core/src/main/java/sonia/scm/store/DataStoreFactory.java b/scm-core/src/main/java/sonia/scm/store/DataStoreFactory.java index c7ebbbb67f..45d9a93993 100644 --- a/scm-core/src/main/java/sonia/scm/store/DataStoreFactory.java +++ b/scm-core/src/main/java/sonia/scm/store/DataStoreFactory.java @@ -21,10 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - -package sonia.scm.store; -import sonia.scm.repository.Repository; +package sonia.scm.store; /** * The DataStoreFactory can be used to create new or get existing {@link DataStore}s. @@ -48,7 +46,7 @@ import sonia.scm.repository.Repository; * * @author Sebastian Sdorra * @since 1.23 - * + * * @apiviz.landmark * @apiviz.uses sonia.scm.store.DataStore */ @@ -69,67 +67,7 @@ public interface DataStoreFactory { * @return Floating API to set the name and either specify a repository or directly build a global * {@link DataStore}. */ - default TypedFloatingDataStoreParameters.Builder withType(Class type) { - return new TypedFloatingDataStoreParameters(this).new Builder(type); - } -} - -final class TypedFloatingDataStoreParameters { - - private final TypedStoreParametersImpl parameters = new TypedStoreParametersImpl<>(); - private final DataStoreFactory factory; - - TypedFloatingDataStoreParameters(DataStoreFactory factory) { - this.factory = factory; - } - - public class Builder { - - Builder(Class type) { - parameters.setType(type); - } - - /** - * Use this to set the name for the {@link DataStore}. - * @param name The name for the {@link DataStore}. - * @return Floating API to either specify a repository or directly build a global {@link DataStore}. - */ - public OptionalRepositoryBuilder withName(String name) { - parameters.setName(name); - return new OptionalRepositoryBuilder(); - } - } - - public class OptionalRepositoryBuilder { - - /** - * Use this to create or get a {@link DataStore} for a specific repository. This step is optional. If you - * want to have a global {@link DataStore}, omit this. - * @param repository The optional repository for the {@link DataStore}. - * @return Floating API to finish the call. - */ - public OptionalRepositoryBuilder forRepository(Repository repository) { - parameters.setRepositoryId(repository.getId()); - return this; - } - - /** - * Use this to create or get a {@link DataStore} for a specific repository. This step is optional. If you - * want to have a global {@link DataStore}, omit this. - * @param repositoryId The id of the optional repository for the {@link DataStore}. - * @return Floating API to finish the call. - */ - public OptionalRepositoryBuilder forRepository(String repositoryId) { - parameters.setRepositoryId(repositoryId); - return this; - } - - /** - * Creates or gets the {@link DataStore} with the given name and (if specified) the given repository. If no - * repository is given, the {@link DataStore} will be global. - */ - public DataStore build(){ - return factory.getStore(parameters); - } + default TypedStoreParametersBuilder> withType(Class type) { + return new TypedStoreParametersBuilder<>(type, this::getStore); } } diff --git a/scm-core/src/main/java/sonia/scm/store/StoreParameters.java b/scm-core/src/main/java/sonia/scm/store/StoreParameters.java index 379013388a..2326a68803 100644 --- a/scm-core/src/main/java/sonia/scm/store/StoreParameters.java +++ b/scm-core/src/main/java/sonia/scm/store/StoreParameters.java @@ -21,10 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - -package sonia.scm.store; -import sonia.scm.repository.Repository; +package sonia.scm.store; /** * The fields of the {@link StoreParameters} are used from the {@link BlobStoreFactory} to create a store. diff --git a/scm-core/src/main/java/sonia/scm/store/StoreParametersBuilder.java b/scm-core/src/main/java/sonia/scm/store/StoreParametersBuilder.java new file mode 100644 index 0000000000..38cd208a7d --- /dev/null +++ b/scm-core/src/main/java/sonia/scm/store/StoreParametersBuilder.java @@ -0,0 +1,90 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package sonia.scm.store; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import sonia.scm.repository.Repository; + +import java.util.function.Function; + +/** + * Builder for {@link StoreParameters}. + * + * @param type of store + */ +public final class StoreParametersBuilder { + + private final StoreParametersImpl parameters; + private final Function factory; + + StoreParametersBuilder(String name, Function factory) { + this.parameters = new StoreParametersImpl(name); + this.factory = factory; + } + + @Getter + @Setter(AccessLevel.PRIVATE) + @RequiredArgsConstructor + private static class StoreParametersImpl implements StoreParameters { + private final String name; + private String repositoryId; + } + + + /** + * Use this to create or get a store for a specific repository. This step is optional. If you want to + * have a global store, omit this. + * + * @param repository The optional repository for the store. + * @return Floating API to finish the call. + */ + public StoreParametersBuilder forRepository(Repository repository) { + parameters.repositoryId = repository.getId(); + return this; + } + + /** + * Use this to create or get a store for a specific repository. This step is optional. If you want to + * have a global store, omit this. + * + * @param repositoryId The id of the optional repository for the store. + * @return Floating API to finish the call. + */ + public StoreParametersBuilder forRepository(String repositoryId) { + parameters.repositoryId = repositoryId; + return this; + } + + /** + * Creates or gets the store with the given name and (if specified) the given repository. If no + * repository is given, the store will be global. + */ + public S build() { + return factory.apply(parameters); + } +} diff --git a/scm-core/src/main/java/sonia/scm/store/TypedStoreParameters.java b/scm-core/src/main/java/sonia/scm/store/TypedStoreParameters.java index c07df2b4a0..0a28b0d455 100644 --- a/scm-core/src/main/java/sonia/scm/store/TypedStoreParameters.java +++ b/scm-core/src/main/java/sonia/scm/store/TypedStoreParameters.java @@ -21,10 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - -package sonia.scm.store; -import sonia.scm.repository.Repository; +package sonia.scm.store; /** * The fields of the {@link TypedStoreParameters} are used from the {@link ConfigurationStoreFactory}, @@ -33,11 +31,8 @@ import sonia.scm.repository.Repository; * @author Mohamed Karray * @since 2.0.0 */ -public interface TypedStoreParameters { +public interface TypedStoreParameters extends StoreParameters { Class getType(); - String getName(); - - String getRepositoryId(); } diff --git a/scm-core/src/main/java/sonia/scm/store/TypedStoreParametersBuilder.java b/scm-core/src/main/java/sonia/scm/store/TypedStoreParametersBuilder.java new file mode 100644 index 0000000000..e590ce40a0 --- /dev/null +++ b/scm-core/src/main/java/sonia/scm/store/TypedStoreParametersBuilder.java @@ -0,0 +1,102 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package sonia.scm.store; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import sonia.scm.repository.Repository; +import java.util.function.Function; + +/** + * Builder for {@link TypedStoreParameters}. + * + * @param type of data + * @param type of store + */ +public final class TypedStoreParametersBuilder { + + private final TypedStoreParametersImpl parameters; + private final Function, S> factory; + + TypedStoreParametersBuilder(Class type, Function, S> factory) { + this.factory = factory; + this.parameters = new TypedStoreParametersImpl<>(type); + } + + /** + * Use this to set the name for the store. + * @param name The name for the store. + * @return Floating API to either specify a repository or directly build a global store. + */ + public OptionalRepositoryBuilder withName(String name) { + parameters.setName(name); + return new OptionalRepositoryBuilder(); + } + + @Getter + @Setter(AccessLevel.PRIVATE) + @RequiredArgsConstructor + private static class TypedStoreParametersImpl implements TypedStoreParameters { + private final Class type; + private String name; + private String repositoryId; + } + + public class OptionalRepositoryBuilder { + + /** + * Use this to create or get a store for a specific repository. This step is optional. If you + * want to have a global store, omit this. + * @param repository The optional repository for the store. + * @return Floating API to finish the call. + */ + public OptionalRepositoryBuilder forRepository(Repository repository) { + parameters.setRepositoryId(repository.getId()); + return this; + } + + /** + * Use this to create or get a store for a specific repository. This step is optional. If you + * want to have a global store, omit this. + * @param repositoryId The id of the optional repository for the store. + * @return Floating API to finish the call. + */ + public OptionalRepositoryBuilder forRepository(String repositoryId) { + parameters.setRepositoryId(repositoryId); + return this; + } + + /** + * Creates or gets the store with the given name and (if specified) the given repository. If no + * repository is given, the store will be global. + */ + public S build(){ + return factory.apply(parameters); + } + } + +} diff --git a/scm-core/src/main/java/sonia/scm/store/TypedStoreParametersImpl.java b/scm-core/src/main/java/sonia/scm/store/TypedStoreParametersImpl.java deleted file mode 100644 index 6d99185302..0000000000 --- a/scm-core/src/main/java/sonia/scm/store/TypedStoreParametersImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2020-present Cloudogu GmbH and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package sonia.scm.store; - -class TypedStoreParametersImpl implements TypedStoreParameters { - private Class type; - private String name; - private String repositoryId; - - @Override - public Class getType() { - return type; - } - - void setType(Class type) { - this.type = type; - } - - @Override - public String getName() { - return name; - } - - void setName(String name) { - this.name = name; - } - - @Override - public String getRepositoryId() { - return repositoryId; - } - - void setRepositoryId(String repositoryId) { - this.repositoryId = repositoryId; - } -} diff --git a/scm-dao-xml/src/test/java/sonia/scm/store/JAXBDataStoreTest.java b/scm-dao-xml/src/test/java/sonia/scm/store/JAXBDataStoreTest.java index 54057cfad6..13b9ad29b8 100644 --- a/scm-dao-xml/src/test/java/sonia/scm/store/JAXBDataStoreTest.java +++ b/scm-dao-xml/src/test/java/sonia/scm/store/JAXBDataStoreTest.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.store; //~--- non-JDK imports -------------------------------------------------------- @@ -52,7 +52,7 @@ public class JAXBDataStoreTest extends DataStoreTestBase { } @Override - protected DataStore getDataStore(Class type, Repository repository) { + protected DataStore getDataStore(Class type, Repository repository) { return createDataStoreFactory() .withType(type) .withName("test") @@ -61,7 +61,7 @@ public class JAXBDataStoreTest extends DataStoreTestBase { } @Override - protected DataStore getDataStore(Class type) { + protected DataStore getDataStore(Class type) { return createDataStoreFactory() .withType(type) .withName("test") diff --git a/scm-test/src/main/java/sonia/scm/store/ConfigurationEntryStoreTestBase.java b/scm-test/src/main/java/sonia/scm/store/ConfigurationEntryStoreTestBase.java index b90af5c970..ff44f6cbd2 100644 --- a/scm-test/src/main/java/sonia/scm/store/ConfigurationEntryStoreTestBase.java +++ b/scm-test/src/main/java/sonia/scm/store/ConfigurationEntryStoreTestBase.java @@ -21,13 +21,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.store; import sonia.scm.repository.Repository; /** - * * @author Sebastian Sdorra */ public abstract class ConfigurationEntryStoreTestBase extends KeyValueStoreTestBase { @@ -35,26 +34,25 @@ public abstract class ConfigurationEntryStoreTestBase extends KeyValueStoreTestB /** * Method description * - * * @return */ protected abstract ConfigurationEntryStoreFactory createConfigurationStoreFactory(); //~--- get methods ---------------------------------------------------------- @Override - protected ConfigurationEntryStore getDataStore(Class type) { + protected ConfigurationEntryStore getDataStore(Class type) { return this.createConfigurationStoreFactory() .withType(type) .withName(storeName) .build(); } - @Override - protected ConfigurationEntryStore getDataStore(Class type, Repository repository) { - return this.createConfigurationStoreFactory() - .withType(type) - .withName(repoStoreName) - .forRepository(repository) - .build(); + @Override + protected ConfigurationEntryStore getDataStore(Class type, Repository repository) { + return this.createConfigurationStoreFactory() + .withType(type) + .withName(repoStoreName) + .forRepository(repository) + .build(); } }