commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1225909 - /commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileChangedReloadingStrategy.java
Date Fri, 30 Dec 2011 20:09:00 GMT
Author: oheger
Date: Fri Dec 30 20:09:00 2011
New Revision: 1225909

URL: http://svn.apache.org/viewvc?rev=1225909&view=rev
Log:
Converted tests to JUnit 4.

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

Modified: commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileChangedReloadingStrategy.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileChangedReloadingStrategy.java?rev=1225909&r1=1225908&r2=1225909&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileChangedReloadingStrategy.java
(original)
+++ commons/proper/configuration/trunk/src/test/java/org/apache/commons/configuration/reloading/TestVFSFileChangedReloadingStrategy.java
Fri Dec 30 20:09:00 2011
@@ -17,39 +17,46 @@
 
 package org.apache.commons.configuration.reloading;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.io.File;
 import java.io.FileWriter;
 
-import junit.framework.TestCase;
-
 import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.commons.configuration.FileSystem;
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.commons.configuration.VFSFileSystem;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test case for the VFSFileMonitorReloadingStrategy class.
  *
  * @author Ralph Goers
- * @version $Revision$
+ * @version $Id$
  */
-public class TestVFSFileChangedReloadingStrategy extends TestCase
+public class TestVFSFileChangedReloadingStrategy
 {
     /** Constant for the name of a test properties file.*/
     private static final String TEST_FILE = "test.properties";
 
-    protected void setUp() throws Exception
+    @Before
+    public void setUp() throws Exception
     {
-        super.setUp();
         FileSystem.setDefaultFileSystem(new VFSFileSystem());
     }
 
-    protected void tearDown() throws Exception
+    @After
+    public void tearDown() throws Exception
     {
         FileSystem.resetDefaultFileSystem();
-        super.tearDown();
     }
 
+    @Test
     public void testAutomaticReloading() throws Exception
     {
         // create a new configuration
@@ -85,6 +92,7 @@ public class TestVFSFileChangedReloading
         assertEquals("Modified value with enabled reloading", "value2", config.getString("string"));
     }
 
+    @Test
     public void testNewFileReloading() throws Exception
     {
         // create a new configuration
@@ -115,6 +123,7 @@ public class TestVFSFileChangedReloading
         assertEquals("Modified value with enabled reloading", "value1", config.getString("string"));
     }
 
+    @Test
     public void testGetRefreshDelay() throws Exception
     {
         VFSFileChangedReloadingStrategy strategy = new VFSFileChangedReloadingStrategy();
@@ -126,11 +135,13 @@ public class TestVFSFileChangedReloading
      * Tests calling reloadingRequired() multiple times before a reload actually
      * happens. This test is related to CONFIGURATION-302.
      */
+    @Test
     public void testReloadingRequiredMultipleTimes()
             throws ConfigurationException
     {
         VFSFileChangedReloadingStrategy strategy = new VFSFileChangedReloadingStrategy()
         {
+            @Override
             protected boolean hasChanged()
             {
                 // signal always a change



Mime
View raw message