From abe8e4adf8e252a0724ce5cbc5f6309435366f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Wed, 5 Jan 2022 16:58:43 +0100 Subject: [PATCH] remove property settings loader by default --- .../java/org/xbib/config/ConfigLoader.java | 8 +- .../java/org/xbib/config/ConfigParams.java | 4 +- .../xbib/config/test/ConfigLoaderTest.java | 13 ++- gradle/config/checkstyle/checkstyle.xml | 17 +++- .../pmd/category/java/bestpractices.xml | 26 ++++-- .../content/json/JsonSettingsTest.java | 82 +++++++++++++++++++ .../json/test/JsonSettingsTest.java | 15 ++++ .../services/org.xbib.settings.SettingsLoader | 1 + .../DatastructureSettingsBuilder.java | 3 +- .../services/org.xbib.settings.SettingsLoader | 0 10 files changed, 144 insertions(+), 25 deletions(-) create mode 100644 settings-content-json/src/test/java/org/xbib/settings/content/json/JsonSettingsTest.java create mode 100644 settings-datastructures-json/src/test/resources/META-INF/services/org.xbib.settings.SettingsLoader rename settings-datastructures/src/{main => test}/resources/META-INF/services/org.xbib.settings.SettingsLoader (100%) diff --git a/config/src/main/java/org/xbib/config/ConfigLoader.java b/config/src/main/java/org/xbib/config/ConfigLoader.java index 15657fb..6505a07 100644 --- a/config/src/main/java/org/xbib/config/ConfigLoader.java +++ b/config/src/main/java/org/xbib/config/ConfigLoader.java @@ -1,9 +1,5 @@ package org.xbib.config; -import org.xbib.settings.Settings; -import org.xbib.settings.SettingsBuilder; -import org.xbib.settings.SettingsLoader; -import org.xbib.settings.SettingsLoaderService; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -23,6 +19,10 @@ import java.util.Map; import java.util.Optional; import java.util.ServiceLoader; import java.util.stream.Collectors; +import org.xbib.settings.Settings; +import org.xbib.settings.SettingsBuilder; +import org.xbib.settings.SettingsLoader; +import org.xbib.settings.SettingsLoaderService; /** * A configuration loader for configuration files. diff --git a/config/src/main/java/org/xbib/config/ConfigParams.java b/config/src/main/java/org/xbib/config/ConfigParams.java index 07e5d3c..17a1944 100644 --- a/config/src/main/java/org/xbib/config/ConfigParams.java +++ b/config/src/main/java/org/xbib/config/ConfigParams.java @@ -1,7 +1,5 @@ package org.xbib.config; -import org.xbib.settings.Settings; -import org.xbib.settings.datastructures.DatastructureSettings; import java.io.IOException; import java.io.Reader; import java.sql.Connection; @@ -10,6 +8,8 @@ import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Objects; +import org.xbib.settings.Settings; +import org.xbib.settings.datastructures.DatastructureSettings; public class ConfigParams implements Comparable { diff --git a/config/src/test/java/org/xbib/config/test/ConfigLoaderTest.java b/config/src/test/java/org/xbib/config/test/ConfigLoaderTest.java index 9ce3c5c..f0e8520 100644 --- a/config/src/test/java/org/xbib/config/test/ConfigLoaderTest.java +++ b/config/src/test/java/org/xbib/config/test/ConfigLoaderTest.java @@ -1,15 +1,14 @@ package org.xbib.config.test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; -import org.xbib.settings.Settings; -import org.xbib.config.ConfigLoader; -import org.xbib.config.ConfigParams; import java.io.IOException; import java.io.Reader; import java.io.StringReader; +import org.junit.jupiter.api.Test; +import org.xbib.config.ConfigLoader; +import org.xbib.config.ConfigParams; +import org.xbib.settings.Settings; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ConfigLoaderTest { diff --git a/gradle/config/checkstyle/checkstyle.xml b/gradle/config/checkstyle/checkstyle.xml index fa4396b..1a82ee5 100644 --- a/gradle/config/checkstyle/checkstyle.xml +++ b/gradle/config/checkstyle/checkstyle.xml @@ -56,10 +56,19 @@ page at http://checkstyle.sourceforge.net/config.html --> - - - - + + + + + + + + + + + + +