db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1195309 - /db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformerTest.java
Date Mon, 31 Oct 2011 02:06:40 GMT
Author: tfischer
Date: Mon Oct 31 02:06:40 2011
New Revision: 1195309

URL: http://svn.apache.org/viewvc?rev=1195309&view=rev
Log:
Simplified test

Modified:
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformerTest.java

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformerTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformerTest.java?rev=1195309&r1=1195308&r2=1195309&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformerTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/source/transform/LoadAdditionalSourceTransformerTest.java
Mon Oct 31 02:06:40 2011
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
-import java.io.FileReader;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -53,7 +52,7 @@ public class LoadAdditionalSourceTransfo
         + "  </element>\n"
         + "  <element/>\n"
         + "</root>\n";
-    
+
     @Test
     public void testLoadAdditionalSourceTransformerGeneration() throws Exception
     {
@@ -75,19 +74,7 @@ public class LoadAdditionalSourceTransfo
         File targetFile = new File(targetDir, "output.txt");
         assertTrue(targetFile.exists());
 
-        FileReader fileReader = new FileReader(targetFile);
-        StringBuilder content = new StringBuilder();
-        int readChars;
-        char[] buffer = new char[50];
-        do
-        {
-            readChars = fileReader.read(buffer);
-            if (readChars != -1)
-            {
-                content.append(buffer, 0, readChars);
-            }
-        }
-        while (readChars != -1);
+        String content = FileUtils.readFileToString(targetFile);
         assertEquals(EXPECTED, content.toString());
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message