You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/06/07 18:32:02 UTC
(commons-configuration) branch master updated: Use JUnit 5 convention for test method visibility
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-configuration.git
The following commit(s) were added to refs/heads/master by this push:
new fd17cd18 Use JUnit 5 convention for test method visibility
fd17cd18 is described below
commit fd17cd18069e4a3c1b514cedae8720c3bf1bf5b4
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 7 14:31:56 2025 -0400
Use JUnit 5 convention for test method visibility
---
.../configuration2/BaseNonStringProperties.java | 46 ++---
.../configuration2/NonStringTestHolder.java | 32 ++--
.../configuration2/TestAbstractConfiguration.java | 22 +--
.../TestAbstractConfigurationBasicFeatures.java | 130 +++++++-------
.../TestAbstractConfigurationSynchronization.java | 38 ++--
.../TestAbstractHierarchicalConfiguration.java | 110 ++++++------
.../configuration2/TestBaseConfiguration.java | 130 +++++++-------
.../TestBaseConfigurationXMLReader.java | 8 +-
...seHierarchicalConfigurationSynchronization.java | 28 +--
.../configuration2/TestBaseNullConfiguration.java | 74 ++++----
.../configuration2/TestCatalogResolver.java | 10 +-
.../configuration2/TestCombinedConfiguration.java | 118 ++++++-------
.../configuration2/TestCompositeConfiguration.java | 104 +++++------
.../configuration2/TestConfigurationConverter.java | 12 +-
.../configuration2/TestConfigurationLookup.java | 10 +-
.../configuration2/TestConfigurationMap.java | 4 +-
.../configuration2/TestConfigurationSet.java | 4 +-
.../configuration2/TestConfigurationUtils.java | 72 ++++----
.../configuration2/TestDataConfiguration.java | 122 ++++++-------
.../configuration2/TestDatabaseConfiguration.java | 74 ++++----
.../TestDefaultImmutableConfiguration.java | 8 +-
.../TestDynamicCombinedConfiguration.java | 24 +--
.../TestEnvironmentConfiguration.java | 10 +-
.../commons/configuration2/TestEqualBehavior.java | 14 +-
.../commons/configuration2/TestEqualsProperty.java | 2 +-
.../TestHierarchicalConfiguration.java | 74 ++++----
.../TestHierarchicalConfigurationXMLReader.java | 2 +-
.../TestHierarchicalXMLConfiguration.java | 20 +--
.../configuration2/TestINIConfiguration.java | 138 +++++++--------
.../configuration2/TestImmutableConfiguration.java | 20 +--
.../configuration2/TestJNDIConfiguration.java | 54 +++---
.../configuration2/TestJNDIEnvironmentValues.java | 24 +--
.../configuration2/TestJSONConfiguration.java | 24 +--
.../configuration2/TestMapConfiguration.java | 18 +-
.../TestNullCompositeConfiguration.java | 46 ++---
.../TestNullJNDIEnvironmentValues.java | 24 +--
.../TestPatternSubtreeConfiguration.java | 6 +-
.../TestPatternSubtreeConfigurationWrapper.java | 2 +-
.../TestPropertiesConfiguration.java | 186 ++++++++++----------
.../TestPropertiesConfigurationLayout.java | 78 ++++-----
.../configuration2/TestPropertiesSequence.java | 6 +-
.../TestStrictConfigurationComparator.java | 4 +-
.../configuration2/TestSubnodeConfiguration.java | 48 ++---
.../configuration2/TestSubsetConfiguration.java | 46 ++---
.../configuration2/TestSubsetConfiguration848.java | 4 +-
.../configuration2/TestSystemConfiguration.java | 10 +-
.../configuration2/TestThreesomeConfiguration.java | 6 +-
.../configuration2/TestXMLConfiguration.java | 194 ++++++++++-----------
.../configuration2/TestXMLConfiguration605.java | 16 +-
.../configuration2/TestXMLDocumentHelper.java | 22 +--
.../configuration2/TestXMLListHandling.java | 10 +-
.../TestXMLPropertiesConfiguration.java | 8 +-
.../configuration2/TestYAMLConfiguration.java | 24 +--
.../configuration2/beanutils/TestBeanHelper.java | 54 +++---
.../beanutils/TestCombinedBeanDeclaration.java | 24 +--
.../beanutils/TestConfigurationDynaBean.java | 84 ++++-----
.../beanutils/TestConstructorArg.java | 12 +-
.../beanutils/TestDefaultBeanFactory.java | 22 +--
.../beanutils/TestXMLBeanDeclaration.java | 54 +++---
.../builder/TestAutoSaveListener.java | 14 +-
.../builder/TestBasicBuilderParameters.java | 68 ++++----
.../builder/TestBasicConfigurationBuilder.java | 54 +++---
.../TestBasicConfigurationBuilderEvents.java | 22 +--
.../TestBuilderConfigurationWrapperFactory.java | 16 +-
.../builder/TestCopyObjectDefaultHandler.java | 8 +-
.../builder/TestDatabaseBuilderParametersImpl.java | 16 +-
.../builder/TestDefaultParametersManager.java | 18 +-
.../TestDefaultReloadingDetectorFactory.java | 4 +-
.../builder/TestEventListenerParameters.java | 8 +-
.../builder/TestFileBasedBuilderParameters.java | 48 ++---
.../builder/TestFileBasedConfigurationBuilder.java | 50 +++---
.../TestHierarchicalBuilderParametersImpl.java | 6 +-
.../builder/TestJndiBuilderParametersImpl.java | 8 +-
.../TestPropertiesBuilderParametersImpl.java | 16 +-
.../TestReloadingBuilderSupportListener.java | 4 +-
...TestReloadingFileBasedConfigurationBuilder.java | 18 +-
.../builder/TestXMLBuilderParametersImpl.java | 16 +-
.../TestBaseConfigurationBuilderProvider.java | 20 +--
.../TestCombinedBuilderParametersImpl.java | 54 +++---
.../combined/TestCombinedConfigurationBuilder.java | 102 +++++------
.../TestCombinedConfigurationBuilderVFS.java | 2 +-
.../combined/TestConfigurationDeclaration.java | 10 +-
...tFileExtensionConfigurationBuilderProvider.java | 20 +--
.../TestMultiFileBuilderParametersImpl.java | 14 +-
.../TestMultiFileConfigurationBuilder.java | 32 ++--
.../builder/combined/TestMultiWrapDynaBean.java | 26 +--
.../TestReloadingCombinedConfigurationBuilder.java | 10 +-
...adingCombinedConfigurationBuilderFileBased.java | 8 +-
...TestReloadingMultiFileConfigurationBuilder.java | 12 +-
.../builder/fluent/TestConfigurations.java | 68 ++++----
.../builder/fluent/TestParameters.java | 38 ++--
.../convert/TestDefaultConversionHandler.java | 48 ++---
.../convert/TestDefaultListDelimiterHandler.java | 28 +--
.../convert/TestDisabledListDelimiterHandler.java | 26 +--
.../convert/TestPropertyConverter.java | 58 +++---
.../event/AbstractTestConfigurationEvents.java | 16 +-
.../event/TestConfigurationEventTypes.java | 38 ++--
.../commons/configuration2/event/TestEvent.java | 6 +-
.../event/TestEventListenerList.java | 62 +++----
.../configuration2/event/TestEventSource.java | 38 ++--
.../configuration2/event/TestEventType.java | 2 +-
.../event/TestHierarchicalConfigurationEvents.java | 10 +-
.../interpol/TestConfigurationInterpolator.java | 120 ++++++-------
.../interpol/TestConstantLookup.java | 16 +-
.../configuration2/interpol/TestDummyLookup.java | 2 +-
.../interpol/TestEnvironmentLookup.java | 4 +-
.../configuration2/interpol/TestExprLookup.java | 14 +-
.../interpol/TestInterpolatorSpecification.java | 20 +--
.../interpol/TestSystemPropertiesLookup.java | 4 +-
.../io/TestAbsoluteNameLocationStrategy.java | 8 +-
.../io/TestBasePathLocationStrategy.java | 8 +-
.../io/TestClasspathLocationStrategy.java | 6 +-
.../io/TestCombinedLocationStrategy.java | 14 +-
.../configuration2/io/TestConfigurationLogger.java | 32 ++--
.../configuration2/io/TestDefaultFileSystem.java | 6 +-
.../commons/configuration2/io/TestFileHandler.java | 170 +++++++++---------
.../commons/configuration2/io/TestFileLocator.java | 16 +-
.../configuration2/io/TestFileLocatorUtils.java | 72 ++++----
.../io/TestFileSystemLocationStrategy.java | 2 +-
.../io/TestHomeDirectoryLocationStrategy.java | 12 +-
.../io/TestProvidedURLLocationStrategy.java | 4 +-
.../plist/AbstractTestPListEvents.java | 4 +-
.../plist/TestPropertyListConfiguration.java | 46 ++---
.../plist/TestPropertyListParser.java | 8 +-
.../plist/TestXMLPropertyListConfiguration.java | 52 +++---
.../reloading/TestCombinedReloadingController.java | 16 +-
.../TestFileHandlerReloadingDetector.java | 22 +--
.../reloading/TestManagedReloadingDetector.java | 6 +-
.../reloading/TestPeriodicReloadingTrigger.java | 18 +-
.../reloading/TestReloadingController.java | 16 +-
.../TestVFSFileHandlerReloadingDetector.java | 12 +-
.../TestConfigurationPropertiesFactoryBean.java | 20 +--
.../spring/TestConfigurationPropertySource.java | 8 +-
.../sync/TestReadWriteSynchronizer.java | 6 +-
.../configuration2/tree/AbstractCombinerTest.java | 2 +-
.../tree/AbstractImmutableNodeHandlerTest.java | 50 +++---
.../tree/TestDefaultConfigurationKey.java | 66 +++----
.../tree/TestDefaultExpressionEngine.java | 76 ++++----
.../tree/TestDefaultExpressionEngineSymbols.java | 12 +-
.../configuration2/tree/TestImmutableNode.java | 72 ++++----
.../configuration2/tree/TestInMemoryNodeModel.java | 78 ++++-----
.../tree/TestInMemoryNodeModelReferences.java | 24 +--
.../tree/TestInMemoryNodeModelTrackedNodes.java | 86 ++++-----
.../configuration2/tree/TestMergeCombiner.java | 14 +-
.../configuration2/tree/TestNodeAddData.java | 8 +-
.../configuration2/tree/TestNodeNameMatchers.java | 12 +-
.../configuration2/tree/TestNodeSelector.java | 24 +--
.../configuration2/tree/TestNodeTreeWalker.java | 16 +-
.../configuration2/tree/TestNodeUpdateData.java | 14 +-
.../configuration2/tree/TestOverrideCombiner.java | 16 +-
.../configuration2/tree/TestQueryResult.java | 18 +-
.../tree/TestTrackedNodeHandler.java | 4 +-
.../configuration2/tree/TestTrackedNodeModel.java | 26 +--
.../configuration2/tree/TestUnionCombiner.java | 10 +-
.../xpath/TestConfigurationAttributePointer.java | 26 +--
.../xpath/TestConfigurationIteratorAttributes.java | 12 +-
.../TestConfigurationNodeIteratorChildren.java | 26 +--
.../tree/xpath/TestConfigurationNodePointer.java | 14 +-
.../xpath/TestConfigurationNodePointerFactory.java | 16 +-
.../tree/xpath/TestXPathContextFactory.java | 2 +-
.../tree/xpath/TestXPathExpressionEngine.java | 68 ++++----
.../xpath/TestXPathExpressionEngineInConfig.java | 12 +-
.../TestJakartaServletRequestConfiguration.java | 2 +-
.../web/TestServletRequestConfiguration.java | 2 +-
164 files changed, 2642 insertions(+), 2642 deletions(-)
diff --git a/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java b/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java
index 5b608da9..ae52e1c8 100644
--- a/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java
+++ b/src/test/java/org/apache/commons/configuration2/BaseNonStringProperties.java
@@ -31,29 +31,29 @@ public abstract class BaseNonStringProperties {
protected Configuration conf;
@Test
- public void testBoolean() throws Exception {
+ void testBoolean() throws Exception {
nonStringTestHolder.testBoolean();
}
@Test
- public void testBooleanArrayValue() throws Exception {
+ void testBooleanArrayValue() throws Exception {
final boolean booleanValue = conf.getBoolean("test.boolean");
assertTrue(booleanValue);
assertEquals(2, conf.getList("test.boolean.array").size());
}
@Test
- public void testBooleanDefaultValue() throws Exception {
+ void testBooleanDefaultValue() throws Exception {
nonStringTestHolder.testBooleanDefaultValue();
}
@Test
- public void testByte() throws Exception {
+ void testByte() throws Exception {
nonStringTestHolder.testByte();
}
@Test
- public void testByteArrayValue() throws Exception {
+ void testByteArrayValue() throws Exception {
final byte testValue = 10;
final byte byteValue = conf.getByte("test.byte");
assertEquals(testValue, byteValue);
@@ -61,12 +61,12 @@ public abstract class BaseNonStringProperties {
}
@Test
- public void testDouble() throws Exception {
+ void testDouble() throws Exception {
nonStringTestHolder.testDouble();
}
@Test
- public void testDoubleArrayValue() throws Exception {
+ void testDoubleArrayValue() throws Exception {
final double testValue = 10.25;
final double doubleValue = conf.getDouble("test.double");
assertEquals(testValue, doubleValue, 0.01);
@@ -74,17 +74,17 @@ public abstract class BaseNonStringProperties {
}
@Test
- public void testDoubleDefaultValue() throws Exception {
+ void testDoubleDefaultValue() throws Exception {
nonStringTestHolder.testDoubleDefaultValue();
}
@Test
- public void testFloat() throws Exception {
+ void testFloat() throws Exception {
nonStringTestHolder.testFloat();
}
@Test
- public void testFloatArrayValue() throws Exception {
+ void testFloatArrayValue() throws Exception {
final float testValue = (float) 20.25;
final float floatValue = conf.getFloat("test.float");
assertEquals(testValue, floatValue, 0.01);
@@ -92,74 +92,74 @@ public abstract class BaseNonStringProperties {
}
@Test
- public void testFloatDefaultValue() throws Exception {
+ void testFloatDefaultValue() throws Exception {
nonStringTestHolder.testFloatDefaultValue();
}
@Test
- public void testInteger() throws Exception {
+ void testInteger() throws Exception {
nonStringTestHolder.testInteger();
}
@Test
- public void testIntegerArrayValue() throws Exception {
+ void testIntegerArrayValue() throws Exception {
final int intValue = conf.getInt("test.integer");
assertEquals(10, intValue);
assertEquals(2, conf.getList("test.integer.array").size());
}
@Test
- public void testIntegerDefaultValue() throws Exception {
+ void testIntegerDefaultValue() throws Exception {
nonStringTestHolder.testIntegerDefaultValue();
}
@Test
- public void testIsEmpty() throws Exception {
+ void testIsEmpty() throws Exception {
nonStringTestHolder.testIsEmpty();
}
@Test
- public void testListMissing() throws Exception {
+ void testListMissing() throws Exception {
nonStringTestHolder.testListMissing();
}
@Test
- public void testLong() throws Exception {
+ void testLong() throws Exception {
nonStringTestHolder.testLong();
}
@Test
- public void testLongArrayValue() throws Exception {
+ void testLongArrayValue() throws Exception {
final long longValue = conf.getLong("test.long");
assertEquals(1000000, longValue);
assertEquals(2, conf.getList("test.long.array").size());
}
@Test
- public void testLongDefaultValue() throws Exception {
+ void testLongDefaultValue() throws Exception {
nonStringTestHolder.testLongDefaultValue();
}
@Test
- public void testShort() throws Exception {
+ void testShort() throws Exception {
nonStringTestHolder.testShort();
}
@Test
- public void testShortArrayValue() throws Exception {
+ void testShortArrayValue() throws Exception {
final short shortValue = conf.getShort("test.short");
assertEquals(1, shortValue);
assertEquals(2, conf.getList("test.short.array").size());
}
@Test
- public void testShortDefaultValue() throws Exception {
+ void testShortDefaultValue() throws Exception {
nonStringTestHolder.testShortDefaultValue();
}
@Test
- public void testSubset() throws Exception {
+ void testSubset() throws Exception {
nonStringTestHolder.testSubset();
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/NonStringTestHolder.java b/src/test/java/org/apache/commons/configuration2/NonStringTestHolder.java
index c50bcb4c..9e257adb 100644
--- a/src/test/java/org/apache/commons/configuration2/NonStringTestHolder.java
+++ b/src/test/java/org/apache/commons/configuration2/NonStringTestHolder.java
@@ -34,13 +34,13 @@ public class NonStringTestHolder {
this.configuration = configuration;
}
- public void testBoolean() throws Exception {
+ void testBoolean() throws Exception {
final boolean booleanValue = configuration.getBoolean("test.boolean");
assertTrue(booleanValue);
assertEquals(1, configuration.getList("test.boolean").size());
}
- public void testBooleanDefaultValue() throws Exception {
+ void testBooleanDefaultValue() throws Exception {
final boolean booleanValue = configuration.getBoolean("test.boolean.missing", true);
assertTrue(booleanValue);
@@ -48,82 +48,82 @@ public class NonStringTestHolder {
assertEquals(Boolean.valueOf(true), booleanObject);
}
- public void testByte() throws Exception {
+ void testByte() throws Exception {
final byte testValue = 10;
final byte byteValue = configuration.getByte("test.byte");
assertEquals(testValue, byteValue);
assertEquals(1, configuration.getList("test.byte").size());
}
- public void testDouble() throws Exception {
+ void testDouble() throws Exception {
final double testValue = 10.25;
final double doubleValue = configuration.getDouble("test.double");
assertEquals(testValue, doubleValue, 0.01);
assertEquals(1, configuration.getList("test.double").size());
}
- public void testDoubleDefaultValue() throws Exception {
+ void testDoubleDefaultValue() throws Exception {
final double testValue = 10.25;
final double doubleValue = configuration.getDouble("test.double.missing", 10.25);
assertEquals(testValue, doubleValue, 0.01);
}
- public void testFloat() throws Exception {
+ void testFloat() throws Exception {
final float testValue = (float) 20.25;
final float floatValue = configuration.getFloat("test.float");
assertEquals(testValue, floatValue, 0.01);
assertEquals(1, configuration.getList("test.float").size());
}
- public void testFloatDefaultValue() throws Exception {
+ void testFloatDefaultValue() throws Exception {
final float testValue = (float) 20.25;
final float floatValue = configuration.getFloat("test.float.missing", testValue);
assertEquals(testValue, floatValue, 0.01);
}
- public void testInteger() throws Exception {
+ void testInteger() throws Exception {
final int intValue = configuration.getInt("test.integer");
assertEquals(10, intValue);
assertEquals(1, configuration.getList("test.integer").size());
}
- public void testIntegerDefaultValue() throws Exception {
+ void testIntegerDefaultValue() throws Exception {
final int intValue = configuration.getInt("test.integer.missing", 10);
assertEquals(10, intValue);
}
- public void testIsEmpty() throws Exception {
+ void testIsEmpty() throws Exception {
assertFalse(configuration.isEmpty());
}
- public void testListMissing() throws Exception {
+ void testListMissing() throws Exception {
final List<?> list = configuration.getList("missing.list");
assertTrue(list.isEmpty());
}
- public void testLong() throws Exception {
+ void testLong() throws Exception {
final long longValue = configuration.getLong("test.long");
assertEquals(1000000, longValue);
assertEquals(1, configuration.getList("test.long").size());
}
- public void testLongDefaultValue() throws Exception {
+ void testLongDefaultValue() throws Exception {
final long longValue = configuration.getLong("test.long.missing", 1000000);
assertEquals(1000000, longValue);
}
- public void testShort() throws Exception {
+ void testShort() throws Exception {
final short shortValue = configuration.getShort("test.short");
assertEquals(1, shortValue);
assertEquals(1, configuration.getList("test.short").size());
}
- public void testShortDefaultValue() throws Exception {
+ void testShortDefaultValue() throws Exception {
final short shortValue = configuration.getShort("test.short.missing", (short) 1);
assertEquals(1, shortValue);
}
- public void testSubset() throws Exception {
+ void testSubset() throws Exception {
final Configuration subset = configuration.subset("test");
// search the "short" key in the subset using the key iterator
diff --git a/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java
index 4d4902fa..dc142cfc 100644
--- a/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java
@@ -100,14 +100,14 @@ public abstract class TestAbstractConfiguration {
}
@Test
- public void testContains() {
+ void testContains() {
final AbstractConfiguration config = getConfiguration();
assertTrue(config.contains(config.getKeys(), "value1"));
assertFalse(config.contains(config.getKeys(), "value99999"));
}
@Test
- public void testContainsKey() {
+ void testContainsKey() {
final Configuration config = getConfiguration();
assertTrue(config.containsKey("key1"));
assertFalse(config.containsKey("key3"));
@@ -126,7 +126,7 @@ public abstract class TestAbstractConfiguration {
* Tests the exception message triggered by the conversion to BigInteger. This test is related to CONFIGURATION-357.
*/
@Test
- public void testGetBigIntegerConversion() {
+ void testGetBigIntegerConversion() {
final Configuration config = getConfiguration();
final ConversionException cex = assertThrows(ConversionException.class, () -> config.getBigInteger("key1"));
assertTrue(cex.getMessage().contains("'key1'"));
@@ -135,7 +135,7 @@ public abstract class TestAbstractConfiguration {
}
@Test
- public void testGetKeys() {
+ void testGetKeys() {
final Configuration config = getConfiguration();
final Iterator<String> keys = config.getKeys();
final Set<String> expectedKeys = new HashSet<>(Arrays.asList("key1", "key2", "list", "listesc"));
@@ -149,7 +149,7 @@ public abstract class TestAbstractConfiguration {
}
@Test
- public void testGetProperty() {
+ void testGetProperty() {
final Configuration config = getConfiguration();
assertEquals("value1", config.getProperty("key1"));
assertEquals("value2", config.getProperty("key2"));
@@ -157,14 +157,14 @@ public abstract class TestAbstractConfiguration {
}
@Test
- public void testIsEmpty() {
+ void testIsEmpty() {
final Configuration config = getConfiguration();
assertFalse(config.isEmpty());
assertTrue(getEmptyConfiguration().isEmpty());
}
@Test
- public void testList() {
+ void testList() {
final Configuration config = getConfiguration();
final List<?> list = config.getList("list");
@@ -176,7 +176,7 @@ public abstract class TestAbstractConfiguration {
* Tests whether the escape character for list delimiters is recocknized and removed.
*/
@Test
- public void testListEscaped() {
+ void testListEscaped() {
assertEquals("value1,value2", getConfiguration().getString("listesc"));
}
@@ -184,7 +184,7 @@ public abstract class TestAbstractConfiguration {
* Tests accessing the configuration's logger.
*/
@Test
- public void testSetLogger() {
+ void testSetLogger() {
final AbstractConfiguration config = getEmptyConfiguration();
assertNotNull(config.getLogger());
final ConfigurationLogger log = new ConfigurationLogger(config.getClass());
@@ -193,12 +193,12 @@ public abstract class TestAbstractConfiguration {
}
@Test
- public void testSize() {
+ void testSize() {
assertEquals(4, getConfiguration().size());
}
@Test
- public void testSizeEmpty() {
+ void testSizeEmpty() {
assertEquals(0, getEmptyConfiguration().size());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java b/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
index 5c90c7e5..2459fce7 100644
--- a/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
+++ b/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
@@ -260,7 +260,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests adding list properties. The single elements of the list should be added.
*/
@Test
- public void testAddPropertyList() {
+ void testAddPropertyList() {
checkAddListProperty(new TestConfigurationImpl(new PropertiesConfiguration()));
}
@@ -268,7 +268,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests adding list properties if delimiter parsing is disabled.
*/
@Test
- public void testAddPropertyListNoDelimiterParsing() {
+ void testAddPropertyListNoDelimiterParsing() {
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
checkAddListProperty(config);
}
@@ -277,7 +277,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the append() method.
*/
@Test
- public void testAppend() {
+ void testAppend() {
final AbstractConfiguration config = setUpDestConfig();
final Configuration srcConfig = setUpSourceConfig();
config.append(srcConfig);
@@ -296,7 +296,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether the list delimiter is correctly handled if a configuration is appended.
*/
@Test
- public void testAppendDelimiterHandling() {
+ void testAppendDelimiterHandling() {
final BaseConfiguration srcConfig = new BaseConfiguration();
final BaseConfiguration dstConfig = new BaseConfiguration();
dstConfig.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
@@ -309,7 +309,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the events generated by an append() operation.
*/
@Test
- public void testAppendEvents() {
+ void testAppendEvents() {
final AbstractConfiguration config = setUpDestConfig();
final Configuration srcConfig = setUpSourceConfig();
final CollectingConfigurationListener l = new CollectingConfigurationListener();
@@ -322,7 +322,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests appending a null configuration. This should be a noop.
*/
@Test
- public void testAppendNull() {
+ void testAppendNull() {
final AbstractConfiguration config = setUpDestConfig();
config.append(null);
ConfigurationAssert.assertConfigurationEquals(setUpDestConfig(), config);
@@ -332,7 +332,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the append() method when properties with multiple values and escaped list delimiters are involved.
*/
@Test
- public void testAppendWithLists() {
+ void testAppendWithLists() {
final AbstractConfiguration config = setUpDestConfig();
config.append(setUpSourceConfig());
checkListProperties(config);
@@ -343,7 +343,7 @@ public class TestAbstractConfigurationBasicFeatures {
* remove() operation.
*/
@Test
- public void testClearIteratorNoRemove() {
+ void testClearIteratorNoRemove() {
final AbstractConfiguration config = new TestConfigurationImpl(new BaseConfiguration()) {
// return an iterator that does not support remove operations
@Override
@@ -365,7 +365,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the copy() method.
*/
@Test
- public void testCopy() {
+ void testCopy() {
final AbstractConfiguration config = setUpDestConfig();
final Configuration srcConfig = setUpSourceConfig();
config.copy(srcConfig);
@@ -383,7 +383,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether list delimiters are correctly handled when copying a configuration.
*/
@Test
- public void testCopyDelimiterHandling() {
+ void testCopyDelimiterHandling() {
final BaseConfiguration srcConfig = new BaseConfiguration();
final BaseConfiguration dstConfig = new BaseConfiguration();
dstConfig.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
@@ -396,7 +396,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the events generated by a copy() operation.
*/
@Test
- public void testCopyEvents() {
+ void testCopyEvents() {
final AbstractConfiguration config = setUpDestConfig();
final Configuration srcConfig = setUpSourceConfig();
final CollectingConfigurationListener l = new CollectingConfigurationListener();
@@ -409,7 +409,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests copying a null configuration. This should be a noop.
*/
@Test
- public void testCopyNull() {
+ void testCopyNull() {
final AbstractConfiguration config = setUpDestConfig();
config.copy(null);
ConfigurationAssert.assertConfigurationEquals(setUpDestConfig(), config);
@@ -419,7 +419,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the copy() method if properties with multiple values and escaped list delimiters are involved.
*/
@Test
- public void testCopyWithLists() {
+ void testCopyWithLists() {
final Configuration srcConfig = setUpSourceConfig();
final AbstractConfiguration config = setUpDestConfig();
config.copy(srcConfig);
@@ -430,7 +430,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests an interpolation that leads to a cycle. This should throw an exception.
*/
@Test
- public void testCyclicInterpolation() {
+ void testCyclicInterpolation() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.addProperty("animal", "${animal_attr} ${species}");
config.addProperty("animal_attr", "quick brown");
@@ -443,7 +443,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether a configuration instance has a default conversion hander.
*/
@Test
- public void testDefaultConversionHandler() {
+ void testDefaultConversionHandler() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertEquals(DefaultConversionHandler.class, config.getConversionHandler().getClass());
}
@@ -452,7 +452,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests that the default conversion handler is shared between all configuration instances.
*/
@Test
- public void testDefaultConversionHandlerSharedInstance() {
+ void testDefaultConversionHandlerSharedInstance() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final PropertiesConfiguration config2 = new PropertiesConfiguration();
assertSame(config.getConversionHandler(), config2.getConversionHandler());
@@ -462,7 +462,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the default list delimiter hander.
*/
@Test
- public void testDefaultListDelimiterHandler() {
+ void testDefaultListDelimiterHandler() {
final BaseConfiguration config = new BaseConfiguration();
assertInstanceOf(DisabledListDelimiterHandler.class, config.getListDelimiterHandler());
}
@@ -471,7 +471,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the generic get() method.
*/
@Test
- public void testGet() {
+ void testGet() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final Integer value = 20130816;
config.addProperty(KEY_PREFIX, value.toString());
@@ -482,7 +482,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether conversion to an array is possible.
*/
@Test
- public void testGetArray() {
+ void testGetArray() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final Integer[] expected = new Integer[PROP_COUNT];
for (int i = 0; i < PROP_COUNT; i++) {
@@ -497,7 +497,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getArray() if the default value is not an array.
*/
@Test
- public void testGetArrayDefaultValueNotAnArray() {
+ void testGetArrayDefaultValueNotAnArray() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertThrows(IllegalArgumentException.class, () -> config.getArray(Integer.class, KEY_PREFIX, this));
}
@@ -506,7 +506,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getArray() if the default value is an array with a different component type.
*/
@Test
- public void testGetArrayDefaultValueWrongComponentClass() {
+ void testGetArrayDefaultValueWrongComponentClass() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertThrows(IllegalArgumentException.class, () -> config.getArray(Integer.class, KEY_PREFIX, new short[1]));
}
@@ -515,7 +515,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests a conversion to an array of primitive types.
*/
@Test
- public void testGetArrayPrimitive() {
+ void testGetArrayPrimitive() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final short[] expected = new short[PROP_COUNT];
for (int i = 0; i < PROP_COUNT; i++) {
@@ -530,7 +530,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests get() for an unknown array property if no default value is provided.
*/
@Test
- public void testGetArrayUnknownNoDefault() {
+ void testGetArrayUnknownNoDefault() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertNull(config.get(Integer[].class, KEY_PREFIX));
}
@@ -539,7 +539,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests get() for an unknown array property if a default value is provided.
*/
@Test
- public void testGetArrayUnknownWithDefault() {
+ void testGetArrayUnknownWithDefault() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final int[] defValue = {1, 2, 3};
assertArrayEquals(defValue, config.get(int[].class, KEY_PREFIX, defValue));
@@ -549,7 +549,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests a conversion to a collection.
*/
@Test
- public void testGetCollection() {
+ void testGetCollection() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<Integer> expected = prepareListTest(config);
final List<Integer> result = new ArrayList<>(PROP_COUNT);
@@ -561,7 +561,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getCollection() if no target collection is provided.
*/
@Test
- public void testGetCollectionNullTarget() {
+ void testGetCollectionNullTarget() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<Integer> expected = prepareListTest(config);
final Collection<Integer> result = config.getCollection(Integer.class, KEY_PREFIX, null, new ArrayList<>());
@@ -572,7 +572,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether a single value property can be converted to a collection.
*/
@Test
- public void testGetCollectionSingleValue() {
+ void testGetCollectionSingleValue() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.addProperty(KEY_PREFIX, "1");
final List<Integer> result = new ArrayList<>(1);
@@ -584,7 +584,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getCollection() for an unknown property if no default value is provided.
*/
@Test
- public void testGetCollectionUnknownNoDefault() {
+ void testGetCollectionUnknownNoDefault() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<Integer> result = new ArrayList<>();
assertNull(config.getCollection(Integer.class, KEY_PREFIX, result));
@@ -595,7 +595,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getCollection() for an unknown property if a default collection is provided.
*/
@Test
- public void testGetCollectionUnknownWithDefault() {
+ void testGetCollectionUnknownWithDefault() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<Integer> defValue = Arrays.asList(1, 2, 4, 8, 16, 32);
final Collection<Integer> result = config.getCollection(Integer.class, KEY_PREFIX, null, defValue);
@@ -606,7 +606,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tries to query an encoded string without a decoder.
*/
@Test
- public void testGetEncodedStringNoDecoder() {
+ void testGetEncodedStringNoDecoder() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertThrows(IllegalArgumentException.class, () -> config.getEncodedString(KEY_PREFIX, null));
}
@@ -615,7 +615,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tries to query an encoded string with the default decoder if this property is not defined.
*/
@Test
- public void testGetEncodedStringNoDefaultDecoderDefined() {
+ void testGetEncodedStringNoDefaultDecoderDefined() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertThrows(IllegalStateException.class, () -> config.getEncodedString(KEY_PREFIX));
}
@@ -624,7 +624,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether undefined keys are handled when querying encoded strings.
*/
@Test
- public void testGetEncodedStringNoValue() {
+ void testGetEncodedStringNoValue() {
final ConfigurationDecoder decoder = mock(ConfigurationDecoder.class);
final PropertiesConfiguration config = new PropertiesConfiguration();
assertNull(config.getEncodedString(KEY_PREFIX, decoder));
@@ -634,7 +634,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether an encoded value can be retrieved.
*/
@Test
- public void testGetEncodedStringValue() {
+ void testGetEncodedStringValue() {
final ConfigurationDecoder decoder = mock(ConfigurationDecoder.class);
final String value = "original value";
final String decodedValue = "decoded value";
@@ -650,7 +650,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether a default decoder can be set which is queried for encoded strings.
*/
@Test
- public void testGetEncodedStringWithDefaultDecoder() {
+ void testGetEncodedStringWithDefaultDecoder() {
final ConfigurationDecoder decoder = mock(ConfigurationDecoder.class);
final String value = "original value";
final String decodedValue = "decoded value";
@@ -667,7 +667,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests a conversion to a list.
*/
@Test
- public void testGetList() {
+ void testGetList() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<Integer> expected = prepareListTest(config);
final List<Integer> result = config.getList(Integer.class, KEY_PREFIX);
@@ -678,7 +678,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getList() for single non-string values.
*/
@Test
- public void testGetListNonString() {
+ void testGetListNonString() {
checkGetListScalar(Integer.valueOf(42));
checkGetListScalar(Long.valueOf(42));
checkGetListScalar(Short.valueOf((short) 42));
@@ -692,7 +692,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests a conversion to a list if the property is unknown and no default value is provided.
*/
@Test
- public void testGetListUnknownNoDefault() {
+ void testGetListUnknownNoDefault() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertNull(config.getList(Integer.class, KEY_PREFIX));
}
@@ -701,7 +701,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests a conversion to a list if the property is unknown and a default list is provided.
*/
@Test
- public void testGetListUnknownWithDefault() {
+ void testGetListUnknownWithDefault() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<Integer> defValue = Arrays.asList(1, 2, 3);
assertEquals(defValue, config.getList(Integer.class, KEY_PREFIX, defValue));
@@ -711,7 +711,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getStringArray() for single son-string values.
*/
@Test
- public void testGetStringArrayNonString() {
+ void testGetStringArrayNonString() {
checkGetStringArrayScalar(Integer.valueOf(42));
checkGetStringArrayScalar(Long.valueOf(42));
checkGetStringArrayScalar(Short.valueOf((short) 42));
@@ -725,7 +725,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests getStringArray() if the key cannot be found.
*/
@Test
- public void testGetStringArrayUnknown() {
+ void testGetStringArrayUnknown() {
final BaseConfiguration config = new BaseConfiguration();
final String[] array = config.getStringArray(KEY_PREFIX);
assertEquals(0, array.length);
@@ -735,7 +735,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests get() for an unknown property if no default value is provided.
*/
@Test
- public void testGetUnknownNoDefaultValue() {
+ void testGetUnknownNoDefaultValue() {
final PropertiesConfiguration config = new PropertiesConfiguration();
assertNull(config.get(Integer.class, KEY_PREFIX));
}
@@ -744,7 +744,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests get() for an unknown property if a default value is provided.
*/
@Test
- public void testGetUnknownWithDefaultValue() {
+ void testGetUnknownWithDefaultValue() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final Integer defaultValue = 2121;
assertEquals(defaultValue, config.get(Integer.class, KEY_PREFIX, defaultValue));
@@ -754,7 +754,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests get() for an unknown property if the throwExceptionOnMissing flag is set.
*/
@Test
- public void testGetUnknownWithThrowExceptionOnMissing() {
+ void testGetUnknownWithThrowExceptionOnMissing() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.setThrowExceptionOnMissing(true);
assertThrows(NoSuchElementException.class, () -> config.get(Integer.class, KEY_PREFIX));
@@ -765,7 +765,7 @@ public class TestAbstractConfigurationBasicFeatures {
* value no exception should be thrown.
*/
@Test
- public void testGetUnownWithDefaultValueThrowExceptionOnMissing() {
+ void testGetUnownWithDefaultValueThrowExceptionOnMissing() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.setThrowExceptionOnMissing(true);
final Integer defaultValue = 2121;
@@ -776,7 +776,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether a new {@code ConfigurationInterpolator} can be installed without providing custom lookups.
*/
@Test
- public void testInstallInterpolatorNull() {
+ void testInstallInterpolatorNull() {
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
config.installInterpolator(null, null);
assertTrue(config.getInterpolator().getLookups().isEmpty());
@@ -789,7 +789,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether a property can reference an array using interpolation. This is related to CONFIGURATION-633.
*/
@Test
- public void testInterpolateArray() {
+ void testInterpolateArray() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final String[] values = {"some", "test", "values"};
final String keyArray = "testArray";
@@ -803,7 +803,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether environment variables can be interpolated.
*/
@Test
- public void testInterpolateEnvironmentVariables() {
+ void testInterpolateEnvironmentVariables() {
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
InterpolationTestHelper.testInterpolationEnvironment(config);
}
@@ -812,7 +812,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests escaping the variable marker, so that no interpolation will be performed.
*/
@Test
- public void testInterpolateEscape() {
+ void testInterpolateEscape() {
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
config.addProperty("mypath", "$${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar\\,$${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar");
@@ -823,7 +823,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether a property can reference a list using interpolation. This is related to CONFIGURATION-633.
*/
@Test
- public void testInterpolateList() {
+ void testInterpolateList() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<String> values = Arrays.asList("some", "test", "values");
final String keyList = "testList";
@@ -837,7 +837,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests complex interpolation where the variables' values contain in turn other variables.
*/
@Test
- public void testInterpolateRecursive() {
+ void testInterpolateRecursive() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.addProperty("animal", "${animal_attr} fox");
config.addProperty("target", "${target_attr} dog");
@@ -851,7 +851,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the interpolation features.
*/
@Test
- public void testInterpolateString() {
+ void testInterpolateString() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.addProperty("animal", "quick brown fox");
config.addProperty("target", "lazy dog");
@@ -864,7 +864,7 @@ public class TestAbstractConfigurationBasicFeatures {
* in the list.
*/
@Test
- public void testInterpolateStringWithListVariable() {
+ void testInterpolateStringWithListVariable() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final List<String> values = Arrays.asList("some", "test", "values");
final String keyList = "testList";
@@ -878,7 +878,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests interpolate() if the configuration does not have a {@code ConfigurationInterpolator}.
*/
@Test
- public void testInterpolationNoInterpolator() {
+ void testInterpolationNoInterpolator() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.addProperty("animal", "quick brown fox");
config.addProperty("target", "lazy dog");
@@ -891,7 +891,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests interpolation if a variable is unknown. Then the variable won't be substituted.
*/
@Test
- public void testInterpolationUnknownVariable() {
+ void testInterpolationUnknownVariable() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.addProperty("animal", "quick brown fox");
config.addProperty(KEY_PREFIX, SUBST_TXT);
@@ -902,7 +902,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether interpolation works in variable names.
*/
@Test
- public void testNestedVariableInterpolation() {
+ void testNestedVariableInterpolation() {
final BaseConfiguration config = new BaseConfiguration();
config.getInterpolator().setEnableSubstitutionInVariables(true);
config.addProperty("java.version", "1.4");
@@ -915,7 +915,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether the conversion handler can be changed.
*/
@Test
- public void testSetDefaultConversionHandler() {
+ void testSetDefaultConversionHandler() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final ConversionHandler handler = new DefaultConversionHandler();
config.setConversionHandler(handler);
@@ -926,7 +926,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tries to set a null value for the conversion handler.
*/
@Test
- public void testSetDefaultConversionHandlerNull() {
+ void testSetDefaultConversionHandlerNull() {
final PropertiesConfiguration configuration = new PropertiesConfiguration();
assertThrows(IllegalArgumentException.class, () -> configuration.setConversionHandler(null));
}
@@ -935,7 +935,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether default lookups can be added to an already existing {@code ConfigurationInterpolator}.
*/
@Test
- public void testSetDefaultLookupsExistingInterpolator() {
+ void testSetDefaultLookupsExistingInterpolator() {
final Lookup look = mock(Lookup.class);
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
config.getInterpolator().addDefaultLookup(new ConfigurationLookup(new PropertiesConfiguration()));
@@ -950,7 +950,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether default lookups can be added if not {@code ConfigurationInterpolator} exists yet.
*/
@Test
- public void testSetDefaultLookupsNoInterpolator() {
+ void testSetDefaultLookupsNoInterpolator() {
final Lookup look = mock(Lookup.class);
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
config.setInterpolator(null);
@@ -965,7 +965,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tries to set a null list delimiter handler.
*/
@Test
- public void testSetListDelimiterHandlerNull() {
+ void testSetListDelimiterHandlerNull() {
final BaseConfiguration config = new BaseConfiguration();
assertThrows(IllegalArgumentException.class, () -> config.setListDelimiterHandler(null));
}
@@ -975,7 +975,7 @@ public class TestAbstractConfigurationBasicFeatures {
* available.
*/
@Test
- public void testSetParentInterpolatorExistingInterpolator() {
+ void testSetParentInterpolatorExistingInterpolator() {
final ConfigurationInterpolator parent = mock(ConfigurationInterpolator.class);
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
final ConfigurationInterpolator ci = config.getInterpolator();
@@ -989,7 +989,7 @@ public class TestAbstractConfigurationBasicFeatures {
* is available.
*/
@Test
- public void testSetParentInterpolatorNoInterpolator() {
+ void testSetParentInterpolatorNoInterpolator() {
final ConfigurationInterpolator parent = mock(ConfigurationInterpolator.class);
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
config.setInterpolator(null);
@@ -1001,7 +1001,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether prefix lookups can be added to an existing {@code ConfigurationInterpolator}.
*/
@Test
- public void testSetPrefixLookupsExistingInterpolator() {
+ void testSetPrefixLookupsExistingInterpolator() {
final Lookup look = mock(Lookup.class);
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
final int count = config.getInterpolator().getLookups().size();
@@ -1017,7 +1017,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests whether prefix lookups can be added if no {@code ConfigurationInterpolator} exists yet.
*/
@Test
- public void testSetPrefixLookupsNoInterpolator() {
+ void testSetPrefixLookupsNoInterpolator() {
final Lookup look = mock(Lookup.class);
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
config.setInterpolator(null);
@@ -1031,7 +1031,7 @@ public class TestAbstractConfigurationBasicFeatures {
* Tests the default implementation of sizeInternal().
*/
@Test
- public void testSizeInternal() {
+ void testSizeInternal() {
final AbstractConfiguration config = new TestConfigurationImpl(new PropertiesConfiguration());
for (int i = 0; i < PROP_COUNT; i++) {
config.addProperty(KEY_PREFIX + i, "value" + i);
diff --git a/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationSynchronization.java b/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationSynchronization.java
index a5b93915..e2a124a0 100644
--- a/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationSynchronization.java
+++ b/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationSynchronization.java
@@ -87,7 +87,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests the correct synchronization of addProperty().
*/
@Test
- public void testAddPropertySynchronized() {
+ void testAddPropertySynchronized() {
config.addProperty(PROP, "of course");
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
}
@@ -96,7 +96,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether the append() method uses synchronization.
*/
@Test
- public void testAppendSynchronized() {
+ void testAppendSynchronized() {
final Configuration config2 = prepareConfigurationMockForCopy();
config.append(config2);
@@ -108,7 +108,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests the correct synchronization of clearProperty().
*/
@Test
- public void testClearPropertySynchronized() {
+ void testClearPropertySynchronized() {
config.clearProperty(PROP);
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
}
@@ -117,7 +117,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests the correct synchronization of clear().
*/
@Test
- public void testClearSynchronized() {
+ void testClearSynchronized() {
config.clear();
sync.verifyStart(Methods.BEGIN_WRITE);
sync.verifyEnd(Methods.END_WRITE);
@@ -127,7 +127,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether containsKey() is correctly synchronized.
*/
@Test
- public void testContainsKeySychronized() {
+ void testContainsKeySychronized() {
assertTrue(config.containsKey(PROP));
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@@ -136,7 +136,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether the copy() method uses synchronization.
*/
@Test
- public void testCopySynchronized() {
+ void testCopySynchronized() {
final Configuration config2 = prepareConfigurationMockForCopy();
config.copy(config2);
@@ -148,7 +148,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests the Synchronizer used by default.
*/
@Test
- public void testDefaultSynchronizer() {
+ void testDefaultSynchronizer() {
assertSame(NoOpSynchronizer.INSTANCE, new PropertiesConfiguration().getSynchronizer());
}
@@ -156,7 +156,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether getKeys(String prefix) is correctly synchronized.
*/
@Test
- public void testGetKeysPrefixSynchronized() {
+ void testGetKeysPrefixSynchronized() {
config.getKeys("test");
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@@ -165,7 +165,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether getKeys() is correctly synchronized.
*/
@Test
- public void testGetKeysSynchronized() {
+ void testGetKeysSynchronized() {
assertTrue(config.getKeys().hasNext());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@@ -174,7 +174,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether read access to properties is synchronized.
*/
@Test
- public void testGetPropertySynchronized() {
+ void testGetPropertySynchronized() {
assertEquals("true", config.getProperty(PROP));
assertTrue(config.getBoolean(PROP));
sync.verify(Methods.BEGIN_READ, Methods.END_READ, Methods.BEGIN_READ, Methods.END_READ);
@@ -184,7 +184,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether isEmpty() is correctly synchronized.
*/
@Test
- public void testIsEmptySynchronized() {
+ void testIsEmptySynchronized() {
assertFalse(config.isEmpty());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@@ -193,7 +193,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests lock() with a null argument.
*/
@Test
- public void testLockNull() {
+ void testLockNull() {
assertThrows(NullPointerException.class, () -> config.lock(null));
}
@@ -201,7 +201,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether a read lock can be obtained.
*/
@Test
- public void testLockRead() {
+ void testLockRead() {
config.lock(LockMode.READ);
sync.verify(Methods.BEGIN_READ);
}
@@ -210,7 +210,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether a write lock can be obtained.
*/
@Test
- public void testLockWrite() {
+ void testLockWrite() {
config.lock(LockMode.WRITE);
sync.verify(Methods.BEGIN_WRITE);
}
@@ -219,7 +219,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests the correct synchronization of setProperty().
*/
@Test
- public void testSetPropertySynchronized() {
+ void testSetPropertySynchronized() {
config.setProperty(PROP, "yes");
sync.verifyStart(Methods.BEGIN_WRITE);
sync.verifyEnd(Methods.END_WRITE);
@@ -229,7 +229,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether size() is correctly synchronized.
*/
@Test
- public void testSizeSynchronized() {
+ void testSizeSynchronized() {
assertFalse(config.isEmpty());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@@ -238,7 +238,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests synchronization of subset().
*/
@Test
- public void testSubsetSynchronized() {
+ void testSubsetSynchronized() {
final AbstractConfiguration subset = (AbstractConfiguration) config.subset("configuration");
sync.verify();
assertEquals(NoOpSynchronizer.INSTANCE, subset.getSynchronizer());
@@ -248,7 +248,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether a read lock can be released.
*/
@Test
- public void testUnlockRead() {
+ void testUnlockRead() {
config.unlock(LockMode.READ);
sync.verify(Methods.END_READ);
}
@@ -257,7 +257,7 @@ public class TestAbstractConfigurationSynchronization {
* Tests whether a write lock can be released.
*/
@Test
- public void testUnlockWrite() {
+ void testUnlockWrite() {
config.unlock(LockMode.WRITE);
sync.verify(Methods.END_WRITE);
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestAbstractHierarchicalConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestAbstractHierarchicalConfiguration.java
index dc41a34d..7f028e3a 100644
--- a/src/test/java/org/apache/commons/configuration2/TestAbstractHierarchicalConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestAbstractHierarchicalConfiguration.java
@@ -251,7 +251,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testAddNodes() {
+ void testAddNodes() {
final Collection<ImmutableNode> nodes = new ArrayList<>();
nodes.add(NodeStructureHelper.createFieldNode("birthDate"));
nodes.add(NodeStructureHelper.createFieldNode("lastLogin"));
@@ -267,7 +267,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests copying nodes from one configuration to another one.
*/
@Test
- public void testAddNodesCopy() {
+ void testAddNodesCopy() {
final AbstractHierarchicalConfigurationTestImpl configDest = new AbstractHierarchicalConfigurationTestImpl(new InMemoryNodeModel());
configDest.addProperty("test", "TEST");
final Collection<ImmutableNode> nodes = getRootNode().getChildren();
@@ -288,7 +288,7 @@ public class TestAbstractHierarchicalConfiguration {
* branch) is created.
*/
@Test
- public void testAddNodesForNonExistingKey() {
+ void testAddNodesForNonExistingKey() {
final Collection<ImmutableNode> nodes = new ArrayList<>();
final ImmutableNode newNode = new ImmutableNode.Builder().name("usr").value("scott").addAttribute("pwd", "tiger").create();
nodes.add(newNode);
@@ -302,14 +302,14 @@ public class TestAbstractHierarchicalConfiguration {
* Tests the addNodes() method when the new nodes should be added to an attribute node. This is not allowed.
*/
@Test
- public void testAddNodesWithAttributeKey() {
+ void testAddNodesWithAttributeKey() {
final Collection<ImmutableNode> nodes = new ArrayList<>();
nodes.add(NodeStructureHelper.createNode("testNode", "yes"));
assertThrows(IllegalArgumentException.class, () -> config.addNodes("database.connection[@settings]", nodes));
}
@Test
- public void testAddProperty() {
+ void testAddProperty() {
config.addProperty("tables.table(0).fields.field(-1).name", "phone");
Object prop = config.getProperty("tables.table(0).fields.field.name");
Collection<?> collection = assertInstanceOf(Collection.class, prop);
@@ -344,7 +344,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testAddPropertyInvalidKey() {
+ void testAddPropertyInvalidKey() {
assertThrows(IllegalArgumentException.class, () -> config.addProperty(".", "InvalidKey"));
}
@@ -352,7 +352,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether list handling works correctly when adding properties.
*/
@Test
- public void testAddPropertyWithListHandling() {
+ void testAddPropertyWithListHandling() {
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
final String key = "list.delimiter.value";
config.addProperty(key + ".escaped", "3\\,1415");
@@ -362,7 +362,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testClear() {
+ void testClear() {
config.setProperty(null, "value");
config.addProperty("[@attr]", "defined");
config.clear();
@@ -370,7 +370,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testClearProperty() {
+ void testClearProperty() {
config.clearProperty("tables.table(0).fields.field(0).name");
assertEquals("uname", config.getProperty("tables.table(0).fields.field(0).name"));
config.clearProperty("tables.table(0).name");
@@ -388,7 +388,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testClearTree() {
+ void testClearTree() {
Object prop = config.getProperty("tables.table(0).fields.field.name");
assertNotNull(prop);
config.clearTree("tables.table(0).fields.field(3)");
@@ -410,7 +410,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests removing more complex node structures.
*/
@Test
- public void testClearTreeComplex() {
+ void testClearTreeComplex() {
final int count = 5;
// create the structure
for (int idx = 0; idx < count; idx++) {
@@ -451,7 +451,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests the clearTree() method on a hierarchical structure of nodes. This is a test case for CONFIGURATION-293.
*/
@Test
- public void testClearTreeHierarchy() {
+ void testClearTreeHierarchy() {
config.addProperty("a.b.c", "c");
config.addProperty("a.b.c.d", "d");
config.addProperty("a.b.c.d.e", "e");
@@ -461,7 +461,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testClone() {
+ void testClone() {
final Configuration copy = (Configuration) config.clone();
assertInstanceOf(AbstractHierarchicalConfiguration.class, copy);
checkContent(copy);
@@ -471,7 +471,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether interpolation works as expected after cloning.
*/
@Test
- public void testCloneInterpolation() {
+ void testCloneInterpolation() {
final String keyAnswer = "answer";
final String keyValue = "value";
config.addProperty(keyAnswer, "The answer is ${" + keyValue + "}.");
@@ -487,7 +487,7 @@ public class TestAbstractHierarchicalConfiguration {
* registered at the clone.
*/
@Test
- public void testCloneWithEventListeners() {
+ void testCloneWithEventListeners() {
final EventListener<ConfigurationEvent> l = new EventListenerTestImpl(null);
config.addEventListener(ConfigurationEvent.ANY, l);
final AbstractHierarchicalConfiguration<?> copy = (AbstractHierarchicalConfiguration<?>) config.clone();
@@ -495,7 +495,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testContainsKey() {
+ void testContainsKey() {
assertTrue(config.containsKey("tables.table(0).name"));
assertTrue(config.containsKey("tables.table(1).name"));
assertFalse(config.containsKey("tables.table(2).name"));
@@ -509,13 +509,13 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testContainsValue() {
+ void testContainsValue() {
assertFalse(config.containsValue(null));
assertFalse(config.containsValue(""));
}
@Test
- public void testGetKeys() {
+ void testGetKeys() {
final List<String> keys = new ArrayList<>();
for (final Iterator<String> it = config.getKeys(); it.hasNext();) {
keys.add(it.next());
@@ -528,7 +528,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether attribute keys are contained in the iteration of keys.
*/
@Test
- public void testGetKeysAttribute() {
+ void testGetKeysAttribute() {
config.addProperty("tables.table(0)[@type]", "system");
final Set<String> keys = new HashSet<>();
for (final Iterator<String> it = config.getKeys(); it.hasNext();) {
@@ -541,7 +541,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether a prefix that points to an attribute is correctly handled.
*/
@Test
- public void testGetKeysAttributePrefix() {
+ void testGetKeysAttributePrefix() {
config.addProperty("tables.table(0)[@type]", "system");
final Iterator<String> itKeys = config.getKeys("tables.table[@type]");
assertEquals("tables.table[@type]", itKeys.next());
@@ -552,7 +552,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether keys are returned in a defined order.
*/
@Test
- public void testGetKeysOrder() {
+ void testGetKeysOrder() {
config.addProperty("order.key1", "value1");
config.addProperty("order.key2", "value2");
config.addProperty("order.key3", "value3");
@@ -564,7 +564,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testGetKeysString() {
+ void testGetKeysString() {
// add some more properties to make it more interesting
config.addProperty("tables.table(0).fields.field(1).type", "VARCHAR");
config.addProperty("tables.table(0)[@type]", "system");
@@ -586,7 +586,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests getKeys() with a prefix when the prefix matches exactly a key.
*/
@Test
- public void testGetKeysWithKeyAsPrefix() {
+ void testGetKeysWithKeyAsPrefix() {
config.addProperty("order.key1", "value1");
config.addProperty("order.key2", "value2");
final Iterator<String> it = config.getKeys("order.key1");
@@ -600,7 +600,7 @@ public class TestAbstractHierarchicalConfiguration {
* prefix.
*/
@Test
- public void testGetKeysWithKeyAsPrefixMultiple() {
+ void testGetKeysWithKeyAsPrefixMultiple() {
config.addProperty("order.key1", "value1");
config.addProperty("order.key1.test", "value2");
config.addProperty("order.key1.test.complex", "value2");
@@ -612,7 +612,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testGetMaxIndex() {
+ void testGetMaxIndex() {
assertEquals(NodeStructureHelper.fieldsLength(0) - 1, config.getMaxIndex("tables.table(0).fields.field"));
assertEquals(NodeStructureHelper.fieldsLength(1) - 1, config.getMaxIndex("tables.table(1).fields.field"));
assertEquals(1, config.getMaxIndex("tables.table"));
@@ -633,7 +633,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether the configuration's node model can be correctly accessed.
*/
@Test
- public void testGetNodeModel() {
+ void testGetNodeModel() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
config.setSynchronizer(sync);
final NodeModel<ImmutableNode> model = config.getNodeModel();
@@ -646,7 +646,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testGetProperty() {
+ void testGetProperty() {
checkGetProperty(config);
}
@@ -654,7 +654,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether keys that contains brackets can be used.
*/
@Test
- public void testGetPropertyKeyWithBrackets() {
+ void testGetPropertyKeyWithBrackets() {
final String key = "test.directory.platform(x86)";
config.addProperty(key, "C:\\Temp");
assertEquals("C:\\Temp", config.getString(key));
@@ -664,7 +664,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests the copy constructor when a null reference is passed.
*/
@Test
- public void testInitCopyNull() {
+ void testInitCopyNull() {
final BaseHierarchicalConfiguration copy = new BaseHierarchicalConfiguration((BaseHierarchicalConfiguration) null);
assertTrue(copy.isEmpty());
}
@@ -673,7 +673,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests obtaining a configuration with all variables substituted.
*/
@Test
- public void testInterpolatedConfiguration() {
+ void testInterpolatedConfiguration() {
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
final AbstractHierarchicalConfiguration<?> c = (AbstractHierarchicalConfiguration<?>) InterpolationTestHelper.testInterpolatedConfiguration(config);
@@ -685,7 +685,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests interpolation facilities.
*/
@Test
- public void testInterpolation() {
+ void testInterpolation() {
config.addProperty("base.dir", "/home/foo");
config.addProperty("test.absolute.dir.dir1", "${base.dir}/path1");
config.addProperty("test.absolute.dir.dir2", "${base.dir}/path2");
@@ -701,7 +701,7 @@ public class TestAbstractHierarchicalConfiguration {
* Basic interpolation tests.
*/
@Test
- public void testInterpolationBasic() {
+ void testInterpolationBasic() {
InterpolationTestHelper.testInterpolation(config);
}
@@ -709,7 +709,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests interpolation with constant values.
*/
@Test
- public void testInterpolationConstants() {
+ void testInterpolationConstants() {
InterpolationTestHelper.testInterpolationConstants(config);
}
@@ -717,7 +717,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests escaping variables.
*/
@Test
- public void testInterpolationEscaped() {
+ void testInterpolationEscaped() {
InterpolationTestHelper.testInterpolationEscaped(config);
}
@@ -725,7 +725,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests interpolation with localhost values.
*/
@Test
- public void testInterpolationLocalhost() {
+ void testInterpolationLocalhost() {
InterpolationTestHelper.testInterpolationLocalhost(config);
}
@@ -733,7 +733,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests an invalid interpolation that causes an endless loop.
*/
@Test
- public void testInterpolationLoop() {
+ void testInterpolationLoop() {
InterpolationTestHelper.testInterpolationLoop(config);
}
@@ -741,7 +741,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests multiple levels of interpolation.
*/
@Test
- public void testInterpolationMultipleLevels() {
+ void testInterpolationMultipleLevels() {
InterpolationTestHelper.testMultipleInterpolation(config);
}
@@ -749,7 +749,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests interpolation with a subset.
*/
@Test
- public void testInterpolationSubset() {
+ void testInterpolationSubset() {
InterpolationTestHelper.testInterpolationSubset(config);
}
@@ -757,7 +757,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether interpolation with a subset configuration works over multiple layers.
*/
@Test
- public void testInterpolationSubsetMultipleLayers() {
+ void testInterpolationSubsetMultipleLayers() {
config.clear();
config.addProperty("var", "value");
config.addProperty("prop2.prop[@attr]", "${var}");
@@ -770,7 +770,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests interpolation with system properties.
*/
@Test
- public void testInterpolationSystemProperties() {
+ void testInterpolationSystemProperties() {
InterpolationTestHelper.testInterpolationSystemProperties(config);
}
@@ -778,7 +778,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests interpolation of a variable, which cannot be resolved.
*/
@Test
- public void testInterpolationUnknownProperty() {
+ void testInterpolationUnknownProperty() {
InterpolationTestHelper.testInterpolationUnknownProperty(config);
}
@@ -786,12 +786,12 @@ public class TestAbstractHierarchicalConfiguration {
* Tests manipulating the interpolator.
*/
@Test
- public void testInterpolator() {
+ void testInterpolator() {
InterpolationTestHelper.testGetInterpolator(config);
}
@Test
- public void testIsEmptyFalse() {
+ void testIsEmptyFalse() {
assertFalse(config.isEmpty());
}
@@ -799,7 +799,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests isEmpty() if the structure contains some nodes without values.
*/
@Test
- public void testIsEmptyNodesWithNoValues() {
+ void testIsEmptyNodesWithNoValues() {
final ImmutableNode.Builder rootBuilder = new ImmutableNode.Builder(1);
final ImmutableNode.Builder nodeBuilder = new ImmutableNode.Builder(1);
nodeBuilder.addChild(NodeStructureHelper.createNode("child", null));
@@ -812,7 +812,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests isEmpty() if only the root node exists.
*/
@Test
- public void testIsEmptyRootOnly() {
+ void testIsEmptyRootOnly() {
config = new AbstractHierarchicalConfigurationTestImpl(new InMemoryNodeModel());
assertTrue(config.isEmpty());
}
@@ -821,7 +821,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests nodeKey() if the key is directly found in the cache.
*/
@Test
- public void testNodeKeyCacheHit() {
+ void testNodeKeyCacheHit() {
final Map<ImmutableNode, String> cache = new HashMap<>();
final String key = "someResultKey";
cache.put(getRootNode(), key);
@@ -832,7 +832,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether the cache map is filled while generating node keys.
*/
@Test
- public void testNodeKeyCachePopulated() {
+ void testNodeKeyCachePopulated() {
final Map<ImmutableNode, String> cache = new HashMap<>();
final ImmutableNode nodeTabName = NodeStructureHelper.nodeForKey(getRootNode(), "tables/table(0)/name");
final NodeHandler<ImmutableNode> handler = config.getModel().getNodeHandler();
@@ -848,7 +848,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether the cache is used by nodeKey().
*/
@Test
- public void testNodeKeyCacheUsage() {
+ void testNodeKeyCacheUsage() {
final Map<ImmutableNode, String> cache = new HashMap<>();
final ImmutableNode nodeTabName = NodeStructureHelper.nodeForKey(getRootNode(), "tables/table(0)/name");
final NodeHandler<ImmutableNode> handler = config.getModel().getNodeHandler();
@@ -860,7 +860,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether a correct node key is generated if no data is contained in the cache.
*/
@Test
- public void testNodeKeyEmptyCache() {
+ void testNodeKeyEmptyCache() {
final Map<ImmutableNode, String> cache = new HashMap<>();
final ImmutableNode nodeTabName = NodeStructureHelper.nodeForKey(getRootNode(), "tables/table(0)/name");
final ImmutableNode nodeFldName = NodeStructureHelper.nodeForKey(getRootNode(), "tables/table(0)/fields/field(1)/name");
@@ -872,7 +872,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether a node key for the root node can be generated.
*/
@Test
- public void testNodeKeyRootNode() {
+ void testNodeKeyRootNode() {
final Map<ImmutableNode, String> cache = new HashMap<>();
assertEquals("", config.nodeKey(getRootNode(), cache, config.getModel().getNodeHandler()));
}
@@ -881,7 +881,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether node keys can be resolved.
*/
@Test
- public void testResolveNodeKey() {
+ void testResolveNodeKey() {
final List<ImmutableNode> nodes = config.resolveNodeKey(getRootNode(), "tables.table.name", config.getModel().getNodeHandler());
assertEquals(NodeStructureHelper.tablesLength(), nodes.size());
for (int i = 0; i < NodeStructureHelper.tablesLength(); i++) {
@@ -893,7 +893,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether attribute keys are filtered out when resolving node keys.
*/
@Test
- public void testResolveNodeKeyAttribute() {
+ void testResolveNodeKeyAttribute() {
final String attrKey = "tables.table(0)[@type]";
config.addProperty(attrKey, "system");
assertTrue(config.resolveNodeKey(getRootNode(), attrKey, config.getModel().getNodeHandler()).isEmpty());
@@ -903,7 +903,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests setting a custom expression engine, which uses a slightly different syntax.
*/
@Test
- public void testSetExpressionEngine() {
+ void testSetExpressionEngine() {
config.setExpressionEngine(null);
assertNotNull(config.getExpressionEngine());
assertSame(DefaultExpressionEngine.INSTANCE, config.getExpressionEngine());
@@ -913,7 +913,7 @@ public class TestAbstractHierarchicalConfiguration {
}
@Test
- public void testSetProperty() {
+ void testSetProperty() {
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
config.setProperty("tables.table(0).name", "resources");
assertEquals("resources", config.getString("tables.table(0).name"));
@@ -944,7 +944,7 @@ public class TestAbstractHierarchicalConfiguration {
* Tests whether the correct size is calculated.
*/
@Test
- public void testSize() {
+ void testSize() {
assertEquals(2, config.size());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestBaseConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestBaseConfiguration.java
index 9d860409..a3158191 100644
--- a/src/test/java/org/apache/commons/configuration2/TestBaseConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestBaseConfiguration.java
@@ -69,7 +69,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testAddProperty() throws Exception {
+ void testAddProperty() throws Exception {
Collection<Object> props = new ArrayList<>();
props.add("one");
props.add("two,three,four");
@@ -105,7 +105,7 @@ public class TestBaseConfiguration {
* Tests cloning a BaseConfiguration.
*/
@Test
- public void testClone() {
+ void testClone() {
for (int i = 0; i < 10; i++) {
config.addProperty("key" + i, Integer.valueOf(i));
}
@@ -122,7 +122,7 @@ public class TestBaseConfiguration {
* Tests whether interpolation works as expected after cloning.
*/
@Test
- public void testCloneInterpolation() {
+ void testCloneInterpolation() {
final String keyAnswer = "answer";
config.addProperty(keyAnswer, "The answer is ${" + KEY_NUMBER + "}.");
config.addProperty(KEY_NUMBER, 42);
@@ -136,7 +136,7 @@ public class TestBaseConfiguration {
* Tests the clone() method if a list property is involved.
*/
@Test
- public void testCloneListProperty() {
+ void testCloneListProperty() {
final String key = "list";
config.addProperty(key, "value1");
config.addProperty(key, "value2");
@@ -149,7 +149,7 @@ public class TestBaseConfiguration {
* Tests whether a cloned configuration is decoupled from its original.
*/
@Test
- public void testCloneModify() {
+ void testCloneModify() {
final EventListener<ConfigurationEvent> l = new EventListenerTestImpl(config);
config.addEventListener(ConfigurationEvent.ANY, l);
config.addProperty("original", Boolean.TRUE);
@@ -164,7 +164,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testCommaSeparatedString() {
+ void testCommaSeparatedString() {
final String prop = "hey, that's a test";
config.setProperty("prop.string", prop);
final List<Object> list = config.getList("prop.string");
@@ -172,19 +172,19 @@ public class TestBaseConfiguration {
}
@Test
- public void testCommaSeparatedStringEscaped() {
+ void testCommaSeparatedStringEscaped() {
final String prop2 = "hey\\, that's a test";
config.setProperty("prop.string", prop2);
assertEquals("hey, that's a test", config.getString("prop.string"));
}
@Test
- public void testContainsValue() {
+ void testContainsValue() {
assertFalse(config.containsValue(null));
}
@Test
- public void testGetBigDecimal() {
+ void testGetBigDecimal() {
config.setProperty("numberBigD", "123.456");
final BigDecimal number = new BigDecimal("123.456");
final BigDecimal defaultValue = new BigDecimal("654.321");
@@ -195,18 +195,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetBigDecimalIncompatibleType() {
+ void testGetBigDecimalIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getBigDecimal("test.empty"));
}
@Test
- public void testGetBigDecimalUnknown() {
+ void testGetBigDecimalUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getBigDecimal("numberNotInConfig"));
}
@Test
- public void testGetBigInteger() {
+ void testGetBigInteger() {
config.setProperty("numberBigI", "1234567890");
final BigInteger number = new BigInteger("1234567890");
final BigInteger defaultValue = new BigInteger("654321");
@@ -217,18 +217,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetBigIntegerIncompatibleType() {
+ void testGetBigIntegerIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getBigInteger("test.empty"));
}
@Test
- public void testGetBigIntegerUnknown() {
+ void testGetBigIntegerUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getBigInteger("numberNotInConfig"));
}
@Test
- public void testGetBinaryValue() {
+ void testGetBinaryValue() {
config.setProperty("number", "0b11111111");
assertEquals((byte) 0xFF, config.getByte("number"));
@@ -245,7 +245,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetBoolean() {
+ void testGetBoolean() {
config.setProperty("boolA", Boolean.TRUE);
final boolean boolT = true;
final boolean boolF = false;
@@ -256,18 +256,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetBooleanIncompatibleType() {
+ void testGetBooleanIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getBoolean("test.empty"));
}
@Test
- public void testGetBooleanUnknown() {
+ void testGetBooleanUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getBoolean("numberNotInConfig"));
}
@Test
- public void testGetByte() {
+ void testGetByte() {
config.setProperty("number", "1");
final byte oneB = 1;
final byte twoB = 2;
@@ -278,18 +278,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetByteIncompatibleType() {
+ void testGetByteIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getByte("test.empty"));
}
@Test
- public void testGetByteUnknown() {
+ void testGetByteUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getByte("numberNotInConfig"));
}
@Test
- public void testGetDouble() {
+ void testGetDouble() {
config.setProperty("numberD", "1.0");
final double oneD = 1;
final double twoD = 2;
@@ -300,18 +300,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetDoubleIncompatibleType() {
+ void testGetDoubleIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getDouble("test.empty"));
}
@Test
- public void testGetDoubleUnknown() {
+ void testGetDoubleUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getDouble("numberNotInConfig"));
}
@Test
- public void testGetDuration() {
+ void testGetDuration() {
final Duration d = Duration.ofSeconds(1);
config.setProperty("durationD", d.toString());
final Duration oneD = Duration.ofSeconds(1);
@@ -323,18 +323,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetDurationIncompatibleType() {
+ void testGetDurationIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getDuration("test.empty"));
}
@Test
- public void testGetDurationUnknown() {
+ void testGetDurationUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getDuration("numberNotInConfig"));
}
@Test
- public void testGetEnum() {
+ void testGetEnum() {
config.setProperty("testEnum", EnumFixture.SMALLTALK.name());
config.setProperty("testBadEnum", "This is not an enum value.");
final EnumFixture enum1 = EnumFixture.SMALLTALK;
@@ -350,7 +350,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetFloat() {
+ void testGetFloat() {
config.setProperty("numberF", "1.0");
final float oneF = 1;
final float twoF = 2;
@@ -361,18 +361,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetFloatIncompatibleType() {
+ void testGetFloatIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getFloat("test.empty"));
}
@Test
- public void testGetFloatUnknown() {
+ void testGetFloatUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getFloat("numberNotInConfig"));
}
@Test
- public void testGetHexadecimalValue() {
+ void testGetHexadecimalValue() {
config.setProperty("number", "0xFF");
assertEquals((byte) 0xFF, config.getByte("number"));
@@ -389,7 +389,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetInterpolatedList() {
+ void testGetInterpolatedList() {
config.addProperty("number", "1");
config.addProperty("array", "${number}");
config.addProperty("array", "${number}");
@@ -402,7 +402,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetInterpolatedPrimitives() {
+ void testGetInterpolatedPrimitives() {
config.addProperty("number", "1");
config.addProperty("value", "${number}");
@@ -435,12 +435,12 @@ public class TestBaseConfiguration {
* Tests accessing and manipulating the interpolator object.
*/
@Test
- public void testGetInterpolator() {
+ void testGetInterpolator() {
InterpolationTestHelper.testGetInterpolator(config);
}
@Test
- public void testGetList() {
+ void testGetList() {
config.addProperty("number", "1");
config.addProperty("number", "2");
final List<Object> list = config.getList("number");
@@ -448,7 +448,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetLong() {
+ void testGetLong() {
config.setProperty("numberL", "1");
final long oneL = 1;
final long twoL = 2;
@@ -459,18 +459,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetLongIncompatibleTypes() {
+ void testGetLongIncompatibleTypes() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getLong("test.empty"));
}
@Test
- public void testGetLongUnknown() {
+ void testGetLongUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getLong("numberNotInConfig"));
}
@Test
- public void testGetProperty() {
+ void testGetProperty() {
/* should be empty and return null */
assertNull(config.getProperty("foo"));
@@ -481,7 +481,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetShort() {
+ void testGetShort() {
config.setProperty("numberS", "1");
final short oneS = 1;
final short twoS = 2;
@@ -492,18 +492,18 @@ public class TestBaseConfiguration {
}
@Test
- public void testGetShortIncompatibleType() {
+ void testGetShortIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getShort("test.empty"));
}
@Test
- public void testGetShortUnknown() {
+ void testGetShortUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getShort("numberNotInConfig"));
}
@Test
- public void testGetString() {
+ void testGetString() {
config.setProperty("testString", "The quick brown fox");
final String string = "The quick brown fox";
final String defaultValue = "jumps over the lazy dog";
@@ -517,14 +517,14 @@ public class TestBaseConfiguration {
* Tests that the first scalar of a list is returned.
*/
@Test
- public void testGetStringForListValue() {
+ void testGetStringForListValue() {
config.addProperty("number", "1");
config.addProperty("number", "2");
assertEquals("1", config.getString("number"));
}
@Test
- public void testGetStringUnknown() {
+ void testGetStringUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getString("stringNotInConfig"));
}
@@ -532,7 +532,7 @@ public class TestBaseConfiguration {
* Tests whether a {@code ConfigurationInterpolator} can be created and installed.
*/
@Test
- public void testInstallInterpolator() {
+ void testInstallInterpolator() {
final Lookup prefixLookup = mock(Lookup.class);
final Lookup defLookup = mock(Lookup.class);
final Map<String, Lookup> prefixLookups = new HashMap<>();
@@ -555,12 +555,12 @@ public class TestBaseConfiguration {
* Tests obtaining a configuration with all variables replaced by their actual values.
*/
@Test
- public void testInterpolatedConfiguration() {
+ void testInterpolatedConfiguration() {
InterpolationTestHelper.testInterpolatedConfiguration(config);
}
@Test
- public void testInterpolation() {
+ void testInterpolation() {
InterpolationTestHelper.testInterpolation(config);
}
@@ -568,7 +568,7 @@ public class TestBaseConfiguration {
* Tests interpolation of constant values.
*/
@Test
- public void testInterpolationConstants() {
+ void testInterpolationConstants() {
InterpolationTestHelper.testInterpolationConstants(config);
}
@@ -576,7 +576,7 @@ public class TestBaseConfiguration {
* Tests interpolation of environment properties.
*/
@Test
- public void testInterpolationEnvironment() {
+ void testInterpolationEnvironment() {
InterpolationTestHelper.testInterpolationEnvironment(config);
}
@@ -584,7 +584,7 @@ public class TestBaseConfiguration {
* Tests whether a variable can be escaped, so that it won't be interpolated.
*/
@Test
- public void testInterpolationEscaped() {
+ void testInterpolationEscaped() {
InterpolationTestHelper.testInterpolationEscaped(config);
}
@@ -592,12 +592,12 @@ public class TestBaseConfiguration {
* Tests interpolation with localhost values.
*/
@Test
- public void testInterpolationLocalhost() {
+ void testInterpolationLocalhost() {
InterpolationTestHelper.testInterpolationLocalhost(config);
}
@Test
- public void testInterpolationLoop() {
+ void testInterpolationLoop() {
InterpolationTestHelper.testInterpolationLoop(config);
}
@@ -605,7 +605,7 @@ public class TestBaseConfiguration {
* Tests interpolation when a subset configuration is involved.
*/
@Test
- public void testInterpolationSubset() {
+ void testInterpolationSubset() {
InterpolationTestHelper.testInterpolationSubset(config);
}
@@ -613,7 +613,7 @@ public class TestBaseConfiguration {
* Tests interpolation of system properties.
*/
@Test
- public void testInterpolationSystemProperties() {
+ void testInterpolationSystemProperties() {
InterpolationTestHelper.testInterpolationSystemProperties(config);
}
@@ -621,12 +621,12 @@ public class TestBaseConfiguration {
* Tests interpolation when the referred property is not found.
*/
@Test
- public void testInterpolationUnknownProperty() {
+ void testInterpolationUnknownProperty() {
InterpolationTestHelper.testInterpolationUnknownProperty(config);
}
@Test
- public void testMultipleInterpolation() {
+ void testMultipleInterpolation() {
InterpolationTestHelper.testMultipleInterpolation(config);
}
@@ -634,7 +634,7 @@ public class TestBaseConfiguration {
* Tests whether property access is possible without a {@code ConfigurationInterpolator}.
*/
@Test
- public void testNoInterpolator() {
+ void testNoInterpolator() {
config.setProperty("test", "${value}");
config.setInterpolator(null);
assertEquals("${value}", config.getString("test"));
@@ -644,7 +644,7 @@ public class TestBaseConfiguration {
* Tests if conversion between number types is possible.
*/
@Test
- public void testNumberConversions() {
+ void testNumberConversions() {
config.setProperty(KEY_NUMBER, Integer.valueOf(42));
assertEquals(42, config.getInt(KEY_NUMBER));
assertEquals(42L, config.getLong(KEY_NUMBER));
@@ -658,7 +658,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testPropertyAccess() {
+ void testPropertyAccess() {
config.clearProperty("prop.properties");
config.setProperty("prop.properties", "");
assertEquals(new Properties(), config.getProperties("prop.properties"));
@@ -676,7 +676,7 @@ public class TestBaseConfiguration {
* Tests whether a {@code ConfigurationInterpolator} can be set.
*/
@Test
- public void testSetInterpolator() {
+ void testSetInterpolator() {
final ConfigurationInterpolator interpolator = mock(ConfigurationInterpolator.class);
config.setInterpolator(interpolator);
assertSame(interpolator, config.getInterpolator());
@@ -686,7 +686,7 @@ public class TestBaseConfiguration {
* Tests the specific size() implementation.
*/
@Test
- public void testSize() {
+ void testSize() {
final int count = 16;
for (int i = 0; i < count; i++) {
config.addProperty("key" + i, "value" + i);
@@ -695,7 +695,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testSubset() {
+ void testSubset() {
/*
* test subset : assure we don't reprocess the data elements when generating the subset
*/
@@ -720,7 +720,7 @@ public class TestBaseConfiguration {
}
@Test
- public void testThrowExceptionOnMissing() {
+ void testThrowExceptionOnMissing() {
assertTrue(config.isThrowExceptionOnMissing());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestBaseConfigurationXMLReader.java b/src/test/java/org/apache/commons/configuration2/TestBaseConfigurationXMLReader.java
index b5ecec59..cbdc85a2 100644
--- a/src/test/java/org/apache/commons/configuration2/TestBaseConfigurationXMLReader.java
+++ b/src/test/java/org/apache/commons/configuration2/TestBaseConfigurationXMLReader.java
@@ -117,24 +117,24 @@ public class TestBaseConfigurationXMLReader {
}
@Test
- public void testParse() throws Exception {
+ void testParse() throws Exception {
checkDocument(configReader, "config");
}
@Test
- public void testParseIOException() {
+ void testParseIOException() {
final BaseConfigurationXMLReader reader = new BaseConfigurationXMLReader();
assertThrows(IOException.class, () -> reader.parse("document"));
}
@Test
- public void testParseSAXException() {
+ void testParseSAXException() {
configReader.setContentHandler(new TestContentHandler());
assertThrows(SAXException.class, () -> configReader.parse("systemID"));
}
@Test
- public void testSetRootName() throws Exception {
+ void testSetRootName() throws Exception {
final BaseConfigurationXMLReader reader = new BaseConfigurationXMLReader(config);
reader.setRootName("apache");
checkDocument(reader, "apache");
diff --git a/src/test/java/org/apache/commons/configuration2/TestBaseHierarchicalConfigurationSynchronization.java b/src/test/java/org/apache/commons/configuration2/TestBaseHierarchicalConfigurationSynchronization.java
index 5eae793c..e37313e4 100644
--- a/src/test/java/org/apache/commons/configuration2/TestBaseHierarchicalConfigurationSynchronization.java
+++ b/src/test/java/org/apache/commons/configuration2/TestBaseHierarchicalConfigurationSynchronization.java
@@ -141,7 +141,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether addNodes() is correctly synchronized.
*/
@Test
- public void testAddNodesSynchronized() {
+ void testAddNodesSynchronized() {
final ImmutableNode node = NodeStructureHelper.createNode("newNode", "true");
config.addNodes("test.addNodes", Collections.singleton(node));
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
@@ -151,7 +151,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether childConfigurationsAt() is correctly synchronized.
*/
@Test
- public void testChildConfigurationsAtSynchronized() {
+ void testChildConfigurationsAtSynchronized() {
final List<HierarchicalConfiguration<ImmutableNode>> subs = config.childConfigurationsAt("clear");
assertFalse(subs.isEmpty());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -161,7 +161,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether clearTree() is correctly synchronized.
*/
@Test
- public void testClearTreeSynchronized() {
+ void testClearTreeSynchronized() {
config.clearTree("clear");
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
}
@@ -170,7 +170,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether a clone() operation also copies the data used to manage SubnodeConfiguration objects.
*/
@Test
- public void testCloneCopySubnodeData() {
+ void testCloneCopySubnodeData() {
final BaseHierarchicalConfiguration conf2 = new BaseHierarchicalConfiguration(config);
final HierarchicalConfiguration<ImmutableNode> sub = conf2.configurationAt("element2.subelement", true);
@@ -187,7 +187,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether clone() is correctly synchronized.
*/
@Test
- public void testCloneSynchronized() {
+ void testCloneSynchronized() {
final BaseHierarchicalConfiguration clone = (BaseHierarchicalConfiguration) config.clone();
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
assertNotSame(config.getSynchronizer(), clone.getSynchronizer());
@@ -197,7 +197,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether synchronization is performed when constructing a SubnodeConfiguration.
*/
@Test
- public void testConfigurationAtSynchronized() {
+ void testConfigurationAtSynchronized() {
final HierarchicalConfiguration<ImmutableNode> sub = config.configurationAt("element2");
assertEquals("I'm complex!", sub.getString("subelement.subsubelement"));
sync.verify(Methods.BEGIN_READ, Methods.END_READ, Methods.BEGIN_READ, Methods.END_READ);
@@ -207,7 +207,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether synchronization is performed when constructing multiple SubnodeConfiguration objects.
*/
@Test
- public void testConfigurationsAtSynchronized() {
+ void testConfigurationsAtSynchronized() {
final List<HierarchicalConfiguration<ImmutableNode>> subs = config.configurationsAt("list.item");
assertFalse(subs.isEmpty());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -217,7 +217,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether synchronization is performed when copying a configuration.
*/
@Test
- public void testCopyConstructorSynchronized() {
+ void testCopyConstructorSynchronized() {
final BaseHierarchicalConfiguration copy = new BaseHierarchicalConfiguration(config);
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
assertNotSame(sync, copy.getSynchronizer());
@@ -227,7 +227,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether getMaxIndex() is correctly synchronized.
*/
@Test
- public void testGetMaxIndexSynchronized() {
+ void testGetMaxIndexSynchronized() {
assertTrue(config.getMaxIndex("list.item") > 0);
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@@ -236,7 +236,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether getRootElementName() is correctly synchronized.
*/
@Test
- public void testGetRootElementNameSynchronized() {
+ void testGetRootElementNameSynchronized() {
assertEquals("testconfig", config.getRootElementName());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@@ -245,7 +245,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests that access to an initialized configuration's sub configurations is possible without a special synchronizer.
*/
@Test
- public void testReadOnlyAccessToSubConfigurations() throws ConfigurationException {
+ void testReadOnlyAccessToSubConfigurations() throws ConfigurationException {
final FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>(XMLConfiguration.class);
builder.configure(new Parameters().fileBased().setFile(testFile));
config = builder.getConfiguration();
@@ -273,7 +273,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether updates on nodes are communicated to all SubnodeConfigurations of a configuration.
*/
@Test
- public void testSubnodeUpdate() {
+ void testSubnodeUpdate() {
config.addProperty("element2.test", Boolean.TRUE);
final HierarchicalConfiguration<ImmutableNode> sub = config.configurationAt("element2", true);
final HierarchicalConfiguration<ImmutableNode> subsub = sub.configurationAt("subelement", true);
@@ -286,7 +286,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether updates caused by a SubnodeConfiguration are communicated to all other SubnodeConfigurations.
*/
@Test
- public void testSubnodeUpdateBySubnode() {
+ void testSubnodeUpdateBySubnode() {
final HierarchicalConfiguration<ImmutableNode> sub = config.configurationAt("element2", true);
final HierarchicalConfiguration<ImmutableNode> subsub = sub.configurationAt("subelement", true);
final HierarchicalConfiguration<ImmutableNode> sub2 = config.configurationAt("element2.subelement", true);
@@ -299,7 +299,7 @@ public class TestBaseHierarchicalConfigurationSynchronization {
* Tests whether subset() is correctly synchronized.
*/
@Test
- public void testSubsetSynchronized() {
+ void testSubsetSynchronized() {
final Configuration subset = config.subset("test");
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
assertSame(sync, subset.getSynchronizer());
diff --git a/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java
index 4f6ce23c..20001746 100644
--- a/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestBaseNullConfiguration.java
@@ -49,7 +49,7 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testCommaSeparatedString() {
+ void testCommaSeparatedString() {
final String prop = "hey, that's a test";
config.setProperty("prop.string", prop);
final List<Object> list = config.getList("prop.string");
@@ -57,7 +57,7 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testCommaSeparatedStringEscaped() {
+ void testCommaSeparatedStringEscaped() {
final String prop2 = "hey\\, that's a test";
config.clearProperty("prop.string");
config.setProperty("prop.string", prop2);
@@ -65,7 +65,7 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetBigDecimal() {
+ void testGetBigDecimal() {
config.setProperty("numberBigD", "123.456");
final BigDecimal number = new BigDecimal("123.456");
final BigDecimal defaultValue = new BigDecimal("654.321");
@@ -76,18 +76,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetBigDecimalIncompatibleType() {
+ void testGetBigDecimalIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getBigDecimal("test.empty"));
}
@Test
- public void testGetBigDecimalUnknown() {
+ void testGetBigDecimalUnknown() {
assertNull(config.getBigDecimal("numberNotInConfig"));
}
@Test
- public void testGetBigInteger() {
+ void testGetBigInteger() {
config.setProperty("numberBigI", "1234567890");
final BigInteger number = new BigInteger("1234567890");
final BigInteger defaultValue = new BigInteger("654321");
@@ -98,18 +98,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetBigIntegerIncompatibleType() {
+ void testGetBigIntegerIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getBigInteger("test.empty"));
}
@Test
- public void testGetBigIntegerUnknown() {
+ void testGetBigIntegerUnknown() {
assertNull(config.getBigInteger("numberNotInConfig"));
}
@Test
- public void testGetBoolean() {
+ void testGetBoolean() {
config.setProperty("boolA", Boolean.TRUE);
final boolean boolT = true;
final boolean boolF = false;
@@ -120,18 +120,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetBooleanIncompatibleType() {
+ void testGetBooleanIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getBoolean("test.empty"));
}
@Test
- public void testGetBooleanUnknown() {
+ void testGetBooleanUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getBoolean("numberNotInConfig"));
}
@Test
- public void testGetByte() {
+ void testGetByte() {
config.setProperty("number", "1");
final byte oneB = 1;
final byte twoB = 2;
@@ -142,18 +142,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetByteIncompatibleType() {
+ void testGetByteIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getByte("test.empty"));
}
@Test
- public void testGetByteUnknown() {
+ void testGetByteUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getByte("numberNotInConfig"));
}
@Test
- public void testGetDouble() {
+ void testGetDouble() {
config.setProperty("numberD", "1.0");
final double oneD = 1;
final double twoD = 2;
@@ -164,18 +164,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetDoubleIncompatibleType() {
+ void testGetDoubleIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getDouble("test.empty"));
}
@Test
- public void testGetDoubleUnknown() {
+ void testGetDoubleUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getDouble("numberNotInConfig"));
}
@Test
- public void testGetFloat() {
+ void testGetFloat() {
config.setProperty("numberF", "1.0");
final float oneF = 1;
final float twoF = 2;
@@ -186,18 +186,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetFloatIncompatibleType() {
+ void testGetFloatIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getFloat("test.empty"));
}
@Test
- public void testGetFloatUnknown() {
+ void testGetFloatUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getFloat("numberNotInConfig"));
}
@Test
- public void testGetList() {
+ void testGetList() {
config.addProperty("number", "1");
config.addProperty("number", "2");
final List<Object> list = config.getList("number");
@@ -205,14 +205,14 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetListAsScalar() {
+ void testGetListAsScalar() {
config.addProperty("number", "1");
config.addProperty("number", "2");
assertEquals("1", config.getString("number"));
}
@Test
- public void testGetLong() {
+ void testGetLong() {
config.setProperty("numberL", "1");
final long oneL = 1;
final long twoL = 2;
@@ -223,18 +223,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetLongIncompatibleTypes() {
+ void testGetLongIncompatibleTypes() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getLong("test.empty"));
}
@Test
- public void testGetLongUnknown() {
+ void testGetLongUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getLong("numberNotInConfig"));
}
@Test
- public void testGetProperty() {
+ void testGetProperty() {
/* should be empty and return null */
assertNull(config.getProperty("foo"));
@@ -245,7 +245,7 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetShort() {
+ void testGetShort() {
config.setProperty("numberS", "1");
final short oneS = 1;
final short twoS = 2;
@@ -256,18 +256,18 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetShortIncompatibleType() {
+ void testGetShortIncompatibleType() {
config.setProperty("test.empty", "");
assertThrows(ConversionException.class, () -> config.getShort("test.empty"));
}
@Test
- public void testGetShortUnknown() {
+ void testGetShortUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getShort("numberNotInConfig"));
}
@Test
- public void testGetString() {
+ void testGetString() {
config.setProperty("testString", "The quick brown fox");
final String string = "The quick brown fox";
final String defaultValue = "jumps over the lazy dog";
@@ -278,12 +278,12 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testGetStringUnknown() {
+ void testGetStringUnknown() {
assertNull(config.getString("stringNotInConfig"));
}
@Test
- public void testInterpolation() throws Exception {
+ void testInterpolation() throws Exception {
config.setProperty("applicationRoot", "/home/applicationRoot");
config.setProperty("db", "${applicationRoot}/db/hypersonic");
final String unInterpolatedValue = "${applicationRoot2}/db/hypersonic";
@@ -302,14 +302,14 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testInterpolationLoop() throws Exception {
+ void testInterpolationLoop() throws Exception {
config.setProperty("test.a", "${test.b}");
config.setProperty("test.b", "${test.a}");
assertThrows(IllegalStateException.class, () -> config.getString("test.a"));
}
@Test
- public void testMultipleInterpolation() throws Exception {
+ void testMultipleInterpolation() throws Exception {
config.setProperty("test.base-level", "/base-level");
config.setProperty("test.first-level", "${test.base-level}/first-level");
config.setProperty("test.second-level", "${test.first-level}/second-level");
@@ -321,7 +321,7 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testPropertyAccess() {
+ void testPropertyAccess() {
config.clearProperty("prop.properties");
config.setProperty("prop.properties", "");
assertEquals(new Properties(), config.getProperties("prop.properties"));
@@ -336,7 +336,7 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testSubset() {
+ void testSubset() {
/*
* test subset : assure we don't reprocess the data elements when generating the subset
*/
@@ -361,7 +361,7 @@ public class TestBaseNullConfiguration {
}
@Test
- public void testThrowExceptionOnMissing() {
+ void testThrowExceptionOnMissing() {
assertFalse(config.isThrowExceptionOnMissing());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java b/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
index 48bec4c3..8b166c87 100644
--- a/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
+++ b/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
@@ -68,14 +68,14 @@ public class TestCatalogResolver {
}
@Test
- public void testDebug() throws Exception {
+ void testDebug() throws Exception {
resolver.setDebug(true);
// There is no really good way to check this except to do something
// that causes debug output.
}
@Test
- public void testLogger() throws Exception {
+ void testLogger() throws Exception {
final ConfigurationLogger log = new ConfigurationLogger(this.getClass());
resolver.setLogger(log);
assertNotNull(resolver.getLogger());
@@ -83,12 +83,12 @@ public class TestCatalogResolver {
}
@Test
- public void testPublic() {
+ void testPublic() {
assertDoesNotThrow(() -> load(PUBLIC_FILE));
}
@Test
- public void testRewriteSystem() {
+ void testRewriteSystem() {
assertDoesNotThrow(() -> load(REWRITE_SYSTEM_FILE));
}
@@ -96,7 +96,7 @@ public class TestCatalogResolver {
* Tests that the schema can be resolved and that XMLConfiguration will validate the file using the schema.
*/
@Test
- public void testSchemaResolver() {
+ void testSchemaResolver() {
assertDoesNotThrow(() -> load(REWRITE_SCHEMA_FILE));
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestCombinedConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestCombinedConfiguration.java
index 325f9a6e..4577b82a 100644
--- a/src/test/java/org/apache/commons/configuration2/TestCombinedConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestCombinedConfiguration.java
@@ -347,7 +347,7 @@ public class TestCombinedConfiguration {
* Tests accessing properties if no configurations have been added.
*/
@Test
- public void testAccessPropertyEmpty() {
+ void testAccessPropertyEmpty() {
assertFalse(config.containsKey(TEST_KEY));
assertNull(config.getString("test.comment"));
assertTrue(config.isEmpty());
@@ -357,7 +357,7 @@ public class TestCombinedConfiguration {
* Tests accessing properties if multiple configurations have been added.
*/
@Test
- public void testAccessPropertyMulti() {
+ void testAccessPropertyMulti() {
config.addConfiguration(setUpTestConfiguration());
config.addConfiguration(setUpTestConfiguration(), null, "prefix1");
config.addConfiguration(setUpTestConfiguration(), null, "prefix2");
@@ -372,7 +372,7 @@ public class TestCombinedConfiguration {
* Tests adding a configuration (without further information).
*/
@Test
- public void testAddConfiguration() {
+ void testAddConfiguration() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c);
checkAddConfig(c);
@@ -387,7 +387,7 @@ public class TestCombinedConfiguration {
* Tests adding a configuration and specifying an at position.
*/
@Test
- public void testAddConfigurationAt() {
+ void testAddConfigurationAt() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c, null, "my");
checkAddConfig(c);
@@ -398,7 +398,7 @@ public class TestCombinedConfiguration {
* Tests adding a configuration with a complex at position. Here the at path contains a dot, which must be escaped.
*/
@Test
- public void testAddConfigurationComplexAt() {
+ void testAddConfigurationComplexAt() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c, null, "This..is.a.complex");
checkAddConfig(c);
@@ -409,7 +409,7 @@ public class TestCombinedConfiguration {
* Tests whether adding a new configuration is synchronized.
*/
@Test
- public void testAddConfigurationSynchronized() {
+ void testAddConfigurationSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
config.addConfiguration(new BaseHierarchicalConfiguration());
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
@@ -420,7 +420,7 @@ public class TestCombinedConfiguration {
* Tests adding a configuration with a name.
*/
@Test
- public void testAddConfigurationWithName() {
+ void testAddConfigurationWithName() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c, TEST_NAME);
checkAddConfig(c);
@@ -438,7 +438,7 @@ public class TestCombinedConfiguration {
* Tests adding a configuration with a name when this name already exists. This should cause an exception.
*/
@Test
- public void testAddConfigurationWithNameTwice() {
+ void testAddConfigurationWithNameTwice() {
config.addConfiguration(setUpTestConfiguration(), TEST_NAME);
final Configuration configuration = setUpTestConfiguration();
assertThrows(ConfigurationRuntimeException.class, () -> config.addConfiguration(configuration, TEST_NAME, "prefix"));
@@ -448,7 +448,7 @@ public class TestCombinedConfiguration {
* Tests adding a null configuration. This should cause an exception to be thrown.
*/
@Test
- public void testAddNullConfiguration() {
+ void testAddNullConfiguration() {
assertThrows(IllegalArgumentException.class, () -> config.addConfiguration(null));
}
@@ -456,7 +456,7 @@ public class TestCombinedConfiguration {
* Tests clearing a combined configuration. This should remove all contained configurations.
*/
@Test
- public void testClear() {
+ void testClear() {
config.addConfiguration(setUpTestConfiguration(), TEST_NAME, "test");
config.addConfiguration(setUpTestConfiguration());
@@ -473,7 +473,7 @@ public class TestCombinedConfiguration {
* operation. This test is related to CONFIGURATION-572.
*/
@Test
- public void testClearRemoveChildListener() {
+ void testClearRemoveChildListener() {
final AbstractConfiguration child = setUpTestConfiguration();
config.addConfiguration(child);
@@ -487,7 +487,7 @@ public class TestCombinedConfiguration {
* Tests cloning a combined configuration.
*/
@Test
- public void testClone() {
+ void testClone() {
config.addConfiguration(setUpTestConfiguration());
config.addConfiguration(setUpTestConfiguration(), TEST_NAME, "conf2");
config.addConfiguration(new PropertiesConfiguration(), "props");
@@ -513,7 +513,7 @@ public class TestCombinedConfiguration {
* Tests if the cloned configuration is decoupled from the original.
*/
@Test
- public void testCloneModify() {
+ void testCloneModify() {
config.addConfiguration(setUpTestConfiguration(), TEST_NAME);
final CombinedConfiguration cc2 = (CombinedConfiguration) config.clone();
assertTrue(cc2.getConfigurationNames().contains(TEST_NAME));
@@ -525,7 +525,7 @@ public class TestCombinedConfiguration {
* Tests whether cloning of a configuration is correctly synchronized.
*/
@Test
- public void testCloneSynchronized() {
+ void testCloneSynchronized() {
setUpSourceTest();
config.lock(LockMode.READ); // Causes the root node to be constructed
config.unlock(LockMode.READ);
@@ -542,7 +542,7 @@ public class TestCombinedConfiguration {
* CONFIGURATION-445.
*/
@Test
- public void testCombinedCopyToXML() throws ConfigurationException {
+ void testCombinedCopyToXML() throws ConfigurationException {
final XMLConfiguration x1 = new XMLConfiguration();
x1.addProperty("key1", "value1");
x1.addProperty("key1[@override]", "USER1");
@@ -571,7 +571,7 @@ public class TestCombinedConfiguration {
* writer thread. It is checked that no inconsistencies occur.
*/
@Test
- public void testConcurrentAccess() throws ConfigurationException, InterruptedException {
+ void testConcurrentAccess() throws ConfigurationException, InterruptedException {
// populate the test combined configuration
setUpSourceTest();
final XMLConfiguration xmlConf = new XMLConfiguration();
@@ -619,7 +619,7 @@ public class TestCombinedConfiguration {
* Tests whether sub configurations can be created from a key.
*/
@Test
- public void testConfigurationsAt() {
+ void testConfigurationsAt() {
checkConfigurationsAt(false);
}
@@ -627,7 +627,7 @@ public class TestCombinedConfiguration {
* Tests whether sub configurations can be created which are attached.
*/
@Test
- public void testConfigurationsAtWithUpdates() {
+ void testConfigurationsAtWithUpdates() {
checkConfigurationsAt(true);
}
@@ -636,7 +636,7 @@ public class TestCombinedConfiguration {
* CONFIGURATION-336.
*/
@Test
- public void testConversionExpressionEngine() {
+ void testConversionExpressionEngine() {
final PropertiesConfiguration child = new PropertiesConfiguration();
child.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
child.addProperty("test(a)", "1,2,3");
@@ -656,7 +656,7 @@ public class TestCombinedConfiguration {
* Tests whether escaped list delimiters are treated correctly.
*/
@Test
- public void testEscapeListDelimiters() {
+ void testEscapeListDelimiters() {
final PropertiesConfiguration sub = new PropertiesConfiguration();
sub.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
sub.addProperty("test.pi", "3\\,1415");
@@ -668,7 +668,7 @@ public class TestCombinedConfiguration {
* Tests whether access to a configuration by index is correctly synchronized.
*/
@Test
- public void testGetConfigurationByIdxSynchronized() {
+ void testGetConfigurationByIdxSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertNotNull(config.getConfiguration(0));
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -679,7 +679,7 @@ public class TestCombinedConfiguration {
* Tests whether access to a configuration by name is correctly synchronized.
*/
@Test
- public void testGetConfigurationByNameSynchronized() {
+ void testGetConfigurationByNameSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertNotNull(config.getConfiguration(CHILD1));
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -687,7 +687,7 @@ public class TestCombinedConfiguration {
}
@Test
- public void testGetConfigurationNameList() throws Exception {
+ void testGetConfigurationNameList() throws Exception {
config.addConfiguration(setUpTestConfiguration());
config.addConfiguration(setUpTestConfiguration(), TEST_NAME, "conf2");
final AbstractConfiguration pc = new PropertiesConfiguration();
@@ -704,7 +704,7 @@ public class TestCombinedConfiguration {
* Tests whether querying the name list of child configurations is synchronized.
*/
@Test
- public void testGetConfigurationNameListSynchronized() {
+ void testGetConfigurationNameListSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertFalse(config.getConfigurationNameList().isEmpty());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -715,7 +715,7 @@ public class TestCombinedConfiguration {
* Tests whether querying the name set of child configurations is synchronized.
*/
@Test
- public void testGetConfigurationNamesSynchronized() {
+ void testGetConfigurationNamesSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertFalse(config.getConfigurationNames().isEmpty());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -723,7 +723,7 @@ public class TestCombinedConfiguration {
}
@Test
- public void testGetConfigurations() throws Exception {
+ void testGetConfigurations() throws Exception {
config.addConfiguration(setUpTestConfiguration());
config.addConfiguration(setUpTestConfiguration(), TEST_NAME, "conf2");
final AbstractConfiguration pc = new PropertiesConfiguration();
@@ -739,7 +739,7 @@ public class TestCombinedConfiguration {
* Tests whether querying the list of child configurations is synchronized.
*/
@Test
- public void testGetConfigurationsSynchronized() {
+ void testGetConfigurationsSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertFalse(config.getConfigurations().isEmpty());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -750,7 +750,7 @@ public class TestCombinedConfiguration {
* Tests whether read access to the conversion expression engine is synchronized.
*/
@Test
- public void testGetConversionExpressionEngineSynchronized() {
+ void testGetConversionExpressionEngineSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertNull(config.getConversionExpressionEngine());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -761,7 +761,7 @@ public class TestCombinedConfiguration {
* Tests CONFIGURATION-799.
*/
@Test
- public void testGetKeys() {
+ void testGetKeys() {
// Set up
final BaseConfiguration conf1 = new BaseConfiguration();
final String key = "x1";
@@ -782,7 +782,7 @@ public class TestCombinedConfiguration {
* Tests whether getNodeCombiner() is correctly synchronized.
*/
@Test
- public void testGetNodeCombinerSynchronized() {
+ void testGetNodeCombinerSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertNotNull(config.getNodeCombiner());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -793,7 +793,7 @@ public class TestCombinedConfiguration {
* Tests whether querying the number of child configurations is synchronized.
*/
@Test
- public void testGetNumberOfConfigurationsSynchronized() {
+ void testGetNumberOfConfigurationsSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertEquals(2, config.getNumberOfConfigurations());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -804,7 +804,7 @@ public class TestCombinedConfiguration {
* Tests the getSource() method when the passed in key belongs to the combined configuration itself.
*/
@Test
- public void testGetSourceCombined() {
+ void testGetSourceCombined() {
setUpSourceTest();
final String key = "yet.another.key";
config.addProperty(key, Boolean.TRUE);
@@ -815,7 +815,7 @@ public class TestCombinedConfiguration {
* Tests the gestSource() method when the source property is defined in a hierarchical configuration.
*/
@Test
- public void testGetSourceHierarchical() {
+ void testGetSourceHierarchical() {
setUpSourceTest();
assertEquals(config.getConfiguration(CHILD1), config.getSource(TEST_KEY));
}
@@ -825,7 +825,7 @@ public class TestCombinedConfiguration {
* source configuration.
*/
@Test
- public void testGetSourceMulti() {
+ void testGetSourceMulti() {
setUpSourceTest();
final String key = "list.key";
config.getConfiguration(CHILD1).addProperty(key, "1,2,3");
@@ -837,7 +837,7 @@ public class TestCombinedConfiguration {
* should cause an exception.
*/
@Test
- public void testGetSourceMultiSources() {
+ void testGetSourceMultiSources() {
setUpSourceTest();
final String key = "list.key";
config.getConfiguration(CHILD1).addProperty(key, "1,2,3");
@@ -849,7 +849,7 @@ public class TestCombinedConfiguration {
* Tests whether the source configuration can be detected for non hierarchical configurations.
*/
@Test
- public void testGetSourceNonHierarchical() {
+ void testGetSourceNonHierarchical() {
setUpSourceTest();
assertEquals(config.getConfiguration(CHILD2), config.getSource("another.key"));
}
@@ -858,7 +858,7 @@ public class TestCombinedConfiguration {
* Tests the getSource() method when a null key is passed in. This should cause an exception.
*/
@Test
- public void testGetSourceNull() {
+ void testGetSourceNull() {
assertThrows(IllegalArgumentException.class, () -> config.getSource(null));
}
@@ -866,7 +866,7 @@ public class TestCombinedConfiguration {
* Tests whether multiple sources of a key can be retrieved.
*/
@Test
- public void testGetSourcesMultiSources() {
+ void testGetSourcesMultiSources() {
setUpSourceTest();
final String key = "list.key";
config.getConfiguration(CHILD1).addProperty(key, "1,2,3");
@@ -881,7 +881,7 @@ public class TestCombinedConfiguration {
* Tests getSources() for a non existing key.
*/
@Test
- public void testGetSourcesUnknownKey() {
+ void testGetSourcesUnknownKey() {
setUpSourceTest();
assertTrue(config.getSources("non.existing,key").isEmpty());
}
@@ -890,7 +890,7 @@ public class TestCombinedConfiguration {
* Tests whether getSource() is correctly synchronized.
*/
@Test
- public void testGetSourceSynchronized() {
+ void testGetSourceSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
assertNotNull(config.getSource(TEST_KEY));
sync.verifyStart(Methods.BEGIN_READ);
@@ -901,7 +901,7 @@ public class TestCombinedConfiguration {
* Tests the getSource() method when the passed in key is not contained. Result should be null in this case.
*/
@Test
- public void testGetSourceUnknown() {
+ void testGetSourceUnknown() {
setUpSourceTest();
assertNull(config.getSource("an.unknown.key"));
}
@@ -910,7 +910,7 @@ public class TestCombinedConfiguration {
* Tests getSource() if a child configuration is again a combined configuration.
*/
@Test
- public void testGetSourceWithCombinedChildConfiguration() {
+ void testGetSourceWithCombinedChildConfiguration() {
setUpSourceTest();
final CombinedConfiguration cc = new CombinedConfiguration();
cc.addConfiguration(config);
@@ -921,7 +921,7 @@ public class TestCombinedConfiguration {
* Tests accessing a newly created combined configuration.
*/
@Test
- public void testInit() {
+ void testInit() {
assertEquals(0, config.getNumberOfConfigurations());
assertTrue(config.getConfigurationNames().isEmpty());
assertInstanceOf(UnionCombiner.class, config.getNodeCombiner());
@@ -932,7 +932,7 @@ public class TestCombinedConfiguration {
* Tests whether only a single invalidate event is fired for a change. This test is related to CONFIGURATION-315.
*/
@Test
- public void testInvalidateEventBeforeAndAfterChange() {
+ void testInvalidateEventBeforeAndAfterChange() {
ConfigurationEvent event = new ConfigurationEvent(config, ConfigurationEvent.ANY, null, null, true);
config.onEvent(event);
assertEquals(1, listener.invalidateEvents);
@@ -945,7 +945,7 @@ public class TestCombinedConfiguration {
* Tests whether invalidate() performs correct synchronization.
*/
@Test
- public void testInvalidateSynchronized() {
+ void testInvalidateSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
config.invalidate();
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
@@ -955,7 +955,7 @@ public class TestCombinedConfiguration {
* Tests whether requested locks are freed correctly if an exception occurs while constructing the root node.
*/
@Test
- public void testLockHandlingWithExceptionWhenConstructingRootNode() {
+ void testLockHandlingWithExceptionWhenConstructingRootNode() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
final RuntimeException testEx = new ConfigurationRuntimeException("Test exception");
final BaseHierarchicalConfiguration childEx = new BaseHierarchicalConfiguration() {
@@ -975,7 +975,7 @@ public class TestCombinedConfiguration {
* Tests removing a configuration.
*/
@Test
- public void testRemoveConfiguration() {
+ void testRemoveConfiguration() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c);
checkAddConfig(c);
@@ -987,7 +987,7 @@ public class TestCombinedConfiguration {
* Tests removing a configuration by index.
*/
@Test
- public void testRemoveConfigurationAt() {
+ void testRemoveConfigurationAt() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c);
assertSame(c, config.removeConfigurationAt(0));
@@ -998,7 +998,7 @@ public class TestCombinedConfiguration {
* Tests removing a configuration by name.
*/
@Test
- public void testRemoveConfigurationByName() {
+ void testRemoveConfigurationByName() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c, TEST_NAME);
assertSame(c, config.removeConfiguration(TEST_NAME));
@@ -1009,7 +1009,7 @@ public class TestCombinedConfiguration {
* Tests removing a configuration by name, which is not contained.
*/
@Test
- public void testRemoveConfigurationByUnknownName() {
+ void testRemoveConfigurationByUnknownName() {
assertNull(config.removeConfiguration("unknownName"));
listener.checkEvent(0, 0);
}
@@ -1018,7 +1018,7 @@ public class TestCombinedConfiguration {
* Tests removing a configuration with a name.
*/
@Test
- public void testRemoveNamedConfiguration() {
+ void testRemoveNamedConfiguration() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c, TEST_NAME);
config.removeConfiguration(c);
@@ -1029,7 +1029,7 @@ public class TestCombinedConfiguration {
* Tests removing a named configuration by index.
*/
@Test
- public void testRemoveNamedConfigurationAt() {
+ void testRemoveNamedConfigurationAt() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c, TEST_NAME);
assertSame(c, config.removeConfigurationAt(0));
@@ -1040,7 +1040,7 @@ public class TestCombinedConfiguration {
* Tests removing a configuration that was not added prior.
*/
@Test
- public void testRemoveNonContainedConfiguration() {
+ void testRemoveNonContainedConfiguration() {
assertFalse(config.removeConfiguration(setUpTestConfiguration()));
listener.checkEvent(0, 0);
}
@@ -1049,7 +1049,7 @@ public class TestCombinedConfiguration {
* Tests whether write access to the conversion expression engine is synchronized.
*/
@Test
- public void testSetConversionExpressionEngineSynchronized() {
+ void testSetConversionExpressionEngineSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
config.setConversionExpressionEngine(new DefaultExpressionEngine(DefaultExpressionEngineSymbols.DEFAULT_SYMBOLS));
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
@@ -1060,7 +1060,7 @@ public class TestCombinedConfiguration {
* Tests if setting a node combiner causes an invalidation.
*/
@Test
- public void testSetNodeCombiner() {
+ void testSetNodeCombiner() {
final NodeCombiner combiner = new UnionCombiner();
config.setNodeCombiner(combiner);
assertSame(combiner, config.getNodeCombiner());
@@ -1071,7 +1071,7 @@ public class TestCombinedConfiguration {
* Tests whether setNodeCombiner() is correctly synchronized.
*/
@Test
- public void testSetNodeCombinerSynchronized() {
+ void testSetNodeCombinerSynchronized() {
final SynchronizerTestImpl sync = setUpSynchronizerTest();
config.setNodeCombiner(new UnionCombiner());
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
@@ -1082,7 +1082,7 @@ public class TestCombinedConfiguration {
* Tests setting a null node combiner. This should cause an exception.
*/
@Test
- public void testSetNullNodeCombiner() {
+ void testSetNullNodeCombiner() {
assertThrows(IllegalArgumentException.class, () -> config.setNodeCombiner(null));
}
@@ -1090,7 +1090,7 @@ public class TestCombinedConfiguration {
* Tests whether a sub configuration survives updates of its parent.
*/
@Test
- public void testSubConfigurationWithUpdates() {
+ void testSubConfigurationWithUpdates() {
final AbstractConfiguration srcConfig = setUpSubConfigTest();
final HierarchicalConfiguration<ImmutableNode> sub = config.configurationAt(SUB_KEY, true);
assertTrue(sub.getBoolean(TEST_KEY));
@@ -1103,7 +1103,7 @@ public class TestCombinedConfiguration {
* Tests if an update of a contained configuration leeds to an invalidation of the combined configuration.
*/
@Test
- public void testUpdateContainedConfiguration() {
+ void testUpdateContainedConfiguration() {
final AbstractConfiguration c = setUpTestConfiguration();
config.addConfiguration(c);
c.addProperty("test.otherTest", "yes");
diff --git a/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java
index fd0905f6..79cc0652 100644
--- a/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java
@@ -142,14 +142,14 @@ public class TestCompositeConfiguration {
* Tests whether adding a child configuration is synchronized.
*/
@Test
- public void testAddConfigurationSynchronized() {
+ void testAddConfigurationSynchronized() {
final SynchronizerTestImpl sync = installSynchronizer();
cc.addConfiguration(xmlConf);
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
}
@Test
- public void testAddFirstRemoveConfigurations() throws Exception {
+ void testAddFirstRemoveConfigurations() throws Exception {
cc.addConfigurationFirst(conf1);
assertEquals(2, cc.getNumberOfConfigurations());
cc.addConfigurationFirst(conf1);
@@ -167,7 +167,7 @@ public class TestCompositeConfiguration {
* sequence
*/
@Test
- public void testAddingProperty() throws Exception {
+ void testAddingProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -183,7 +183,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testAddRemoveConfigurations() throws Exception {
+ void testAddRemoveConfigurations() throws Exception {
cc.addConfiguration(conf1);
assertEquals(2, cc.getNumberOfConfigurations());
cc.addConfiguration(conf1);
@@ -197,7 +197,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testCantRemoveMemoryConfig() throws Exception {
+ void testCantRemoveMemoryConfig() throws Exception {
cc.clear();
assertEquals(1, cc.getNumberOfConfigurations());
@@ -208,7 +208,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testCheckingInMemoryConfiguration() throws Exception {
+ void testCheckingInMemoryConfiguration() throws Exception {
final String testKey = "testKey";
final Configuration defaults = new PropertiesConfiguration();
defaults.setProperty(testKey, "testValue");
@@ -235,7 +235,7 @@ public class TestCompositeConfiguration {
* Tests setting values. These are set in memory mode only!
*/
@Test
- public void testClearingProperty() throws Exception {
+ void testClearingProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
cc.clearProperty("test.short");
@@ -243,7 +243,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testClone() {
+ void testClone() {
final CompositeConfiguration cc2 = (CompositeConfiguration) cc.clone();
assertEquals(cc.getNumberOfConfigurations(), cc2.getNumberOfConfigurations());
@@ -261,7 +261,7 @@ public class TestCompositeConfiguration {
* Ensures that event listeners are not cloned.
*/
@Test
- public void testCloneEventListener() {
+ void testCloneEventListener() {
cc.addEventListener(ConfigurationEvent.ANY, new EventListenerTestImpl(null));
final CompositeConfiguration cc2 = (CompositeConfiguration) cc.clone();
assertTrue(cc2.getEventListeners(ConfigurationEvent.ANY).isEmpty());
@@ -271,7 +271,7 @@ public class TestCompositeConfiguration {
* Tests whether interpolation works as expected after cloning.
*/
@Test
- public void testCloneInterpolation() {
+ void testCloneInterpolation() {
final CompositeConfiguration cc2 = (CompositeConfiguration) cc.clone();
assertNotSame(cc.getInterpolator(), cc2.getInterpolator());
}
@@ -280,7 +280,7 @@ public class TestCompositeConfiguration {
* Tests cloning if one of the contained configurations does not support this operation. This should cause an exception.
*/
@Test
- public void testCloneNotSupported() {
+ void testCloneNotSupported() {
cc.addConfiguration(new NonCloneableConfiguration());
assertThrows(ConfigurationRuntimeException.class, cc::clone);
}
@@ -289,7 +289,7 @@ public class TestCompositeConfiguration {
* Tests getting a default when the key doesn't exist
*/
@Test
- public void testDefaultValueWhenKeyMissing() throws Exception {
+ void testDefaultValueWhenKeyMissing() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals("default", cc.getString("bogus", "default"));
@@ -301,7 +301,7 @@ public class TestCompositeConfiguration {
* Tests whether add property events are triggered.
*/
@Test
- public void testEventAddProperty() {
+ void testEventAddProperty() {
final EventListenerTestImpl listener = new EventListenerTestImpl(cc);
cc.addEventListener(ConfigurationEvent.ANY, listener);
cc.addProperty("test", "value");
@@ -314,7 +314,7 @@ public class TestCompositeConfiguration {
* Tests whether clear property events are triggered.
*/
@Test
- public void testEventClearProperty() {
+ void testEventClearProperty() {
cc.addConfiguration(conf1);
final String key = "configuration.loaded";
assertTrue(cc.getBoolean(key));
@@ -331,7 +331,7 @@ public class TestCompositeConfiguration {
* Tests whether set property events are triggered.
*/
@Test
- public void testEventSetProperty() {
+ void testEventSetProperty() {
final EventListenerTestImpl listener = new EventListenerTestImpl(cc);
cc.addEventListener(ConfigurationEvent.ANY, listener);
cc.setProperty("test", "value");
@@ -344,7 +344,7 @@ public class TestCompositeConfiguration {
* Tests whether access to a configuration by index is synchronized.
*/
@Test
- public void testGetConfigurationSynchronized() {
+ void testGetConfigurationSynchronized() {
final SynchronizerTestImpl sync = installSynchronizer();
assertEquals(conf1, cc.getConfiguration(0));
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -354,7 +354,7 @@ public class TestCompositeConfiguration {
* Tests whether access to the in-memory configuration is synchronized.
*/
@Test
- public void testGetInMemoryConfigurationSynchronized() {
+ void testGetInMemoryConfigurationSynchronized() {
final SynchronizerTestImpl sync = installSynchronizer();
cc.getInMemoryConfiguration();
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
@@ -364,7 +364,7 @@ public class TestCompositeConfiguration {
* Tests {@code getKeys(String key)} preserves the order
*/
@Test
- public void testGetKeys2PreservesOrder() throws Exception {
+ void testGetKeys2PreservesOrder() throws Exception {
cc.addConfiguration(conf1);
final List<String> orderedList = new ArrayList<>();
for (final Iterator<String> keys = conf1.getKeys("test"); keys.hasNext();) {
@@ -381,7 +381,7 @@ public class TestCompositeConfiguration {
* Tests {@code getKeys} preserves the order
*/
@Test
- public void testGetKeysPreservesOrder() throws Exception {
+ void testGetKeysPreservesOrder() throws Exception {
cc.addConfiguration(conf1);
final List<String> orderedList = new ArrayList<>();
for (final Iterator<String> keys = conf1.getKeys(); keys.hasNext();) {
@@ -395,7 +395,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testGetList() {
+ void testGetList() {
final Configuration conf1 = new BaseConfiguration();
conf1.addProperty("array", "value1");
conf1.addProperty("array", "value2");
@@ -423,7 +423,7 @@ public class TestCompositeConfiguration {
* Tests querying a list when a tricky interpolation is involved. This is related to CONFIGURATION-339.
*/
@Test
- public void testGetListWithInterpolation() {
+ void testGetListWithInterpolation() {
prepareInterpolationTest();
final List<Object> lst = cc.getList("bar");
assertEquals(Arrays.asList("override"), lst);
@@ -433,14 +433,14 @@ public class TestCompositeConfiguration {
* Tests whether querying the number of child configurations is synchronized.
*/
@Test
- public void testGetNumberOfConfigurationsSynchronized() {
+ void testGetNumberOfConfigurationsSynchronized() {
final SynchronizerTestImpl sync = installSynchronizer();
assertEquals(3, cc.getNumberOfConfigurations());
sync.verify(Methods.BEGIN_READ, Methods.END_READ);
}
@Test
- public void testGetProperty() throws Exception {
+ void testGetProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(conf2);
assertEquals("test.properties", cc.getString("propertyInOrder"));
@@ -458,7 +458,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testGetPropertyMissing() throws Exception {
+ void testGetPropertyMissing() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(conf2);
final NoSuchElementException nsee = assertThrows(NoSuchElementException.class, () -> cc.getString("bogus.property"));
@@ -469,7 +469,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testGetPropertyWIncludes() throws Exception {
+ void testGetPropertyWIncludes() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(conf2);
final List<Object> l = cc.getList("packages");
@@ -480,7 +480,7 @@ public class TestCompositeConfiguration {
* Tests the getSource() method for a property contained in the in memory configuration.
*/
@Test
- public void testGetSourceInMemory() {
+ void testGetSourceInMemory() {
setUpSourceTest();
cc.addProperty(TEST_PROPERTY, Boolean.TRUE);
assertSame(cc.getInMemoryConfiguration(), cc.getSource(TEST_PROPERTY));
@@ -491,7 +491,7 @@ public class TestCompositeConfiguration {
* should be thrown.
*/
@Test
- public void testGetSourceMultiple() {
+ void testGetSourceMultiple() {
setUpSourceTest();
conf1.addProperty(TEST_PROPERTY, Boolean.TRUE);
cc.addProperty(TEST_PROPERTY, "a value");
@@ -502,7 +502,7 @@ public class TestCompositeConfiguration {
* Tests the getSource() method for a null key. This should cause an exception.
*/
@Test
- public void testGetSourceNull() {
+ void testGetSourceNull() {
assertThrows(IllegalArgumentException.class, () -> cc.getSource(null));
}
@@ -510,7 +510,7 @@ public class TestCompositeConfiguration {
* Tests the getSource() method if the property is defined in a single child configuration.
*/
@Test
- public void testGetSourceSingle() {
+ void testGetSourceSingle() {
setUpSourceTest();
conf1.addProperty(TEST_PROPERTY, Boolean.TRUE);
assertSame(conf1, cc.getSource(TEST_PROPERTY));
@@ -520,7 +520,7 @@ public class TestCompositeConfiguration {
* Tests the getSource() method for an unknown property key.
*/
@Test
- public void testGetSourceUnknown() {
+ void testGetSourceUnknown() {
setUpSourceTest();
assertNull(cc.getSource(TEST_PROPERTY));
}
@@ -529,14 +529,14 @@ public class TestCompositeConfiguration {
* Tests querying a string array when a tricky interpolation is involved.
*/
@Test
- public void testGetStringArrayWithInterpolation() {
+ void testGetStringArrayWithInterpolation() {
prepareInterpolationTest();
final String[] values = cc.getStringArray("bar");
assertArrayEquals(new String[] {"override"}, values);
}
@Test
- public void testGetStringWithDefaults() {
+ void testGetStringWithDefaults() {
final BaseConfiguration defaults = new BaseConfiguration();
defaults.addProperty("default", "default string");
@@ -555,7 +555,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testGettingConfiguration() throws Exception {
+ void testGettingConfiguration() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals(PropertiesConfiguration.class, cc.getConfiguration(0).getClass());
@@ -566,7 +566,7 @@ public class TestCompositeConfiguration {
* Tests retrieving subsets of configurations
*/
@Test
- public void testGettingSubset() throws Exception {
+ void testGettingSubset() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -581,7 +581,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testInstanciateWithCollection() {
+ void testInstanciateWithCollection() {
final Collection<Configuration> configs = new ArrayList<>();
configs.add(xmlConf);
configs.add(conf1);
@@ -597,7 +597,7 @@ public class TestCompositeConfiguration {
* CONFIGURATION-632.
*/
@Test
- public void testInterpolationArrayReference() {
+ void testInterpolationArrayReference() {
final Configuration props = new PropertiesConfiguration();
final String[] values = {"a", "property", "with", "multiple", "values"};
props.addProperty("keyMultiValues", values);
@@ -610,7 +610,7 @@ public class TestCompositeConfiguration {
* Tests whether interpolation works if multiple configurations are involved. This test is related to CONFIGURATION-441.
*/
@Test
- public void testInterpolationInMultipleConfigs() {
+ void testInterpolationInMultipleConfigs() {
final Configuration c1 = new PropertiesConfiguration();
c1.addProperty("property.one", "one");
c1.addProperty("property.two", "two");
@@ -625,7 +625,7 @@ public class TestCompositeConfiguration {
* Tests {@code List} parsing.
*/
@Test
- public void testList() throws Exception {
+ void testList() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -647,7 +647,7 @@ public class TestCompositeConfiguration {
* Tests whether global interpolation works with lists.
*/
@Test
- public void testListInterpolation() {
+ void testListInterpolation() {
final PropertiesConfiguration c1 = new PropertiesConfiguration();
c1.addProperty("c1.value", "test1");
c1.addProperty("c1.value", "${c2.value}");
@@ -663,7 +663,7 @@ public class TestCompositeConfiguration {
* Tests {@code List} parsing.
*/
@Test
- public void testMultipleTypesOfConfigs() throws Exception {
+ void testMultipleTypesOfConfigs() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals(1, cc.getInt("test.short"));
@@ -675,7 +675,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testPropertyExistsInOnlyOneConfig() throws Exception {
+ void testPropertyExistsInOnlyOneConfig() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals("value", cc.getString("element"));
@@ -685,7 +685,7 @@ public class TestCompositeConfiguration {
* Tests whether removing a child configuration is synchronized.
*/
@Test
- public void testRemoveConfigurationSynchronized() {
+ void testRemoveConfigurationSynchronized() {
final SynchronizerTestImpl sync = installSynchronizer();
cc.removeConfiguration(conf1);
sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
@@ -695,7 +695,7 @@ public class TestCompositeConfiguration {
* Tests whether the in-memory configuration can be replaced by a new child configuration.
*/
@Test
- public void testReplaceInMemoryConfig() {
+ void testReplaceInMemoryConfig() {
conf1.setProperty(TEST_PROPERTY, "conf1");
conf2.setProperty(TEST_PROPERTY, "conf2");
cc.addConfiguration(conf1, true);
@@ -711,7 +711,7 @@ public class TestCompositeConfiguration {
* Tests changing the list delimiter handler.
*/
@Test
- public void testSetListDelimiter() {
+ void testSetListDelimiter() {
cc.setListDelimiterHandler(new DefaultListDelimiterHandler('/'));
checkSetListDelimiterHandler();
}
@@ -720,7 +720,7 @@ public class TestCompositeConfiguration {
* Tests whether the correct list delimiter handler is set after a clear operation.
*/
@Test
- public void testSetListDelimiterAfterClear() {
+ void testSetListDelimiterAfterClear() {
cc.setListDelimiterHandler(new DefaultListDelimiterHandler('/'));
cc.clear();
checkSetListDelimiterHandler();
@@ -731,7 +731,7 @@ public class TestCompositeConfiguration {
* This test is related to CONFIGURATION-476.
*/
@Test
- public void testSetListDelimiterInMemoryConfigNonBaseConfig() {
+ void testSetListDelimiterInMemoryConfigNonBaseConfig() {
final Configuration inMemoryConfig = mock(Configuration.class);
cc = new CompositeConfiguration(inMemoryConfig);
assertDoesNotThrow(() -> cc.setListDelimiterHandler(new DefaultListDelimiterHandler(';')));
@@ -741,7 +741,7 @@ public class TestCompositeConfiguration {
* Tests setting values. These are set in memory mode only!
*/
@Test
- public void testSettingMissingProperty() throws Exception {
+ void testSettingMissingProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
cc.setProperty("my.new.property", "supernew");
@@ -752,7 +752,7 @@ public class TestCompositeConfiguration {
* Tests {@code String} array parsing.
*/
@Test
- public void testStringArray() throws Exception {
+ void testStringArray() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -766,7 +766,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testStringArrayInterpolation() {
+ void testStringArrayInterpolation() {
final CompositeConfiguration config = new CompositeConfiguration();
config.addProperty("base", "foo");
config.addProperty("list", "${base}.bar1");
@@ -781,7 +781,7 @@ public class TestCompositeConfiguration {
* Tests subsets and still can resolve elements
*/
@Test
- public void testSubsetCanResolve() throws Exception {
+ void testSubsetCanResolve() throws Exception {
cc = new CompositeConfiguration();
final BaseConfiguration config = new BaseConfiguration();
config.addProperty("subset.tempfile", "${java.io.tmpdir}/file.tmp");
@@ -793,7 +793,7 @@ public class TestCompositeConfiguration {
}
@Test
- public void testThrowExceptionOnMissing() {
+ void testThrowExceptionOnMissing() {
assertTrue(cc.isThrowExceptionOnMissing());
}
@@ -802,7 +802,7 @@ public class TestCompositeConfiguration {
* related to CONFIGURATION-471.
*/
@Test
- public void testUseChildConfigAsInMemoryConfig() {
+ void testUseChildConfigAsInMemoryConfig() {
conf1.setProperty(TEST_PROPERTY, "conf1");
conf2.setProperty(TEST_PROPERTY, "conf2");
cc.addConfiguration(conf1, true);
diff --git a/src/test/java/org/apache/commons/configuration2/TestConfigurationConverter.java b/src/test/java/org/apache/commons/configuration2/TestConfigurationConverter.java
index 8931678f..4179883d 100644
--- a/src/test/java/org/apache/commons/configuration2/TestConfigurationConverter.java
+++ b/src/test/java/org/apache/commons/configuration2/TestConfigurationConverter.java
@@ -51,7 +51,7 @@ public class TestConfigurationConverter {
}
@Test
- public void testConfigurationToMap() {
+ void testConfigurationToMap() {
final Configuration config = new BaseConfiguration();
config.addProperty("string", "teststring");
@@ -65,7 +65,7 @@ public class TestConfigurationConverter {
* Tests a conversion to Properties if the default list delimiter handler is used (which does not support list joining).
*/
@Test
- public void testConfigurationToPropertiesDefaultListHandling() {
+ void testConfigurationToPropertiesDefaultListHandling() {
final BaseConfiguration config = createTestConfiguration();
final Properties props = ConfigurationConverter.getProperties(config);
@@ -80,7 +80,7 @@ public class TestConfigurationConverter {
* Tests a conversion to Properties if the list delimiter handler supports list joining.
*/
@Test
- public void testConfigurationToPropertiesListDelimiterHandler() {
+ void testConfigurationToPropertiesListDelimiterHandler() {
final BaseConfiguration config = createTestConfiguration();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
final Properties props = ConfigurationConverter.getProperties(config);
@@ -92,7 +92,7 @@ public class TestConfigurationConverter {
* properties with multiple values have to be handled in a special way.
*/
@Test
- public void testConfigurationToPropertiesNoAbstractConfiguration() {
+ void testConfigurationToPropertiesNoAbstractConfiguration() {
final Configuration src = mock(Configuration.class);
final BaseConfiguration config = createTestConfiguration();
@@ -111,7 +111,7 @@ public class TestConfigurationConverter {
* CONFIGURATION-432.
*/
@Test
- public void testConfigurationToPropertiesScalarValue() {
+ void testConfigurationToPropertiesScalarValue() {
final BaseConfiguration config = new BaseConfiguration();
config.addProperty("scalar", Integer.valueOf(42));
final Properties props = ConfigurationConverter.getProperties(config);
@@ -119,7 +119,7 @@ public class TestConfigurationConverter {
}
@Test
- public void testPropertiesToConfiguration() {
+ void testPropertiesToConfiguration() {
final Properties props = new Properties();
props.setProperty("string", "teststring");
props.setProperty("int", "123");
diff --git a/src/test/java/org/apache/commons/configuration2/TestConfigurationLookup.java b/src/test/java/org/apache/commons/configuration2/TestConfigurationLookup.java
index 3ac1af22..4c92fe2d 100644
--- a/src/test/java/org/apache/commons/configuration2/TestConfigurationLookup.java
+++ b/src/test/java/org/apache/commons/configuration2/TestConfigurationLookup.java
@@ -41,7 +41,7 @@ public class TestConfigurationLookup {
* Tries to create an instance without a configuration.
*/
@Test
- public void testInitNoConfig() {
+ void testInitNoConfig() {
assertThrows(IllegalArgumentException.class, () -> new ConfigurationLookup(null));
}
@@ -49,7 +49,7 @@ public class TestConfigurationLookup {
* Tests lookup() for a complex property value.
*/
@Test
- public void testLookupComplex() {
+ void testLookupComplex() {
final int count = 5;
final Configuration conf = new BaseConfiguration();
for (int i = 0; i < count; i++) {
@@ -69,7 +69,7 @@ public class TestConfigurationLookup {
* Tests lookup() if the variable cannot be resolved.
*/
@Test
- public void testLookupNotFound() {
+ void testLookupNotFound() {
final Configuration conf = new BaseConfiguration();
final ConfigurationLookup lookup = new ConfigurationLookup(conf);
assertNull(lookup.lookup(VAR));
@@ -79,7 +79,7 @@ public class TestConfigurationLookup {
* Tests lookup() if the variable cannot be resolved, and the configuration throws an exception.
*/
@Test
- public void testLookupNotFoundEx() {
+ void testLookupNotFoundEx() {
final BaseConfiguration conf = new BaseConfiguration();
conf.setThrowExceptionOnMissing(true);
final ConfigurationLookup lookup = new ConfigurationLookup(conf);
@@ -90,7 +90,7 @@ public class TestConfigurationLookup {
* Tests whether an existing variable can be resolved.
*/
@Test
- public void testLookupSuccess() {
+ void testLookupSuccess() {
final Configuration conf = new BaseConfiguration();
conf.addProperty(VAR, VALUE);
final ConfigurationLookup lookup = new ConfigurationLookup(conf);
diff --git a/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java b/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java
index b10c0361..b007bd62 100644
--- a/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java
+++ b/src/test/java/org/apache/commons/configuration2/TestConfigurationMap.java
@@ -61,7 +61,7 @@ public class TestConfigurationMap {
* Attempts to create a ConfigurationMap with null configuration. This should cause an exception.
*/
@Test
- public void testNullConfig() {
+ void testNullConfig() {
assertThrows(NullPointerException.class, () -> new ConfigurationMap(null));
}
@@ -69,7 +69,7 @@ public class TestConfigurationMap {
* Class under test for Object put(Object, Object)
*/
@Test
- public void testPut() {
+ void testPut() {
for (int i = 0; i < properties.length; i++) {
Object object = map.put(properties[i], values[i]);
assertNotNull(object);
diff --git a/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java b/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java
index d8686012..729bdd6b 100644
--- a/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java
+++ b/src/test/java/org/apache/commons/configuration2/TestConfigurationSet.java
@@ -63,7 +63,7 @@ public class TestConfigurationSet {
* Class under test for Iterator iterator()
*/
@Test
- public void testIterator() {
+ void testIterator() {
final Iterator<Map.Entry<Object, Object>> iterator = set.iterator();
while (iterator.hasNext()) {
final Map.Entry<Object, Object> entry = iterator.next();
@@ -81,7 +81,7 @@ public class TestConfigurationSet {
}
@Test
- public void testSize() {
+ void testSize() {
assertEquals(properties.length, set.size());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java b/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java
index 0aa2fc41..e421b3ae 100644
--- a/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java
+++ b/src/test/java/org/apache/commons/configuration2/TestConfigurationUtils.java
@@ -106,7 +106,7 @@ public class TestConfigurationUtils {
}
@Test
- public void testAppend() {
+ void testAppend() {
// create the source configuration
final Configuration conf1 = new BaseConfiguration();
conf1.addProperty("key1", "value1");
@@ -135,7 +135,7 @@ public class TestConfigurationUtils {
* Tests asEventSource() if an exception is expected.
*/
@Test
- public void testAsEventSourceNonSupportedEx() {
+ void testAsEventSourceNonSupportedEx() {
assertThrows(ConfigurationRuntimeException.class, () -> ConfigurationUtils.asEventSource(this, false));
}
@@ -143,7 +143,7 @@ public class TestConfigurationUtils {
* Tests asEventSource() if the passed in object implements this interface.
*/
@Test
- public void testAsEventSourceSupported() {
+ void testAsEventSourceSupported() {
final XMLConfiguration src = new XMLConfiguration();
assertSame(src, ConfigurationUtils.asEventSource(src, true));
}
@@ -152,7 +152,7 @@ public class TestConfigurationUtils {
* Tests asEventSource() if a mock object has to be returned.
*/
@Test
- public void testAsEventSourceUnsupportedMock() {
+ void testAsEventSourceUnsupportedMock() {
@SuppressWarnings("unchecked")
final EventListener<ConfigurationEvent> cl = mock(EventListener.class);
final EventSource source = ConfigurationUtils.asEventSource(this, true);
@@ -165,7 +165,7 @@ public class TestConfigurationUtils {
* Tests cloning a configuration that supports this operation.
*/
@Test
- public void testCloneConfiguration() {
+ void testCloneConfiguration() {
final BaseHierarchicalConfiguration conf = new BaseHierarchicalConfiguration();
conf.addProperty("test", "yes");
final BaseHierarchicalConfiguration copy = (BaseHierarchicalConfiguration) ConfigurationUtils.cloneConfiguration(conf);
@@ -177,7 +177,7 @@ public class TestConfigurationUtils {
* Tests cloning a configuration that does not support this operation. This should cause an exception.
*/
@Test
- public void testCloneConfigurationNotSupported() {
+ void testCloneConfigurationNotSupported() {
final Configuration myNonCloneableConfig = new NonCloneableConfiguration();
assertThrows(ConfigurationRuntimeException.class, () -> ConfigurationUtils.cloneConfiguration(myNonCloneableConfig));
}
@@ -186,7 +186,7 @@ public class TestConfigurationUtils {
* Tests cloning a <strong>null</strong> configuration.
*/
@Test
- public void testCloneConfigurationNull() {
+ void testCloneConfigurationNull() {
assertNull(ConfigurationUtils.cloneConfiguration(null));
}
@@ -194,7 +194,7 @@ public class TestConfigurationUtils {
* Tests whether errors are handled correctly by cloneIfPossible().
*/
@Test
- public void testCloneIfPossibleError() {
+ void testCloneIfPossibleError() {
final XMLBuilderParametersImpl params = new XMLBuilderParametersImpl() {
@Override
public XMLBuilderParametersImpl clone() {
@@ -208,7 +208,7 @@ public class TestConfigurationUtils {
* Tests cloneIfPossible() if the passed in object does not support cloning.
*/
@Test
- public void testCloneIfPossibleNotSupported() {
+ void testCloneIfPossibleNotSupported() {
final Long value = 20130116221714L;
assertSame(value, ConfigurationUtils.cloneIfPossible(value));
}
@@ -217,7 +217,7 @@ public class TestConfigurationUtils {
* Tests whether cloneIfPossible() can handle null parameters.
*/
@Test
- public void testCloneIfPossibleNull() {
+ void testCloneIfPossibleNull() {
assertNull(ConfigurationUtils.cloneIfPossible(null));
}
@@ -225,7 +225,7 @@ public class TestConfigurationUtils {
* Tests whether an object can be cloned which supports cloning.
*/
@Test
- public void testCloneIfPossibleSupported() {
+ void testCloneIfPossibleSupported() {
final XMLBuilderParametersImpl params = new XMLBuilderParametersImpl();
params.setPublicID("testID");
params.setSchemaValidation(true);
@@ -243,7 +243,7 @@ public class TestConfigurationUtils {
* Tests whether a Synchronizer can be cloned using its clone() method.
*/
@Test
- public void testCloneSynchronizerClone() {
+ void testCloneSynchronizerClone() {
final CloneableSynchronizer sync = new CloneableSynchronizer(false);
final CloneableSynchronizer sync2 = (CloneableSynchronizer) ConfigurationUtils.cloneSynchronizer(sync);
assertTrue(sync2.isCloned());
@@ -253,7 +253,7 @@ public class TestConfigurationUtils {
* Tests cloneSynchronizer() if the argument cannot be cloned.
*/
@Test
- public void testCloneSynchronizerFailed() {
+ void testCloneSynchronizerFailed() {
final NonCloneableSynchronizer synchronizer = new NonCloneableSynchronizer();
assertThrows(ConfigurationRuntimeException.class, () -> ConfigurationUtils.cloneSynchronizer(synchronizer));
}
@@ -262,7 +262,7 @@ public class TestConfigurationUtils {
* Tests whether a new Synchronizer can be created using reflection.
*/
@Test
- public void testCloneSynchronizerNewInstance() {
+ void testCloneSynchronizerNewInstance() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
final SynchronizerTestImpl sync2 = (SynchronizerTestImpl) ConfigurationUtils.cloneSynchronizer(sync);
assertNotNull(sync2);
@@ -273,7 +273,7 @@ public class TestConfigurationUtils {
* Tests whether the NoOpSyhnchronizer can be cloned.
*/
@Test
- public void testCloneSynchronizerNoOp() {
+ void testCloneSynchronizerNoOp() {
assertSame(NoOpSynchronizer.INSTANCE, ConfigurationUtils.cloneSynchronizer(NoOpSynchronizer.INSTANCE));
}
@@ -281,7 +281,7 @@ public class TestConfigurationUtils {
* Tries to clone a null Synchronizer.
*/
@Test
- public void testCloneSynchronizerNull() {
+ void testCloneSynchronizerNull() {
assertThrows(IllegalArgumentException.class, () -> ConfigurationUtils.cloneSynchronizer(null));
}
@@ -289,7 +289,7 @@ public class TestConfigurationUtils {
* Tests converting a configuration into a hierarchical one that is already hierarchical.
*/
@Test
- public void testConvertHierarchicalToHierarchical() {
+ void testConvertHierarchicalToHierarchical() {
final Configuration conf = new BaseHierarchicalConfiguration();
conf.addProperty("test", "yes");
assertSame(conf, ConfigurationUtils.convertToHierarchical(conf));
@@ -299,7 +299,7 @@ public class TestConfigurationUtils {
* Tests converting an already hierarchical configuration using an expression engine. The new engine should be set.
*/
@Test
- public void testConvertHierarchicalToHierarchicalEngine() {
+ void testConvertHierarchicalToHierarchicalEngine() {
final BaseHierarchicalConfiguration hc = new BaseHierarchicalConfiguration();
final ExpressionEngine engine = new DefaultExpressionEngine(DefaultExpressionEngineSymbols.DEFAULT_SYMBOLS);
assertSame(hc, ConfigurationUtils.convertToHierarchical(hc, engine));
@@ -311,7 +311,7 @@ public class TestConfigurationUtils {
* engine of the configuration should not be touched.
*/
@Test
- public void testConvertHierarchicalToHierarchicalNullEngine() {
+ void testConvertHierarchicalToHierarchicalNullEngine() {
final BaseHierarchicalConfiguration hc = new BaseHierarchicalConfiguration();
final ExpressionEngine engine = new DefaultExpressionEngine(DefaultExpressionEngineSymbols.DEFAULT_SYMBOLS);
hc.setExpressionEngine(engine);
@@ -323,7 +323,7 @@ public class TestConfigurationUtils {
* Tests converting a null configuration to a hierarchical one. The result should be null, too.
*/
@Test
- public void testConvertNullToHierarchical() {
+ void testConvertNullToHierarchical() {
assertNull(ConfigurationUtils.convertToHierarchical(null));
}
@@ -331,7 +331,7 @@ public class TestConfigurationUtils {
* Tests converting a configuration into a hierarchical one.
*/
@Test
- public void testConvertToHierarchical() {
+ void testConvertToHierarchical() {
final Configuration conf = new BaseConfiguration();
for (int i = 0; i < 10; i++) {
conf.addProperty("test" + i, "value" + i);
@@ -350,7 +350,7 @@ public class TestConfigurationUtils {
* characters.
*/
@Test
- public void testConvertToHierarchicalDelimiters() {
+ void testConvertToHierarchicalDelimiters() {
final BaseConfiguration conf = new BaseConfiguration();
conf.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
conf.addProperty("test.key", "1\\,2\\,3");
@@ -363,7 +363,7 @@ public class TestConfigurationUtils {
* Tests converting a configuration to a hierarchical one using a specific expression engine.
*/
@Test
- public void testConvertToHierarchicalEngine() {
+ void testConvertToHierarchicalEngine() {
final Configuration conf = new BaseConfiguration();
conf.addProperty("test(a)", Boolean.TRUE);
conf.addProperty("test(b)", Boolean.FALSE);
@@ -379,7 +379,7 @@ public class TestConfigurationUtils {
* related to CONFIGURATION-346.
*/
@Test
- public void testConvertToHierarchicalMultiValues() {
+ void testConvertToHierarchicalMultiValues() {
final BaseConfiguration config = new BaseConfiguration();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
config.addProperty("test", "1,2,3");
@@ -394,7 +394,7 @@ public class TestConfigurationUtils {
* the source configuration. This test is related to CONFIGURATION-604.
*/
@Test
- public void testConvertToHierarchicalOrderOfProperties() {
+ void testConvertToHierarchicalOrderOfProperties() {
final PropertiesConfiguration config = new PropertiesConfiguration();
config.addProperty("x.y.z", true);
config.addProperty("x.y", true);
@@ -406,7 +406,7 @@ public class TestConfigurationUtils {
}
@Test
- public void testCopy() {
+ void testCopy() {
// create the source configuration
final Configuration conf1 = new BaseConfiguration();
conf1.addProperty("key1", "value1");
@@ -428,7 +428,7 @@ public class TestConfigurationUtils {
* Tests whether runtime exceptions can be enabled.
*/
@Test
- public void testEnableRuntimeExceptions() {
+ void testEnableRuntimeExceptions() {
final PropertiesConfiguration config = new PropertiesConfiguration() {
@Override
protected void addPropertyDirect(final String key, final Object value) {
@@ -446,7 +446,7 @@ public class TestConfigurationUtils {
* exception.
*/
@Test
- public void testEnableRuntimeExceptionsInvalid() {
+ void testEnableRuntimeExceptionsInvalid() {
final Configuration c = mock(Configuration.class);
assertThrows(IllegalArgumentException.class, () -> ConfigurationUtils.enableRuntimeExceptions(c));
}
@@ -455,7 +455,7 @@ public class TestConfigurationUtils {
* Tries to enable runtime exceptions for a null configuration. This should cause an exception.
*/
@Test
- public void testEnableRuntimeExceptionsNull() {
+ void testEnableRuntimeExceptionsNull() {
assertThrows(IllegalArgumentException.class, () -> ConfigurationUtils.enableRuntimeExceptions(null));
}
@@ -463,7 +463,7 @@ public class TestConfigurationUtils {
* Tests whether a class can be loaded if it is not found by the CCL.
*/
@Test
- public void testLoadClassCCLNotFound() throws ClassNotFoundException {
+ void testLoadClassCCLNotFound() throws ClassNotFoundException {
Thread.currentThread().setContextClassLoader(new ClassLoader() {
@Override
public Class<?> loadClass(final String name) throws ClassNotFoundException {
@@ -477,7 +477,7 @@ public class TestConfigurationUtils {
* Tests whether a class can be loaded if there is no CCL.
*/
@Test
- public void testLoadClassCCLNull() throws ClassNotFoundException {
+ void testLoadClassCCLNull() throws ClassNotFoundException {
Thread.currentThread().setContextClassLoader(null);
assertEquals(CLS_NAME, ConfigurationUtils.loadClass(CLS_NAME).getName());
}
@@ -486,7 +486,7 @@ public class TestConfigurationUtils {
* Tests whether a class can be loaded from CCL.
*/
@Test
- public void testLoadClassFromCCL() throws ClassNotFoundException {
+ void testLoadClassFromCCL() throws ClassNotFoundException {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
assertEquals(CLS_NAME, ConfigurationUtils.loadClass(CLS_NAME).getName());
}
@@ -495,7 +495,7 @@ public class TestConfigurationUtils {
* Tests loadClassNoEx() if the class can be resolved.
*/
@Test
- public void testLoadClassNoExFound() {
+ void testLoadClassNoExFound() {
assertEquals(CLS_NAME, ConfigurationUtils.loadClassNoEx(CLS_NAME).getName());
}
@@ -503,7 +503,7 @@ public class TestConfigurationUtils {
* Tests loadClassNoEx() if the class cannot be resolved.
*/
@Test
- public void testLoadClassNoExNotFound() {
+ void testLoadClassNoExNotFound() {
assertThrows(ConfigurationRuntimeException.class, () -> ConfigurationUtils.loadClassNoEx("a non existing class!"));
}
@@ -511,12 +511,12 @@ public class TestConfigurationUtils {
* Tests the behavior of loadClass() for a non-existing class.
*/
@Test
- public void testLoadClassNotFound() {
+ void testLoadClassNotFound() {
assertThrows(ClassNotFoundException.class, () -> ConfigurationUtils.loadClass("a non existing class!"));
}
@Test
- public void testToString() {
+ void testToString() {
final Configuration config = new BaseConfiguration();
final String lineSeparator = System.lineSeparator();
diff --git a/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java
index a9bf0077..9d672bf3 100644
--- a/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestDataConfiguration.java
@@ -336,7 +336,7 @@ public class TestDataConfiguration {
* Tests whether properties can be cleared.
*/
@Test
- public void testClearProperty() {
+ void testClearProperty() {
final String key = "test.property";
conf.addProperty(key, "someValue");
conf.clearProperty(key);
@@ -347,7 +347,7 @@ public class TestDataConfiguration {
* Tests the implementation of clearPropertyDirect().
*/
@Test
- public void testClearPropertyDirect() {
+ void testClearPropertyDirect() {
final String key = "test.property";
conf.addProperty(key, "someValue");
conf.clearPropertyDirect(key);
@@ -358,7 +358,7 @@ public class TestDataConfiguration {
* Tests clearPropertyDirect() if the wrapped configuration does not extend AbstractConfiguration.
*/
@Test
- public void testClearPropertyDirectNoAbstractConf() {
+ void testClearPropertyDirectNoAbstractConf() {
final Configuration wrapped = mock(Configuration.class);
final String key = "test.property";
conf = new DataConfiguration(wrapped);
@@ -369,7 +369,7 @@ public class TestDataConfiguration {
}
@Test
- public void testContainsKey() {
+ void testContainsKey() {
final Configuration baseconf = new BaseConfiguration();
final DataConfiguration conf = new DataConfiguration(baseconf);
@@ -381,14 +381,14 @@ public class TestDataConfiguration {
}
@Test
- public void testContainsValue() {
+ void testContainsValue() {
final Configuration config = conf.getConfiguration();
assertFalse(config.containsValue(null));
assertTrue(config.containsValue(""));
}
@Test
- public void testConversionException() throws Exception {
+ void testConversionException() throws Exception {
conf.addProperty("key1", new Object());
conf.addProperty("key2", "xxxxxx");
@@ -491,18 +491,18 @@ public class TestDataConfiguration {
* Tests that the cause of a conversion exception is kept.
*/
@Test
- public void testConversionExceptionCause() {
+ void testConversionExceptionCause() {
final ConversionException cex = assertThrows(ConversionException.class, () -> conf.get(Integer.TYPE, "uri.string"));
assertInstanceOf(NumberFormatException.class, cex.getCause());
}
@Test
- public void testGetArrayInvalidDefaultType() {
+ void testGetArrayInvalidDefaultType() {
assertThrows(IllegalArgumentException.class, () -> conf.getArray(Boolean.class, "unknownkey", new URL[] {}));
}
@Test
- public void testGetBigDecimalArray() {
+ void testGetBigDecimalArray() {
// missing list
final BigDecimal[] defaultValue = {new BigDecimal("2"), new BigDecimal("1")};
assertArrayEquals(defaultValue, conf.getBigDecimalArray("bigdecimal.list", defaultValue));
@@ -536,7 +536,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetBigDecimalList() {
+ void testGetBigDecimalList() {
// missing list
assertNull(conf.getBigDecimalList("bigdecimal.list", null));
@@ -573,7 +573,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetBigIntegerArray() {
+ void testGetBigIntegerArray() {
// missing list
final BigInteger[] defaultValue = {new BigInteger("2"), new BigInteger("1")};
assertArrayEquals(defaultValue, conf.getBigIntegerArray("biginteger.list", defaultValue));
@@ -607,7 +607,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetBigIntegerList() {
+ void testGetBigIntegerList() {
// missing list
final List<BigInteger> bigIntegerList = conf.getBigIntegerList("biginteger.list", null);
assertNull(bigIntegerList);
@@ -645,7 +645,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetBooleanArray() {
+ void testGetBooleanArray() {
// missing list
final boolean[] defaultValue = {false, true};
assertArrayEquals(defaultValue, conf.getBooleanArray("boolean.list", defaultValue));
@@ -682,7 +682,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetBooleanList() {
+ void testGetBooleanList() {
// missing list
assertNull(conf.getBooleanList("boolean.list", null));
@@ -722,7 +722,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetByteArray() {
+ void testGetByteArray() {
// missing list
final byte[] defaultValue = {1, 2};
assertArrayEquals(defaultValue, conf.getByteArray("byte.list", defaultValue));
@@ -759,7 +759,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetByteList() {
+ void testGetByteList() {
// missing list
assertNull(conf.getByteList("byte.list", null));
@@ -799,7 +799,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetCalendar() throws Exception {
+ void testGetCalendar() throws Exception {
final DateFormat format = new SimpleDateFormat(DATE_PATTERN);
// missing Date
@@ -830,7 +830,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetCalendarArray() throws Exception {
+ void testGetCalendarArray() throws Exception {
final DateFormat format = new SimpleDateFormat(DATE_PATTERN);
final Date date1 = format.parse("2004-01-01");
final Date date2 = format.parse("2004-12-31");
@@ -875,7 +875,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetCalendarArrayWithFormat() throws Exception {
+ void testGetCalendarArrayWithFormat() throws Exception {
final DateFormat format = new SimpleDateFormat("MM/dd/yyyy");
final Date date1 = format.parse("01/01/2004");
final Date date2 = format.parse("12/31/2004");
@@ -892,7 +892,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetCalendarList() throws Exception {
+ void testGetCalendarList() throws Exception {
final DateFormat format = new SimpleDateFormat(DATE_PATTERN);
final Date date1 = format.parse("2004-01-01");
final Date date2 = format.parse("2004-12-31");
@@ -945,7 +945,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetColor() {
+ void testGetColor() {
// RRGGBB
conf.setProperty("color", "FF0000");
assertEquals(Color.red, conf.getColor("color"));
@@ -971,7 +971,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetColorArray() throws Exception {
+ void testGetColorArray() throws Exception {
// missing list
final Color[] defaultValue = {Color.red, Color.blue};
assertArrayEquals(defaultValue, conf.getColorArray("color.list", defaultValue));
@@ -1005,7 +1005,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetColorList() throws Exception {
+ void testGetColorList() throws Exception {
// missing list
assertNull(conf.getColorList("color.list", null));
@@ -1042,7 +1042,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetConfiguration() {
+ void testGetConfiguration() {
final Configuration baseconf = new BaseConfiguration();
final DataConfiguration conf = new DataConfiguration(baseconf);
@@ -1050,7 +1050,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetDate() throws Exception {
+ void testGetDate() throws Exception {
final Date expected = expectedDate();
// missing Date
@@ -1077,7 +1077,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetDateArray() throws Exception {
+ void testGetDateArray() throws Exception {
final DateFormat format = new SimpleDateFormat(DATE_PATTERN);
final Date date1 = format.parse("2004-01-01");
final Date date2 = format.parse("2004-12-31");
@@ -1118,7 +1118,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetDateArrayWithFormat() throws Exception {
+ void testGetDateArrayWithFormat() throws Exception {
final DateFormat format = new SimpleDateFormat("MM/dd/yyyy");
final Date date1 = format.parse("01/01/2004");
final Date date2 = format.parse("12/31/2004");
@@ -1130,7 +1130,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetDateList() throws Exception {
+ void testGetDateList() throws Exception {
final DateFormat format = new SimpleDateFormat(DATE_PATTERN);
final Date date1 = format.parse("2004-01-01");
final Date date2 = format.parse("2004-12-31");
@@ -1183,7 +1183,7 @@ public class TestDataConfiguration {
* conversion handler.
*/
@Test
- public void testGetDateNoFormatPropertyConversionHandler() throws Exception {
+ void testGetDateNoFormatPropertyConversionHandler() throws Exception {
conf.clearProperty(DataConfiguration.DATE_FORMAT_KEY);
final DefaultConversionHandler handler = new DefaultConversionHandler();
handler.setDateFormat(DATE_PATTERN);
@@ -1195,13 +1195,13 @@ public class TestDataConfiguration {
* Tests a conversion to a Date if no property is set with the date format, and the format is directly passed in.
*/
@Test
- public void testGetDateNoFormatPropertyDirectlySpecified() throws Exception {
+ void testGetDateNoFormatPropertyDirectlySpecified() throws Exception {
conf.clearProperty(DataConfiguration.DATE_FORMAT_KEY);
assertEquals(expectedDate(), conf.getDate("date.string", DATE_PATTERN));
}
@Test
- public void testGetDoubleArray() {
+ void testGetDoubleArray() {
// missing list
final double[] defaultValue = {2, 1};
assertArrayEquals(defaultValue, conf.getDoubleArray("double.list", defaultValue), 0);
@@ -1238,7 +1238,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetDoubleList() {
+ void testGetDoubleList() {
// missing list
assertNull(conf.getDoubleList("double.list", null));
@@ -1278,7 +1278,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetFloatArray() {
+ void testGetFloatArray() {
// missing list
final float[] defaultValue = {2, 1};
assertArrayEquals(defaultValue, conf.getFloatArray("float.list", defaultValue), 0);
@@ -1315,7 +1315,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetFloatList() {
+ void testGetFloatList() {
// missing list
assertNull(conf.getFloatList("float.list", null));
@@ -1355,7 +1355,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetInetAddress() throws Exception {
+ void testGetInetAddress() throws Exception {
final InetAddress expected = InetAddress.getByName("127.0.0.1");
// address as string
@@ -1369,13 +1369,13 @@ public class TestDataConfiguration {
}
@Test
- public void testGetInetAddressInvalidType() {
+ void testGetInetAddressInvalidType() {
conf.setProperty("ip.unknownhost", "foo");
assertThrows(ConversionException.class, () -> conf.get(InetAddress.class, "ip.unknownhost"));
}
@Test
- public void testGetIntegerArray() {
+ void testGetIntegerArray() {
// missing list
final int[] defaultValue = {2, 1};
assertArrayEquals(conf.getIntArray("integer.list", defaultValue), defaultValue);
@@ -1412,7 +1412,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetIntegerList() {
+ void testGetIntegerList() {
// missing list
assertNull(conf.getIntegerList("integer.list", null));
@@ -1452,7 +1452,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetInternetAddress() throws Exception {
+ void testGetInternetAddress() throws Exception {
final Object expected = new InternetAddress("dev@test.org");
// address as string
@@ -1469,19 +1469,19 @@ public class TestDataConfiguration {
}
@Test
- public void testGetInternetAddressInvalidType() throws Exception {
+ void testGetInternetAddressInvalidType() throws Exception {
final Object expected = new InternetAddress("dev@test.org");
conf.setProperty("email.invalid", "dev@test@org");
assertThrows(ConversionException.class, () -> conf.get(expected.getClass(), "email.invalid"));
}
@Test
- public void testGetInvalidType() {
+ void testGetInvalidType() {
assertThrows(ConversionException.class, () -> conf.get(Boolean.class, "url.object", null));
}
@Test
- public void testGetKeys() {
+ void testGetKeys() {
final Configuration baseconf = new BaseConfiguration();
final DataConfiguration conf = new DataConfiguration(baseconf);
@@ -1494,7 +1494,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetLocale() {
+ void testGetLocale() {
// language
conf.setProperty("locale", "fr");
assertEquals(new Locale("fr", ""), conf.getLocale("locale"));
@@ -1529,7 +1529,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetLocaleArray() throws Exception {
+ void testGetLocaleArray() throws Exception {
// missing list
final Locale[] defaultValue = {Locale.GERMAN, Locale.FRENCH};
assertArrayEquals(conf.getLocaleArray("locale.list", defaultValue), defaultValue);
@@ -1563,7 +1563,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetLocaleList() throws Exception {
+ void testGetLocaleList() throws Exception {
// missing list
assertNull(conf.getLocaleList("locale.list", null));
@@ -1600,7 +1600,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetLongArray() {
+ void testGetLongArray() {
// missing list
final long[] defaultValue = {2, 1};
assertArrayEquals(conf.getLongArray("long.list", defaultValue), defaultValue);
@@ -1637,7 +1637,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetLongList() {
+ void testGetLongList() {
// missing list
assertNull(conf.getLongList("long.list", null));
@@ -1677,7 +1677,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetPrimitiveArrayInvalidType() {
+ void testGetPrimitiveArrayInvalidType() {
assertThrows(ConversionException.class, () -> conf.getArray(Boolean.TYPE, "calendar.list4"));
}
@@ -1685,7 +1685,7 @@ public class TestDataConfiguration {
* Tests whether a string property can be obtained through get() if no type conversion is required.
*/
@Test
- public void testGetPropertyWithoutConversion() {
+ void testGetPropertyWithoutConversion() {
final String key = "test.str";
final String value = "someTestValue";
conf.addProperty(key, value);
@@ -1693,7 +1693,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetShortArray() {
+ void testGetShortArray() {
// missing list
final short[] defaultValue = {2, 1};
assertArrayEquals(conf.getShortArray("short.list", defaultValue), defaultValue);
@@ -1730,7 +1730,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetShortList() {
+ void testGetShortList() {
// missing list
assertNull(conf.getShortList("short.list", null));
@@ -1770,18 +1770,18 @@ public class TestDataConfiguration {
}
@Test
- public void testGetUnknown() {
+ void testGetUnknown() {
assertNull(conf.get(Object.class, "unknownkey"));
}
@Test
- public void testGetUnknownException() {
+ void testGetUnknownException() {
conf.setThrowExceptionOnMissing(true);
assertThrows(NoSuchElementException.class, () -> conf.get(Object.class, "unknownkey"));
}
@Test
- public void testGetURI() throws Exception {
+ void testGetURI() throws Exception {
// missing URI
final URI defaultValue = new URI("http://www.google.com");
assertEquals(conf.getURI("url", defaultValue), defaultValue);
@@ -1799,7 +1799,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetURIArray() throws Exception {
+ void testGetURIArray() throws Exception {
// missing list
final URI[] defaultValue = {new URI("http://www.apache.org"), new URI("http://jakarta.apache.org")};
assertArrayEquals(conf.getURIArray("url.list", defaultValue), defaultValue);
@@ -1833,7 +1833,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetURIList() throws Exception {
+ void testGetURIList() throws Exception {
// missing list
assertNull(conf.getURIList("uri.list", null));
@@ -1870,7 +1870,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetURL() throws Exception {
+ void testGetURL() throws Exception {
// missing URL
final URL defaultValue = new URL("http://www.google.com");
assertEquals(conf.getURL("url", defaultValue), defaultValue);
@@ -1888,7 +1888,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetURLArray() throws Exception {
+ void testGetURLArray() throws Exception {
// missing list
final URL[] defaultValue = {new URL("http://www.apache.org"), new URL("http://jakarta.apache.org")};
assertArrayEquals(conf.getURLArray("url.list", defaultValue), defaultValue);
@@ -1922,7 +1922,7 @@ public class TestDataConfiguration {
}
@Test
- public void testGetURLList() throws Exception {
+ void testGetURLList() throws Exception {
// missing list
assertNull(conf.getURLList("url.list", null));
@@ -1959,7 +1959,7 @@ public class TestDataConfiguration {
}
@Test
- public void testIsEmpty() {
+ void testIsEmpty() {
final Configuration baseconf = new BaseConfiguration();
final DataConfiguration conf = new DataConfiguration(baseconf);
@@ -1969,7 +1969,7 @@ public class TestDataConfiguration {
}
@Test
- public void testNullConfiguration() {
+ void testNullConfiguration() {
assertThrows(NullPointerException.class, () -> new DataConfiguration(null));
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java
index ac1fc48d..4d75e32b 100644
--- a/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java
@@ -175,7 +175,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testAddNonStringProperty() throws ConfigurationException {
+ void testAddNonStringProperty() throws ConfigurationException {
final DatabaseConfiguration config = helper.setUpConfig();
config.addPropertyDirect("boolean", Boolean.TRUE);
@@ -186,7 +186,7 @@ public class TestDatabaseConfiguration {
* Tests whether a commit is performed after a property was added.
*/
@Test
- public void testAddPropertyDirectCommit() throws ConfigurationException {
+ void testAddPropertyDirectCommit() throws ConfigurationException {
helper.setAutoCommit(false);
final DatabaseConfiguration config = helper.setUpConfig();
config.addPropertyDirect("key", "value");
@@ -194,7 +194,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testAddPropertyDirectMultiple() throws ConfigurationException {
+ void testAddPropertyDirectMultiple() throws ConfigurationException {
final DatabaseConfiguration config = helper.setUpMultiConfig();
config.addPropertyDirect("key", "value");
@@ -202,7 +202,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testAddPropertyDirectSingle() throws ConfigurationException {
+ void testAddPropertyDirectSingle() throws ConfigurationException {
final DatabaseConfiguration config = helper.setUpConfig();
config.addPropertyDirect("key", "value");
@@ -213,7 +213,7 @@ public class TestDatabaseConfiguration {
* Tests handling of errors in addPropertyDirect().
*/
@Test
- public void testAddPropertyError() throws ConfigurationException {
+ void testAddPropertyError() throws ConfigurationException {
setUpErrorConfig().addProperty("key1", "value");
checkErrorListener(ConfigurationErrorEvent.WRITE, ConfigurationEvent.ADD_PROPERTY, "key1", "value");
}
@@ -223,7 +223,7 @@ public class TestDatabaseConfiguration {
* returned.
*/
@Test
- public void testAddWithDelimiter() throws ConfigurationException {
+ void testAddWithDelimiter() throws ConfigurationException {
final DatabaseConfiguration config = setUpConfig();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
config.addProperty("keyList", "1;2;3");
@@ -235,7 +235,7 @@ public class TestDatabaseConfiguration {
* Tests whether a commit is performed after a clear operation.
*/
@Test
- public void testClearCommit() throws ConfigurationException {
+ void testClearCommit() throws ConfigurationException {
helper.setAutoCommit(false);
final Configuration config = helper.setUpConfig();
config.clear();
@@ -246,13 +246,13 @@ public class TestDatabaseConfiguration {
* Tests handling of errors in clear().
*/
@Test
- public void testClearError() throws ConfigurationException {
+ void testClearError() throws ConfigurationException {
setUpErrorConfig().clear();
checkErrorListener(ConfigurationErrorEvent.WRITE, ConfigurationEvent.CLEAR, null, null);
}
@Test
- public void testClearMultiple() throws ConfigurationException {
+ void testClearMultiple() throws ConfigurationException {
final Configuration config = helper.setUpMultiConfig();
config.clear();
@@ -263,7 +263,7 @@ public class TestDatabaseConfiguration {
* Tests whether a commit is performed after a property was cleared.
*/
@Test
- public void testClearPropertyCommit() throws ConfigurationException {
+ void testClearPropertyCommit() throws ConfigurationException {
helper.setAutoCommit(false);
final Configuration config = helper.setUpConfig();
config.clearProperty("key1");
@@ -274,13 +274,13 @@ public class TestDatabaseConfiguration {
* Tests handling of errors in clearProperty().
*/
@Test
- public void testClearPropertyError() throws ConfigurationException {
+ void testClearPropertyError() throws ConfigurationException {
setUpErrorConfig().clearProperty("key1");
checkErrorListener(ConfigurationErrorEvent.WRITE, ConfigurationEvent.CLEAR_PROPERTY, "key1", null);
}
@Test
- public void testClearPropertyMultiple() throws ConfigurationException {
+ void testClearPropertyMultiple() throws ConfigurationException {
final Configuration config = helper.setUpMultiConfig();
config.clearProperty("key1");
@@ -291,7 +291,7 @@ public class TestDatabaseConfiguration {
* Tests that another configuration is not affected when clearing properties.
*/
@Test
- public void testClearPropertyMultipleOtherConfig() throws ConfigurationException {
+ void testClearPropertyMultipleOtherConfig() throws ConfigurationException {
final DatabaseConfiguration config = helper.setUpMultiConfig();
final DatabaseConfiguration config2 = helper.setUpMultiConfig(DatabaseConfiguration.class, CONFIG_NAME2);
config2.addProperty("key1", "some test");
@@ -301,7 +301,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testClearPropertySingle() throws ConfigurationException {
+ void testClearPropertySingle() throws ConfigurationException {
final Configuration config = helper.setUpConfig();
config.clearProperty("key1");
@@ -309,7 +309,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testClearSingle() throws ConfigurationException {
+ void testClearSingle() throws ConfigurationException {
final Configuration config = helper.setUpConfig();
config.clear();
@@ -317,7 +317,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testClearSubset() throws ConfigurationException {
+ void testClearSubset() throws ConfigurationException {
final Configuration config = setUpConfig();
final Configuration subset = config.subset("key1");
@@ -331,20 +331,20 @@ public class TestDatabaseConfiguration {
* Tests handling of errors in containsKey().
*/
@Test
- public void testContainsKeyError() throws ConfigurationException {
+ void testContainsKeyError() throws ConfigurationException {
assertFalse(setUpErrorConfig().containsKey("key1"));
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, "key1", null);
}
@Test
- public void testContainsKeyMultiple() throws ConfigurationException {
+ void testContainsKeyMultiple() throws ConfigurationException {
final Configuration config = helper.setUpMultiConfig();
assertTrue(config.containsKey("key1"));
assertTrue(config.containsKey("key2"));
}
@Test
- public void testContainsKeySingle() throws ConfigurationException {
+ void testContainsKeySingle() throws ConfigurationException {
final Configuration config = setUpConfig();
assertTrue(config.containsKey("key1"));
assertTrue(config.containsKey("key2"));
@@ -363,7 +363,7 @@ public class TestDatabaseConfiguration {
* Tests whether a CLOB as a property value is handled correctly.
*/
@Test
- public void testExtractPropertyValueCLOB() throws ConfigurationException, SQLException {
+ void testExtractPropertyValueCLOB() throws ConfigurationException, SQLException {
final ResultSet rs = mock(ResultSet.class);
final Clob clob = mock(Clob.class);
final String content = "This is the content of the test CLOB!";
@@ -385,7 +385,7 @@ public class TestDatabaseConfiguration {
* Tests whether an empty CLOB is correctly handled by extractPropertyValue().
*/
@Test
- public void testExtractPropertyValueCLOBEmpty() throws ConfigurationException, SQLException {
+ void testExtractPropertyValueCLOBEmpty() throws ConfigurationException, SQLException {
final ResultSet rs = mock(ResultSet.class);
final Clob clob = mock(Clob.class);
@@ -401,7 +401,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testGetKeys() throws ConfigurationException {
+ void testGetKeys() throws ConfigurationException {
final DatabaseBuilderParameters params = helper.setUpDefaultParameters().setTable("configurationList");
final Configuration config1 = helper.createConfiguration(DatabaseConfiguration.class, params);
final Iterator<String> i = config1.getKeys();
@@ -415,19 +415,19 @@ public class TestDatabaseConfiguration {
* Tests handling of errors in getKeys().
*/
@Test
- public void testGetKeysError() throws ConfigurationException {
+ void testGetKeysError() throws ConfigurationException {
final Iterator<String> it = setUpErrorConfig().getKeys();
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, null, null);
assertFalse(it.hasNext());
}
@Test
- public void testGetKeysInternalNoDatasource() throws Exception {
+ void testGetKeysInternalNoDatasource() throws Exception {
ConfigurationUtils.toString(new DatabaseConfiguration());
}
@Test
- public void testGetKeysMultiple() throws ConfigurationException {
+ void testGetKeysMultiple() throws ConfigurationException {
final Configuration config = helper.setUpMultiConfig();
final Iterator<String> it = config.getKeys();
@@ -436,7 +436,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testGetKeysSingle() throws ConfigurationException {
+ void testGetKeysSingle() throws ConfigurationException {
final Configuration config = setUpConfig();
final Iterator<String> it = config.getKeys();
@@ -445,7 +445,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testGetList() throws ConfigurationException {
+ void testGetList() throws ConfigurationException {
final DatabaseBuilderParameters params = helper.setUpDefaultParameters().setTable("configurationList");
final Configuration config1 = helper.createConfiguration(DatabaseConfiguration.class, params);
final List<Object> list = config1.getList("key3");
@@ -456,7 +456,7 @@ public class TestDatabaseConfiguration {
* Tests obtaining a property as list whose value contains the list delimiter. Multiple values should be returned.
*/
@Test
- public void testGetListWithDelimiter() throws ConfigurationException {
+ void testGetListWithDelimiter() throws ConfigurationException {
final DatabaseConfiguration config = setUpConfig();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
final List<Object> values = config.getList("keyMulti");
@@ -467,13 +467,13 @@ public class TestDatabaseConfiguration {
* Tests obtaining a property whose value contains the list delimiter when delimiter parsing is disabled.
*/
@Test
- public void testGetListWithDelimiterParsingDisabled() throws ConfigurationException {
+ void testGetListWithDelimiterParsingDisabled() throws ConfigurationException {
final DatabaseConfiguration config = setUpConfig();
assertEquals("a;b;c", config.getString("keyMulti"));
}
@Test
- public void testGetPropertyDirectMultiple() throws ConfigurationException {
+ void testGetPropertyDirectMultiple() throws ConfigurationException {
final Configuration config = helper.setUpMultiConfig();
assertEquals("value1", config.getProperty("key1"));
@@ -482,7 +482,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testGetPropertyDirectSingle() throws ConfigurationException {
+ void testGetPropertyDirectSingle() throws ConfigurationException {
final Configuration config = setUpConfig();
assertEquals("value1", config.getProperty("key1"));
@@ -494,7 +494,7 @@ public class TestDatabaseConfiguration {
* Tests handling of errors in getProperty().
*/
@Test
- public void testGetPropertyError() throws ConfigurationException {
+ void testGetPropertyError() throws ConfigurationException {
setUpErrorConfig().getProperty("key1");
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, "key1", null);
}
@@ -503,13 +503,13 @@ public class TestDatabaseConfiguration {
* Tests handling of errors in isEmpty().
*/
@Test
- public void testIsEmptyError() throws ConfigurationException {
+ void testIsEmptyError() throws ConfigurationException {
assertTrue(setUpErrorConfig().isEmpty());
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, null, null);
}
@Test
- public void testIsEmptyMultiple() throws ConfigurationException {
+ void testIsEmptyMultiple() throws ConfigurationException {
final Configuration config1 = helper.setUpMultiConfig();
assertFalse(config1.isEmpty());
@@ -518,7 +518,7 @@ public class TestDatabaseConfiguration {
}
@Test
- public void testIsEmptySingle() throws ConfigurationException {
+ void testIsEmptySingle() throws ConfigurationException {
final Configuration config1 = setUpConfig();
assertFalse(config1.isEmpty());
}
@@ -527,7 +527,7 @@ public class TestDatabaseConfiguration {
* Tests whether the configuration has already an error listener registered that is used for logging.
*/
@Test
- public void testLogErrorListener() throws ConfigurationException {
+ void testLogErrorListener() throws ConfigurationException {
final DatabaseConfiguration config = helper.setUpConfig();
assertEquals(1, config.getEventListeners(ConfigurationErrorEvent.ANY).size());
}
@@ -536,7 +536,7 @@ public class TestDatabaseConfiguration {
* Tests setProperty() if the property value contains the list delimiter.
*/
@Test
- public void testSetPropertyWithDelimiter() throws ConfigurationException {
+ void testSetPropertyWithDelimiter() throws ConfigurationException {
final DatabaseConfiguration config = helper.setUpMultiConfig();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
config.setProperty("keyList", "1;2;3");
diff --git a/src/test/java/org/apache/commons/configuration2/TestDefaultImmutableConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestDefaultImmutableConfiguration.java
index eaffaa12..09f4d8b5 100644
--- a/src/test/java/org/apache/commons/configuration2/TestDefaultImmutableConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestDefaultImmutableConfiguration.java
@@ -346,7 +346,7 @@ public class TestDefaultImmutableConfiguration {
}
@Test
- public void testContainsValueDefaultImplementation() {
+ void testContainsValueDefaultImplementation() {
config.map.put("test", "213123");
assertFalse(config.containsValue(""));
assertFalse(config.containsValue(null));
@@ -354,7 +354,7 @@ public class TestDefaultImmutableConfiguration {
}
@Test
- public void testGetDuration() {
+ void testGetDuration() {
final Duration d = Duration.ofSeconds(1);
config.map.put("durationD", d.toString());
final Duration oneD = Duration.ofSeconds(1);
@@ -366,13 +366,13 @@ public class TestDefaultImmutableConfiguration {
}
@Test
- public void testGetDurationIncompatibleType() {
+ void testGetDurationIncompatibleType() {
config.map.put("test.empty", "");
assertThrows(ConversionException.class, () -> config.getDuration("test.empty"));
}
@Test
- public void testGetDurationUnknown() {
+ void testGetDurationUnknown() {
assertThrows(NoSuchElementException.class, () -> config.getDuration("numberNotInConfig"));
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
index ce4a2208..cf5d28b8 100644
--- a/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java
@@ -224,7 +224,7 @@ public class TestDynamicCombinedConfiguration {
* Tests whether adding a configuration is synchronized.
*/
@Test
- public void testAddConfigurationSynchronized() {
+ void testAddConfigurationSynchronized() {
final DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
final SynchronizerTestImpl sync = prepareSynchronizerTest(config);
config.addConfiguration(new PropertiesConfiguration());
@@ -232,7 +232,7 @@ public class TestDynamicCombinedConfiguration {
}
@Test
- public void testConcurrentGetAndReload() throws Exception {
+ void testConcurrentGetAndReload() throws Exception {
System.getProperties().remove("Id");
final CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
builder.configure(parameters.fileBased().setFile(MULTI_TENENT_FILE).setSynchronizer(new ReadWriteSynchronizer()));
@@ -256,7 +256,7 @@ public class TestDynamicCombinedConfiguration {
}
@Test
- public void testConcurrentGetAndReload2() throws Exception {
+ void testConcurrentGetAndReload2() throws Exception {
System.getProperties().remove("Id");
final CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
builder.configure(parameters.fileBased().setFile(MULTI_TENENT_FILE).setSynchronizer(new ReadWriteSynchronizer()));
@@ -283,7 +283,7 @@ public class TestDynamicCombinedConfiguration {
}
@Test
- public void testConcurrentGetAndReloadFile() throws Exception {
+ void testConcurrentGetAndReloadFile() throws Exception {
final int threadCount = 25;
System.getProperties().remove("Id");
System.setProperty("TemporaryFolder", tempFolder.getAbsolutePath());
@@ -333,7 +333,7 @@ public class TestDynamicCombinedConfiguration {
}
@Test
- public void testConcurrentGetAndReloadMultipleClients() throws Exception {
+ void testConcurrentGetAndReloadMultipleClients() throws Exception {
System.getProperties().remove("Id");
final CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
builder.configure(parameters.fileBased().setFile(MULTI_TENENT_FILE).setSynchronizer(new ReadWriteSynchronizer()));
@@ -366,7 +366,7 @@ public class TestDynamicCombinedConfiguration {
}
@Test
- public void testConfiguration() throws Exception {
+ void testConfiguration() throws Exception {
final DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
final DefaultListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
config.setListDelimiterHandler(listHandler);
@@ -404,7 +404,7 @@ public class TestDynamicCombinedConfiguration {
* Tests whether querying a configuration by index is synchronized.
*/
@Test
- public void testGetConfigurationByIdxSynchronized() {
+ void testGetConfigurationByIdxSynchronized() {
final DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
final Configuration child = new PropertiesConfiguration();
config.addConfiguration(child);
@@ -417,7 +417,7 @@ public class TestDynamicCombinedConfiguration {
* Tests whether querying a configuration by name is synchronized.
*/
@Test
- public void testGetConfigurationByNameSynchronized() {
+ void testGetConfigurationByNameSynchronized() {
final DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
final SynchronizerTestImpl sync = prepareSynchronizerTest(config);
assertNull(config.getConfiguration("unknown config"));
@@ -428,7 +428,7 @@ public class TestDynamicCombinedConfiguration {
* Tests whether querying the set of configuration names is synchronized.
*/
@Test
- public void testGetConfigurationNamesSynchronized() {
+ void testGetConfigurationNamesSynchronized() {
final DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
final SynchronizerTestImpl sync = prepareSynchronizerTest(config);
config.getConfigurationNames();
@@ -439,7 +439,7 @@ public class TestDynamicCombinedConfiguration {
* Tests whether querying the number of configurations is synchronized.
*/
@Test
- public void testGetNumberOfConfigurationsSynchronized() {
+ void testGetNumberOfConfigurationsSynchronized() {
final DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
final SynchronizerTestImpl sync = prepareSynchronizerTest(config);
config.getNumberOfConfigurations();
@@ -450,7 +450,7 @@ public class TestDynamicCombinedConfiguration {
* Tests whether removing a child configuration is synchronized.
*/
@Test
- public void testRemoveConfigurationSynchronized() {
+ void testRemoveConfigurationSynchronized() {
final DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
final String configName = "testConfig";
config.addConfiguration(new PropertiesConfiguration(), configName);
@@ -463,7 +463,7 @@ public class TestDynamicCombinedConfiguration {
* Tests whether a configuration can be updated.
*/
@Test
- public void testUpdateConfiguration() throws ConfigurationException {
+ void testUpdateConfiguration() throws ConfigurationException {
System.getProperties().remove("Id");
final CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
builder.configure(parameters.fileBased().setFile(MULTI_TENENT_FILE).setSynchronizer(new ReadWriteSynchronizer()));
diff --git a/src/test/java/org/apache/commons/configuration2/TestEnvironmentConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestEnvironmentConfiguration.java
index 11f08ee6..03ae07b7 100644
--- a/src/test/java/org/apache/commons/configuration2/TestEnvironmentConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestEnvironmentConfiguration.java
@@ -43,7 +43,7 @@ public class TestEnvironmentConfiguration {
* Tries to add another property. This should cause an exception.
*/
@Test
- public void testAddProperty() {
+ void testAddProperty() {
assertThrows(UnsupportedOperationException.class, () -> config.addProperty("JAVA_HOME", "C:\\java"));
}
@@ -51,7 +51,7 @@ public class TestEnvironmentConfiguration {
* Tests removing all properties. This should not be possible.
*/
@Test
- public void testClear() {
+ void testClear() {
assertThrows(UnsupportedOperationException.class, config::clear);
}
@@ -59,7 +59,7 @@ public class TestEnvironmentConfiguration {
* Tests removing properties. This should not be possible.
*/
@Test
- public void testClearProperty() {
+ void testClearProperty() {
final String key = config.getKeys().next();
assertThrows(UnsupportedOperationException.class, () -> config.clearProperty(key));
}
@@ -69,7 +69,7 @@ public class TestEnvironmentConfiguration {
* set in each environment.)
*/
@Test
- public void testInit() {
+ void testInit() {
boolean found = false;
assertFalse(config.isEmpty());
for (final Iterator<String> it = config.getKeys(); it.hasNext();) {
@@ -85,7 +85,7 @@ public class TestEnvironmentConfiguration {
* Tries to set the value of a property. This should cause an exception.
*/
@Test
- public void testSetProperty() {
+ void testSetProperty() {
assertThrows(UnsupportedOperationException.class, () -> config.setProperty("JAVA_HOME", "C:\\java"));
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestEqualBehavior.java b/src/test/java/org/apache/commons/configuration2/TestEqualBehavior.java
index 314b9b40..5fa0eedb 100644
--- a/src/test/java/org/apache/commons/configuration2/TestEqualBehavior.java
+++ b/src/test/java/org/apache/commons/configuration2/TestEqualBehavior.java
@@ -87,7 +87,7 @@ public class TestEqualBehavior {
* If we add a to an existing key, does it work?
*/
@Test
- public void testAddingSet() throws Exception {
+ void testAddingSet() throws Exception {
final Configuration simple = setupSimpleConfiguration();
final Configuration composite = setupCompositeConfiguration();
@@ -111,7 +111,7 @@ public class TestEqualBehavior {
* If we add a key, does it work?
*/
@Test
- public void testAddingUnset() throws Exception {
+ void testAddingUnset() throws Exception {
final Configuration simple = setupSimpleConfiguration();
final Configuration composite = setupCompositeConfiguration();
@@ -132,7 +132,7 @@ public class TestEqualBehavior {
* If we delete a key, does it vanish? Does it leave all the other keys unchanged? How about an unset key?
*/
@Test
- public void testDeletingExisting() throws Exception {
+ void testDeletingExisting() throws Exception {
final Configuration simple = setupSimpleConfiguration();
final Configuration composite = setupCompositeConfiguration();
@@ -151,7 +151,7 @@ public class TestEqualBehavior {
}
@Test
- public void testDeletingNonExisting() throws Exception {
+ void testDeletingNonExisting() throws Exception {
final Configuration simple = setupSimpleConfiguration();
final Configuration composite = setupCompositeConfiguration();
@@ -173,7 +173,7 @@ public class TestEqualBehavior {
* Are both configurations equal after loading?
*/
@Test
- public void testLoading() throws Exception {
+ void testLoading() throws Exception {
final Configuration simple = setupSimpleConfiguration();
final Configuration composite = setupCompositeConfiguration();
@@ -181,7 +181,7 @@ public class TestEqualBehavior {
}
@Test
- public void testSettingExisting() throws Exception {
+ void testSettingExisting() throws Exception {
final Configuration simple = setupSimpleConfiguration();
final Configuration composite = setupCompositeConfiguration();
@@ -207,7 +207,7 @@ public class TestEqualBehavior {
* If we set a key, does it work? How about an existing key? Can we change it?
*/
@Test
- public void testSettingNonExisting() throws Exception {
+ void testSettingNonExisting() throws Exception {
final Configuration simple = setupSimpleConfiguration();
final Configuration composite = setupCompositeConfiguration();
diff --git a/src/test/java/org/apache/commons/configuration2/TestEqualsProperty.java b/src/test/java/org/apache/commons/configuration2/TestEqualsProperty.java
index af37af26..8c4b6f47 100644
--- a/src/test/java/org/apache/commons/configuration2/TestEqualsProperty.java
+++ b/src/test/java/org/apache/commons/configuration2/TestEqualsProperty.java
@@ -30,7 +30,7 @@ public class TestEqualsProperty {
private final String testProperties = ConfigurationAssert.getTestFile("test.properties").getAbsolutePath();
@Test
- public void testEquals() throws Exception {
+ void testEquals() throws Exception {
final PropertiesConfiguration conf = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(conf);
handler.setFileName(testProperties);
diff --git a/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfiguration.java
index 328d5e4e..d1113113 100644
--- a/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfiguration.java
@@ -134,7 +134,7 @@ public class TestHierarchicalConfiguration {
* Tests the result of childConfigurationsAt() if the key does not point to an existing node.
*/
@Test
- public void testChildConfigurationsAtNotFound() {
+ void testChildConfigurationsAtNotFound() {
assertTrue(config.childConfigurationsAt("not.existing.key").isEmpty());
}
@@ -142,7 +142,7 @@ public class TestHierarchicalConfiguration {
* Tests the result of childConfigurationsAt() if the key selects multiple nodes.
*/
@Test
- public void testChildConfigurationsAtNoUniqueKey() {
+ void testChildConfigurationsAtNoUniqueKey() {
assertTrue(config.childConfigurationsAt("tables.table").isEmpty());
}
@@ -150,7 +150,7 @@ public class TestHierarchicalConfiguration {
* Tests whether sub configurations for the children of a given node can be queried if no updates are propagated.
*/
@Test
- public void testChildConfigurationsAtNoUpdates() {
+ void testChildConfigurationsAtNoUpdates() {
checkChildConfigurationsAtWithUpdates(false, NodeStructureHelper.table(0));
}
@@ -158,12 +158,12 @@ public class TestHierarchicalConfiguration {
* Tests whether sub configurations for the children of a given node can be queried that support updates.
*/
@Test
- public void testChildConfigurationsAtWithUpdates() {
+ void testChildConfigurationsAtWithUpdates() {
checkChildConfigurationsAtWithUpdates(true, NEW_NAME);
}
@Test
- public void testClone() {
+ void testClone() {
final Configuration copy = (Configuration) config.clone();
assertInstanceOf(BaseHierarchicalConfiguration.class, copy);
config.setProperty("tables.table(0).name", "changed table name");
@@ -174,7 +174,7 @@ public class TestHierarchicalConfiguration {
* Tests configurationAt() if the passed in key selects an attribute result.
*/
@Test
- public void testConfigurationAtAttributeNode() {
+ void testConfigurationAtAttributeNode() {
checkConfigurationAtAttributeNode(false);
}
@@ -182,7 +182,7 @@ public class TestHierarchicalConfiguration {
* Tests configurationAt() if the passed in key selects an attribute result and the updates flag is set.
*/
@Test
- public void testConfigurationAtAttributeNodeWithUpdates() {
+ void testConfigurationAtAttributeNodeWithUpdates() {
checkConfigurationAtAttributeNode(true);
}
@@ -191,7 +191,7 @@ public class TestHierarchicalConfiguration {
* configuration.
*/
@Test
- public void testConfigurationAtClearAndDetach() {
+ void testConfigurationAtClearAndDetach() {
config.addProperty("test.sub.test", "success");
config.addProperty("test.other", "check");
final HierarchicalConfiguration<ImmutableNode> sub = config.configurationAt("test.sub", true);
@@ -206,7 +206,7 @@ public class TestHierarchicalConfiguration {
* Tests the configurationAt() method if the passed in key selects multiple nodes. This should cause an exception.
*/
@Test
- public void testConfigurationAtMultipleNodes() {
+ void testConfigurationAtMultipleNodes() {
assertThrows(ConfigurationRuntimeException.class, () -> config.configurationAt("tables.table.name"));
}
@@ -214,7 +214,7 @@ public class TestHierarchicalConfiguration {
* Tests configurationAt() if the passed in key selects multiple nodes and the update flag is set.
*/
@Test
- public void testConfigurationAtMultipleNodesWithUpdates() {
+ void testConfigurationAtMultipleNodesWithUpdates() {
assertThrows(ConfigurationRuntimeException.class, () -> config.configurationAt("tables.table.name", true));
}
@@ -222,7 +222,7 @@ public class TestHierarchicalConfiguration {
* Tests whether a configuration obtained via configurationAt() contains the expected properties.
*/
@Test
- public void testConfigurationAtReadAccess() {
+ void testConfigurationAtReadAccess() {
final HierarchicalConfiguration<ImmutableNode> subConfig = config.configurationAt("tables.table(1)");
assertEquals(NodeStructureHelper.table(1), subConfig.getString("name"));
final List<Object> lstFlds = subConfig.getList("fields.field.name");
@@ -238,7 +238,7 @@ public class TestHierarchicalConfiguration {
* Tests the configurationAt() method if the passed in key does not exist.
*/
@Test
- public void testConfigurationAtUnknownSubTree() {
+ void testConfigurationAtUnknownSubTree() {
assertThrows(ConfigurationRuntimeException.class, () -> config.configurationAt("non.existing.key"));
}
@@ -246,7 +246,7 @@ public class TestHierarchicalConfiguration {
* Tests configurationAt() for a non existing key if the update flag is set.
*/
@Test
- public void testConfigurationAtUnknownSubTreeWithUpdates() {
+ void testConfigurationAtUnknownSubTreeWithUpdates() {
assertThrows(ConfigurationRuntimeException.class, () -> config.configurationAt("non.existing.key", true));
}
@@ -254,7 +254,7 @@ public class TestHierarchicalConfiguration {
* Tests an update operation on a parent configuration if the sub configuration is connected.
*/
@Test
- public void testConfigurationAtUpdateParentConnected() {
+ void testConfigurationAtUpdateParentConnected() {
final HierarchicalConfiguration<ImmutableNode> subConfig = config.configurationAt("tables.table(1)", true);
config.setProperty("tables.table(1).fields.field(2).name", "testField");
assertEquals("testField", subConfig.getString("fields.field(2).name"));
@@ -264,7 +264,7 @@ public class TestHierarchicalConfiguration {
* Tests an update operation on a parent configuration if the sub configuration is independent.
*/
@Test
- public void testConfigurationAtUpdateParentIndependent() {
+ void testConfigurationAtUpdateParentIndependent() {
final HierarchicalConfiguration<ImmutableNode> subConfig = config.configurationAt("tables.table(1)");
config.setProperty("tables.table(1).fields.field(2).name", "testField");
assertEquals(NodeStructureHelper.field(1, 2), subConfig.getString("fields.field(2).name"));
@@ -274,7 +274,7 @@ public class TestHierarchicalConfiguration {
* Tests an update operation on a sub configuration which is connected to its parent.
*/
@Test
- public void testConfigurationAtUpdateSubConfigConnected() {
+ void testConfigurationAtUpdateSubConfigConnected() {
final HierarchicalConfiguration<ImmutableNode> subConfig = config.configurationAt("tables.table(1)", true);
subConfig.setProperty("name", "testTable");
assertEquals("testTable", config.getString("tables.table(1).name"));
@@ -284,7 +284,7 @@ public class TestHierarchicalConfiguration {
* Tests an update operation on a sub configuration which is independent on its parent.
*/
@Test
- public void testConfigurationAtUpdateSubConfigIndependent() {
+ void testConfigurationAtUpdateSubConfigIndependent() {
final HierarchicalConfiguration<ImmutableNode> subConfig = config.configurationAt("tables.table(1)");
subConfig.setProperty("name", "testTable");
assertEquals("testTable", subConfig.getString("name"));
@@ -295,7 +295,7 @@ public class TestHierarchicalConfiguration {
* Tests whether a connected configuration is correctly initialized with properties of its parent.
*/
@Test
- public void testConfigurationAtWithUpdateInitialized() {
+ void testConfigurationAtWithUpdateInitialized() {
final String key = "tables.table";
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
config.setThrowExceptionOnMissing(true);
@@ -309,7 +309,7 @@ public class TestHierarchicalConfiguration {
* Tests configurationsAt() if an attribute key is passed in.
*/
@Test
- public void testConfigurationsAtAttributeKey() {
+ void testConfigurationsAtAttributeKey() {
final String attrKey = "tables.table(0)[@type]";
config.addProperty(attrKey, "user");
assertTrue(config.configurationsAt(attrKey).isEmpty());
@@ -319,7 +319,7 @@ public class TestHierarchicalConfiguration {
* Tests the configurationsAt() method when the passed in key does not select any sub nodes.
*/
@Test
- public void testConfigurationsAtEmpty() {
+ void testConfigurationsAtEmpty() {
assertTrue(config.configurationsAt("unknown.key").isEmpty());
}
@@ -327,7 +327,7 @@ public class TestHierarchicalConfiguration {
* Tests the configurationsAt() method if the sub configurations are not connected.
*/
@Test
- public void testConfigurationsAtNoUpdate() {
+ void testConfigurationsAtNoUpdate() {
checkConfigurationsAtWithUpdate(false, NodeStructureHelper.field(1, 0));
}
@@ -335,7 +335,7 @@ public class TestHierarchicalConfiguration {
* Tests configurationsAt() if the sub configurations are connected.
*/
@Test
- public void testConfigurationsAtWithUpdates() {
+ void testConfigurationsAtWithUpdates() {
checkConfigurationsAtWithUpdate(true, NEW_NAME);
}
@@ -343,7 +343,7 @@ public class TestHierarchicalConfiguration {
* Tests whether immutable configurations for the children of a given node can be queried.
*/
@Test
- public void testImmutableChildConfigurationsAt() {
+ void testImmutableChildConfigurationsAt() {
final List<ImmutableHierarchicalConfiguration> children = config.immutableChildConfigurationsAt("tables.table(0)");
assertEquals(2, children.size());
final ImmutableHierarchicalConfiguration c1 = children.get(0);
@@ -358,7 +358,7 @@ public class TestHierarchicalConfiguration {
* Tests whether an immutable configuration for a sub tree can be obtained.
*/
@Test
- public void testImmutableConfigurationAt() {
+ void testImmutableConfigurationAt() {
final ImmutableHierarchicalConfiguration subConfig = config.immutableConfigurationAt("tables.table(1)");
assertEquals(NodeStructureHelper.table(1), subConfig.getString("name"));
final List<Object> lstFlds = subConfig.getList("fields.field.name");
@@ -374,7 +374,7 @@ public class TestHierarchicalConfiguration {
* Tests whether the support updates flag is taken into account when creating an immutable sub configuration.
*/
@Test
- public void testImmutableConfigurationAtSupportUpdates() {
+ void testImmutableConfigurationAtSupportUpdates() {
final String newTableName = NodeStructureHelper.table(1) + "_other";
final ImmutableHierarchicalConfiguration subConfig = config.immutableConfigurationAt("tables.table(1)", true);
config.addProperty("tables.table(-1).name", newTableName);
@@ -386,7 +386,7 @@ public class TestHierarchicalConfiguration {
* Tests whether a list of immutable sub configurations can be queried.
*/
@Test
- public void testImmutableConfigurationsAt() {
+ void testImmutableConfigurationsAt() {
final List<ImmutableHierarchicalConfiguration> lstFlds = config.immutableConfigurationsAt("tables.table(1).fields.field");
checkSubConfigurations(lstFlds);
}
@@ -395,7 +395,7 @@ public class TestHierarchicalConfiguration {
* Tests the copy constructor.
*/
@Test
- public void testInitCopy() {
+ void testInitCopy() {
final BaseHierarchicalConfiguration copy = new BaseHierarchicalConfiguration(config);
checkContent(copy);
}
@@ -404,7 +404,7 @@ public class TestHierarchicalConfiguration {
* Tests the copy constructor when a null reference is passed.
*/
@Test
- public void testInitCopyNull() {
+ void testInitCopyNull() {
final BaseHierarchicalConfiguration copy = new BaseHierarchicalConfiguration((HierarchicalConfiguration<ImmutableNode>) null);
assertTrue(copy.isEmpty());
}
@@ -413,7 +413,7 @@ public class TestHierarchicalConfiguration {
* Tests whether the nodes of a copied configuration are independent from the source configuration.
*/
@Test
- public void testInitCopyUpdate() {
+ void testInitCopyUpdate() {
final BaseHierarchicalConfiguration copy = new BaseHierarchicalConfiguration(config);
config.setProperty("tables.table(0).name", "NewTable");
checkContent(copy);
@@ -423,7 +423,7 @@ public class TestHierarchicalConfiguration {
* Tests obtaining a configuration with all variables substituted.
*/
@Test
- public void testInterpolatedConfiguration() {
+ void testInterpolatedConfiguration() {
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
final BaseHierarchicalConfiguration c = (BaseHierarchicalConfiguration) InterpolationTestHelper.testInterpolatedConfiguration(config);
@@ -435,7 +435,7 @@ public class TestHierarchicalConfiguration {
* Tests whether interpolation works on an empty configuration.
*/
@Test
- public void testInterpolatedConfigurationEmpty() {
+ void testInterpolatedConfigurationEmpty() {
config = new BaseHierarchicalConfiguration();
assertTrue(config.interpolatedConfiguration().isEmpty());
}
@@ -444,7 +444,7 @@ public class TestHierarchicalConfiguration {
* Tests interpolation with a subset.
*/
@Test
- public void testInterpolationSubset() {
+ void testInterpolationSubset() {
InterpolationTestHelper.testInterpolationSubset(config);
}
@@ -452,7 +452,7 @@ public class TestHierarchicalConfiguration {
* Tests whether interpolation with a subset configuration works over multiple layers.
*/
@Test
- public void testInterpolationSubsetMultipleLayers() {
+ void testInterpolationSubsetMultipleLayers() {
config.clear();
config.addProperty("var", "value");
config.addProperty("prop2.prop[@attr]", "${var}");
@@ -462,7 +462,7 @@ public class TestHierarchicalConfiguration {
}
@Test
- public void testSubset() {
+ void testSubset() {
// test the subset on the first table
Configuration subset = config.subset("tables.table(0)");
assertEquals(NodeStructureHelper.table(0), subset.getProperty("name"));
@@ -502,7 +502,7 @@ public class TestHierarchicalConfiguration {
* Tests subset() if the passed in key selects an attribute.
*/
@Test
- public void testSubsetAttributeResult() {
+ void testSubsetAttributeResult() {
final String key = "tables.table(0)[@type]";
config.addProperty(key, "system");
final BaseHierarchicalConfiguration subset = (BaseHierarchicalConfiguration) config.subset(key);
@@ -515,7 +515,7 @@ public class TestHierarchicalConfiguration {
* only if exactly one of the selected nodes has a value. Related to CONFIGURATION-295.
*/
@Test
- public void testSubsetMultipleNodesWithValues() {
+ void testSubsetMultipleNodesWithValues() {
config.setProperty("tables.table(0).fields", "My fields");
Configuration subset = config.subset("tables.table.fields");
assertEquals("My fields", subset.getString(""));
@@ -529,7 +529,7 @@ public class TestHierarchicalConfiguration {
* to CONFIGURATION-295.
*/
@Test
- public void testSubsetNodeWithValue() {
+ void testSubsetNodeWithValue() {
config.setProperty("tables.table(0).fields", "My fields");
final Configuration subset = config.subset("tables.table(0).fields");
assertEquals(NodeStructureHelper.field(0, 0), subset.getString("field(0).name"));
diff --git a/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java b/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java
index 1650a0d9..ad801f7a 100644
--- a/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java
+++ b/src/test/java/org/apache/commons/configuration2/TestHierarchicalConfigurationXMLReader.java
@@ -50,7 +50,7 @@ public class TestHierarchicalConfigurationXMLReader {
}
@Test
- public void testParse() throws Exception {
+ void testParse() throws Exception {
final SAXSource source = new SAXSource(parser, new InputSource());
final DOMResult result = new DOMResult();
final Transformer trans = TransformerFactory.newInstance().newTransformer();
diff --git a/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java
index 0b81fce3..5e1b4a79 100644
--- a/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java
@@ -95,7 +95,7 @@ public class TestHierarchicalXMLConfiguration {
}
@Test
- public void testGetProperty() throws Exception {
+ void testGetProperty() throws Exception {
final FileHandler handler = new FileHandler(config);
handler.setFileName(TEST_FILE);
handler.load();
@@ -104,7 +104,7 @@ public class TestHierarchicalXMLConfiguration {
}
@Test
- public void testLoadBasePath1() throws Exception {
+ void testLoadBasePath1() throws Exception {
final FileHandler handler = new FileHandler(config);
handler.setBasePath(TEST_DIR);
handler.setFileName(TEST_FILENAME);
@@ -113,7 +113,7 @@ public class TestHierarchicalXMLConfiguration {
}
@Test
- public void testLoadBasePath2() throws Exception {
+ void testLoadBasePath2() throws Exception {
final FileHandler handler = new FileHandler(config);
handler.setBasePath(new File(TEST_FILE).getAbsoluteFile().toURI().toURL().toString());
handler.setFileName(TEST_FILENAME);
@@ -122,7 +122,7 @@ public class TestHierarchicalXMLConfiguration {
}
@Test
- public void testLoadURL() throws Exception {
+ void testLoadURL() throws Exception {
final FileHandler handler = new FileHandler(config);
handler.load(new File(TEST_FILE).getAbsoluteFile().toURI().toURL());
configTest(config);
@@ -132,14 +132,14 @@ public class TestHierarchicalXMLConfiguration {
* Tests manipulation of the root element's name.
*/
@Test
- public void testRootElement() throws Exception {
+ void testRootElement() throws Exception {
assertEquals("configuration", config.getRootElementName());
config.setRootElementName("newRootName");
assertEquals("newRootName", config.getRootElementName());
}
@Test
- public void testSave() throws Exception {
+ void testSave() throws Exception {
final FileHandler handler = new FileHandler(config);
handler.setFileName(TEST_FILE3);
handler.load();
@@ -161,7 +161,7 @@ public class TestHierarchicalXMLConfiguration {
* Tests to save a modified configuration.
*/
@Test
- public void testSaveModified() throws Exception {
+ void testSaveModified() throws Exception {
FileHandler handler = new FileHandler(config);
handler.setFile(new File(TEST_FILE3));
handler.load();
@@ -201,7 +201,7 @@ public class TestHierarchicalXMLConfiguration {
* Tests to save a newly created configuration.
*/
@Test
- public void testSaveNew() throws Exception {
+ void testSaveNew() throws Exception {
config.addProperty("connection.url", "jdbc://mydb:1234");
config.addProperty("connection.user", "scott");
config.addProperty("connection.passwd", "tiger");
@@ -239,7 +239,7 @@ public class TestHierarchicalXMLConfiguration {
* Tests that it is not allowed to change the root element name when the configuration was loaded from a file.
*/
@Test
- public void testSetRootElementNameWhenLoadedFromFile() throws Exception {
+ void testSetRootElementNameWhenLoadedFromFile() throws Exception {
final FileHandler handler = new FileHandler(config);
handler.setFile(new File(TEST_FILE3));
handler.load();
@@ -251,7 +251,7 @@ public class TestHierarchicalXMLConfiguration {
* Ensure various node types are correctly processed in config.
*/
@Test
- public void testXmlNodeTypes() throws Exception {
+ void testXmlNodeTypes() throws Exception {
// Number of keys expected from test configuration file
final int keyCount = 5;
diff --git a/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java
index 97ead527..17265497 100644
--- a/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestINIConfiguration.java
@@ -297,7 +297,7 @@ public class TestINIConfiguration {
* Test of read method with changed comment leading separator
*/
@Test
- public void testCommentLeadingSeparatorUsedInINIInput() throws Exception {
+ void testCommentLeadingSeparatorUsedInINIInput() throws Exception {
final String inputCommentLeadingSeparator = ";";
final String input = "[section]" + LINE_SEPARATOR + "key1=a;b;c" + LINE_SEPARATOR + "key2=a#b#c" + LINE_SEPARATOR + ";key3=value3" + LINE_SEPARATOR
+ "#key4=value4" + LINE_SEPARATOR;
@@ -316,7 +316,7 @@ public class TestINIConfiguration {
* Tests correct handling of empty sections "[ ]".
*/
@Test
- public void testEmptySection() throws ConfigurationException {
+ void testEmptySection() throws ConfigurationException {
final INIConfiguration config = setUpConfig("[]" + LINE_SEPARATOR + "key=value" + LINE_SEPARATOR);
final String value = config.getString(" .key");
assertEquals("value", value);
@@ -326,7 +326,7 @@ public class TestINIConfiguration {
* Tests whether an expression engine can be used which ignores case.
*/
@Test
- public void testExpressionEngineIgnoringCase() throws ConfigurationException {
+ void testExpressionEngineIgnoringCase() throws ConfigurationException {
final DefaultExpressionEngine engine = new DefaultExpressionEngine(DefaultExpressionEngineSymbols.DEFAULT_SYMBOLS, NodeNameMatchers.EQUALS_IGNORE_CASE);
final INIConfiguration config = new INIConfiguration();
config.setExpressionEngine(engine);
@@ -342,7 +342,7 @@ public class TestINIConfiguration {
* Tests a property that has no key.
*/
@Test
- public void testGetPropertyNoKey() throws ConfigurationException {
+ void testGetPropertyNoKey() throws ConfigurationException {
final String data = INI_DATA2 + LINE_SEPARATOR + "= noKey" + LINE_SEPARATOR;
final INIConfiguration config = setUpConfig(data);
assertEquals("noKey", config.getString("section4. "));
@@ -352,7 +352,7 @@ public class TestINIConfiguration {
* Tests a property that has no value.
*/
@Test
- public void testGetPropertyNoValue() throws ConfigurationException {
+ void testGetPropertyNoValue() throws ConfigurationException {
final String data = INI_DATA2 + LINE_SEPARATOR + "noValue =" + LINE_SEPARATOR;
final INIConfiguration config = setUpConfig(data);
assertEquals("", config.getString("section4.noValue"));
@@ -362,7 +362,7 @@ public class TestINIConfiguration {
* Tests whether the sub configuration returned by getSection() is connected to the parent.
*/
@Test
- public void testGetSectionConnected() throws ConfigurationException {
+ void testGetSectionConnected() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA);
final HierarchicalConfiguration<ImmutableNode> section = config.getSection("section1");
section.setProperty("var1", "foo2");
@@ -373,7 +373,7 @@ public class TestINIConfiguration {
* Tests whether getSection() can deal with duplicate sections.
*/
@Test
- public void testGetSectionDuplicate() {
+ void testGetSectionDuplicate() {
final INIConfiguration config = new INIConfiguration();
config.addProperty("section.var1", "value1");
config.addProperty("section(-1).var2", "value2");
@@ -387,7 +387,7 @@ public class TestINIConfiguration {
* Tests querying the properties of an existing section.
*/
@Test
- public void testGetSectionExisting() throws ConfigurationException {
+ void testGetSectionExisting() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA);
final HierarchicalConfiguration<ImmutableNode> section = config.getSection("section1");
assertEquals("foo", section.getString("var1"));
@@ -398,7 +398,7 @@ public class TestINIConfiguration {
* Tests concurrent access to the global section.
*/
@Test
- public void testGetSectionGloabalMultiThreaded() throws ConfigurationException, InterruptedException {
+ void testGetSectionGloabalMultiThreaded() throws ConfigurationException, InterruptedException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
config.setSynchronizer(new ReadWriteSynchronizer());
final int threadCount = 10;
@@ -417,7 +417,7 @@ public class TestINIConfiguration {
* Tests querying the content of the global section.
*/
@Test
- public void testGetSectionGlobal() throws ConfigurationException {
+ void testGetSectionGlobal() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
final HierarchicalConfiguration<ImmutableNode> section = config.getSection(null);
assertEquals("testGlobal", section.getString("globalVar"));
@@ -427,7 +427,7 @@ public class TestINIConfiguration {
* Tests querying the content of the global section if there is none.
*/
@Test
- public void testGetSectionGlobalNonExisting() throws ConfigurationException {
+ void testGetSectionGlobalNonExisting() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA);
final HierarchicalConfiguration<ImmutableNode> section = config.getSection(null);
assertTrue(section.isEmpty());
@@ -437,7 +437,7 @@ public class TestINIConfiguration {
* Tests querying the properties of a section that was merged from two sections with the same name.
*/
@Test
- public void testGetSectionMerged() throws ConfigurationException {
+ void testGetSectionMerged() throws ConfigurationException {
final String data = INI_DATA + "[section1]" + LINE_SEPARATOR + "var3 = merged" + LINE_SEPARATOR;
final INIConfiguration config = setUpConfig(data);
final HierarchicalConfiguration<ImmutableNode> section = config.getSection("section1");
@@ -450,7 +450,7 @@ public class TestINIConfiguration {
* Tests querying a non existing section.
*/
@Test
- public void testGetSectionNonExisting() throws ConfigurationException {
+ void testGetSectionNonExisting() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA);
final HierarchicalConfiguration<ImmutableNode> section = config.getSection("Non existing section");
assertTrue(section.isEmpty());
@@ -460,7 +460,7 @@ public class TestINIConfiguration {
* Tests whether a section that was created by getSection() can be manipulated.
*/
@Test
- public void testGetSectionNonExistingManipulate() throws ConfigurationException, IOException {
+ void testGetSectionNonExistingManipulate() throws ConfigurationException, IOException {
final INIConfiguration config = setUpConfig(INI_DATA);
HierarchicalConfiguration<ImmutableNode> section = config.getSection("newSection");
section.addProperty("test", "success");
@@ -476,7 +476,7 @@ public class TestINIConfiguration {
* Test of getSections method, of class {@link INIConfiguration}.
*/
@Test
- public void testGetSections() {
+ void testGetSections() {
final INIConfiguration instance = new INIConfiguration();
instance.addProperty("test1.foo", "bar");
instance.addProperty("test2.foo", "abc");
@@ -491,7 +491,7 @@ public class TestINIConfiguration {
* Tests whether a section added later is also found by getSections().
*/
@Test
- public void testGetSectionsAdded() throws ConfigurationException {
+ void testGetSectionsAdded() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA2);
config.addProperty("section5.test", Boolean.TRUE);
checkSectionNames(config, new String[] {"section4", "section5"});
@@ -502,7 +502,7 @@ public class TestINIConfiguration {
* CONFIGURATION-327.
*/
@Test
- public void testGetSectionsDottedVar() throws ConfigurationException {
+ void testGetSectionsDottedVar() throws ConfigurationException {
final String data = "dotted.var = 1" + LINE_SEPARATOR + INI_DATA_GLOBAL;
final INIConfiguration config = checkSectionNames(data, new String[] {null, "section1", "section2", "section3"});
assertEquals(1, config.getInt("dotted..var"));
@@ -512,7 +512,7 @@ public class TestINIConfiguration {
* Tests whether the sections of a configuration can be queried that contains only a global section.
*/
@Test
- public void testGetSectionsGlobalOnly() throws ConfigurationException {
+ void testGetSectionsGlobalOnly() throws ConfigurationException {
checkSectionNames(INI_DATA_GLOBAL_ONLY, new String[] {null});
}
@@ -520,7 +520,7 @@ public class TestINIConfiguration {
* Tests querying the sections if there is no global section.
*/
@Test
- public void testGetSectionsNoGlobal() throws ConfigurationException {
+ void testGetSectionsNoGlobal() throws ConfigurationException {
checkSectionNames(INI_DATA, new String[] {"section1", "section2", "section3"});
}
@@ -528,7 +528,7 @@ public class TestINIConfiguration {
* Tests whether synchronization is performed when querying the configuration's sections.
*/
@Test
- public void testGetSectionsSynchronized() throws ConfigurationException {
+ void testGetSectionsSynchronized() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA);
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
config.setSynchronizer(sync);
@@ -540,7 +540,7 @@ public class TestINIConfiguration {
* Tests querying the sections if a global section if available.
*/
@Test
- public void testGetSectionsWithGlobal() throws ConfigurationException {
+ void testGetSectionsWithGlobal() throws ConfigurationException {
checkSectionNames(INI_DATA_GLOBAL, new String[] {null, "section1", "section2", "section3"});
}
@@ -549,7 +549,7 @@ public class TestINIConfiguration {
*/
@ParameterizedTest
@MethodSource("provideSectionsWithComments")
- public void testGetSectionsWithInLineComment(final String source, final boolean allowComments, final String[] results) throws ConfigurationException {
+ void testGetSectionsWithInLineComment(final String source, final boolean allowComments, final String[] results) throws ConfigurationException {
final INIConfiguration config = setUpConfig(source, allowComments);
checkSectionNames(config, results);
}
@@ -558,7 +558,7 @@ public class TestINIConfiguration {
* Tests reading a property from the global section.
*/
@Test
- public void testGlobalProperty() throws ConfigurationException {
+ void testGlobalProperty() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
assertEquals("testGlobal", config.getString("globalVar"));
}
@@ -567,7 +567,7 @@ public class TestINIConfiguration {
* Tests whether the sub configuration for the global section is connected to its parent.
*/
@Test
- public void testGlobalSectionConnected() throws ConfigurationException {
+ void testGlobalSectionConnected() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
final HierarchicalConfiguration<ImmutableNode> sub = config.getSection(null);
config.setProperty("globalVar", "changed");
@@ -578,7 +578,7 @@ public class TestINIConfiguration {
* Tests whether the node handler of a global section correctly returns a child by index.
*/
@Test
- public void testGlobalSectionNodeHandlerGetChildByIndex() throws ConfigurationException {
+ void testGlobalSectionNodeHandlerGetChildByIndex() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
final SubnodeConfiguration sub = config.getSection(null);
final NodeHandler<ImmutableNode> handler = sub.getModel().getNodeHandler();
@@ -592,7 +592,7 @@ public class TestINIConfiguration {
* Tests whether the node handler of a global section correctly filters named children.
*/
@Test
- public void testGlobalSectionNodeHandlerGetChildrenByName() throws ConfigurationException {
+ void testGlobalSectionNodeHandlerGetChildrenByName() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
final SubnodeConfiguration sub = config.getSection(null);
final NodeHandler<ImmutableNode> handler = sub.getModel().getNodeHandler();
@@ -603,7 +603,7 @@ public class TestINIConfiguration {
* Tests whether the node handler of a global section correctly determines the number of children.
*/
@Test
- public void testGlobalSectionNodeHandlerGetChildrenCount() throws ConfigurationException {
+ void testGlobalSectionNodeHandlerGetChildrenCount() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
final SubnodeConfiguration sub = config.getSection(null);
final NodeHandler<ImmutableNode> handler = sub.getModel().getNodeHandler();
@@ -614,7 +614,7 @@ public class TestINIConfiguration {
* Tests whether the node handler of a global section correctly determines the index of a child.
*/
@Test
- public void testGlobalSectionNodeHandlerIndexOfChild() throws ConfigurationException {
+ void testGlobalSectionNodeHandlerIndexOfChild() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
final SubnodeConfiguration sub = config.getSection(null);
final NodeHandler<ImmutableNode> handler = sub.getModel().getNodeHandler();
@@ -627,7 +627,7 @@ public class TestINIConfiguration {
* Test of isCommentLine method, of class {@link INIConfiguration}.
*/
@Test
- public void testIsCommentLine() {
+ void testIsCommentLine() {
final INIConfiguration instance = new INIConfiguration();
assertTrue(instance.isCommentLine("#comment1"));
assertTrue(instance.isCommentLine(";comment1"));
@@ -639,7 +639,7 @@ public class TestINIConfiguration {
* Test of isSectionLine method, of class {@link INIConfiguration}.
*/
@Test
- public void testIsSectionLine() {
+ void testIsSectionLine() {
final INIConfiguration instance = new INIConfiguration();
assertTrue(instance.isSectionLine("[section]"));
assertFalse(instance.isSectionLine("nosection=true"));
@@ -650,7 +650,7 @@ public class TestINIConfiguration {
* Tests whether only properties with values occur in the enumeration of the global section.
*/
@Test
- public void testKeysOfGlobalSection() throws ConfigurationException {
+ void testKeysOfGlobalSection() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_GLOBAL);
final HierarchicalConfiguration<ImmutableNode> sub = config.getSection(null);
final Iterator<String> keys = sub.getKeys();
@@ -668,7 +668,7 @@ public class TestINIConfiguration {
* Tests a property whose value spans multiple lines.
*/
@Test
- public void testLineContinuation() throws ConfigurationException {
+ void testLineContinuation() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA3);
assertEquals("one" + LINE_SEPARATOR + "two" + LINE_SEPARATOR + "three", config.getString("section5.multiLine"));
}
@@ -677,7 +677,7 @@ public class TestINIConfiguration {
* Tests a line continuation at the end of the file.
*/
@Test
- public void testLineContinuationAtEnd() throws ConfigurationException {
+ void testLineContinuationAtEnd() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA3);
assertEquals("one" + LINE_SEPARATOR, config.getString("section5.continueNoLine"));
}
@@ -686,7 +686,7 @@ public class TestINIConfiguration {
* Tests a property whose value spans multiple lines with a comment.
*/
@Test
- public void testLineContinuationComment() throws ConfigurationException {
+ void testLineContinuationComment() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA3);
assertEquals("one" + LINE_SEPARATOR + "two", config.getString("section5.multiComment"));
}
@@ -695,7 +695,7 @@ public class TestINIConfiguration {
* Tests a multi-line property value with an empty line.
*/
@Test
- public void testLineContinuationEmptyLine() throws ConfigurationException {
+ void testLineContinuationEmptyLine() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA3);
assertEquals(LINE_SEPARATOR + "line 2", config.getString("section5.noFirstLine"));
}
@@ -704,7 +704,7 @@ public class TestINIConfiguration {
* Tests a property value that ends on a backslash, which is no line continuation character.
*/
@Test
- public void testLineContinuationNone() throws ConfigurationException {
+ void testLineContinuationNone() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA3);
assertEquals("C:\\Temp\\", config.getString("section5.singleLine"));
}
@@ -714,7 +714,7 @@ public class TestINIConfiguration {
* trimmed.
*/
@Test
- public void testLineContinuationQuoted() throws ConfigurationException {
+ void testLineContinuationQuoted() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA3);
assertEquals("one" + LINE_SEPARATOR + " two " + LINE_SEPARATOR + "three", config.getString("section5.multiQuoted"));
}
@@ -723,7 +723,7 @@ public class TestINIConfiguration {
* Tests a property with a quoted value spanning multiple lines and a comment.
*/
@Test
- public void testLineContinuationQuotedComment() throws ConfigurationException {
+ void testLineContinuationQuotedComment() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA3);
assertEquals(" one " + LINE_SEPARATOR + "two", config.getString("section5.multiQuotedComment"));
}
@@ -732,7 +732,7 @@ public class TestINIConfiguration {
* Tests whether the configuration deals correctly with list delimiters.
*/
@Test
- public void testListDelimiterHandling() throws ConfigurationException {
+ void testListDelimiterHandling() throws ConfigurationException {
final INIConfiguration config = new INIConfiguration();
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
config.addProperty("list", "a,b,c");
@@ -747,7 +747,7 @@ public class TestINIConfiguration {
* Tests whether property values are correctly escaped even if they are part of a property with multiple values.
*/
@Test
- public void testListDelimiterHandlingInList() throws ConfigurationException {
+ void testListDelimiterHandlingInList() throws ConfigurationException {
final String data = INI_DATA + "[sectest]" + LINE_SEPARATOR + "list = 3\\,1415,pi,\\\\Test\\,5" + LINE_SEPARATOR;
final INIConfiguration config = setUpConfig(data);
final INIConfiguration config2 = setUpConfig(saveToString(config));
@@ -759,7 +759,7 @@ public class TestINIConfiguration {
* Tests whether parsing of lists can be disabled.
*/
@Test
- public void testListParsingDisabled() throws ConfigurationException {
+ void testListParsingDisabled() throws ConfigurationException {
final INIConfiguration config = new INIConfiguration();
load(config, "[test]" + LINE_SEPARATOR + "nolist=1,2,3");
assertEquals("1,2,3", config.getString("test.nolist"));
@@ -769,7 +769,7 @@ public class TestINIConfiguration {
* Test of load method, of class {@link INIConfiguration}.
*/
@Test
- public void testLoad() throws Exception {
+ void testLoad() throws Exception {
checkLoad(INI_DATA);
}
@@ -777,7 +777,7 @@ public class TestINIConfiguration {
* Tests the load() method when the alternative value separator is used (a ':' for '=').
*/
@Test
- public void testLoadAlternativeSeparator() throws Exception {
+ void testLoadAlternativeSeparator() throws Exception {
checkLoad(INI_DATA.replace('=', ':'));
}
@@ -785,7 +785,7 @@ public class TestINIConfiguration {
* Tests whether an instance can be created using a file-based builder.
*/
@Test
- public void testLoadFromBuilder() throws ConfigurationException, IOException {
+ void testLoadFromBuilder() throws ConfigurationException, IOException {
final File file = writeTestFile(INI_DATA);
final FileBasedConfigurationBuilder<INIConfiguration> builder = new FileBasedConfigurationBuilder<>(INIConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl().setFile(file));
@@ -797,7 +797,7 @@ public class TestINIConfiguration {
* Tests whether a duplicate session is merged.
*/
@Test
- public void testMergeDuplicateSection() throws ConfigurationException, IOException {
+ void testMergeDuplicateSection() throws ConfigurationException, IOException {
final String data = "[section]\nvar1 = sec1\n\n" + "[section]\nvar2 = sec2\n";
final INIConfiguration config = setUpConfig(data);
assertEquals("sec1", config.getString("section.var1"));
@@ -817,7 +817,7 @@ public class TestINIConfiguration {
* Tests property definitions containing multiple separators.
*/
@Test
- public void testMultipleSeparators() throws ConfigurationException {
+ void testMultipleSeparators() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_SEPARATORS);
assertEquals("value=5", config.getString("section.var5"));
assertEquals("6=value", config.getString("section.var"));
@@ -827,7 +827,7 @@ public class TestINIConfiguration {
* Tests property definitions containing multiple separators that are quoted.
*/
@Test
- public void testMultipleSeparatorsQuoted() throws ConfigurationException {
+ void testMultipleSeparatorsQuoted() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_SEPARATORS);
assertEquals("value7", config.getString("section.var:7"));
assertEquals("value8", config.getString("section.var:8"));
@@ -838,7 +838,7 @@ public class TestINIConfiguration {
* is related to CONFIGURATION-622.
*/
@Test
- public void testPropertyWithDelimiter() throws ConfigurationException {
+ void testPropertyWithDelimiter() throws ConfigurationException {
final String data = INI_DATA + "key.dot = dotValue";
final INIConfiguration conf = new INIConfiguration();
load(conf, data);
@@ -848,7 +848,7 @@ public class TestINIConfiguration {
}
@Test
- public void testQuotedValue() throws Exception {
+ void testQuotedValue() throws Exception {
final INIConfiguration config = setUpConfig(INI_DATA2);
assertEquals("quoted value", config.getString("section4.var1"));
}
@@ -857,25 +857,25 @@ public class TestINIConfiguration {
* Tests an empty quoted value.
*/
@Test
- public void testQuotedValueEmpty() throws ConfigurationException {
+ void testQuotedValueEmpty() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA2);
assertEquals("", config.getString("section4.var6"));
}
@Test
- public void testQuotedValueWithComment() throws Exception {
+ void testQuotedValueWithComment() throws Exception {
final INIConfiguration config = setUpConfig(INI_DATA2);
assertEquals("1;2;3", config.getString("section4.var4"));
}
@Test
- public void testQuotedValueWithQuotes() throws Exception {
+ void testQuotedValueWithQuotes() throws Exception {
final INIConfiguration config = setUpConfig(INI_DATA2);
assertEquals("quoted value\\nwith \"quotes\"", config.getString("section4.var2"));
}
@Test
- public void testQuotedValueWithSingleQuotes() throws Exception {
+ void testQuotedValueWithSingleQuotes() throws Exception {
final INIConfiguration config = setUpConfig(INI_DATA2);
assertEquals("'quoted' \"value\"", config.getString("section4.var5"));
}
@@ -884,7 +884,7 @@ public class TestINIConfiguration {
* Tests whether whitespace is left unchanged for quoted values.
*/
@Test
- public void testQuotedValueWithWhitespace() throws Exception {
+ void testQuotedValueWithWhitespace() throws Exception {
final String content = "CmdPrompt = \" [test@cmd ~]$ \"";
final INIConfiguration config = setUpConfig(content);
assertEquals(" [test@cmd ~]$ ", config.getString("CmdPrompt"));
@@ -894,7 +894,7 @@ public class TestINIConfiguration {
* Tests a quoted value with space and a comment.
*/
@Test
- public void testQuotedValueWithWhitespaceAndComment() throws Exception {
+ void testQuotedValueWithWhitespaceAndComment() throws Exception {
final String content = "CmdPrompt = \" [test@cmd ~]$ \" ; a comment";
final INIConfiguration config = setUpConfig(content);
assertEquals(" [test@cmd ~]$ ", config.getString("CmdPrompt"));
@@ -904,7 +904,7 @@ public class TestINIConfiguration {
* Test of save method, of class {@link INIConfiguration}.
*/
@Test
- public void testSave() throws Exception {
+ void testSave() throws Exception {
final Writer writer = new StringWriter();
final INIConfiguration instance = new INIConfiguration();
instance.addProperty("section1.var1", "foo");
@@ -924,7 +924,7 @@ public class TestINIConfiguration {
* Tests whether a section that has been cleared can be manipulated and saved later.
*/
@Test
- public void testSaveClearedSection() throws ConfigurationException, IOException {
+ void testSaveClearedSection() throws ConfigurationException, IOException {
final String data = "[section]\ntest = failed\n";
final INIConfiguration config = setUpConfig(data);
SubnodeConfiguration sub = config.getSection("section");
@@ -944,7 +944,7 @@ public class TestINIConfiguration {
* to CONFIGURATION-409.
*/
@Test
- public void testSaveKeysWithDelimiters() throws ConfigurationException, IOException {
+ void testSaveKeysWithDelimiters() throws ConfigurationException, IOException {
INIConfiguration conf = new INIConfiguration();
final String section = "Section..with..dots";
conf.addProperty(section + ".test1", "test1");
@@ -961,7 +961,7 @@ public class TestINIConfiguration {
* Tests whether list delimiter parsing can be disabled.
*/
@Test
- public void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
+ void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
final INIConfiguration config = new INIConfiguration();
final String data = INI_DATA.substring(0, INI_DATA.length() - LINE_SEPARATOR.length()) + "nolist = 1,2, 3";
load(config, data);
@@ -976,7 +976,7 @@ public class TestINIConfiguration {
* Tests saving a configuration that contains a global section.
*/
@Test
- public void testSaveWithGlobalSection() throws ConfigurationException {
+ void testSaveWithGlobalSection() throws ConfigurationException {
checkSave(INI_DATA_GLOBAL);
}
@@ -984,7 +984,7 @@ public class TestINIConfiguration {
* Tests whether a configuration that contains only a global section can be saved correctly.
*/
@Test
- public void testSaveWithOnlyGlobalSection() throws ConfigurationException {
+ void testSaveWithOnlyGlobalSection() throws ConfigurationException {
checkSave(INI_DATA_GLOBAL_ONLY);
}
@@ -992,7 +992,7 @@ public class TestINIConfiguration {
* Tests whether the different separators with or without whitespace are recognized.
*/
@Test
- public void testSeparators() throws ConfigurationException {
+ void testSeparators() throws ConfigurationException {
final INIConfiguration config = setUpConfig(INI_DATA_SEPARATORS);
for (int i = 1; i <= 4; i++) {
assertEquals("value" + i, config.getString("section.var" + i));
@@ -1003,7 +1003,7 @@ public class TestINIConfiguration {
* Test of read method with changed separator.
*/
@Test
- public void testSeparatorUsedInINIInput() throws Exception {
+ void testSeparatorUsedInINIInput() throws Exception {
final String inputSeparator = "=";
final String input = "[section]" + LINE_SEPARATOR + "k1:v1$key1=value1" + LINE_SEPARATOR + "k1:v1,k2:v2$key2=value2" + LINE_SEPARATOR + "key3:value3"
+ LINE_SEPARATOR + "key4 = value4" + LINE_SEPARATOR;
@@ -1022,7 +1022,7 @@ public class TestINIConfiguration {
* Test of save method with changed separator
*/
@Test
- public void testSeparatorUsedInINIOutput() throws Exception {
+ void testSeparatorUsedInINIOutput() throws Exception {
final String outputSeparator = ": ";
final String input = MessageFormat.format(INI_DATA4, "=").trim();
final String expectedOutput = MessageFormat.format(INI_DATA4, outputSeparator).trim();
@@ -1043,7 +1043,7 @@ public class TestINIConfiguration {
*/
@ParameterizedTest
@MethodSource("provideValuesWithComments")
- public void testValueWithComment(final String source, final String key, final String value) throws Exception {
+ void testValueWithComment(final String source, final String key, final String value) throws Exception {
final INIConfiguration config = setUpConfig(source);
assertEquals(value, config.getString(key));
}
@@ -1052,7 +1052,7 @@ public class TestINIConfiguration {
* Tests whether the list delimiter character is recognized.
*/
@Test
- public void testValueWithDelimiters() throws ConfigurationException {
+ void testValueWithDelimiters() throws ConfigurationException {
final INIConfiguration config = setUpConfig("[test]" + LINE_SEPARATOR + "list=1,2,3" + LINE_SEPARATOR);
final List<Object> list = config.getList("test.list");
assertEquals(Arrays.asList("1", "2", "3"), list);
@@ -1063,7 +1063,7 @@ public class TestINIConfiguration {
* CONFIGURATION-434.
*/
@Test
- public void testValueWithSemicolon() throws ConfigurationException {
+ void testValueWithSemicolon() throws ConfigurationException {
final String path = "C:\\Program Files\\jar\\manage.jar;" + "C:\\Program Files\\jar\\guiLauncher.jar";
final String content = "[Environment]" + LINE_SEPARATOR + "Application Type=any" + LINE_SEPARATOR + "Class Path=" + path + " ;comment" + LINE_SEPARATOR
+ "Path=" + path + "\t; another comment";
@@ -1076,7 +1076,7 @@ public class TestINIConfiguration {
* Tests whether an empty section can be saved. This is related to CONFIGURATION-671.
*/
@Test
- public void testWriteEmptySection() throws ConfigurationException, IOException {
+ void testWriteEmptySection() throws ConfigurationException, IOException {
final String section = "[EmptySection]";
final INIConfiguration config = setUpConfig(section);
assertEquals(Collections.singleton("EmptySection"), config.getSections());
@@ -1087,7 +1087,7 @@ public class TestINIConfiguration {
}
@Test
- public void testWriteValueWithCommentChar() throws Exception {
+ void testWriteValueWithCommentChar() throws Exception {
final INIConfiguration config = new INIConfiguration();
config.setProperty("section.key1", "1;2;3");
diff --git a/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java
index ba2ceda9..4bd36599 100644
--- a/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestImmutableConfiguration.java
@@ -67,7 +67,7 @@ public class TestImmutableConfiguration {
* Tests that exceptions thrown by the wrapped configuration are handled correctly.
*/
@Test
- public void testExceptionHandling() {
+ void testExceptionHandling() {
final PropertiesConfiguration config = new PropertiesConfiguration();
final String property = "nonExistingProperty";
config.setThrowExceptionOnMissing(true);
@@ -80,7 +80,7 @@ public class TestImmutableConfiguration {
* Tests whether an immutable subset can be queried.
*/
@Test
- public void testImmutableSubset() throws ConfigurationException {
+ void testImmutableSubset() throws ConfigurationException {
final ImmutableConfiguration conf = ConfigurationUtils.unmodifiableConfiguration(createTestConfig());
final ImmutableConfiguration subset = conf.immutableSubset("test");
assertFalse(subset.isEmpty());
@@ -91,7 +91,7 @@ public class TestImmutableConfiguration {
* Tests whether data can be accessed from an unmodifiable configuration.
*/
@Test
- public void testUnmodifiableConfigurationAccess() throws ConfigurationException {
+ void testUnmodifiableConfigurationAccess() throws ConfigurationException {
final Configuration confOrg = createTestConfig();
final ImmutableConfiguration conf = ConfigurationUtils.unmodifiableConfiguration(confOrg);
assertFalse(conf.isEmpty());
@@ -106,7 +106,7 @@ public class TestImmutableConfiguration {
* Tests that a cast to a mutable configuration is not possible.
*/
@Test
- public void testUnmodifiableConfigurationCast() throws ConfigurationException {
+ void testUnmodifiableConfigurationCast() throws ConfigurationException {
final ImmutableConfiguration conf = ConfigurationUtils.unmodifiableConfiguration(createTestConfig());
assertThrows(ClassCastException.class, () -> {
final Configuration mutableConf = (Configuration) conf;
@@ -118,7 +118,7 @@ public class TestImmutableConfiguration {
* Tests an iteration over the keys of the immutable configuration.
*/
@Test
- public void testUnmodifiableConfigurationIterate() throws ConfigurationException {
+ void testUnmodifiableConfigurationIterate() throws ConfigurationException {
final Configuration confOrg = createTestConfig();
final ImmutableConfiguration conf = ConfigurationUtils.unmodifiableConfiguration(confOrg);
assertEquals(fetchKeys(confOrg.getKeys()), fetchKeys(conf.getKeys()));
@@ -128,7 +128,7 @@ public class TestImmutableConfiguration {
* Tests that it is not possible to remove keys using the iterator.
*/
@Test
- public void testUnmodifiableConfigurationIteratorRemove() throws ConfigurationException {
+ void testUnmodifiableConfigurationIteratorRemove() throws ConfigurationException {
final ImmutableConfiguration conf = ConfigurationUtils.unmodifiableConfiguration(createTestConfig());
final Iterator<String> it = conf.getKeys();
it.next();
@@ -139,7 +139,7 @@ public class TestImmutableConfiguration {
* Tests whether an update of the original configuration is visible for the immutable view.
*/
@Test
- public void testUnmodifiableConfigurationLiveUpdate() throws ConfigurationException {
+ void testUnmodifiableConfigurationLiveUpdate() throws ConfigurationException {
final Configuration confOrg = createTestConfig();
final ImmutableConfiguration conf = ConfigurationUtils.unmodifiableConfiguration(confOrg);
final String key = "new.property";
@@ -152,7 +152,7 @@ public class TestImmutableConfiguration {
* Tries to create an immutable configuration from a null object.
*/
@Test
- public void testUnmodifiableConfigurationNull() {
+ void testUnmodifiableConfigurationNull() {
assertThrows(NullPointerException.class, () -> ConfigurationUtils.unmodifiableConfiguration(null));
}
@@ -160,7 +160,7 @@ public class TestImmutableConfiguration {
* Tests different access methods for properties.
*/
@Test
- public void testUnmodifiableConfigurationOtherTypes() throws ConfigurationException {
+ void testUnmodifiableConfigurationOtherTypes() throws ConfigurationException {
final ImmutableConfiguration conf = ConfigurationUtils.unmodifiableConfiguration(createTestConfig());
assertEquals((byte) 10, conf.getByte("test.byte"));
assertTrue(conf.getBoolean("test.boolean"));
@@ -175,7 +175,7 @@ public class TestImmutableConfiguration {
* Tests whether an unmodifiable hierarchical configuration can be created.
*/
@Test
- public void testUnmodifiableHierarchicalConfiguration() {
+ void testUnmodifiableHierarchicalConfiguration() {
final HierarchicalConfiguration<?> conf = new BaseHierarchicalConfiguration();
final String key = "test";
conf.addProperty(key, Boolean.TRUE);
diff --git a/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java
index 8e0ae6b7..29d437ac 100644
--- a/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestJNDIConfiguration.java
@@ -149,22 +149,22 @@ public class TestJNDIConfiguration {
}
@Test
- public void testBoolean() throws Exception {
+ void testBoolean() throws Exception {
nonStringTestHolder.testBoolean();
}
@Test
- public void testBooleanDefaultValue() throws Exception {
+ void testBooleanDefaultValue() throws Exception {
nonStringTestHolder.testBooleanDefaultValue();
}
@Test
- public void testByte() throws Exception {
+ void testByte() throws Exception {
nonStringTestHolder.testByte();
}
@Test
- public void testChangePrefix() {
+ void testChangePrefix() {
assertEquals("true", conf.getString("test.boolean"));
assertNull(conf.getString("boolean"));
@@ -175,7 +175,7 @@ public class TestJNDIConfiguration {
}
@Test
- public void testConstructor() throws Exception {
+ void testConstructor() throws Exception {
// test the constructor accepting a context
JNDIConfiguration c = new JNDIConfiguration(new InitialContext());
@@ -188,7 +188,7 @@ public class TestJNDIConfiguration {
}
@Test
- public void testContainsKey() {
+ void testContainsKey() {
final String key = "test.boolean";
assertTrue(conf.containsKey(key));
@@ -200,28 +200,28 @@ public class TestJNDIConfiguration {
* Tests handling of errors in the containsKey() method.
*/
@Test
- public void testContainsKeyError() {
+ void testContainsKeyError() {
assertFalse(setUpErrorConfig().containsKey("key"));
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, "key", null);
}
@Test
- public void testDouble() throws Exception {
+ void testDouble() throws Exception {
nonStringTestHolder.testDouble();
}
@Test
- public void testDoubleDefaultValue() throws Exception {
+ void testDoubleDefaultValue() throws Exception {
nonStringTestHolder.testDoubleDefaultValue();
}
@Test
- public void testFloat() throws Exception {
+ void testFloat() throws Exception {
nonStringTestHolder.testFloat();
}
@Test
- public void testFloatDefaultValue() throws Exception {
+ void testFloatDefaultValue() throws Exception {
nonStringTestHolder.testFloatDefaultValue();
}
@@ -229,7 +229,7 @@ public class TestJNDIConfiguration {
* Tests handling of errors in getKeys().
*/
@Test
- public void testGetKeysError() {
+ void testGetKeysError() {
assertFalse(setUpErrorConfig().getKeys().hasNext());
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, null, null);
}
@@ -238,7 +238,7 @@ public class TestJNDIConfiguration {
* Tests getKeys() if no data is found. This should not cause a problem and not notify the error listeners.
*/
@Test
- public void testGetKeysNoData() {
+ void testGetKeysNoData() {
conf.installException(new NameNotFoundException("Test exception"));
assertFalse(conf.getKeys().hasNext());
listener.done();
@@ -248,7 +248,7 @@ public class TestJNDIConfiguration {
* Tests the getKeys() method when there are cycles in the tree.
*/
@Test
- public void testGetKeysWithCycles() throws NamingException {
+ void testGetKeysWithCycles() throws NamingException {
final Hashtable<Object, Object> env = new Hashtable<>();
env.put(MockInitialContextFactory.PROP_CYCLES, Boolean.TRUE);
final InitialContext initCtx = new InitialContext(env);
@@ -260,18 +260,18 @@ public class TestJNDIConfiguration {
* Tests handling of errors in getProperty().
*/
@Test
- public void testGetPropertyError() {
+ void testGetPropertyError() {
assertNull(setUpErrorConfig().getProperty("key"));
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, "key", null);
}
@Test
- public void testInteger() throws Exception {
+ void testInteger() throws Exception {
nonStringTestHolder.testInteger();
}
@Test
- public void testIntegerDefaultValue() throws Exception {
+ void testIntegerDefaultValue() throws Exception {
nonStringTestHolder.testIntegerDefaultValue();
}
@@ -279,13 +279,13 @@ public class TestJNDIConfiguration {
* Tests handling of errors in isEmpty().
*/
@Test
- public void testIsEmptyError() throws Exception {
+ void testIsEmptyError() throws Exception {
assertTrue(setUpErrorConfig().isEmpty());
checkErrorListener(ConfigurationErrorEvent.READ, ConfigurationErrorEvent.READ, null, null);
}
@Test
- public void testListMissing() throws Exception {
+ void testListMissing() throws Exception {
nonStringTestHolder.testListMissing();
}
@@ -293,30 +293,30 @@ public class TestJNDIConfiguration {
* Tests whether a JNDI configuration registers an error log listener.
*/
@Test
- public void testLogListener() throws NamingException {
+ void testLogListener() throws NamingException {
final JNDIConfiguration c = new JNDIConfiguration();
assertEquals(1, c.getEventListeners(ConfigurationErrorEvent.ANY).size());
}
@Test
- public void testLong() throws Exception {
+ void testLong() throws Exception {
nonStringTestHolder.testLong();
}
@Test
- public void testLongDefaultValue() throws Exception {
+ void testLongDefaultValue() throws Exception {
nonStringTestHolder.testLongDefaultValue();
}
@Test
- public void testProperties() throws Exception {
+ void testProperties() throws Exception {
final Object o = conf.getProperty("test.boolean");
assertNotNull(o);
assertEquals("true", o.toString());
}
@Test
- public void testResetRemovedProperties() throws Exception {
+ void testResetRemovedProperties() throws Exception {
assertEquals("true", conf.getString("test.boolean"));
// remove the property
@@ -331,17 +331,17 @@ public class TestJNDIConfiguration {
}
@Test
- public void testShort() throws Exception {
+ void testShort() throws Exception {
nonStringTestHolder.testShort();
}
@Test
- public void testShortDefaultValue() throws Exception {
+ void testShortDefaultValue() throws Exception {
nonStringTestHolder.testShortDefaultValue();
}
@Test
- public void testSubset() throws Exception {
+ void testSubset() throws Exception {
nonStringTestHolder.testSubset();
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestJNDIEnvironmentValues.java b/src/test/java/org/apache/commons/configuration2/TestJNDIEnvironmentValues.java
index b1fac081..34cdcb4d 100644
--- a/src/test/java/org/apache/commons/configuration2/TestJNDIEnvironmentValues.java
+++ b/src/test/java/org/apache/commons/configuration2/TestJNDIEnvironmentValues.java
@@ -42,20 +42,20 @@ public class TestJNDIEnvironmentValues {
}
@Test
- public void testClearProperty() {
+ void testClearProperty() {
assertNotNull(conf.getShort("test.short", null));
conf.clearProperty("test.short");
assertNull(conf.getShort("test.short", null));
}
@Test
- public void testContainsKey() throws Exception {
+ void testContainsKey() throws Exception {
assertTrue(conf.containsKey("test.key"));
assertFalse(conf.containsKey("test.imaginarykey"));
}
@Test
- public void testGetKeys() throws Exception {
+ void testGetKeys() throws Exception {
boolean found = false;
final Iterator<String> it = conf.getKeys();
@@ -69,7 +69,7 @@ public class TestJNDIEnvironmentValues {
}
@Test
- public void testGetKeysWithExistingPrefix() {
+ void testGetKeysWithExistingPrefix() {
// test for an existing prefix
final Iterator<String> it = conf.getKeys("test");
boolean found = false;
@@ -81,7 +81,7 @@ public class TestJNDIEnvironmentValues {
}
@Test
- public void testGetKeysWithKeyAsPrefix() {
+ void testGetKeysWithKeyAsPrefix() {
// test for a prefix matching exactly the key of a property
final Iterator<String> it = conf.getKeys("test.boolean");
boolean found = false;
@@ -93,30 +93,30 @@ public class TestJNDIEnvironmentValues {
}
@Test
- public void testGetKeysWithUnknownPrefix() {
+ void testGetKeysWithUnknownPrefix() {
// test for a unknown prefix
final Iterator<String> it = conf.getKeys("foo.bar");
assertFalse(it.hasNext());
}
@Test
- public void testGetMissingKey() throws Exception {
+ void testGetMissingKey() throws Exception {
assertThrows(NoSuchElementException.class, () -> conf.getString("test.imaginarykey"));
}
@Test
- public void testGetMissingKeyWithDefault() throws Exception {
+ void testGetMissingKeyWithDefault() throws Exception {
final String result = conf.getString("test.imaginarykey", "bob");
assertEquals("bob", result);
}
@Test
- public void testIsEmpty() {
+ void testIsEmpty() {
assertFalse(conf.isEmpty());
}
@Test
- public void testMoreGets() throws Exception {
+ void testMoreGets() throws Exception {
final String s = conf.getString("test.key");
assertEquals("jndivalue", s);
assertEquals("jndivalue2", conf.getString("test.key2"));
@@ -124,13 +124,13 @@ public class TestJNDIEnvironmentValues {
}
@Test
- public void testSimpleGet() throws Exception {
+ void testSimpleGet() throws Exception {
final String s = conf.getString("test.key");
assertEquals("jndivalue", s);
}
@Test
- public void testThrowExceptionOnMissing() {
+ void testThrowExceptionOnMissing() {
assertTrue(conf.isThrowExceptionOnMissing());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestJSONConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestJSONConfiguration.java
index 30a22fae..9fd9f80a 100644
--- a/src/test/java/org/apache/commons/configuration2/TestJSONConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestJSONConfiguration.java
@@ -54,7 +54,7 @@ public class TestJSONConfiguration {
}
@Test
- public void testCopyConstructor() {
+ void testCopyConstructor() {
final BaseHierarchicalConfiguration c = new BaseHierarchicalConfiguration();
c.addProperty("foo", "bar");
@@ -65,53 +65,53 @@ public class TestJSONConfiguration {
/**
* Tests CONFIGURATION-793.
*/
- public void testGetListNestedWithList() {
+ void testGetListNestedWithList() {
assertEquals(Arrays.asList("col1", "col2"), jsonConfiguration.getList(String.class, "key4.key5"));
}
@Test
- public void testGetPropertyDictionary() {
+ void testGetPropertyDictionary() {
assertEquals("Martin D'vloper", jsonConfiguration.getProperty("martin.name"));
assertEquals("Developer", jsonConfiguration.getProperty("martin.job"));
assertEquals("Elite", jsonConfiguration.getProperty("martin.skill"));
}
@Test
- public void testGetPropertyDictionaryInList() {
+ void testGetPropertyDictionaryInList() {
assertEquals("UK", jsonConfiguration.getString("capitals(1).country"));
assertEquals("Washington", jsonConfiguration.getString("capitals(0).capital"));
}
@Test
- public void testGetPropertyInteger() {
+ void testGetPropertyInteger() {
final Object property = jsonConfiguration.getProperty("int1");
assertInstanceOf(Integer.class, property);
assertEquals(37, property);
}
@Test
- public void testGetPropertyNested() {
+ void testGetPropertyNested() {
assertEquals("value23", jsonConfiguration.getProperty("key2.key3"));
}
@Test
- public void testGetPropertyNestedWithList() {
+ void testGetPropertyNestedWithList() {
assertEquals(Arrays.asList("col1", "col2"), jsonConfiguration.getProperty("key4.key5"));
}
@Test
- public void testGetPropertySimple() {
+ void testGetPropertySimple() {
assertEquals("value1", jsonConfiguration.getProperty("key1"));
}
@Test
- public void testGetPropertySubset() {
+ void testGetPropertySubset() {
final Configuration subset = jsonConfiguration.subset("key4");
assertEquals(Arrays.asList("col1", "col2"), subset.getProperty("key5"));
}
@Test
- public void testGetPropertyVeryNestedProperties() {
+ void testGetPropertyVeryNestedProperties() {
final Object property = jsonConfiguration.getProperty("very.nested.properties");
assertEquals(Arrays.asList("nested1", "nested2", "nested3"), property);
}
@@ -121,7 +121,7 @@ public class TestJSONConfiguration {
*/
@Disabled
@Test
- public void testListOfObjects() {
+ void testListOfObjects() {
final Configuration subset = jsonConfiguration.subset("capitals");
assertNotNull(subset);
assertEquals(2, subset.size());
@@ -137,7 +137,7 @@ public class TestJSONConfiguration {
}
@Test
- public void testSave() throws IOException, ConfigurationException {
+ void testSave() throws IOException, ConfigurationException {
// save the Configuration as a String...
final StringWriter sw = new StringWriter();
jsonConfiguration.write(sw);
diff --git a/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java
index 7809aa6c..f4b7a400 100644
--- a/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java
@@ -68,7 +68,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
* Tests adding another value to an existing property.
*/
@Test
- public void testAddProperty() {
+ void testAddProperty() {
final MapConfiguration config = (MapConfiguration) getConfiguration();
config.addProperty(KEY, TRIM_VALUE);
config.addProperty(KEY, "anotherValue");
@@ -77,7 +77,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
}
@Test
- public void testClone() {
+ void testClone() {
final MapConfiguration config = (MapConfiguration) getConfiguration();
final MapConfiguration copy = (MapConfiguration) config.clone();
final StrictConfigurationComparator comp = new StrictConfigurationComparator();
@@ -88,7 +88,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
* Tests whether interpolation works as expected after cloning.
*/
@Test
- public void testCloneInterpolation() {
+ void testCloneInterpolation() {
final String keyAnswer = "answer";
final String keyValue = "value";
final MapConfiguration config = (MapConfiguration) getConfiguration();
@@ -104,7 +104,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
* Tests if the cloned configuration is decoupled from the original.
*/
@Test
- public void testCloneModify() {
+ void testCloneModify() {
final MapConfiguration config = (MapConfiguration) getConfiguration();
config.addEventListener(ConfigurationEvent.ANY, new EventListenerTestImpl(config));
final MapConfiguration copy = (MapConfiguration) config.clone();
@@ -124,7 +124,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
}
@Test
- public void testGetMap() {
+ void testGetMap() {
final Map<String, Object> map = new HashMap<>();
final MapConfiguration conf = new MapConfiguration(map);
@@ -135,7 +135,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
* Tests querying a property when trimming is active.
*/
@Test
- public void testGetPropertyTrim() {
+ void testGetPropertyTrim() {
final MapConfiguration config = (MapConfiguration) getConfiguration();
config.getMap().put(KEY, SPACE_VALUE);
assertEquals(TRIM_VALUE, config.getProperty(KEY));
@@ -145,7 +145,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
* Tests querying a property when trimming is disabled.
*/
@Test
- public void testGetPropertyTrimDisabled() {
+ void testGetPropertyTrimDisabled() {
final MapConfiguration config = (MapConfiguration) getConfiguration();
config.getMap().put(KEY, SPACE_VALUE);
config.setTrimmingDisabled(true);
@@ -157,7 +157,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
* performed (trimming only works if list splitting is enabled).
*/
@Test
- public void testGetPropertyTrimNoSplit() {
+ void testGetPropertyTrimNoSplit() {
final MapConfiguration config = (MapConfiguration) getConfiguration();
config.getMap().put(KEY, SPACE_VALUE);
config.setListDelimiterHandler(new DisabledListDelimiterHandler());
@@ -165,7 +165,7 @@ public class TestMapConfiguration extends TestAbstractConfiguration {
}
@Test
- public void testNullMap() {
+ void testNullMap() {
assertThrows(NullPointerException.class, () -> new MapConfiguration((Map) null));
assertThrows(NullPointerException.class, () -> new MapConfiguration((Properties) null));
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java
index ba700f20..b5356e6f 100644
--- a/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java
@@ -77,7 +77,7 @@ public class TestNullCompositeConfiguration {
* sequence
*/
@Test
- public void testAddingProperty() throws Exception {
+ void testAddingProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -93,7 +93,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testAddRemoveConfigurations() throws Exception {
+ void testAddRemoveConfigurations() throws Exception {
cc.addConfiguration(conf1);
assertEquals(2, cc.getNumberOfConfigurations());
cc.addConfiguration(conf1);
@@ -107,7 +107,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testCantRemoveMemoryConfig() throws Exception {
+ void testCantRemoveMemoryConfig() throws Exception {
cc.clear();
assertEquals(1, cc.getNumberOfConfigurations());
@@ -118,7 +118,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testCheckingInMemoryConfiguration() throws Exception {
+ void testCheckingInMemoryConfiguration() throws Exception {
final String testKey = "testKey";
final Configuration defaults = new PropertiesConfiguration();
defaults.setProperty(testKey, "testValue");
@@ -142,7 +142,7 @@ public class TestNullCompositeConfiguration {
* Tests setting values. These are set in memory mode only!
*/
@Test
- public void testClearingProperty() throws Exception {
+ void testClearingProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
cc.clearProperty("test.short");
@@ -153,7 +153,7 @@ public class TestNullCompositeConfiguration {
* Tests getting a default when the key doesn't exist
*/
@Test
- public void testDefaultValueWhenKeyMissing() throws Exception {
+ void testDefaultValueWhenKeyMissing() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals("default", cc.getString("bogus", "default"));
@@ -165,7 +165,7 @@ public class TestNullCompositeConfiguration {
* Tests {@code getKeys(String key)} preserves the order
*/
@Test
- public void testGetKeys2PreservesOrder() throws Exception {
+ void testGetKeys2PreservesOrder() throws Exception {
cc.addConfiguration(conf1);
final List<String> orderedList = new ArrayList<>();
for (final Iterator<String> keys = conf1.getKeys("test"); keys.hasNext();) {
@@ -182,7 +182,7 @@ public class TestNullCompositeConfiguration {
* Tests {@code getKeys()} preserves the order
*/
@Test
- public void testGetKeysPreservesOrder() throws Exception {
+ void testGetKeysPreservesOrder() throws Exception {
cc.addConfiguration(conf1);
final List<String> orderedList = new ArrayList<>();
for (final Iterator<String> keys = conf1.getKeys(); keys.hasNext();) {
@@ -196,7 +196,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testGetList() {
+ void testGetList() {
final Configuration conf1 = new BaseConfiguration();
conf1.addProperty("array", "value1");
conf1.addProperty("array", "value2");
@@ -221,7 +221,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testGetProperty() throws Exception {
+ void testGetProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(conf2);
assertEquals("test.properties", cc.getString("propertyInOrder"));
@@ -233,7 +233,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testGetPropertyMissing() throws Exception {
+ void testGetPropertyMissing() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(conf2);
@@ -244,7 +244,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testGetPropertyWIncludes() throws Exception {
+ void testGetPropertyWIncludes() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(conf2);
final List<Object> l = cc.getList("packages");
@@ -252,7 +252,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testGetStringWithDefaults() {
+ void testGetStringWithDefaults() {
final BaseConfiguration defaults = new BaseConfiguration();
defaults.addProperty("default", "default string");
@@ -272,7 +272,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testGettingConfiguration() throws Exception {
+ void testGettingConfiguration() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals(PropertiesConfiguration.class, cc.getConfiguration(0).getClass());
@@ -283,7 +283,7 @@ public class TestNullCompositeConfiguration {
* Tests retrieving subsets of configurations
*/
@Test
- public void testGettingSubset() throws Exception {
+ void testGettingSubset() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -298,7 +298,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testGetVector() {
+ void testGetVector() {
final Configuration conf1 = new BaseConfiguration();
conf1.addProperty("array", "value1");
conf1.addProperty("array", "value2");
@@ -321,7 +321,7 @@ public class TestNullCompositeConfiguration {
* Tests {@code List} parsing.
*/
@Test
- public void testList() throws Exception {
+ void testList() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -339,7 +339,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testMultipleTypesOfConfigs() throws Exception {
+ void testMultipleTypesOfConfigs() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals(1, cc.getInt("test.short"));
@@ -351,7 +351,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testPropertyExistsInOnlyOneConfig() throws Exception {
+ void testPropertyExistsInOnlyOneConfig() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
assertEquals("value", cc.getString("element"));
@@ -361,7 +361,7 @@ public class TestNullCompositeConfiguration {
* Tests setting values. These are set in memory mode only!
*/
@Test
- public void testSettingMissingProperty() throws Exception {
+ void testSettingMissingProperty() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
cc.setProperty("my.new.property", "supernew");
@@ -372,7 +372,7 @@ public class TestNullCompositeConfiguration {
* Tests {@code String} array parsing.
*/
@Test
- public void testStringArray() throws Exception {
+ void testStringArray() throws Exception {
cc.addConfiguration(conf1);
cc.addConfiguration(xmlConf);
@@ -389,7 +389,7 @@ public class TestNullCompositeConfiguration {
* Tests subsets and still can resolve elements
*/
@Test
- public void testSubsetCanResolve() throws Exception {
+ void testSubsetCanResolve() throws Exception {
cc = new CompositeConfiguration();
final BaseConfiguration config = new BaseConfiguration();
config.addProperty("subset.tempfile", "${java.io.tmpdir}/file.tmp");
@@ -401,7 +401,7 @@ public class TestNullCompositeConfiguration {
}
@Test
- public void testThrowExceptionOnMissing() {
+ void testThrowExceptionOnMissing() {
assertFalse(cc.isThrowExceptionOnMissing());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestNullJNDIEnvironmentValues.java b/src/test/java/org/apache/commons/configuration2/TestNullJNDIEnvironmentValues.java
index cb66e65d..1a83010e 100644
--- a/src/test/java/org/apache/commons/configuration2/TestNullJNDIEnvironmentValues.java
+++ b/src/test/java/org/apache/commons/configuration2/TestNullJNDIEnvironmentValues.java
@@ -40,20 +40,20 @@ public class TestNullJNDIEnvironmentValues {
}
@Test
- public void testClearProperty() {
+ void testClearProperty() {
assertNotNull(conf.getShort("test.short", null));
conf.clearProperty("test.short");
assertNull(conf.getShort("test.short", null));
}
@Test
- public void testContainsKey() throws Exception {
+ void testContainsKey() throws Exception {
assertTrue(conf.containsKey("test.key"));
assertFalse(conf.containsKey("test.imaginarykey"));
}
@Test
- public void testGetKeys() throws Exception {
+ void testGetKeys() throws Exception {
boolean found = false;
final Iterator<String> it = conf.getKeys();
@@ -67,7 +67,7 @@ public class TestNullJNDIEnvironmentValues {
}
@Test
- public void testGetKeysWithExistingPrefix() {
+ void testGetKeysWithExistingPrefix() {
// test for an existing prefix
final Iterator<String> it = conf.getKeys("test");
boolean found = false;
@@ -79,7 +79,7 @@ public class TestNullJNDIEnvironmentValues {
}
@Test
- public void testGetKeysWithKeyAsPrefix() {
+ void testGetKeysWithKeyAsPrefix() {
// test for a prefix matching exactly the key of a property
final Iterator<String> it = conf.getKeys("test.boolean");
boolean found = false;
@@ -91,30 +91,30 @@ public class TestNullJNDIEnvironmentValues {
}
@Test
- public void testGetKeysWithUnknownPrefix() {
+ void testGetKeysWithUnknownPrefix() {
// test for a unknown prefix
final Iterator<String> it = conf.getKeys("foo.bar");
assertFalse(it.hasNext());
}
@Test
- public void testGetMissingKey() throws Exception {
+ void testGetMissingKey() throws Exception {
assertNull(conf.getString("test.imaginarykey"));
}
@Test
- public void testGetMissingKeyWithDefault() throws Exception {
+ void testGetMissingKeyWithDefault() throws Exception {
final String result = conf.getString("test.imaginarykey", "bob");
assertEquals("bob", result);
}
@Test
- public void testIsEmpty() {
+ void testIsEmpty() {
assertFalse(conf.isEmpty());
}
@Test
- public void testMoreGets() throws Exception {
+ void testMoreGets() throws Exception {
final String s = conf.getString("test.key");
assertEquals("jndivalue", s);
assertEquals("jndivalue2", conf.getString("test.key2"));
@@ -122,13 +122,13 @@ public class TestNullJNDIEnvironmentValues {
}
@Test
- public void testSimpleGet() throws Exception {
+ void testSimpleGet() throws Exception {
final String s = conf.getString("test.key");
assertEquals("jndivalue", s);
}
@Test
- public void testThrowExceptionOnMissing() {
+ void testThrowExceptionOnMissing() {
assertFalse(conf.isThrowExceptionOnMissing());
}
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java
index b016607f..6865ccb8 100644
--- a/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfiguration.java
@@ -48,7 +48,7 @@ public class TestPatternSubtreeConfiguration {
* Rigorous Test :-)
*/
@Test
- public void testMultiConfiguration() {
+ void testMultiConfiguration() {
final PatternSubtreeConfigurationWrapper config = new PatternSubtreeConfigurationWrapper(this.conf, PATTERN);
config.setExpressionEngine(new XPathExpressionEngine());
@@ -66,7 +66,7 @@ public class TestPatternSubtreeConfiguration {
* Tests a read operation if the wrapped configuration does not implement FileBased.
*/
@Test
- public void testReadNotFileBased() {
+ void testReadNotFileBased() {
final HierarchicalConfiguration<ImmutableNode> hc = new BaseHierarchicalConfiguration();
final PatternSubtreeConfigurationWrapper config = new PatternSubtreeConfigurationWrapper(hc, PATTERN);
final FileHandler fileHandler = new FileHandler(config);
@@ -77,7 +77,7 @@ public class TestPatternSubtreeConfiguration {
* Tests a write operation if the wrapped configuration does not implement FileBased.
*/
@Test
- public void testSaveNotFileBased() {
+ void testSaveNotFileBased() {
final HierarchicalConfiguration<ImmutableNode> hc = new BaseHierarchicalConfiguration();
final PatternSubtreeConfigurationWrapper config = new PatternSubtreeConfigurationWrapper(hc, PATTERN);
final FileHandler fileHandler = new FileHandler(config);
diff --git a/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfigurationWrapper.java b/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfigurationWrapper.java
index a11c8da3..d8492f50 100644
--- a/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfigurationWrapper.java
+++ b/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfigurationWrapper.java
@@ -28,7 +28,7 @@ public class TestPatternSubtreeConfigurationWrapper {
* Tests a read operation if the wrapped configuration does not implement FileBased.
*/
@Test
- public void testReadNotFileBased() {
+ void testReadNotFileBased() {
assertThrows(NullPointerException.class, () -> {
new PatternSubtreeConfigurationWrapper(null, "");
});
diff --git a/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java
index df73fb4f..c00aa0c9 100644
--- a/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java
@@ -350,7 +350,7 @@ public class TestPropertiesConfiguration {
* Tests if properties can be appended by simply calling load() another time.
*/
@Test
- public void testAppend() throws Exception {
+ void testAppend() throws Exception {
final File file2 = ConfigurationAssert.getTestFile("threesome.properties");
final FileHandler handler = new FileHandler(conf);
handler.load(file2);
@@ -363,7 +363,7 @@ public class TestPropertiesConfiguration {
* correctly updated.
*/
@Test
- public void testAppendAndSave() throws ConfigurationException {
+ void testAppendAndSave() throws ConfigurationException {
final Configuration copyConf = setUpCopyConfig();
conf.append(copyConf);
checkCopiedConfig(copyConf);
@@ -373,7 +373,7 @@ public class TestPropertiesConfiguration {
* Tests whether backslashes are correctly handled if lists are parsed. This test is related to CONFIGURATION-418.
*/
@Test
- public void testBackslashEscapingInLists() throws Exception {
+ void testBackslashEscapingInLists() throws Exception {
checkBackslashList("share2");
checkBackslashList("share1");
}
@@ -382,7 +382,7 @@ public class TestPropertiesConfiguration {
* Tests whether another list delimiter character can be set (by using an alternative list delimiter handler).
*/
@Test
- public void testChangingListDelimiter() throws Exception {
+ void testChangingListDelimiter() throws Exception {
assertEquals("a^b^c", conf.getString("test.other.delimiter"));
final PropertiesConfiguration pc2 = new PropertiesConfiguration();
pc2.setListDelimiterHandler(new DefaultListDelimiterHandler('^'));
@@ -395,7 +395,7 @@ public class TestPropertiesConfiguration {
* Tests whether a clear() operation clears the footer comment.
*/
@Test
- public void testClearFooterComment() {
+ void testClearFooterComment() {
conf.clear();
assertNull(conf.getFooter());
assertNull(conf.getHeader());
@@ -406,7 +406,7 @@ public class TestPropertiesConfiguration {
* object is taken into account.
*/
@Test
- public void testClone() throws ConfigurationException {
+ void testClone() throws ConfigurationException {
final PropertiesConfiguration copy = (PropertiesConfiguration) conf.clone();
assertNotSame(conf.getLayout(), copy.getLayout());
assertEquals(1, conf.getEventListeners(ConfigurationEvent.ANY).size());
@@ -424,7 +424,7 @@ public class TestPropertiesConfiguration {
* Tests the clone() method when no layout object exists yet.
*/
@Test
- public void testCloneNullLayout() {
+ void testCloneNullLayout() {
conf = new PropertiesConfiguration();
final PropertiesConfiguration copy = (PropertiesConfiguration) conf.clone();
assertNotSame(conf.getLayout(), copy.getLayout());
@@ -434,7 +434,7 @@ public class TestPropertiesConfiguration {
* Test if the lines starting with # or ! are properly ignored.
*/
@Test
- public void testComment() {
+ void testComment() {
assertFalse(conf.containsKey("#comment"));
assertFalse(conf.containsKey("!comment"));
}
@@ -454,7 +454,7 @@ public class TestPropertiesConfiguration {
@ParameterizedTest
@ValueSource(ints = { 0, 2, 4, 8, 16 })
- public void testCompress840ArrayList(final int size) {
+ void testCompress840ArrayList(final int size) {
final ArrayList<Object> object = new ArrayList<>();
for (int i = 0; i < size; i++) {
object.add(i);
@@ -467,7 +467,7 @@ public class TestPropertiesConfiguration {
@ParameterizedTest
@ValueSource(ints = { 0, 2, 4, 8, 16 })
- public void testCompress840ArrayListCycle(final int size) {
+ void testCompress840ArrayListCycle(final int size) {
final ArrayList<Object> object = new ArrayList<>();
for (int i = 0; i < size; i++) {
object.add(i);
@@ -482,7 +482,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testCompress840BeanContextServicesSupport() {
+ void testCompress840BeanContextServicesSupport() {
testCompress840(new BeanContextServicesSupport());
testCompress840(new BeanContextServicesSupport(new BeanContextServicesSupport()));
final BeanContextSupport bcs = new BeanContextSupport();
@@ -497,7 +497,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testCompress840BeanContextSupport() {
+ void testCompress840BeanContextSupport() {
testCompress840(new BeanContextSupport());
testCompress840(new BeanContextSupport(new BeanContextSupport()));
final BeanContextSupport bcs = new BeanContextSupport();
@@ -509,7 +509,7 @@ public class TestPropertiesConfiguration {
@ParameterizedTest
@ValueSource(ints = { 0, 2, 4, 8, 16 })
- public void testCompress840Exception(final int size) {
+ void testCompress840Exception(final int size) {
final ArrayList<Object> object = new ArrayList<>();
final Exception bottom = new Exception();
object.add(bottom);
@@ -531,7 +531,7 @@ public class TestPropertiesConfiguration {
@ParameterizedTest
@ValueSource(ints = { 0, 2, 4, 8, 16 })
- public void testCompress840Path(final int size) {
+ void testCompress840Path(final int size) {
final PriorityQueue<Object> object = new PriorityQueue<>();
for (int i = 0; i < size; i++) {
object.add(FileSystems.getDefault().getPath("foo"));
@@ -542,7 +542,7 @@ public class TestPropertiesConfiguration {
@ParameterizedTest
@ValueSource(ints = { 0, 2, 4, 8, 16 })
- public void testCompress840PriorityQueue(final int size) {
+ void testCompress840PriorityQueue(final int size) {
final PriorityQueue<Object> object = new PriorityQueue<>();
for (int i = 0; i < size; i++) {
object.add(FileSystems.getDefault().getPath("foo"));
@@ -566,7 +566,7 @@ public class TestPropertiesConfiguration {
* about the newly added properties.
*/
@Test
- public void testCopyAndSave() throws ConfigurationException {
+ void testCopyAndSave() throws ConfigurationException {
final Configuration copyConf = setUpCopyConfig();
conf.copy(copyConf);
checkCopiedConfig(copyConf);
@@ -576,7 +576,7 @@ public class TestPropertiesConfiguration {
* Tests whether include files can be disabled.
*/
@Test
- public void testDisableIncludes() throws ConfigurationException, IOException {
+ void testDisableIncludes() throws ConfigurationException, IOException {
final String content = PropertiesConfiguration.getInclude() + " = nonExistingIncludeFile" + CR + PROP_NAME + " = " + PROP_VALUE + CR;
final StringReader in = new StringReader(content);
conf = new PropertiesConfiguration();
@@ -586,7 +586,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testDisableListDelimiter() throws Exception {
+ void testDisableListDelimiter() throws Exception {
assertEquals(4, conf.getList("test.mixed.array").size());
final PropertiesConfiguration pc2 = new PropertiesConfiguration();
@@ -598,7 +598,7 @@ public class TestPropertiesConfiguration {
* Tests that empty properties are treated as the empty string (rather than as null).
*/
@Test
- public void testEmpty() {
+ void testEmpty() {
checkEmpty("test.empty");
}
@@ -606,12 +606,12 @@ public class TestPropertiesConfiguration {
* Tests that properties are detected that do not have a separator and a value.
*/
@Test
- public void testEmptyNoSeparator() {
+ void testEmptyNoSeparator() {
checkEmpty("test.empty2");
}
@Test
- public void testEscapedKey() throws Exception {
+ void testEscapedKey() throws Exception {
conf.clear();
final FileHandler handler = new FileHandler(conf);
handler.load(new StringReader("\\u0066\\u006f\\u006f=bar"));
@@ -623,7 +623,7 @@ public class TestPropertiesConfiguration {
* Check that key/value separators can be part of a key.
*/
@Test
- public void testEscapedKeyValueSeparator() {
+ void testEscapedKeyValueSeparator() {
assertEquals("foo", conf.getProperty("test.separator=in.key"));
assertEquals("bar", conf.getProperty("test.separator:in.key"));
assertEquals("foo", conf.getProperty("test.separator\tin.key"));
@@ -635,7 +635,7 @@ public class TestPropertiesConfiguration {
* Tests the escaping of quotation marks in a properties value. This test is related to CONFIGURATION-516.
*/
@Test
- public void testEscapeQuote() throws ConfigurationException {
+ void testEscapeQuote() throws ConfigurationException {
conf.clear();
final String text = "\"Hello World!\"";
conf.setProperty(PROP_NAME, text);
@@ -652,7 +652,7 @@ public class TestPropertiesConfiguration {
* Test the creation of a file containing a '#' in its name.
*/
@Test
- public void testFileWithSharpSymbol() throws Exception {
+ void testFileWithSharpSymbol() throws Exception {
final File file = newFile("sharp#1.properties", tempFolder);
final PropertiesConfiguration conf = new PropertiesConfiguration();
@@ -668,7 +668,7 @@ public class TestPropertiesConfiguration {
* Tests whether read access to the footer comment is synchronized.
*/
@Test
- public void testGetFooterSynchronized() {
+ void testGetFooterSynchronized() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
conf.setSynchronizer(sync);
assertNotNull(conf.getFooter());
@@ -679,7 +679,7 @@ public class TestPropertiesConfiguration {
* Tests whether read access to the header comment is synchronized.
*/
@Test
- public void testGetHeaderSynchronized() {
+ void testGetHeaderSynchronized() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
conf.setSynchronizer(sync);
assertNull(conf.getHeader());
@@ -690,7 +690,7 @@ public class TestPropertiesConfiguration {
* Tests whether a default IOFactory is set.
*/
@Test
- public void testGetIOFactoryDefault() {
+ void testGetIOFactoryDefault() {
assertNotNull(conf.getIOFactory());
}
@@ -698,7 +698,7 @@ public class TestPropertiesConfiguration {
* Tests accessing the layout object.
*/
@Test
- public void testGetLayout() {
+ void testGetLayout() {
final PropertiesConfigurationLayout layout = conf.getLayout();
assertNotNull(layout);
assertSame(layout, conf.getLayout());
@@ -709,19 +709,19 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testGetStringWithEscapedChars() {
+ void testGetStringWithEscapedChars() {
final String property = conf.getString("test.unescape");
assertEquals("This \n string \t contains \" escaped \\ characters", property);
}
@Test
- public void testGetStringWithEscapedComma() {
+ void testGetStringWithEscapedComma() {
final String property = conf.getString("test.unescape.list-separator");
assertEquals("This string contains , an escaped list separator", property);
}
@Test
- public void testIncludeIncludeLoadAllOnNotFound() throws Exception {
+ void testIncludeIncludeLoadAllOnNotFound() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
pc.setIncludeListener(PropertiesConfiguration.NOOP_INCLUDE_LISTENER);
final FileHandler handler = new FileHandler(pc);
@@ -733,7 +733,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeIncludeLoadCyclicalReferenceFail() throws Exception {
+ void testIncludeIncludeLoadCyclicalReferenceFail() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pc);
handler.setBasePath(TEST_BASE_PATH);
@@ -743,7 +743,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeIncludeLoadCyclicalReferenceIgnore() throws Exception {
+ void testIncludeIncludeLoadCyclicalReferenceIgnore() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
pc.setIncludeListener(PropertiesConfiguration.NOOP_INCLUDE_LISTENER);
final FileHandler handler = new FileHandler(pc);
@@ -757,7 +757,7 @@ public class TestPropertiesConfiguration {
* Tests including properties when they are loaded from a nested directory structure.
*/
@Test
- public void testIncludeInSubDir() throws ConfigurationException {
+ void testIncludeInSubDir() throws ConfigurationException {
final CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
builder.configure(new FileBasedBuilderParametersImpl().setFileName("testFactoryPropertiesInclude.xml"));
final Configuration config = builder.getConfiguration();
@@ -767,7 +767,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeLoadAllOnLoadException() throws Exception {
+ void testIncludeLoadAllOnLoadException() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
pc.setIncludeListener(PropertiesConfiguration.NOOP_INCLUDE_LISTENER);
final FileHandler handler = new FileHandler(pc);
@@ -778,7 +778,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeLoadAllOnNotFound() throws Exception {
+ void testIncludeLoadAllOnNotFound() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
pc.setIncludeListener(PropertiesConfiguration.NOOP_INCLUDE_LISTENER);
final FileHandler handler = new FileHandler(pc);
@@ -789,7 +789,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeLoadCyclicalMultiStepReferenceFail() throws Exception {
+ void testIncludeLoadCyclicalMultiStepReferenceFail() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pc);
handler.setBasePath(TEST_BASE_PATH);
@@ -799,7 +799,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeLoadCyclicalMultiStepReferenceIgnore() throws Exception {
+ void testIncludeLoadCyclicalMultiStepReferenceIgnore() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
pc.setIncludeListener(PropertiesConfiguration.NOOP_INCLUDE_LISTENER);
final FileHandler handler = new FileHandler(pc);
@@ -810,7 +810,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeLoadCyclicalReferenceFail() throws Exception {
+ void testIncludeLoadCyclicalReferenceFail() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pc);
handler.setBasePath(TEST_BASE_PATH);
@@ -820,7 +820,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testIncludeLoadCyclicalReferenceIgnore() throws Exception {
+ void testIncludeLoadCyclicalReferenceIgnore() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
pc.setIncludeListener(PropertiesConfiguration.NOOP_INCLUDE_LISTENER);
final FileHandler handler = new FileHandler(pc);
@@ -835,7 +835,7 @@ public class TestPropertiesConfiguration {
* getting lost when later save() is called.
*/
@Test
- public void testInitFromNonExistingFile() throws ConfigurationException {
+ void testInitFromNonExistingFile() throws ConfigurationException {
final String testProperty = "test.successfull";
conf = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(conf);
@@ -846,7 +846,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testInMemoryCreatedSave() throws Exception {
+ void testInMemoryCreatedSave() throws Exception {
conf = new PropertiesConfiguration();
// add an array of strings to the configuration
conf.addProperty("string", "value1");
@@ -868,7 +868,7 @@ public class TestPropertiesConfiguration {
* Tests whether comment lines are correctly detected.
*/
@Test
- public void testIsCommentLine() {
+ void testIsCommentLine() {
assertTrue(PropertiesConfiguration.isCommentLine("# a comment"));
assertTrue(PropertiesConfiguration.isCommentLine("! a comment"));
assertTrue(PropertiesConfiguration.isCommentLine("#a comment"));
@@ -881,7 +881,7 @@ public class TestPropertiesConfiguration {
* a test file.
*/
@Test
- public void testJupRead() throws IOException, ConfigurationException {
+ void testJupRead() throws IOException, ConfigurationException {
conf.clear();
conf.setIOFactory(new PropertiesConfiguration.JupIOFactory());
@@ -909,7 +909,7 @@ public class TestPropertiesConfiguration {
* read them exactly like they were set.
*/
@Test
- public void testJupWrite() throws IOException, ConfigurationException {
+ void testJupWrite() throws IOException, ConfigurationException {
conf.clear();
conf.setIOFactory(new PropertiesConfiguration.JupIOFactory());
@@ -951,7 +951,7 @@ public class TestPropertiesConfiguration {
* read them exactly like they were set. This test writes in UTF-8 encoding, with Unicode escapes turned off.
*/
@Test
- public void testJupWriteUtf8WithoutUnicodeEscapes() throws IOException, ConfigurationException {
+ void testJupWriteUtf8WithoutUnicodeEscapes() throws IOException, ConfigurationException {
conf.clear();
conf.setIOFactory(new PropertiesConfiguration.JupIOFactory(false));
@@ -999,7 +999,7 @@ public class TestPropertiesConfiguration {
* Tests that the property separators are retained when saving the configuration.
*/
@Test
- public void testKeepSeparators() throws ConfigurationException, IOException {
+ void testKeepSeparators() throws ConfigurationException, IOException {
saveTestConfig();
// @formatter:off
final Set<String> separatorTests = new HashSet<>(Arrays.asList(
@@ -1027,7 +1027,7 @@ public class TestPropertiesConfiguration {
* Test all acceptable key/value separators ('=', ':' or white spaces).
*/
@Test
- public void testKeyValueSeparators() {
+ void testKeyValueSeparators() {
assertEquals("foo", conf.getProperty("test.separator.equal"));
assertEquals("foo", conf.getProperty("test.separator.colon"));
assertEquals("foo", conf.getProperty("test.separator.tab"));
@@ -1036,7 +1036,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testLargeKey() throws Exception {
+ void testLargeKey() throws Exception {
conf.clear();
final String key = String.join("", Collections.nCopies(10000, "x"));
final FileHandler handler = new FileHandler(conf);
@@ -1049,7 +1049,7 @@ public class TestPropertiesConfiguration {
* Tests whether the correct line separator is used.
*/
@Test
- public void testLineSeparator() throws ConfigurationException {
+ void testLineSeparator() throws ConfigurationException {
final String eol = System.lineSeparator();
conf = new PropertiesConfiguration();
conf.setHeader("My header");
@@ -1066,20 +1066,20 @@ public class TestPropertiesConfiguration {
* Tests {@code List} parsing.
*/
@Test
- public void testList() throws Exception {
+ void testList() throws Exception {
final List<Object> packages = conf.getList("packages");
// we should get 3 packages here
assertEquals(3, packages.size());
}
@Test
- public void testLoad() throws Exception {
+ void testLoad() throws Exception {
final String loaded = conf.getString("configuration.loaded");
assertEquals("true", loaded);
}
@Test
- public void testLoadFromFile() throws Exception {
+ void testLoadFromFile() throws Exception {
final File file = ConfigurationAssert.getTestFile("test.properties");
conf.clear();
final FileHandler handler = new FileHandler(conf);
@@ -1093,7 +1093,7 @@ public class TestPropertiesConfiguration {
* test if includes properties get loaded too
*/
@Test
- public void testLoadInclude() throws Exception {
+ void testLoadInclude() throws Exception {
final String loaded = conf.getString("include.loaded");
assertEquals("true", loaded);
}
@@ -1103,7 +1103,7 @@ public class TestPropertiesConfiguration {
* CONFIGURATION-609.
*/
@Test
- public void testLoadIncludeFileViaFileSystem() throws ConfigurationException {
+ void testLoadIncludeFileViaFileSystem() throws ConfigurationException {
conf.clear();
conf.addProperty("include", "include.properties");
saveTestConfig();
@@ -1128,7 +1128,7 @@ public class TestPropertiesConfiguration {
* Tests if included files are loaded when the source lies in the class path.
*/
@Test
- public void testLoadIncludeFromClassPath() {
+ void testLoadIncludeFromClassPath() {
assertEquals("true", conf.getString("include.loaded"));
}
@@ -1136,7 +1136,7 @@ public class TestPropertiesConfiguration {
* Tests whether include files can be resolved if a configuration file is read from a reader.
*/
@Test
- public void testLoadIncludeFromReader() throws ConfigurationException {
+ void testLoadIncludeFromReader() throws ConfigurationException {
final StringReader in = new StringReader(PropertiesConfiguration.getInclude() + " = " + ConfigurationAssert.getTestURL("include.properties"));
conf = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(conf);
@@ -1148,13 +1148,13 @@ public class TestPropertiesConfiguration {
* test if includes properties from interpolated file name get loaded
*/
@Test
- public void testLoadIncludeInterpol() throws Exception {
+ void testLoadIncludeInterpol() throws Exception {
final String loaded = conf.getString("include.interpol.loaded");
assertEquals("true", loaded);
}
@Test
- public void testLoadIncludeOptional() throws Exception {
+ void testLoadIncludeOptional() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pc);
handler.setBasePath(TEST_BASE_PATH);
@@ -1165,12 +1165,12 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testLoadUnexistingFile() {
+ void testLoadUnexistingFile() {
assertThrows(ConfigurationException.class, () -> load(conf, "unexisting file"));
}
@Test
- public void testLoadViaPropertyWithBasePath() throws Exception {
+ void testLoadViaPropertyWithBasePath() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pc);
handler.setBasePath(TEST_BASE_PATH);
@@ -1181,7 +1181,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testLoadViaPropertyWithBasePath2() throws Exception {
+ void testLoadViaPropertyWithBasePath2() throws Exception {
final PropertiesConfiguration pc = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pc);
handler.setBasePath(TEST_BASE_PATH_2);
@@ -1192,14 +1192,14 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testMixedArray() {
+ void testMixedArray() {
final String[] array = conf.getStringArray("test.mixed.array");
assertArrayEquals(new String[] {"a", "b", "c", "d"}, array);
}
@Test
- public void testMultilines() {
+ void testMultilines() {
final String property = "This is a value spread out across several adjacent " + "natural lines by escaping the line terminator with "
+ "a backslash character.";
@@ -1210,7 +1210,7 @@ public class TestPropertiesConfiguration {
* Tests whether multiple include files can be resolved.
*/
@Test
- public void testMultipleIncludeFiles() throws ConfigurationException {
+ void testMultipleIncludeFiles() throws ConfigurationException {
conf = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(conf);
handler.load(ConfigurationAssert.getTestFile("config/testMultiInclude.properties"));
@@ -1223,7 +1223,7 @@ public class TestPropertiesConfiguration {
* Tests escaping of an end of line with a backslash.
*/
@Test
- public void testNewLineEscaping() {
+ void testNewLineEscaping() {
final List<Object> list = conf.getList("test.path");
assertEquals(Arrays.asList("C:\\path1\\", "C:\\path2\\", "C:\\path3\\complex\\test\\"), list);
}
@@ -1232,7 +1232,7 @@ public class TestPropertiesConfiguration {
* Tests the propertyLoaded() method for a simple property.
*/
@Test
- public void testPropertyLoaded() throws ConfigurationException {
+ void testPropertyLoaded() throws ConfigurationException {
final DummyLayout layout = new DummyLayout();
conf.setLayout(layout);
conf.propertyLoaded("layoutLoadedProperty", "yes", null);
@@ -1244,7 +1244,7 @@ public class TestPropertiesConfiguration {
* Tests the propertyLoaded() method for an include property.
*/
@Test
- public void testPropertyLoadedInclude() throws ConfigurationException {
+ void testPropertyLoadedInclude() throws ConfigurationException {
final DummyLayout layout = new DummyLayout();
conf.setLayout(layout);
conf.propertyLoaded(PropertiesConfiguration.getInclude(), "testClasspath.properties,testEqual.properties", new ArrayDeque<>());
@@ -1256,7 +1256,7 @@ public class TestPropertiesConfiguration {
* Tests propertyLoaded() for an include property, when includes are disabled.
*/
@Test
- public void testPropertyLoadedIncludeNotAllowed() throws ConfigurationException {
+ void testPropertyLoadedIncludeNotAllowed() throws ConfigurationException {
final DummyLayout layout = new DummyLayout();
conf.setLayout(layout);
conf.setIncludesAllowed(false);
@@ -1270,7 +1270,7 @@ public class TestPropertiesConfiguration {
* done. This test is related to CONFIGURATION-641.
*/
@Test
- public void testReadCalledDirectly() throws IOException {
+ void testReadCalledDirectly() throws IOException {
conf = new PropertiesConfiguration();
try (Reader in = new FileReader(ConfigurationAssert.getTestFile("test.properties"))) {
final ConfigurationException e = assertThrows(ConfigurationException.class, () -> conf.read(in));
@@ -1282,7 +1282,7 @@ public class TestPropertiesConfiguration {
* Tests whether a footer comment is correctly read.
*/
@Test
- public void testReadFooterComment() {
+ void testReadFooterComment() {
assertEquals("\n# This is a foot comment\n", conf.getFooter());
assertEquals("\nThis is a foot comment\n", conf.getLayout().getCanonicalFooterCooment(false));
}
@@ -1291,12 +1291,12 @@ public class TestPropertiesConfiguration {
* Tests that references to other properties work
*/
@Test
- public void testReference() throws Exception {
+ void testReference() throws Exception {
assertEquals("baseextra", conf.getString("base.reference"));
}
@Test
- public void testSave() throws Exception {
+ void testSave() throws Exception {
// add an array of strings to the configuration
conf.addProperty("string", "value1");
final List<Object> list = new ArrayList<>();
@@ -1317,7 +1317,7 @@ public class TestPropertiesConfiguration {
* Tests whether the escape character for list delimiters can be itself escaped and survives a save operation.
*/
@Test
- public void testSaveEscapedEscapingCharacter() throws ConfigurationException {
+ void testSaveEscapedEscapingCharacter() throws ConfigurationException {
conf.addProperty("test.dirs", "C:\\Temp\\\\,D:\\Data\\\\,E:\\Test\\");
final List<Object> dirs = conf.getList("test.dirs");
assertEquals(3, dirs.size());
@@ -1326,13 +1326,13 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testSaveMissingFileName() {
+ void testSaveMissingFileName() {
final FileHandler handler = new FileHandler(conf);
assertThrows(ConfigurationException.class, handler::save);
}
@Test
- public void testSaveToCustomURL() throws Exception {
+ void testSaveToCustomURL() throws Exception {
// save the configuration to a custom URL
final URL url = new URL("foo", "", 0, newFile("testsave-custom-url.properties", tempFolder).getAbsolutePath(), new FileURLStreamHandler());
final FileHandler handlerSave = new FileHandler(conf);
@@ -1350,7 +1350,7 @@ public class TestPropertiesConfiguration {
* exception.
*/
@Test
- public void testSaveToHTTPServerFail() throws Exception {
+ void testSaveToHTTPServerFail() throws Exception {
final MockHttpURLStreamHandler handler = new MockHttpURLStreamHandler(HttpURLConnection.HTTP_BAD_REQUEST, TEST_SAVE_PROPERTIES_FILE);
final URL url = new URL(null, "http://jakarta.apache.org", handler);
final FileHandler fileHandler = new FileHandler(conf);
@@ -1362,7 +1362,7 @@ public class TestPropertiesConfiguration {
* Tests saving a file-based configuration to a HTTP server.
*/
@Test
- public void testSaveToHTTPServerSuccess() throws Exception {
+ void testSaveToHTTPServerSuccess() throws Exception {
final MockHttpURLStreamHandler handler = new MockHttpURLStreamHandler(HttpURLConnection.HTTP_OK, TEST_SAVE_PROPERTIES_FILE);
final URL url = new URL(null, "http://jakarta.apache.org", handler);
new FileHandler(conf).save(url);
@@ -1376,7 +1376,7 @@ public class TestPropertiesConfiguration {
* Tests if the base path is taken into account by the save() method.
*/
@Test
- public void testSaveWithBasePath() throws Exception {
+ void testSaveWithBasePath() throws Exception {
conf.setProperty("test", "true");
final FileHandler handler = new FileHandler(conf);
handler.setBasePath(TEST_SAVE_PROPERTIES_FILE.getParentFile().toURI().toURL().toString());
@@ -1389,7 +1389,7 @@ public class TestPropertiesConfiguration {
* Tests adding properties through a DataConfiguration. This is related to CONFIGURATION-332.
*/
@Test
- public void testSaveWithDataConfig() throws ConfigurationException {
+ void testSaveWithDataConfig() throws ConfigurationException {
conf = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(conf);
handler.setFile(TEST_SAVE_PROPERTIES_FILE);
@@ -1407,7 +1407,7 @@ public class TestPropertiesConfiguration {
* Tests whether saving works correctly with the default list delimiter handler implementation.
*/
@Test
- public void testSaveWithDefaultListDelimiterHandler() throws ConfigurationException {
+ void testSaveWithDefaultListDelimiterHandler() throws ConfigurationException {
conf.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
saveTestConfig();
@@ -1421,7 +1421,7 @@ public class TestPropertiesConfiguration {
* Tests saving a configuration if delimiter parsing is disabled.
*/
@Test
- public void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
+ void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
conf.clear();
conf.setListDelimiterHandler(new DisabledListDelimiterHandler());
conf.addProperty("test.list", "a,b,c");
@@ -1438,7 +1438,7 @@ public class TestPropertiesConfiguration {
* Tests whether write access to the footer comment is synchronized.
*/
@Test
- public void testSetFooterSynchronized() {
+ void testSetFooterSynchronized() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
conf.setSynchronizer(sync);
conf.setFooter("new comment");
@@ -1449,7 +1449,7 @@ public class TestPropertiesConfiguration {
* Tests whether write access to the header comment is synchronized.
*/
@Test
- public void testSetHeaderSynchronized() {
+ void testSetHeaderSynchronized() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
conf.setSynchronizer(sync);
conf.setHeader("new comment");
@@ -1457,7 +1457,7 @@ public class TestPropertiesConfiguration {
}
@Test
- public void testSetInclude() throws Exception {
+ void testSetInclude() throws Exception {
conf.clear();
// change the include key
PropertiesConfiguration.setInclude("import");
@@ -1475,7 +1475,7 @@ public class TestPropertiesConfiguration {
* Tests setting the IOFactory to null. This should cause an exception.
*/
@Test
- public void testSetIOFactoryNull() {
+ void testSetIOFactoryNull() {
assertThrows(IllegalArgumentException.class, () -> conf.setIOFactory(null));
}
@@ -1483,7 +1483,7 @@ public class TestPropertiesConfiguration {
* Tests setting an IOFactory that uses a specialized reader.
*/
@Test
- public void testSetIOFactoryReader() throws ConfigurationException {
+ void testSetIOFactoryReader() throws ConfigurationException {
final int propertyCount = 10;
conf.clear();
conf.setIOFactory(new PropertiesConfiguration.IOFactory() {
@@ -1507,7 +1507,7 @@ public class TestPropertiesConfiguration {
* Tests setting an IOFactory that uses a specialized writer.
*/
@Test
- public void testSetIOFactoryWriter() throws ConfigurationException, IOException {
+ void testSetIOFactoryWriter() throws ConfigurationException, IOException {
final MutableObject<Writer> propertiesWriter = new MutableObject<>();
conf.setIOFactory(new PropertiesConfiguration.IOFactory() {
@Override
@@ -1536,7 +1536,7 @@ public class TestPropertiesConfiguration {
* CONFIGURATION-495.
*/
@Test
- public void testSetPropertyListWithDelimiterParsingDisabled() throws ConfigurationException {
+ void testSetPropertyListWithDelimiterParsingDisabled() throws ConfigurationException {
final String prop = "delimiterListProp";
conf.setListDelimiterHandler(DisabledListDelimiterHandler.INSTANCE);
final List<String> list = Arrays.asList("val", "val2", "val3");
@@ -1551,7 +1551,7 @@ public class TestPropertiesConfiguration {
* Tests whether properties with slashes in their values can be saved. This test is related to CONFIGURATION-408.
*/
@Test
- public void testSlashEscaping() throws ConfigurationException {
+ void testSlashEscaping() throws ConfigurationException {
conf.setProperty(PROP_NAME, "http://www.apache.org");
final StringWriter writer = new StringWriter();
new FileHandler(conf).save(writer);
@@ -1563,12 +1563,12 @@ public class TestPropertiesConfiguration {
* Tests whether special characters in a property value are un-escaped. This test is related to CONFIGURATION-640.
*/
@Test
- public void testUnEscapeCharacters() {
+ void testUnEscapeCharacters() {
assertEquals("#1 =: me!", conf.getString("test.unescape.characters"));
}
@Test
- public void testUnescapeJava() {
+ void testUnescapeJava() {
assertEquals("test\\,test", PropertiesConfiguration.unescapeJava("test\\,test"));
}
@@ -1576,7 +1576,7 @@ public class TestPropertiesConfiguration {
* Tests whether a footer comment is correctly written out.
*/
@Test
- public void testWriteFooterComment() throws ConfigurationException, IOException {
+ void testWriteFooterComment() throws ConfigurationException, IOException {
final String footer = "my footer";
conf.clear();
conf.setProperty(PROP_NAME, PROP_VALUE);
diff --git a/src/test/java/org/apache/commons/configuration2/TestPropertiesConfigurationLayout.java b/src/test/java/org/apache/commons/configuration2/TestPropertiesConfigurationLayout.java
index 2b3f40bd..bd0f7cb4 100644
--- a/src/test/java/org/apache/commons/configuration2/TestPropertiesConfigurationLayout.java
+++ b/src/test/java/org/apache/commons/configuration2/TestPropertiesConfigurationLayout.java
@@ -209,7 +209,7 @@ public class TestPropertiesConfigurationLayout {
* Tests whether blank lines before a property are correctly detected.
*/
@Test
- public void testBlankLines() throws ConfigurationException {
+ void testBlankLines() throws ConfigurationException {
builder.addProperty("prop", "value");
builder.addComment(null);
builder.addComment(null);
@@ -226,7 +226,7 @@ public class TestPropertiesConfigurationLayout {
* Tests whether blank lines before a property are correctly detected if a header comment is present
*/
@Test
- public void testBlankLinesWithHeaderComment() throws ConfigurationException {
+ void testBlankLinesWithHeaderComment() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addComment(null);
builder.addComment(null);
@@ -242,7 +242,7 @@ public class TestPropertiesConfigurationLayout {
* Tests whether comments are combined for multiple occurrences.
*/
@Test
- public void testCombineComments() throws ConfigurationException {
+ void testCombineComments() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addProperty(TEST_KEY, TEST_VALUE);
builder.addComment(null);
@@ -257,7 +257,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if a property add event is correctly processed.
*/
@Test
- public void testEventAdd() {
+ void testEventAdd() {
final ConfigurationEvent event = new ConfigurationEvent(this, ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE, false);
layout.onEvent(event);
assertTrue(layout.getKeys().contains(TEST_KEY));
@@ -270,7 +270,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if a before update event is correctly ignored.
*/
@Test
- public void testEventAddBefore() {
+ void testEventAddBefore() {
final ConfigurationEvent event = new ConfigurationEvent(this, ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE, true);
layout.onEvent(event);
assertFalse(layout.getKeys().contains(TEST_KEY));
@@ -280,7 +280,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if an add event is correctly processed if the affected property is already stored in the layout object.
*/
@Test
- public void testEventAddExisting() throws ConfigurationException {
+ void testEventAddExisting() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addProperty(TEST_KEY, TEST_VALUE);
layout.load(config, builder.getReader());
@@ -294,7 +294,7 @@ public class TestPropertiesConfigurationLayout {
* Tests adding a property multiple time through an event. The property should then be a multi-line property.
*/
@Test
- public void testEventAddMultiple() {
+ void testEventAddMultiple() {
final ConfigurationEvent event = new ConfigurationEvent(this, ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE, false);
layout.onEvent(event);
layout.onEvent(event);
@@ -305,7 +305,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if a clear event is correctly processed.
*/
@Test
- public void testEventClearConfig() throws Exception {
+ void testEventClearConfig() throws Exception {
fillLayout();
final ConfigurationEvent event = new ConfigurationEvent(this, ConfigurationEvent.CLEAR, null, null, false);
layout.onEvent(event);
@@ -317,7 +317,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if a property delete event is correctly processed.
*/
@Test
- public void testEventDelete() {
+ void testEventDelete() {
ConfigurationEvent event = new ConfigurationEvent(this, ConfigurationEvent.ADD_PROPERTY, TEST_KEY, TEST_VALUE, false);
layout.onEvent(event);
event = new ConfigurationEvent(this, ConfigurationEvent.CLEAR_PROPERTY, TEST_KEY, null, false);
@@ -329,7 +329,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if a set property event for a non existing property is correctly handled.
*/
@Test
- public void testEventSetNonExisting() {
+ void testEventSetNonExisting() {
final ConfigurationEvent event = new ConfigurationEvent(this, ConfigurationEvent.SET_PROPERTY, TEST_KEY, TEST_VALUE, false);
layout.onEvent(event);
assertTrue(layout.getKeys().contains(TEST_KEY));
@@ -339,7 +339,7 @@ public class TestPropertiesConfigurationLayout {
* Tests accessing data for a property, which is not stored.
*/
@Test
- public void testGetNonExistingLayouData() {
+ void testGetNonExistingLayouData() {
assertNull(layout.getComment("unknown"));
assertTrue(layout.isSingleLine("unknown"));
assertEquals(0, layout.getBlankLinesBefore("unknown"));
@@ -349,7 +349,7 @@ public class TestPropertiesConfigurationLayout {
* Tests accessing a property with a null key. This should throw an exception.
*/
@Test
- public void testGetNullLayouttData() {
+ void testGetNullLayouttData() {
assertThrows(IllegalArgumentException.class, () -> layout.setComment(null, TEST_COMMENT));
}
@@ -357,7 +357,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if a header comment is detected.
*/
@Test
- public void testHeaderComment() throws ConfigurationException {
+ void testHeaderComment() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addComment(null);
builder.addProperty(TEST_KEY, TEST_VALUE);
@@ -370,7 +370,7 @@ public class TestPropertiesConfigurationLayout {
* Tests fetching a canonical header comment when no comment is set.
*/
@Test
- public void testHeaderCommentNull() {
+ void testHeaderCommentNull() {
assertNull(layout.getCanonicalHeaderComment(true));
assertNull(layout.getCanonicalHeaderComment(false));
}
@@ -379,7 +379,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if a header comment containing blank lines is correctly detected.
*/
@Test
- public void testHeaderCommentWithBlanks() throws ConfigurationException {
+ void testHeaderCommentWithBlanks() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addComment(null);
builder.addComment(TEST_COMMENT);
@@ -395,7 +395,7 @@ public class TestPropertiesConfigurationLayout {
* in the case that the header comment is already set
*/
@Test
- public void testHeaderCommentWithBlanksAndPresetHeaderComment() throws ConfigurationException {
+ void testHeaderCommentWithBlanksAndPresetHeaderComment() throws ConfigurationException {
final String presetHeaderComment = "preset" + TEST_COMMENT + CRNORM + CRNORM + TEST_COMMENT;
builder.addComment(TEST_COMMENT);
builder.addComment(null);
@@ -413,7 +413,7 @@ public class TestPropertiesConfigurationLayout {
* too.
*/
@Test
- public void testHeaderCommentWithBlanksAndPropComment() throws ConfigurationException {
+ void testHeaderCommentWithBlanksAndPropComment() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addComment(null);
builder.addComment(TEST_COMMENT);
@@ -429,7 +429,7 @@ public class TestPropertiesConfigurationLayout {
* Tests a newly created instance.
*/
@Test
- public void testInit() {
+ void testInit() {
assertTrue(layout.getKeys().isEmpty());
assertNull(layout.getHeaderComment());
final Iterator<EventListener<? super ConfigurationEvent>> it = config.getEventListeners(ConfigurationEvent.ANY).iterator();
@@ -444,7 +444,7 @@ public class TestPropertiesConfigurationLayout {
* Tests the copy constructor.
*/
@Test
- public void testInitCopy() {
+ void testInitCopy() {
fillLayout();
final PropertiesConfigurationLayout l2 = new PropertiesConfigurationLayout(layout);
assertEquals(l2.getKeys(), layout.getKeys());
@@ -456,7 +456,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if the copy and the original are independent from each other.
*/
@Test
- public void testInitCopyModify() {
+ void testInitCopyModify() {
fillLayout();
final PropertiesConfigurationLayout l2 = new PropertiesConfigurationLayout(layout);
assertEquals(layout.getComment(TEST_KEY), l2.getComment(TEST_KEY));
@@ -470,7 +470,7 @@ public class TestPropertiesConfigurationLayout {
* Tests the copy constructor if no other layout object is passed.
*/
@Test
- public void testInitNull() {
+ void testInitNull() {
layout = new PropertiesConfigurationLayout(null);
assertTrue(layout.getKeys().isEmpty());
}
@@ -479,7 +479,7 @@ public class TestPropertiesConfigurationLayout {
* Tests the single line flag for a simple property definition.
*/
@Test
- public void testIsSingleLine() throws ConfigurationException {
+ void testIsSingleLine() throws ConfigurationException {
builder.addProperty(TEST_KEY, TEST_VALUE + "," + TEST_VALUE + "2");
layout.load(config, builder.getReader());
assertTrue(layout.isSingleLine(TEST_KEY));
@@ -490,7 +490,7 @@ public class TestPropertiesConfigurationLayout {
* Tests the single line flag if there are multiple property definitions.
*/
@Test
- public void testIsSingleLineMulti() throws ConfigurationException {
+ void testIsSingleLineMulti() throws ConfigurationException {
builder.addProperty(TEST_KEY, TEST_VALUE);
builder.addProperty("anotherProp", "a value");
builder.addProperty(TEST_KEY, TEST_VALUE + "2");
@@ -503,7 +503,7 @@ public class TestPropertiesConfigurationLayout {
* Tests whether a line with whitespace is handled correctly. This is related to CONFIGURATION-582.
*/
@Test
- public void testLineWithBlank() throws ConfigurationException {
+ void testLineWithBlank() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addLine(" ");
builder.addProperty(TEST_KEY, TEST_VALUE);
@@ -515,7 +515,7 @@ public class TestPropertiesConfigurationLayout {
* Tests whether the output of the layout object is identical to the source file (at least for simple properties files).
*/
@Test
- public void testReadAndWrite() throws ConfigurationException {
+ void testReadAndWrite() throws ConfigurationException {
builder.addComment("This is my test properties file,");
builder.addComment("which contains a header comment.");
builder.addComment(null);
@@ -534,7 +534,7 @@ public class TestPropertiesConfigurationLayout {
* Tests reading a simple properties file.
*/
@Test
- public void testReadSimple() throws ConfigurationException {
+ void testReadSimple() throws ConfigurationException {
builder.addComment(TEST_COMMENT);
builder.addProperty(TEST_KEY, TEST_VALUE);
layout.load(config, builder.getReader());
@@ -551,7 +551,7 @@ public class TestPropertiesConfigurationLayout {
* Tests a recursive load call.
*/
@Test
- public void testRecursiveLoadCall() throws ConfigurationException {
+ void testRecursiveLoadCall() throws ConfigurationException {
final PropertiesBuilder b = new PropertiesBuilder();
b.addComment("A nested header comment.");
b.addComment("With multiple lines");
@@ -580,7 +580,7 @@ public class TestPropertiesConfigurationLayout {
* Tests if the content of the layout object is correctly written.
*/
@Test
- public void testSave() throws ConfigurationException {
+ void testSave() throws ConfigurationException {
config.addProperty(TEST_KEY, TEST_VALUE);
layout.setComment(TEST_KEY, TEST_COMMENT);
config.addProperty(TEST_KEY, TEST_VALUE + "2");
@@ -599,7 +599,7 @@ public class TestPropertiesConfigurationLayout {
* ignored.
*/
@Test
- public void testSaveCommentForUnexistingProperty() throws ConfigurationException {
+ void testSaveCommentForUnexistingProperty() throws ConfigurationException {
fillLayout();
layout.setComment("NonExistingKey", "NonExistingComment");
final String output = getLayoutString();
@@ -611,7 +611,7 @@ public class TestPropertiesConfigurationLayout {
* Tests saving an empty layout object.
*/
@Test
- public void testSaveEmptyLayout() throws ConfigurationException {
+ void testSaveEmptyLayout() throws ConfigurationException {
checkLayoutString("");
}
@@ -619,7 +619,7 @@ public class TestPropertiesConfigurationLayout {
* Tests the force single line flag.
*/
@Test
- public void testSaveForceSingleLine() throws ConfigurationException {
+ void testSaveForceSingleLine() throws ConfigurationException {
config.setListDelimiterHandler(new DefaultListDelimiterHandler(';'));
config.addProperty(TEST_KEY, TEST_VALUE);
config.addProperty(TEST_KEY, TEST_VALUE + "2");
@@ -634,7 +634,7 @@ public class TestPropertiesConfigurationLayout {
* Tests setting the global separator. This separator should override the separators for all properties.
*/
@Test
- public void testSetGlobalSeparator() throws ConfigurationException {
+ void testSetGlobalSeparator() throws ConfigurationException {
final String sep = "=";
config.addProperty(TEST_KEY, TEST_VALUE);
config.addProperty("key2", "value2");
@@ -647,7 +647,7 @@ public class TestPropertiesConfigurationLayout {
* Tests setting the line separator.
*/
@Test
- public void testSetLineSeparator() throws ConfigurationException {
+ void testSetLineSeparator() throws ConfigurationException {
final String lf = CR + CR;
config.addProperty(TEST_KEY, TEST_VALUE);
layout.setBlankLinesBefore(TEST_KEY, 2);
@@ -661,7 +661,7 @@ public class TestPropertiesConfigurationLayout {
* Tests whether the line separator is also taken into account within comments.
*/
@Test
- public void testSetLineSeparatorInComments() throws ConfigurationException {
+ void testSetLineSeparatorInComments() throws ConfigurationException {
final String lf = "<-\n";
config.addProperty(TEST_KEY, TEST_VALUE);
layout.setComment(TEST_KEY, TEST_COMMENT + "\nMore comment");
@@ -674,7 +674,7 @@ public class TestPropertiesConfigurationLayout {
* Tests resetting a comment.
*/
@Test
- public void testSetNullComment() {
+ void testSetNullComment() {
fillLayout();
layout.setComment(TEST_KEY, null);
assertNull(layout.getComment(TEST_KEY));
@@ -684,7 +684,7 @@ public class TestPropertiesConfigurationLayout {
* Tests changing the separator for a property.
*/
@Test
- public void testSetSeparator() throws ConfigurationException {
+ void testSetSeparator() throws ConfigurationException {
config.addProperty(TEST_KEY, TEST_VALUE);
layout.setSeparator(TEST_KEY, ":");
checkLayoutString(TEST_KEY + ":" + TEST_VALUE + CR);
@@ -694,7 +694,7 @@ public class TestPropertiesConfigurationLayout {
* Tests the trimComment method.
*/
@Test
- public void testTrimComment() {
+ void testTrimComment() {
assertEquals("This is a comment" + CR + "that spans multiple" + CR + "lines in a" + CR + " complex way.",
PropertiesConfigurationLayout.trimComment(
" # This is a comment" + CR + "that spans multiple" + CR + "!lines in a" + CR + " complex way.",
@@ -706,7 +706,7 @@ public class TestPropertiesConfigurationLayout {
* Tests enforcing comment characters in a comment.
*/
@Test
- public void testTrimCommentFalse() {
+ void testTrimCommentFalse() {
assertEquals("# Comment with" + CR + " ! some mixed " + CR + "#comment" + CR + "# lines",
PropertiesConfigurationLayout.trimComment("Comment with" + CR + " ! some mixed " + CR + "#comment" + CR + "lines", true));
}
@@ -715,7 +715,7 @@ public class TestPropertiesConfigurationLayout {
* Tests trimming a comment with trailing CRs.
*/
@Test
- public void testTrimCommentTrainlingCR() {
+ void testTrimCommentTrainlingCR() {
assertEquals("Comment with" + CR + "trailing CR" + CR,
PropertiesConfigurationLayout.trimComment("Comment with" + CR + "! trailing CR" + CR, false));
}
diff --git a/src/test/java/org/apache/commons/configuration2/TestPropertiesSequence.java b/src/test/java/org/apache/commons/configuration2/TestPropertiesSequence.java
index 6fbf8290..67b1fdaa 100644
--- a/src/test/java/org/apache/commons/configuration2/TestPropertiesSequence.java
+++ b/src/test/java/org/apache/commons/configuration2/TestPropertiesSequence.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
*/
public class TestPropertiesSequence {
@Test
- public void testConfigurationValuesInSameOrderFromFile() throws Exception {
+ void testConfigurationValuesInSameOrderFromFile() throws Exception {
final String simpleConfigurationFile = ConfigurationAssert.getTestFile("testSequence.properties").getAbsolutePath();
final String compositeConfigurationFile = ConfigurationAssert.getTestFile("testSequenceDigester.xml").getAbsolutePath();
@@ -58,7 +58,7 @@ public class TestPropertiesSequence {
}
@Test
- public void testConfigurationValuesInSameOrderWithManualAdd() throws Exception {
+ void testConfigurationValuesInSameOrderWithManualAdd() throws Exception {
final String simpleConfigurationFile = ConfigurationAssert.getTestFile("testSequence.properties").getAbsolutePath();
final String compositeConfigurationFile = ConfigurationAssert.getTestFile("testSequenceDigester.xml").getAbsolutePath();
@@ -88,7 +88,7 @@ public class TestPropertiesSequence {
}
@Test
- public void testMappingInSameOrder() throws Exception {
+ void testMappingInSameOrder() throws Exception {
final String simpleConfigurationFile = ConfigurationAssert.getTestFile("testSequence.properties").getAbsolutePath();
final String compositeConfigurationFile = ConfigurationAssert.getTestFile("testSequenceDigester.xml").getAbsolutePath();
diff --git a/src/test/java/org/apache/commons/configuration2/TestStrictConfigurationComparator.java b/src/test/java/org/apache/commons/configuration2/TestStrictConfigurationComparator.java
index da20741c..4a3cd1eb 100644
--- a/src/test/java/org/apache/commons/configuration2/TestStrictConfigurationComparator.java
+++ b/src/test/java/org/apache/commons/configuration2/TestStrictConfigurationComparator.java
@@ -40,7 +40,7 @@ public class TestStrictConfigurationComparator {
* Tests the comparator.
*/
@Test
- public void testCompare() {
+ void testCompare() {
// Identity comparison for empty configuration
assertTrue(comparator.compare(configuration, configuration));
@@ -70,7 +70,7 @@ public class TestStrictConfigurationComparator {
}
@Test
- public void testCompareNull() {
+ void testCompareNull() {
assertTrue(comparator.compare(null, null));
assertFalse(comparator.compare(configuration, null));
assertFalse(comparator.compare(null, configuration));
diff --git a/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java
index ab76d65b..8bd47ebd 100644
--- a/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestSubnodeConfiguration.java
@@ -154,7 +154,7 @@ public class TestSubnodeConfiguration {
* Tests adding of properties.
*/
@Test
- public void testAddProperty() {
+ void testAddProperty() {
setUpSubnodeConfig();
config.addProperty("[@table-type]", "test");
assertEquals("test", parent.getString("tables.table(0)[@table-type]"));
@@ -169,7 +169,7 @@ public class TestSubnodeConfiguration {
* Tests whether a clone of a sub configuration can be created.
*/
@Test
- public void testClone() {
+ void testClone() {
setUpSubnodeConfig();
final SubnodeConfiguration copy = (SubnodeConfiguration) config.clone();
assertNotSame(config.getModel(), copy.getModel());
@@ -188,7 +188,7 @@ public class TestSubnodeConfiguration {
* Tests whether the configuration can be closed.
*/
@Test
- public void testClose() {
+ void testClose() {
final TrackedNodeModel model = mock(TrackedNodeModel.class);
when(model.getSelector()).thenReturn(SELECTOR);
@@ -205,7 +205,7 @@ public class TestSubnodeConfiguration {
* Tests the configurationAt() method if updates are not supported.
*/
@Test
- public void testConfiguarationAtNoUpdates() {
+ void testConfiguarationAtNoUpdates() {
setUpSubnodeConfig();
final HierarchicalConfiguration<ImmutableNode> sub2 = config.configurationAt("fields.field(1)");
assertEquals(NodeStructureHelper.field(0, 1), sub2.getString("name"));
@@ -217,7 +217,7 @@ public class TestSubnodeConfiguration {
* Tests configurationAt() if updates are supported.
*/
@Test
- public void testConfigurationAtWithUpdateSupport() {
+ void testConfigurationAtWithUpdateSupport() {
setUpSubnodeConfig();
final SubnodeConfiguration sub2 = (SubnodeConfiguration) config.configurationAt("fields.field(1)", true);
assertEquals(NodeStructureHelper.field(0, 1), sub2.getString("name"));
@@ -228,7 +228,7 @@ public class TestSubnodeConfiguration {
* Tests listing the defined keys.
*/
@Test
- public void testGetKeys() {
+ void testGetKeys() {
setUpSubnodeConfig();
final Set<String> keys = new HashSet<>(ConfigurationAssert.keysToList(config));
assertEquals(new HashSet<>(Arrays.asList("name", "fields.field.name")), keys);
@@ -238,7 +238,7 @@ public class TestSubnodeConfiguration {
* Tests whether a correct node model is returned for the sub configuration. This test is related to CONFIGURATION-670.
*/
@Test
- public void testGetNodeModel() {
+ void testGetNodeModel() {
setUpSubnodeConfig();
final InMemoryNodeModel nodeModel = config.getNodeModel();
@@ -249,7 +249,7 @@ public class TestSubnodeConfiguration {
* Tests if properties of the sub node can be accessed.
*/
@Test
- public void testGetProperties() {
+ void testGetProperties() {
setUpSubnodeConfig();
checkSubConfigContent();
}
@@ -258,7 +258,7 @@ public class TestSubnodeConfiguration {
* Tests creation of a subnode config.
*/
@Test
- public void testInitSubNodeConfig() {
+ void testInitSubNodeConfig() {
setUpSubnodeConfig();
assertSame(NodeStructureHelper.nodeForKey(parent.getModel().getNodeHandler().getRootNode(), "tables/table(0)"),
config.getModel().getNodeHandler().getRootNode());
@@ -269,7 +269,7 @@ public class TestSubnodeConfiguration {
* Tests constructing a subnode configuration with a null node model. This should cause an exception.
*/
@Test
- public void testInitSubNodeConfigWithNullNode() {
+ void testInitSubNodeConfigWithNullNode() {
assertThrows(IllegalArgumentException.class, () -> new SubnodeConfiguration(parent, null));
}
@@ -277,7 +277,7 @@ public class TestSubnodeConfiguration {
* Tests constructing a subnode configuration with a null parent. This should cause an exception.
*/
@Test
- public void testInitSubNodeConfigWithNullParent() {
+ void testInitSubNodeConfigWithNullParent() {
final TrackedNodeModel model = setUpTrackedModel(SELECTOR);
assertThrows(IllegalArgumentException.class, () -> new SubnodeConfiguration(null, model));
}
@@ -286,7 +286,7 @@ public class TestSubnodeConfiguration {
* Tests interpolation features. The subnode config should use its parent for interpolation.
*/
@Test
- public void testInterpolation() {
+ void testInterpolation() {
parent.addProperty("tablespaces.tablespace.name", "default");
parent.addProperty("tablespaces.tablespace(-1).name", "test");
parent.addProperty("tables.table(0).tablespace", "${tablespaces.tablespace(0).name}");
@@ -301,7 +301,7 @@ public class TestSubnodeConfiguration {
* supported.
*/
@Test
- public void testInterpolationFromConfigurationAtNoUpdateSupport() {
+ void testInterpolationFromConfigurationAtNoUpdateSupport() {
checkInterpolationFromConfigurationAt(false);
}
@@ -309,7 +309,7 @@ public class TestSubnodeConfiguration {
* Tests whether interpolation works for a sub configuration obtained via configurationAt() if updates are supported.
*/
@Test
- public void testInterpolationFromConfigurationAtWithUpdateSupport() {
+ void testInterpolationFromConfigurationAtWithUpdateSupport() {
checkInterpolationFromConfigurationAt(true);
}
@@ -317,7 +317,7 @@ public class TestSubnodeConfiguration {
* Tests manipulating the interpolator.
*/
@Test
- public void testInterpolator() {
+ void testInterpolator() {
parent.addProperty("tablespaces.tablespace.name", "default");
parent.addProperty("tablespaces.tablespace(-1).name", "test");
@@ -329,7 +329,7 @@ public class TestSubnodeConfiguration {
* An additional test for interpolation when the configurationAt() method is involved for a local interpolation.
*/
@Test
- public void testLocalInterpolationFromConfigurationAt() {
+ void testLocalInterpolationFromConfigurationAt() {
parent.addProperty("base.dir", "/home/foo");
parent.addProperty("test.absolute.dir.dir1", "${base.dir}/path1");
parent.addProperty("test.absolute.dir.dir2", "${dir1}");
@@ -340,7 +340,7 @@ public class TestSubnodeConfiguration {
}
@Test
- public void testLocalLookupsInInterpolatorAreInherited() {
+ void testLocalLookupsInInterpolatorAreInherited() {
parent.addProperty("tablespaces.tablespace.name", "default");
parent.addProperty("tablespaces.tablespace(-1).name", "test");
parent.addProperty("tables.table(0).var", "${brackets:x}");
@@ -356,7 +356,7 @@ public class TestSubnodeConfiguration {
* case the sub config should be detached and keep its old values.
*/
@Test
- public void testParentChangeDetach() {
+ void testParentChangeDetach() {
setUpSubnodeConfig();
parent.clear();
checkSubConfigContent();
@@ -367,7 +367,7 @@ public class TestSubnodeConfiguration {
* expression engine is changed for the parent.
*/
@Test
- public void testParentChangeDetatchException() {
+ void testParentChangeDetatchException() {
setUpSubnodeConfig();
parent.setExpressionEngine(new XPathExpressionEngine());
parent.addProperty("newProp", "value");
@@ -378,7 +378,7 @@ public class TestSubnodeConfiguration {
* Tests changing the expression engine.
*/
@Test
- public void testSetExpressionEngine() {
+ void testSetExpressionEngine() {
parent.setExpressionEngine(new XPathExpressionEngine());
setUpSubnodeConfig("tables/table[1]");
assertEquals(NodeStructureHelper.field(0, 1), config.getString("fields/field[2]/name"));
@@ -392,7 +392,7 @@ public class TestSubnodeConfiguration {
* Tests manipulating the list delimiter handler. This object is derived from the parent.
*/
@Test
- public void testSetListDelimiterHandler() {
+ void testSetListDelimiterHandler() {
final ListDelimiterHandler handler1 = new DefaultListDelimiterHandler('/');
final ListDelimiterHandler handler2 = new DefaultListDelimiterHandler(';');
parent.setListDelimiterHandler(handler1);
@@ -410,7 +410,7 @@ public class TestSubnodeConfiguration {
* each other.
*/
@Test
- public void testSetProperty() {
+ void testSetProperty() {
setUpSubnodeConfig();
config.setProperty(null, "testTable");
config.setProperty("name", NodeStructureHelper.table(0) + "_tested");
@@ -425,7 +425,7 @@ public class TestSubnodeConfiguration {
* Tests setting the exception on missing flag. The subnode config obtains this flag from its parent.
*/
@Test
- public void testSetThrowExceptionOnMissing() {
+ void testSetThrowExceptionOnMissing() {
parent.setThrowExceptionOnMissing(true);
setUpSubnodeConfig();
assertTrue(config.isThrowExceptionOnMissing());
@@ -436,7 +436,7 @@ public class TestSubnodeConfiguration {
* Tests whether the exception flag can be set independently from the parent.
*/
@Test
- public void testSetThrowExceptionOnMissingAffectsParent() {
+ void testSetThrowExceptionOnMissingAffectsParent() {
parent.setThrowExceptionOnMissing(true);
setUpSubnodeConfig();
config.setThrowExceptionOnMissing(false);
diff --git a/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java
index 3596ec70..e3b6ff8d 100644
--- a/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration.java
@@ -49,7 +49,7 @@ public class TestSubsetConfiguration {
static final String TEST_FILE = "testDigesterConfiguration2.xml";
@Test
- public void testClear() {
+ void testClear() {
final Configuration config = new BaseConfiguration();
config.setProperty("test.key1", "value1");
config.setProperty("testing.key2", "value1");
@@ -65,12 +65,12 @@ public class TestSubsetConfiguration {
* Tries to create an instance without a parent configuration.
*/
@Test
- public void testConstructNullParent() {
+ void testConstructNullParent() {
assertThrows(NullPointerException.class, () -> new SubsetConfiguration(null, ""));
}
@Test
- public void testGetChildKey() {
+ void testGetChildKey() {
final Configuration conf = new BaseConfiguration();
// subset with delimiter
SubsetConfiguration subset = new SubsetConfiguration(conf, "prefix", ".");
@@ -84,7 +84,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testGetKeys() {
+ void testGetKeys() {
final Configuration conf = new BaseConfiguration();
conf.setProperty("test", "value0");
conf.setProperty("test.key1", "value1");
@@ -99,7 +99,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testGetKeysWithPrefix() {
+ void testGetKeysWithPrefix() {
final Configuration conf = new BaseConfiguration();
conf.setProperty("test.abc", "value0");
conf.setProperty("test.abc.key1", "value1");
@@ -114,7 +114,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testGetList() {
+ void testGetList() {
final BaseConfiguration conf = new BaseConfiguration();
conf.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
conf.setProperty("test.abc", "value0,value1");
@@ -129,7 +129,7 @@ public class TestSubsetConfiguration {
* Tests whether the list delimiter handler from the parent configuration is used.
*/
@Test
- public void testGetListDelimiterHandlerFromParent() {
+ void testGetListDelimiterHandlerFromParent() {
final BaseConfiguration config = new BaseConfiguration();
final AbstractConfiguration subset = (AbstractConfiguration) config.subset("prefix");
final ListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
@@ -138,7 +138,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testGetParent() {
+ void testGetParent() {
final Configuration conf = new BaseConfiguration();
final SubsetConfiguration subset = new SubsetConfiguration(conf, "prefix", ".");
@@ -146,7 +146,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testGetParentKey() {
+ void testGetParentKey() {
final Configuration conf = new BaseConfiguration();
// subset with delimiter
SubsetConfiguration subset = new SubsetConfiguration(conf, "prefix", ".");
@@ -160,7 +160,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testGetPrefix() {
+ void testGetPrefix() {
final Configuration conf = new BaseConfiguration();
final SubsetConfiguration subset = new SubsetConfiguration(conf, "prefix", ".");
@@ -168,7 +168,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testGetProperty() {
+ void testGetProperty() {
final Configuration conf = new BaseConfiguration();
conf.setProperty("test.key1", "value1");
conf.setProperty("testing.key2", "value1");
@@ -180,7 +180,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testInterpolationForKeysOfTheParent() {
+ void testInterpolationForKeysOfTheParent() {
final BaseConfiguration config = new BaseConfiguration();
config.setProperty("test", "junit");
config.setProperty("prefix.key", "${test}");
@@ -192,7 +192,7 @@ public class TestSubsetConfiguration {
* Tests manipulating the interpolator.
*/
@Test
- public void testInterpolator() {
+ void testInterpolator() {
final BaseConfiguration config = new BaseConfiguration();
final AbstractConfiguration subset = (AbstractConfiguration) config.subset("prefix");
InterpolationTestHelper.testGetInterpolator(subset);
@@ -202,7 +202,7 @@ public class TestSubsetConfiguration {
* Tests whether a list delimiter handler is used correctly.
*/
@Test
- public void testListDelimiterHandling() {
+ void testListDelimiterHandling() {
final BaseConfiguration config = new BaseConfiguration();
final Configuration subset = config.subset("prefix");
config.setListDelimiterHandler(new DefaultListDelimiterHandler('/'));
@@ -215,7 +215,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testLocalLookupsInInterpolatorAreInherited() {
+ void testLocalLookupsInInterpolatorAreInherited() {
final BaseConfiguration config = new BaseConfiguration();
final ConfigurationInterpolator interpolator = config.getInterpolator();
interpolator.registerLookup("brackets", key -> "(" + key + ")");
@@ -225,7 +225,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testNested() throws Exception {
+ void testNested() throws Exception {
final CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
builder.configure(new FileBasedBuilderParametersImpl().setFile(ConfigurationAssert.getTestFile(TEST_FILE)));
final Configuration config = builder.getConfiguration();
@@ -245,7 +245,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testPrefixDelimiter() {
+ void testPrefixDelimiter() {
final BaseConfiguration config = new BaseConfiguration();
config.setProperty("part1.part2@test.key1", "value1");
config.setProperty("part1.part2", "value2");
@@ -264,7 +264,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testPrefixDelimiterNegativeTest() {
+ void testPrefixDelimiterNegativeTest() {
final BaseConfiguration config = new BaseConfiguration();
config.setProperty("part1.part2@test.key1", "value1");
config.setProperty("part3.part4@testing.key2", "value2");
@@ -303,7 +303,7 @@ public class TestSubsetConfiguration {
* Tests whether the list delimiter handler is also set for the parent configuration.
*/
@Test
- public void testSetListDelimiterHandlerInParent() {
+ void testSetListDelimiterHandlerInParent() {
final BaseConfiguration config = new BaseConfiguration();
final AbstractConfiguration subset = (AbstractConfiguration) config.subset("prefix");
final ListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
@@ -316,7 +316,7 @@ public class TestSubsetConfiguration {
* list delimiter handler.
*/
@Test
- public void testSetListDelimiterHandlerParentNotSupported() {
+ void testSetListDelimiterHandlerParentNotSupported() {
final Configuration config = mock(Configuration.class);
final SubsetConfiguration subset = new SubsetConfiguration(config, "prefix");
final ListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
@@ -325,7 +325,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testSetPrefix() {
+ void testSetPrefix() {
final Configuration conf = new BaseConfiguration();
final SubsetConfiguration subset = new SubsetConfiguration(conf, null, ".");
subset.setPrefix("prefix");
@@ -334,7 +334,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testSetProperty() {
+ void testSetProperty() {
final Configuration conf = new BaseConfiguration();
final Configuration subset = new SubsetConfiguration(conf, "test", ".");
@@ -350,7 +350,7 @@ public class TestSubsetConfiguration {
}
@Test
- public void testThrowExceptionOnMissing() {
+ void testThrowExceptionOnMissing() {
final BaseConfiguration config = new BaseConfiguration();
config.setThrowExceptionOnMissing(true);
diff --git a/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration848.java b/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration848.java
index a114db44..fe2f711e 100644
--- a/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration848.java
+++ b/src/test/java/org/apache/commons/configuration2/TestSubsetConfiguration848.java
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
public class TestSubsetConfiguration848 {
@Test
- public void testSubsetConfigurationWithIndexAndDelimiter() throws ConfigurationException, IOException {
+ void testSubsetConfigurationWithIndexAndDelimiter() throws ConfigurationException, IOException {
final JSONConfiguration jsonConfiguration = new JSONConfiguration();
try (FileReader in = new FileReader(ConfigurationAssert.getTestFile("test-configuration-848.json").getAbsolutePath())) {
jsonConfiguration.read(in);
@@ -66,7 +66,7 @@ public class TestSubsetConfiguration848 {
}
@Test
- public void testSubsetWithJSONConfiguration() throws ConfigurationException, IOException {
+ void testSubsetWithJSONConfiguration() throws ConfigurationException, IOException {
final JSONConfiguration jsonConfiguration = new JSONConfiguration();
try (FileReader in = new FileReader(ConfigurationAssert.getTestFile("test-configuration-848.json").getAbsolutePath())) {
jsonConfiguration.read(in);
diff --git a/src/test/java/org/apache/commons/configuration2/TestSystemConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestSystemConfiguration.java
index 8b7d3a2e..62a6dc1e 100644
--- a/src/test/java/org/apache/commons/configuration2/TestSystemConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestSystemConfiguration.java
@@ -45,7 +45,7 @@ public class TestSystemConfiguration {
* is related to CONFIGURATION-570.
*/
@Test
- public void testAppendWhileConcurrentAccess() throws InterruptedException {
+ void testAppendWhileConcurrentAccess() throws InterruptedException {
final AtomicBoolean stop = new AtomicBoolean();
final String property = SystemConfiguration.class.getName() + ".testProperty";
final Thread t = new Thread(() -> {
@@ -83,7 +83,7 @@ public class TestSystemConfiguration {
* Tests whether the configuration can be used to change system properties.
*/
@Test
- public void testChangeSystemProperties() {
+ void testChangeSystemProperties() {
final String testProperty = "someTest";
final SystemConfiguration config = new SystemConfiguration();
config.setProperty(testProperty, "true");
@@ -91,7 +91,7 @@ public class TestSystemConfiguration {
}
@Test
- public void testSetSystemProperties() {
+ void testSetSystemProperties() {
final PropertiesConfiguration props = new PropertiesConfiguration();
props.addProperty("test.name", "Apache");
SystemConfiguration.setSystemProperties(props);
@@ -102,7 +102,7 @@ public class TestSystemConfiguration {
* Tests whether system properties can be set from a configuration file.
*/
@Test
- public void testSetSystemPropertiesFromPropertiesFile() throws ConfigurationException, IOException {
+ void testSetSystemPropertiesFromPropertiesFile() throws ConfigurationException, IOException {
final File file = newFile("sys.properties", tempFolder);
final PropertiesConfiguration pconfig = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pconfig);
@@ -115,7 +115,7 @@ public class TestSystemConfiguration {
}
@Test
- public void testSystemConfiguration() {
+ void testSystemConfiguration() {
final Properties props = System.getProperties();
props.put("test.number", "123");
diff --git a/src/test/java/org/apache/commons/configuration2/TestThreesomeConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestThreesomeConfiguration.java
index 9191449e..bdd028ed 100644
--- a/src/test/java/org/apache/commons/configuration2/TestThreesomeConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestThreesomeConfiguration.java
@@ -43,21 +43,21 @@ public class TestThreesomeConfiguration {
}
@Test
- public void testList1() throws Exception {
+ void testList1() throws Exception {
final List<Object> packages = conf.getList("test.threesome.one");
// we should get 3 packages here
assertEquals(3, packages.size());
}
@Test
- public void testList2() throws Exception {
+ void testList2() throws Exception {
final List<Object> packages = conf.getList("test.threesome.two");
// we should get 3 packages here
assertEquals(3, packages.size());
}
@Test
- public void testList3() throws Exception {
+ void testList3() throws Exception {
final List<Object> packages = conf.getList("test.threesome.three");
// we should get 3 packages here
assertEquals(3, packages.size());
diff --git a/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java
index e37a7a7d..9221cc3e 100644
--- a/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java
+++ b/src/test/java/org/apache/commons/configuration2/TestXMLConfiguration.java
@@ -249,7 +249,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testAddList() {
+ void testAddList() {
conf.addProperty("test.array", "value1");
conf.addProperty("test.array", "value2");
@@ -261,7 +261,7 @@ public class TestXMLConfiguration {
* Tests saving a configuration after a node was added. Test for CONFIGURATION-294.
*/
@Test
- public void testAddNodesAndSave() throws ConfigurationException {
+ void testAddNodesAndSave() throws ConfigurationException {
final ImmutableNode.Builder bldrNode = new ImmutableNode.Builder(1);
bldrNode.addChild(NodeStructureHelper.createNode("child", null));
bldrNode.addAttribute("attr", "");
@@ -285,7 +285,7 @@ public class TestXMLConfiguration {
* Tests adding nodes from another configuration.
*/
@Test
- public void testAddNodesCopy() throws ConfigurationException {
+ void testAddNodesCopy() throws ConfigurationException {
final XMLConfiguration c2 = new XMLConfiguration();
load(c2, testProperties2);
conf.addNodes("copiedProperties", c2.getModel().getNodeHandler().getRootNode().getChildren());
@@ -298,27 +298,27 @@ public class TestXMLConfiguration {
* nodes have the correct type. This test is related to CONFIGURATION-472.
*/
@Test
- public void testAddNodesToSubnodeConfiguration() throws Exception {
+ void testAddNodesToSubnodeConfiguration() throws Exception {
final HierarchicalConfiguration<ImmutableNode> sub = conf.configurationAt("element2", true);
sub.addProperty("newKey", "newvalue");
assertEquals("newvalue", conf.getString("element2.newKey"));
}
@Test
- public void testAddObjectAttribute() {
+ void testAddObjectAttribute() {
conf.addProperty("test.boolean[@value]", Boolean.TRUE);
assertTrue(conf.getBoolean("test.boolean[@value]"));
}
@Test
- public void testAddObjectProperty() {
+ void testAddObjectProperty() {
// add a non string property
conf.addProperty("test.boolean", Boolean.TRUE);
assertTrue(conf.getBoolean("test.boolean"));
}
@Test
- public void testAddProperty() {
+ void testAddProperty() {
// add a property to a non initialized XML configuration
final XMLConfiguration config = new XMLConfiguration();
config.addProperty("test.string", "hello");
@@ -331,7 +331,7 @@ public class TestXMLConfiguration {
* CONFIGURATION-495.
*/
@Test
- public void testAddPropertyListWithDelimiterParsingDisabled() throws ConfigurationException {
+ void testAddPropertyListWithDelimiterParsingDisabled() throws ConfigurationException {
conf.clear();
final String prop = "delimiterListProp";
conf.setListDelimiterHandler(DisabledListDelimiterHandler.INSTANCE);
@@ -347,7 +347,7 @@ public class TestXMLConfiguration {
* Tests if a second file can be appended to a first.
*/
@Test
- public void testAppend() throws Exception {
+ void testAppend() throws Exception {
load(conf, testProperties2);
assertEquals("value", conf.getString("element"));
assertEquals("tasks", conf.getString("table.name"));
@@ -363,7 +363,7 @@ public class TestXMLConfiguration {
* Tries to create an attribute with multiple values. Only the first value is taken into account.
*/
@Test
- public void testAttributeKeyWithMultipleValues() throws ConfigurationException {
+ void testAttributeKeyWithMultipleValues() throws ConfigurationException {
conf.addProperty("errorTest[@multiAttr]", Arrays.asList("v1", "v2"));
saveTestConfig();
final XMLConfiguration checkConfig = new XMLConfiguration();
@@ -375,7 +375,7 @@ public class TestXMLConfiguration {
* Tests whether the addNodes() method triggers an auto save.
*/
@Test
- public void testAutoSaveAddNodes() throws ConfigurationException {
+ void testAutoSaveAddNodes() throws ConfigurationException {
final FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>(XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl().setFileName(testProperties));
conf = builder.getConfiguration();
@@ -394,7 +394,7 @@ public class TestXMLConfiguration {
* Tests whether the auto save mechanism is triggered by changes at a subnode configuration.
*/
@Test
- public void testAutoSaveWithSubnodeConfig() throws ConfigurationException {
+ void testAutoSaveWithSubnodeConfig() throws ConfigurationException {
final FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>(XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl().setFileName(testProperties));
conf = builder.getConfiguration();
@@ -414,7 +414,7 @@ public class TestXMLConfiguration {
* the auto save mechanism.
*/
@Test
- public void testAutoSaveWithSubSubnodeConfig() throws ConfigurationException {
+ void testAutoSaveWithSubSubnodeConfig() throws ConfigurationException {
final FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>(XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl().setFileName(testProperties));
conf = builder.getConfiguration();
@@ -431,7 +431,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearAttributeMultipleDisjoined() throws Exception {
+ void testClearAttributeMultipleDisjoined() throws Exception {
String key = "clear.list.item[@id]";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -442,7 +442,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearAttributeNonExisting() {
+ void testClearAttributeNonExisting() {
final String key = "clear[@id]";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -450,7 +450,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearAttributeSingle() {
+ void testClearAttributeSingle() {
String key = "clear.element2[@id]";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -461,7 +461,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearPropertyCData() {
+ void testClearPropertyCData() {
final String key = "clear.cdata";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -469,7 +469,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearPropertyMultipleDisjoined() throws Exception {
+ void testClearPropertyMultipleDisjoined() throws Exception {
final String key = "list.item";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -477,7 +477,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearPropertyMultipleSiblings() {
+ void testClearPropertyMultipleSiblings() {
String key = "clear.list.item";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -488,7 +488,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearPropertyNonText() {
+ void testClearPropertyNonText() {
final String key = "clear.comment";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -496,7 +496,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearPropertyNotExisting() {
+ void testClearPropertyNotExisting() {
final String key = "clearly";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -504,7 +504,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearPropertySingleElement() {
+ void testClearPropertySingleElement() {
final String key = "clear.element";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -512,7 +512,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testClearPropertySingleElementWithAttribute() {
+ void testClearPropertySingleElementWithAttribute() {
String key = "clear.element2";
conf.clearProperty(key);
assertNull(conf.getProperty(key));
@@ -526,7 +526,7 @@ public class TestXMLConfiguration {
* Tests removing the text of the root element.
*/
@Test
- public void testClearTextRootElement() throws ConfigurationException {
+ void testClearTextRootElement() throws ConfigurationException {
final String xml = "<e a=\"v\">text</e>";
conf.clear();
final StringReader in = new StringReader(xml);
@@ -543,7 +543,7 @@ public class TestXMLConfiguration {
* Tests the clone() method.
*/
@Test
- public void testClone() {
+ void testClone() {
final Configuration c = (Configuration) conf.clone();
final XMLConfiguration copy = assertInstanceOf(XMLConfiguration.class, c);
assertNotNull(conf.getDocument());
@@ -559,7 +559,7 @@ public class TestXMLConfiguration {
* Tests saving a configuration after cloning to ensure that the clone and the original are completely detached.
*/
@Test
- public void testCloneWithSave() throws ConfigurationException {
+ void testCloneWithSave() throws ConfigurationException {
final XMLConfiguration c = (XMLConfiguration) conf.clone();
c.addProperty("test.newProperty", Boolean.TRUE);
conf.addProperty("test.orgProperty", Boolean.TRUE);
@@ -574,13 +574,13 @@ public class TestXMLConfiguration {
* Tests access to tag names with delimiter characters.
*/
@Test
- public void testComplexNames() {
+ void testComplexNames() {
assertEquals("Name with dot", conf.getString("complexNames.my..elem"));
assertEquals("Another dot", conf.getString("complexNames.my..elem.sub..elem"));
}
@Test
- public void testConcurrentGetAndReload() throws ConfigurationException, InterruptedException {
+ void testConcurrentGetAndReload() throws ConfigurationException, InterruptedException {
final FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>(XMLConfiguration.class);
builder.configure(new FileBasedBuilderParametersImpl().setFileName(testProperties));
XMLConfiguration config = builder.getConfiguration();
@@ -606,7 +606,7 @@ public class TestXMLConfiguration {
* Tests the copy constructor for null input.
*/
@Test
- public void testCopyNull() {
+ void testCopyNull() {
conf = new XMLConfiguration(null);
assertTrue(conf.isEmpty());
assertEquals("configuration", conf.getRootElementName());
@@ -616,7 +616,7 @@ public class TestXMLConfiguration {
* Tests whether the name of the root element is copied when a configuration is created using the copy constructor.
*/
@Test
- public void testCopyRootName() throws ConfigurationException {
+ void testCopyRootName() throws ConfigurationException {
final String rootName = "rootElement";
final String xml = "<" + rootName + "><test>true</test></" + rootName + ">";
conf.clear();
@@ -633,7 +633,7 @@ public class TestXMLConfiguration {
* Tests whether the name of the root element is copied for a configuration for which not yet a document exists.
*/
@Test
- public void testCopyRootNameNoDocument() throws ConfigurationException {
+ void testCopyRootNameNoDocument() throws ConfigurationException {
final String rootName = "rootElement";
conf = new XMLConfiguration();
conf.setRootElementName(rootName);
@@ -649,7 +649,7 @@ public class TestXMLConfiguration {
* Tests setting a custom document builder.
*/
@Test
- public void testCustomDocBuilder() throws Exception {
+ void testCustomDocBuilder() throws Exception {
// Load an invalid XML file with the default (non validating)
// doc builder. This should work...
conf = new XMLConfiguration();
@@ -662,7 +662,7 @@ public class TestXMLConfiguration {
* Tests whether a validating document builder detects a validation error.
*/
@Test
- public void testCustomDocBuilderValidationError() throws Exception {
+ void testCustomDocBuilderValidationError() throws Exception {
final DocumentBuilder builder = createValidatingDocBuilder();
conf = new XMLConfiguration();
conf.setDocumentBuilder(builder);
@@ -674,7 +674,7 @@ public class TestXMLConfiguration {
* Tests whether a valid document can be loaded with a validating document builder.
*/
@Test
- public void testCustomDocBuilderValidationSuccess() throws Exception {
+ void testCustomDocBuilderValidationSuccess() throws Exception {
final DocumentBuilder builder = createValidatingDocBuilder();
conf = new XMLConfiguration();
conf.setDocumentBuilder(builder);
@@ -686,7 +686,7 @@ public class TestXMLConfiguration {
* Tests string properties with list delimiters when delimiter parsing is disabled
*/
@Test
- public void testDelimiterParsingDisabled() throws ConfigurationException {
+ void testDelimiterParsingDisabled() throws ConfigurationException {
final XMLConfiguration conf2 = new XMLConfiguration();
load(conf2, testProperties);
@@ -703,7 +703,7 @@ public class TestXMLConfiguration {
* expression engine is used.
*/
@Test
- public void testDelimiterParsingDisabledXPath() throws ConfigurationException {
+ void testDelimiterParsingDisabledXPath() throws ConfigurationException {
final XMLConfiguration conf2 = new XMLConfiguration();
conf2.setExpressionEngine(new XPathExpressionEngine());
load(conf2, testProperties);
@@ -720,7 +720,7 @@ public class TestXMLConfiguration {
* Tests whether a DTD can be accessed.
*/
@Test
- public void testDtd() throws ConfigurationException {
+ void testDtd() throws ConfigurationException {
conf = new XMLConfiguration();
load(conf, "testDtd.xml");
assertEquals("value1", conf.getString("entry(0)"));
@@ -731,7 +731,7 @@ public class TestXMLConfiguration {
* Tests whether an attribute can be set to an empty string. This test is related to CONFIGURATION-446.
*/
@Test
- public void testEmptyAttribute() throws ConfigurationException {
+ void testEmptyAttribute() throws ConfigurationException {
final String key = "element3[@value]";
conf.setProperty(key, "");
assertTrue(conf.containsKey(key));
@@ -747,7 +747,7 @@ public class TestXMLConfiguration {
* Tests handling of empty elements.
*/
@Test
- public void testEmptyElements() throws ConfigurationException {
+ void testEmptyElements() throws ConfigurationException {
assertTrue(conf.containsKey("empty"));
assertEquals("", conf.getString("empty"));
conf.addProperty("empty2", "");
@@ -764,7 +764,7 @@ public class TestXMLConfiguration {
* Tests the isEmpty() method for an empty configuration that was reloaded.
*/
@Test
- public void testEmptyReload() throws ConfigurationException {
+ void testEmptyReload() throws ConfigurationException {
conf = new XMLConfiguration();
assertTrue(conf.isEmpty());
saveTestConfig();
@@ -773,22 +773,22 @@ public class TestXMLConfiguration {
}
@Test
- public void testGetAttribute() {
+ void testGetAttribute() {
assertEquals("foo", conf.getProperty("element3[@name]"));
}
@Test
- public void testGetCommentedProperty() {
+ void testGetCommentedProperty() {
assertEquals("", conf.getProperty("test.comment"));
}
@Test
- public void testGetComplexProperty() {
+ void testGetComplexProperty() {
assertEquals("I'm complex!", conf.getProperty("element2.subelement.subsubelement"));
}
@Test
- public void testgetProperty() {
+ void testgetProperty() {
// test non-leaf element
Object property = conf.getProperty("clear");
assertNull(property);
@@ -837,12 +837,12 @@ public class TestXMLConfiguration {
}
@Test
- public void testGetProperty() {
+ void testGetProperty() {
assertEquals("value", conf.getProperty("element"));
}
@Test
- public void testGetPropertyWithXMLEntity() {
+ void testGetPropertyWithXMLEntity() {
assertEquals("1<2", conf.getProperty("test.entity"));
}
@@ -850,7 +850,7 @@ public class TestXMLConfiguration {
* Tests the copy constructor.
*/
@Test
- public void testInitCopy() throws ConfigurationException {
+ void testInitCopy() throws ConfigurationException {
final XMLConfiguration copy = new XMLConfiguration(conf);
copy.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
assertEquals("value", copy.getProperty("element"));
@@ -864,7 +864,7 @@ public class TestXMLConfiguration {
* Tests list nodes with multiple values and attributes.
*/
@Test
- public void testListWithAttributes() {
+ void testListWithAttributes() {
assertEquals(6, conf.getList("attrList.a").size());
assertEquals("ABC", conf.getString("attrList.a(0)"));
assertEquals("x", conf.getString("attrList.a(0)[@name]"));
@@ -876,7 +876,7 @@ public class TestXMLConfiguration {
* attribute should be added to all list nodes.
*/
@Test
- public void testListWithAttributesMultiValue() {
+ void testListWithAttributesMultiValue() {
assertEquals("1", conf.getString("attrList.a(1)"));
assertEquals("y", conf.getString("attrList.a(1)[@name]"));
for (int i = 1; i <= 3; i++) {
@@ -890,7 +890,7 @@ public class TestXMLConfiguration {
* nodes.
*/
@Test
- public void testListWithMultipleAttributesMultiValue() {
+ void testListWithMultipleAttributesMultiValue() {
for (int i = 1; i <= 2; i++) {
final String idxStr = String.format("(%d)", Integer.valueOf(i + 3));
final String nodeKey = "attrList.a" + idxStr;
@@ -904,7 +904,7 @@ public class TestXMLConfiguration {
* Tests constructing an XMLConfiguration from a non existing file and later saving to this file.
*/
@Test
- public void testLoadAndSaveFromFile() throws Exception {
+ void testLoadAndSaveFromFile() throws Exception {
// If the file does not exist, an empty config is created
assertFalse(testSaveConf.exists());
final FileBasedConfigurationBuilder<XMLConfiguration> builder = new FileBasedConfigurationBuilder<>(XMLConfiguration.class, null, true);
@@ -919,7 +919,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testLoadChildNamespace() throws ConfigurationException {
+ void testLoadChildNamespace() throws ConfigurationException {
conf = new XMLConfiguration();
new FileHandler(conf).load(ConfigurationAssert.getTestFile("testChildNamespace.xml"));
assertEquals("http://example.com/", conf.getString("foo:bar.[@xmlns:foo]"));
@@ -929,7 +929,7 @@ public class TestXMLConfiguration {
* Tests loading from a stream.
*/
@Test
- public void testLoadFromStream() throws Exception {
+ void testLoadFromStream() throws Exception {
final String xml = "<?xml version=\"1.0\"?><config><test>1</test></config>";
conf = new XMLConfiguration();
FileHandler handler = new FileHandler(conf);
@@ -946,7 +946,7 @@ public class TestXMLConfiguration {
* Tests loading a non well formed XML from a string.
*/
@Test
- public void testLoadInvalidXML() throws Exception {
+ void testLoadInvalidXML() throws Exception {
final String xml = "<?xml version=\"1.0\"?><config><test>1</rest></config>";
conf = new XMLConfiguration();
final FileHandler handler = new FileHandler(conf);
@@ -960,14 +960,14 @@ public class TestXMLConfiguration {
* allowed in prolog". This test case is related to issue 34204.
*/
@Test
- public void testLoadWithEncoding() throws ConfigurationException {
+ void testLoadWithEncoding() throws ConfigurationException {
conf = new XMLConfiguration();
new FileHandler(conf).load(ConfigurationAssert.getTestFile("testEncoding.xml"));
assertEquals("test3_yoge", conf.getString("yoge"));
}
@Test
- public void testLoadWithRootNamespace() throws ConfigurationException {
+ void testLoadWithRootNamespace() throws ConfigurationException {
conf = new XMLConfiguration();
new FileHandler(conf).load(ConfigurationAssert.getTestFile("testRootNamespace.xml"));
assertEquals("http://example.com/", conf.getString("[@xmlns:foo]"));
@@ -977,7 +977,7 @@ public class TestXMLConfiguration {
* Tests that attribute values are not split.
*/
@Test
- public void testNoDelimiterParsingInAttrValues() throws ConfigurationException {
+ void testNoDelimiterParsingInAttrValues() throws ConfigurationException {
conf.clear();
load(conf, testProperties);
final List<Object> expr = conf.getList("expressions[@value]");
@@ -988,7 +988,7 @@ public class TestXMLConfiguration {
* Tests whether an attribute value can be overridden.
*/
@Test
- public void testOverrideAttribute() {
+ void testOverrideAttribute() {
conf.addProperty("element3[@name]", "bar");
final List<Object> list = conf.getList("element3[@name]");
@@ -999,7 +999,7 @@ public class TestXMLConfiguration {
* Tests whether spaces are preserved when the xml:space attribute is set.
*/
@Test
- public void testPreserveSpace() {
+ void testPreserveSpace() {
assertEquals(" ", conf.getString("space.blank"));
assertEquals(" * * ", conf.getString("space.stars"));
}
@@ -1008,7 +1008,7 @@ public class TestXMLConfiguration {
* Tests an xml:space attribute with an invalid value. This will be interpreted as default.
*/
@Test
- public void testPreserveSpaceInvalid() {
+ void testPreserveSpaceInvalid() {
assertEquals("Some other text", conf.getString("space.testInvalid"));
}
@@ -1017,7 +1017,7 @@ public class TestXMLConfiguration {
* CONFIGURATION-555.
*/
@Test
- public void testPreserveSpaceOnElement() {
+ void testPreserveSpaceOnElement() {
assertEquals(" preserved ", conf.getString("spaceElement"));
assertEquals(" ", conf.getString("spaceBlankElement"));
}
@@ -1026,7 +1026,7 @@ public class TestXMLConfiguration {
* Tests whether the xml:space attribute can be overridden in nested elements.
*/
@Test
- public void testPreserveSpaceOverride() {
+ void testPreserveSpaceOverride() {
assertEquals("Some text", conf.getString("space.description"));
}
@@ -1034,7 +1034,7 @@ public class TestXMLConfiguration {
* Tests whether the public ID is accessed in a synchronized manner.
*/
@Test
- public void testPublicIdSynchronized() {
+ void testPublicIdSynchronized() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
conf.setSynchronizer(sync);
conf.setPublicID(PUBLIC_ID);
@@ -1047,7 +1047,7 @@ public class TestXMLConfiguration {
* done. This test is related to CONFIGURATION-641.
*/
@Test
- public void testReadCalledDirectly() {
+ void testReadCalledDirectly() {
conf = new XMLConfiguration();
final String content = "<configuration><test>1</test></configuration>";
final ByteArrayInputStream bis = new ByteArrayInputStream(content.getBytes());
@@ -1056,7 +1056,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testSave() throws Exception {
+ void testSave() throws Exception {
// add an array of strings to the configuration
conf.addProperty("string", "value1");
for (int i = 1; i < 5; i++) {
@@ -1080,7 +1080,7 @@ public class TestXMLConfiguration {
* CONFIGURATION-301.
*/
@Test
- public void testSaveAfterCreateWithCopyConstructor() throws ConfigurationException {
+ void testSaveAfterCreateWithCopyConstructor() throws ConfigurationException {
final HierarchicalConfiguration<ImmutableNode> hc = conf.configurationAt("element2");
conf = new XMLConfiguration(hc);
saveTestConfig();
@@ -1092,7 +1092,7 @@ public class TestXMLConfiguration {
* Tests saving attributes (related to issue 34442).
*/
@Test
- public void testSaveAttributes() throws Exception {
+ void testSaveAttributes() throws Exception {
conf.clear();
load(conf, testProperties);
saveTestConfig();
@@ -1105,7 +1105,7 @@ public class TestXMLConfiguration {
* Tests saving and loading a configuration when delimiter parsing is disabled.
*/
@Test
- public void testSaveDelimiterParsingDisabled() throws ConfigurationException {
+ void testSaveDelimiterParsingDisabled() throws ConfigurationException {
checkSaveDelimiterParsingDisabled("list.delimiter.test");
}
@@ -1113,7 +1113,7 @@ public class TestXMLConfiguration {
* Tests saving to a stream.
*/
@Test
- public void testSaveToStream() throws ConfigurationException, IOException {
+ void testSaveToStream() throws ConfigurationException, IOException {
final FileHandler handler = new FileHandler(conf);
try (FileOutputStream out = new FileOutputStream(testSaveConf)) {
handler.save(out, "UTF8");
@@ -1126,7 +1126,7 @@ public class TestXMLConfiguration {
* Tests whether a configuration can be saved to a stream with a specific encoding.
*/
@Test
- public void testSaveToStreamWithEncoding() throws ConfigurationException, IOException {
+ void testSaveToStreamWithEncoding() throws ConfigurationException, IOException {
final FileHandler handler = new FileHandler(conf);
handler.setEncoding("UTF8");
try (FileOutputStream out = new FileOutputStream(testSaveConf)) {
@@ -1140,7 +1140,7 @@ public class TestXMLConfiguration {
* Tests saving to a URL.
*/
@Test
- public void testSaveToURL() throws Exception {
+ void testSaveToURL() throws Exception {
final FileHandler handler = new FileHandler(conf);
handler.save(testSaveConf.toURI().toURL());
checkSavedConfig(testSaveConf);
@@ -1150,7 +1150,7 @@ public class TestXMLConfiguration {
* Tests whether a windows path can be saved correctly. This test is related to CONFIGURATION-428.
*/
@Test
- public void testSaveWindowsPath() throws ConfigurationException {
+ void testSaveWindowsPath() throws ConfigurationException {
conf.clear();
conf.setListDelimiterHandler(new DisabledListDelimiterHandler());
conf.addProperty("path", "C:\\Temp");
@@ -1168,7 +1168,7 @@ public class TestXMLConfiguration {
* Tests string properties with list delimiters when delimiter parsing is disabled
*/
@Test
- public void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
+ void testSaveWithDelimiterParsingDisabled() throws ConfigurationException {
conf = new XMLConfiguration();
conf.setExpressionEngine(new XPathExpressionEngine());
load(conf, testProperties);
@@ -1213,7 +1213,7 @@ public class TestXMLConfiguration {
* Tests whether the DOCTYPE survives a save operation.
*/
@Test
- public void testSaveWithDoctype() throws ConfigurationException {
+ void testSaveWithDoctype() throws ConfigurationException {
conf = new XMLConfiguration();
load(conf, "testDtdPublic.xml");
@@ -1229,7 +1229,7 @@ public class TestXMLConfiguration {
* declaration.
*/
@Test
- public void testSaveWithDoctypeIDs() throws ConfigurationException {
+ void testSaveWithDoctypeIDs() throws ConfigurationException {
assertNull(conf.getPublicID());
assertNull(conf.getSystemID());
conf.setPublicID(PUBLIC_ID);
@@ -1243,7 +1243,7 @@ public class TestXMLConfiguration {
* Tests whether the encoding is written to the generated XML file.
*/
@Test
- public void testSaveWithEncoding() throws ConfigurationException {
+ void testSaveWithEncoding() throws ConfigurationException {
conf = new XMLConfiguration();
conf.setProperty("test", "a value");
final FileHandler handler = new FileHandler(conf);
@@ -1259,7 +1259,7 @@ public class TestXMLConfiguration {
* transformer factory. XMLConfiguration should not catch this error.
*/
@Test
- public void testSaveWithInvalidTransformerFactory() {
+ void testSaveWithInvalidTransformerFactory() {
System.setProperty(PROP_FACTORY, "an.invalid.Class");
try {
assertThrows(TransformerFactoryConfigurationError.class, this::saveTestConfig);
@@ -1273,7 +1273,7 @@ public class TestXMLConfiguration {
* (http://www.w3.org/TR/xslt#output) this should be either UTF-8 or UTF-16.
*/
@Test
- public void testSaveWithNullEncoding() throws ConfigurationException {
+ void testSaveWithNullEncoding() throws ConfigurationException {
conf = new XMLConfiguration();
conf.setProperty("testNoEncoding", "yes");
final FileHandler handler = new FileHandler(conf);
@@ -1284,7 +1284,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testSaveWithRootAttributes() throws ConfigurationException {
+ void testSaveWithRootAttributes() throws ConfigurationException {
conf.setProperty("[@xmlns:ex]", "http://example.com/");
assertEquals("http://example.com/", conf.getString("[@xmlns:ex]"));
final FileHandler handler = new FileHandler(conf);
@@ -1295,7 +1295,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testSaveWithRootAttributesByHand() throws ConfigurationException {
+ void testSaveWithRootAttributesByHand() throws ConfigurationException {
conf = new XMLConfiguration();
conf.addProperty("[@xmlns:foo]", "http://example.com/");
assertEquals("http://example.com/", conf.getString("[@xmlns:foo]"));
@@ -1310,7 +1310,7 @@ public class TestXMLConfiguration {
* Tests modifying an XML document and saving it with schema validation enabled.
*/
@Test
- public void testSaveWithValidation() throws Exception {
+ void testSaveWithValidation() throws Exception {
final CatalogResolver resolver = new CatalogResolver();
resolver.setCatalogFiles(CATALOG_FILES);
conf = new XMLConfiguration();
@@ -1332,7 +1332,7 @@ public class TestXMLConfiguration {
* Tests modifying an XML document and validating it against the schema.
*/
@Test
- public void testSaveWithValidationFailure() throws Exception {
+ void testSaveWithValidationFailure() throws Exception {
final CatalogResolver resolver = new CatalogResolver();
resolver.setCatalogFiles(CATALOG_FILES);
conf = new XMLConfiguration();
@@ -1346,7 +1346,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testSetAttribute() {
+ void testSetAttribute() {
// replace an existing attribute
conf.setProperty("element3[@name]", "bar");
assertEquals("bar", conf.getProperty("element3[@name]"));
@@ -1360,7 +1360,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testSetProperty() throws Exception {
+ void testSetProperty() throws Exception {
conf.setProperty("element.string", "hello");
assertEquals("hello", conf.getString("element.string"));
@@ -1372,7 +1372,7 @@ public class TestXMLConfiguration {
* CONFIGURATION-495.
*/
@Test
- public void testSetPropertyListWithDelimiterParsingDisabled() throws ConfigurationException {
+ void testSetPropertyListWithDelimiterParsingDisabled() throws ConfigurationException {
final String prop = "delimiterListProp";
final List<String> list = Arrays.asList("val", "val2", "val3");
conf.setProperty(prop, list);
@@ -1386,7 +1386,7 @@ public class TestXMLConfiguration {
* Tests setting an attribute on the root element.
*/
@Test
- public void testSetRootAttribute() throws ConfigurationException {
+ void testSetRootAttribute() throws ConfigurationException {
conf.setProperty("[@test]", "true");
assertEquals("true", conf.getString("[@test]"));
saveTestConfig();
@@ -1400,7 +1400,7 @@ public class TestXMLConfiguration {
}
@Test
- public void testSetRootNamespace() throws ConfigurationException {
+ void testSetRootNamespace() throws ConfigurationException {
conf.addProperty("[@xmlns:foo]", "http://example.com/");
conf.addProperty("foo:bar", "foobar");
assertEquals("http://example.com/", conf.getString("[@xmlns:foo]"));
@@ -1414,7 +1414,7 @@ public class TestXMLConfiguration {
* Tests setting text of the root element.
*/
@Test
- public void testSetTextRootElement() throws ConfigurationException {
+ void testSetTextRootElement() throws ConfigurationException {
conf.setProperty("", "Root text");
saveTestConfig();
checkSavedConfig();
@@ -1424,7 +1424,7 @@ public class TestXMLConfiguration {
* Tests string properties with list delimiters and escaped delimiters.
*/
@Test
- public void testSplitLists() {
+ void testSplitLists() {
assertEquals("a,b,c", conf.getString("split.list3[@values]"));
assertEquals(0, conf.getMaxIndex("split.list3[@values]"));
assertEquals("a\\,b\\,c", conf.getString("split.list4[@values]"));
@@ -1437,7 +1437,7 @@ public class TestXMLConfiguration {
* Tests the subset() method. There was a bug that calling subset() had undesired side effects.
*/
@Test
- public void testSubset() throws ConfigurationException {
+ void testSubset() throws ConfigurationException {
conf = new XMLConfiguration();
load(conf, "testHierarchicalXMLConfiguration.xml");
conf.subset("tables.table(0)");
@@ -1452,7 +1452,7 @@ public class TestXMLConfiguration {
* Tests whether the system ID is accessed in a synchronized manner.
*/
@Test
- public void testSystemIdSynchronized() {
+ void testSystemIdSynchronized() {
final SynchronizerTestImpl sync = new SynchronizerTestImpl();
conf.setSynchronizer(sync);
conf.setSystemID(SYSTEM_ID);
@@ -1464,7 +1464,7 @@ public class TestXMLConfiguration {
* Tests DTD validation using the setValidating() method.
... 14119 lines suppressed ...