commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1463678 - /commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedConfigurationBuilder.java
Date Tue, 02 Apr 2013 19:02:12 GMT
Author: oheger
Date: Tue Apr  2 19:02:12 2013
New Revision: 1463678

URL: http://svn.apache.org/r1463678
Log:
Changed test class: Only use methods from FileBased interface to load and save XMLConfiguration
objects.

Modified:
    commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedConfigurationBuilder.java

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedConfigurationBuilder.java?rev=1463678&r1=1463677&r2=1463678&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedConfigurationBuilder.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/builder/combined/TestCombinedConfigurationBuilder.java
Tue Apr  2 19:02:12 2013
@@ -60,6 +60,7 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.event.ConfigurationListener;
 import org.apache.commons.configuration.interpol.ConfigurationInterpolator;
 import org.apache.commons.configuration.interpol.Lookup;
+import org.apache.commons.configuration.io.FileHandler;
 import org.apache.commons.configuration.reloading.ReloadingController;
 import org.apache.commons.configuration.reloading.ReloadingControllerSupport;
 import org.apache.commons.configuration.resolver.CatalogResolver;
@@ -1109,9 +1110,11 @@ public class TestCombinedConfigurationBu
                 ConfigurationAssert.getOutFile("MultiFileReloadingTest.xml");
         switchToMultiFile(outFile.getAbsolutePath());
         XMLConfiguration reloadConfig = new XMLConfiguration();
+        FileHandler handler = new FileHandler(reloadConfig);
+        handler.setFile(outFile);
         final String key = "test.reload";
         reloadConfig.setProperty(key, "no");
-        reloadConfig.save(outFile);
+        handler.save();
         try
         {
             assertEquals("Wrong property", "no", config.getString(key));
@@ -1126,7 +1129,7 @@ public class TestCombinedConfigurationBu
             BuilderListenerTestImpl l = new BuilderListenerTestImpl();
             childBuilder.addBuilderListener(l);
             reloadConfig.setProperty(key, "yes");
-            reloadConfig.save(outFile);
+            handler.save();
 
             int attempts = 10;
             boolean changeDetected;
@@ -1136,7 +1139,7 @@ public class TestCombinedConfigurationBu
                 if (!changeDetected)
                 {
                     Thread.sleep(1000);
-                    reloadConfig.save(outFile);
+                    handler.save(outFile);
                 }
             } while (!changeDetected && --attempts > 0);
             assertTrue("No change detected", changeDetected);



Mime
View raw message