package org.ovirt.engine.core.utils;

import java.io.File;
import java.io.FileWriter;

import junit.framework.TestCase;

public class FileUtilTest extends TestCase {

    public void testReadAllText() throws Exception {
        File iFile = File.createTempFile("Test", ".txt");
        FileWriter iFileWriter = new FileWriter(iFile);
        iFileWriter.write("This is a test");
        iFileWriter.close();

        String data = FileUtil.readAllText(iFile.getAbsolutePath());
        assertEquals("Data should be equal", "This is a test", data);
    }

    /**
     * Test to verify fix on File.ReadAllText()
     */
    public void testReadAllTextTonSOfTimes() throws Exception {
        File iFile = File.createTempFile("Test", ".txt");
        FileWriter iFileWriter = new FileWriter(iFile);
        iFileWriter.write("This is a test");
        iFileWriter.close();

        for (int i = 0; i < 10000; i++) {
            String data = FileUtil.readAllText(iFile.getAbsolutePath());
            assertEquals("Data should be equal", "This is a test", data);
        }
    }
}

@@ -31,16 +31,62 @@
 utils;%0A%0A
+import static org.junit.Assert.assertEquals;%0A%0A
 import j
@@ -137,32 +137,22 @@
 ort 
+org.
 junit.
-framework.TestCase
+Test
 ;%0A%0Ap
@@ -180,27 +180,20 @@
 est 
-extends TestCase %7B%0A
+%7B%0A%0A    @Test
 %0A   
@@ -641,16 +641,26 @@
      */%0A
+    @Test%0A
     publ

Convert FileUtilTest to JUnit4 syntax