summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-08-30 15:03:30 +0300
committerArtur Signell <artur@vaadin.com>2012-08-30 15:04:20 +0300
commited2a07f55455eef981944e57ea0e2e35ee11971a (patch)
treea32c5e6a50d1e87b082ac29d20da6711d0fa49a8 /tests
parent22bb5813b3600da1017e8874b521f896e82cde6b (diff)
downloadvaadin-framework-ed2a07f55455eef981944e57ea0e2e35ee11971a.tar.gz
vaadin-framework-ed2a07f55455eef981944e57ea0e2e35ee11971a.zip
Replaced broken file reading routine with IOUtils call (incorrect newlines on Windows)
Diffstat (limited to 'tests')
-rw-r--r--tests/sass/src/com/vaadin/sass/AbstractTestBase.java20
1 files changed, 2 insertions, 18 deletions
diff --git a/tests/sass/src/com/vaadin/sass/AbstractTestBase.java b/tests/sass/src/com/vaadin/sass/AbstractTestBase.java
index 7647afbf68..a6b03fefb0 100644
--- a/tests/sass/src/com/vaadin/sass/AbstractTestBase.java
+++ b/tests/sass/src/com/vaadin/sass/AbstractTestBase.java
@@ -16,7 +16,6 @@
package com.vaadin.sass;
-import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
@@ -24,6 +23,7 @@ import java.net.URISyntaxException;
import junit.framework.Assert;
+import org.apache.commons.io.IOUtils;
import org.w3c.css.sac.CSSException;
public abstract class AbstractTestBase {
@@ -61,23 +61,7 @@ public abstract class AbstractTestBase {
* when file reading fails
*/
public String getFileContent(File file) throws IOException {
- StringBuilder content = new StringBuilder();
-
- FileReader fileReader = new FileReader(file);
- BufferedReader bufferedReader = new BufferedReader(fileReader);
- String line = null;
- // Handle the first line separately to get the right amount of line
- // separators in the loop
- if ((line = bufferedReader.readLine()) != null) {
- content.append(line);
- }
- // Handle the rest of the lines
- while ((line = bufferedReader.readLine()) != null) {
- content.append(System.getProperty("line.separator"));
- content.append(line);
- }
- bufferedReader.close();
- return content.toString();
+ return IOUtils.toString(new FileReader(file));
}
public void testParser(String file) throws CSSException, IOException,