[log] fix graph tests when called from idea ultimate

Use the absolute path to the test data dir, determined by utility method
This commit is contained in:
Kirill Likhodedov
2014-03-18 15:25:46 +04:00
parent 58a9de5c7e
commit 3e873179d6
2 changed files with 6 additions and 3 deletions
@@ -16,6 +16,7 @@
package com.intellij.vcs.log.newgraph;
import com.intellij.openapi.application.ex.PathManagerEx;
import com.intellij.openapi.util.io.FileUtil;
import java.io.File;
@@ -28,13 +29,14 @@ public abstract class AbstractTestWithTextFile {
protected final String myDirectory;
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
protected AbstractTestWithTextFile(String directory) {
this.myDirectory = BASE_DIRECTORY + directory;
this.myDirectory = PathManagerEx.findFileUnderCommunityHome(BASE_DIRECTORY + directory).getPath();
}
protected void doTest(String testName) throws IOException {
String in = FileUtil.loadFile(new File(myDirectory + testName + IN_POSTFIX), true);
String out = FileUtil.loadFile(new File(myDirectory + testName + OUT_POSTFIX), true);
String in = FileUtil.loadFile(new File(myDirectory, testName + IN_POSTFIX), true);
String out = FileUtil.loadFile(new File(myDirectory, testName + OUT_POSTFIX), true);
runTest(in, out);
}
+1
View File
@@ -12,6 +12,7 @@
<orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="vcs-log-api" />
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
<orderEntry type="module" module-name="testFramework" scope="TEST" />
</component>
</module>