commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1460445 - /commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestPropertiesSequence.java
Date Sun, 24 Mar 2013 20:19:06 GMT
Author: oheger
Date: Sun Mar 24 20:19:05 2013
New Revision: 1460445

URL: http://svn.apache.org/r1460445
Log:
Adapted tests to changes in PropertiesConfiguration.

PropertiesConfiguration no longer extends AbstractFileConfiguration.
Also switched from ConfigurationFactory to CombinedConfigurationBuilder.

Modified:
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestPropertiesSequence.java

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestPropertiesSequence.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestPropertiesSequence.java?rev=1460445&r1=1460444&r2=1460445&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestPropertiesSequence.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/TestPropertiesSequence.java
Sun Mar 24 20:19:05 2013
@@ -24,6 +24,9 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.collections.IteratorUtils;
+import org.apache.commons.configuration.builder.FileBasedBuilderParametersImpl;
+import org.apache.commons.configuration.builder.combined.CombinedConfigurationBuilder;
+import org.apache.commons.configuration.io.FileHandler;
 import org.apache.commons.lang.StringUtils;
 import org.junit.Test;
 
@@ -33,7 +36,6 @@ import org.junit.Test;
  *
  * @version $Id$
  */
-@SuppressWarnings("deprecation")
 public class TestPropertiesSequence
 {
     @Test
@@ -43,12 +45,13 @@ public class TestPropertiesSequence
         String compositeConfigurationFile = ConfigurationAssert.getTestFile("testSequenceDigester.xml").getAbsolutePath();
 
         PropertiesConfiguration simpleConfiguration = new PropertiesConfiguration();
-        simpleConfiguration.setFileName(simpleConfigurationFile);
-        simpleConfiguration.load();
-
-        ConfigurationFactory configurationFactory = new ConfigurationFactory();
-        configurationFactory.setConfigurationFileName(compositeConfigurationFile);
-        Configuration compositeConfiguration = configurationFactory.getConfiguration();
+        FileHandler handler = new FileHandler(simpleConfiguration);
+        handler.setFileName(simpleConfigurationFile);
+        handler.load();
+
+        CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
+        builder.configure(new FileBasedBuilderParametersImpl().setFileName(compositeConfigurationFile));
+        Configuration compositeConfiguration = builder.getConfiguration();
 
         Configuration a = simpleConfiguration.subset("prefix");
         Configuration b = compositeConfiguration.subset("prefix");
@@ -72,12 +75,13 @@ public class TestPropertiesSequence
         String compositeConfigurationFile = ConfigurationAssert.getTestFile("testSequenceDigester.xml").getAbsolutePath();
 
         PropertiesConfiguration simpleConfiguration = new PropertiesConfiguration();
-        simpleConfiguration.setFileName(simpleConfigurationFile);
-        simpleConfiguration.load();
-
-        ConfigurationFactory configurationFactory = new ConfigurationFactory();
-        configurationFactory.setConfigurationFileName(compositeConfigurationFile);
-        Configuration compositeConfiguration = configurationFactory.getConfiguration();
+        FileHandler handler = new FileHandler(simpleConfiguration);
+        handler.setFileName(simpleConfigurationFile);
+        handler.load();
+
+        CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
+        builder.configure(new FileBasedBuilderParametersImpl().setFileName(compositeConfigurationFile));
+        Configuration compositeConfiguration = builder.getConfiguration();
 
         simpleConfiguration.setProperty("prefix.Co.test", Boolean.TRUE);
         simpleConfiguration.setProperty("prefix.Av.test", Boolean.TRUE);
@@ -107,12 +111,13 @@ public class TestPropertiesSequence
         String compositeConfigurationFile = ConfigurationAssert.getTestFile("testSequenceDigester.xml").getAbsolutePath();
 
         PropertiesConfiguration simpleConfiguration = new PropertiesConfiguration();
-        simpleConfiguration.setFileName(simpleConfigurationFile);
-        simpleConfiguration.load();
-
-        ConfigurationFactory configurationFactory = new ConfigurationFactory();
-        configurationFactory.setConfigurationFileName(compositeConfigurationFile);
-        Configuration compositeConfiguration = configurationFactory.getConfiguration();
+        FileHandler handler = new FileHandler(simpleConfiguration);
+        handler.setFileName(simpleConfigurationFile);
+        handler.load();
+
+        CombinedConfigurationBuilder builder = new CombinedConfigurationBuilder();
+        builder.configure(new FileBasedBuilderParametersImpl().setFileName(compositeConfigurationFile));
+        Configuration compositeConfiguration = builder.getConfiguration();
 
         Configuration mapping = new BaseConfiguration();
         Configuration mapping2 = new BaseConfiguration();



Mime
View raw message