mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixing OOME in tests
This commit is contained in:
@@ -81,7 +81,7 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase {
|
||||
FileUtil.delete(new File(FileUtil.toSystemDependentName(outputPath)));
|
||||
}
|
||||
}
|
||||
CompilerTestUtil.disableExternalCompiler();
|
||||
CompilerTestUtil.disableExternalCompiler(getProject());
|
||||
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.intellij.compiler;
|
||||
|
||||
import com.intellij.compiler.impl.javaCompiler.javac.JavacConfiguration;
|
||||
import com.intellij.compiler.server.BuildManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.application.WriteAction;
|
||||
@@ -86,12 +87,13 @@ public class CompilerTestUtil {
|
||||
}.execute();
|
||||
}
|
||||
|
||||
public static void disableExternalCompiler() {
|
||||
public static void disableExternalCompiler(final Project project) {
|
||||
new WriteAction() {
|
||||
protected void run(final Result result) {
|
||||
ApplicationManagerEx.getApplicationEx().doNotSave(true);
|
||||
JavaAwareProjectJdkTableImpl table = JavaAwareProjectJdkTableImpl.getInstanceEx();
|
||||
table.removeJdk(table.getInternalJdk());
|
||||
BuildManager.getInstance().clearState(project);
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CompilerTester {
|
||||
}
|
||||
|
||||
public void tearDown() {
|
||||
CompilerTestUtil.disableExternalCompiler();
|
||||
CompilerTestUtil.disableExternalCompiler(getProject());
|
||||
|
||||
try {
|
||||
myMainOutput.tearDown();
|
||||
|
||||
Reference in New Issue
Block a user