Author: oheger
Date: Sat Sep 28 19:44:17 2013
New Revision: 1527243

URL: http://svn.apache.org/r1527243
Log:
Removed access to default file system in test case.

In future, the file system will have to be set explicitly if another one than
the DefaultFileSystem is to be used. Adapted the test class correspondingly.

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

Modified: 
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileHandlerReloadingDetector.java
URL: 
http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileHandlerReloadingDetector.java?rev=1527243&r1=1527242&r2=1527243&view=diff
==============================================================================
--- 
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileHandlerReloadingDetector.java
 (original)
+++ 
commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileHandlerReloadingDetector.java
 Sat Sep 28 19:44:17 2013
@@ -27,14 +27,11 @@ import java.io.IOException;
 import org.apache.commons.configuration.ConfigurationAssert;
 import org.apache.commons.configuration.ConfigurationRuntimeException;
 import org.apache.commons.configuration.io.FileHandler;
-import org.apache.commons.configuration.io.FileSystem;
 import org.apache.commons.configuration.io.VFSFileSystem;
 import org.apache.commons.vfs2.FileName;
 import org.apache.commons.vfs2.FileObject;
 import org.apache.commons.vfs2.FileSystemException;
 import org.easymock.EasyMock;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -58,18 +55,6 @@ public class TestVFSFileHandlerReloading
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
 
-    @Before
-    public void setUp() throws Exception
-    {
-        FileSystem.setDefaultFileSystem(new VFSFileSystem());
-    }
-
-    @After
-    public void tearDown() throws Exception
-    {
-        FileSystem.resetDefaultFileSystem();
-    }
-
     /**
      * Writes a test configuration file containing a single property with the
      * given value.
@@ -97,6 +82,7 @@ public class TestVFSFileHandlerReloading
         VFSFileHandlerReloadingDetector strategy =
                 new VFSFileHandlerReloadingDetector();
         strategy.getFileHandler().setFile(file);
+        strategy.getFileHandler().setFileSystem(new VFSFileSystem());
         long modificationDate = strategy.getLastModificationDate();
         assertEquals("Wrong modification date", file.lastModified(),
                 modificationDate);
@@ -110,6 +96,7 @@ public class TestVFSFileHandlerReloading
     {
         File file = ConfigurationAssert.getOutFile("NonExistingFile.xml");
         FileHandler handler = new FileHandler();
+        handler.setFileSystem(new VFSFileSystem());
         handler.setFile(file);
         VFSFileHandlerReloadingDetector strategy =
                 new VFSFileHandlerReloadingDetector(handler);
@@ -174,6 +161,7 @@ public class TestVFSFileHandlerReloading
                         return null;
                     }
                 };
+        strategy.getFileHandler().setFileSystem(new VFSFileSystem());
         strategy.getFileHandler().setFileName("test.xml");
         strategy.getLastModificationDate();
     }


Reply via email to