diff --git a/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java b/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java index 0e15a672cb4..b84ed9fed32 100644 --- a/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java +++ b/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java @@ -32,10 +32,7 @@ import org.jetbrains.jet.utils.ExceptionUtils; import org.junit.Rule; import org.junit.rules.TestName; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.PrintStream; +import java.io.*; import java.util.List; public class CliBaseTest { @@ -81,13 +78,27 @@ public class CliBaseTest { JetTestUtils.assertEqualsToFile(new File(testDataDir + "/" + testName.getMethodName() + ".out"), actual); } + // TODO: remove after update to newer IDEA where there is a FileUtil.loadLines(String) + @NotNull + public static List loadLines(@NotNull String path) throws IOException { + BufferedReader reader = new BufferedReader(new FileReader(path)); + try { + return FileUtil.loadLines(reader); + } + finally { + reader.close(); + } + } + @NotNull static String[] readArgs( @NotNull String argsFilePath, @NotNull final String testDataDir, @NotNull final String tempDir ) throws IOException { - List lines = FileUtil.loadLines(argsFilePath); + + + List lines = loadLines(argsFilePath); return ArrayUtil.toStringArray(ContainerUtil.mapNotNull(lines, new Function() { @Override