Author: oheger
Date: Wed Jan 9 12:01:42 2008
New Revision: 610537
URL: http://svn.apache.org/viewvc?rev=610537&view=rev
Log:
Adapted test to new location of test files
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration/TestPropertiesConfiguration.java
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration/TestPropertiesConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration/TestPropertiesConfiguration.java?rev=610537&r1=610536&r2=610537&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration/TestPropertiesConfiguration.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration/TestPropertiesConfiguration.java
Wed Jan 9 12:01:42 2008
@@ -48,11 +48,11 @@
private PropertiesConfiguration conf;
/** The File that we test with */
- private String testProperties = new
File("conf/test.properties").getAbsolutePath();
+ private String testProperties =
ConfigurationAssert.getTestFile("test.properties").getAbsolutePath();
- private String testBasePath = new File("conf").getAbsolutePath();
- private String testBasePath2 = new
File("conf").getAbsoluteFile().getParentFile().getAbsolutePath();
- private File testSavePropertiesFile = new
File("target/testsave.properties");
+ private String testBasePath =
ConfigurationAssert.TEST_DIR.getAbsolutePath();
+ private String testBasePath2 =
ConfigurationAssert.TEST_DIR.getAbsoluteFile().getParentFile().getAbsolutePath();
+ private File testSavePropertiesFile =
ConfigurationAssert.getOutFile("testsave.properties");
protected void setUp() throws Exception
{
@@ -78,7 +78,7 @@
*/
public void testAppend() throws Exception
{
- File file2 = new File("conf/threesome.properties");
+ File file2 = ConfigurationAssert.getTestFile("threesome.properties");
conf.load(file2);
assertEquals("aaa", conf.getString("test.threesome.one"));
assertEquals("true", conf.getString("configuration.loaded"));
@@ -119,7 +119,7 @@
// load the configuration
PropertiesConfiguration conf = new PropertiesConfiguration();
- conf.load("conf/test.properties");
+ conf.load(testProperties);
// restore the previous value for the other tests
PropertiesConfiguration.setInclude("include");
@@ -284,14 +284,14 @@
{
PropertiesConfiguration pc = new PropertiesConfiguration();
pc.setBasePath(testBasePath2);
- pc.setFileName("conf/test.properties");
+ pc.setFileName(testProperties);
pc.load();
assertTrue("Make sure we have multiple keys",
pc.getBoolean("test.boolean"));
pc = new PropertiesConfiguration();
pc.setBasePath(testBasePath2);
- pc.setFileName("conf/test.properties");
+ pc.setFileName(testProperties);
pc.load();
assertTrue("Make sure we have multiple keys",
pc.getBoolean("test.boolean"));
@@ -299,7 +299,7 @@
public void testLoadFromFile() throws Exception
{
- File file = new File("conf/test.properties");
+ File file = ConfigurationAssert.getTestFile("test.properties");
conf = new PropertiesConfiguration(file);
assertEquals("true", conf.getString("configuration.loaded"));