AbstractInsertImportOnPasteTest: use test framework to create correct file structure for java files

This commit is contained in:
Pavel V. Talanov
2014-02-10 18:57:49 +04:00
parent e3ae7afac3
commit 4501adf5f1
@@ -125,9 +125,16 @@ public abstract class AbstractInsertImportOnPasteTest extends JetLightCodeInsigh
});
}
private void configureByDependencyIfExists(@NotNull String dependencyFileName) {
if (new File(BASE_PATH + "/" + dependencyFileName).exists()) {
myFixture.configureByFile(dependencyFileName);
private void configureByDependencyIfExists(@NotNull String dependencyFileName) throws Exception {
File file = new File(BASE_PATH + "/" + dependencyFileName);
if (file.exists()) {
if (dependencyFileName.endsWith(".java")) {
//allow test framework to put it under right directory
myFixture.addClass(FileUtil.loadFile(file));
}
else {
myFixture.configureByFile(dependencyFileName);
}
}
}