setup thread factory even when running a single test

This commit is contained in:
Alexey Kudravtsev
2017-11-24 13:48:19 +03:00
parent c661e60d46
commit ec58cce405
2 changed files with 9 additions and 0 deletions
@@ -16,6 +16,7 @@
package com.intellij.testFramework;
import com.intellij.codeInsight.CodeInsightSettings;
import com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory;
import com.intellij.diagnostic.PerformanceWatcher;
import com.intellij.mock.MockApplication;
import com.intellij.openapi.Disposable;
@@ -86,6 +87,8 @@ public abstract class UsefulTestCase extends TestCase {
private static final Map<String, Long> TOTAL_TEARDOWN_COST_MILLIS = new HashMap<>();
static {
// to setup thread factory even when running a single test
IdeaForkJoinWorkerThreadFactory.setupForkJoinCommonPool();
Logger.setFactory(TestLoggerFactory.class);
}
protected static final Logger LOG = Logger.getInstance(UsefulTestCase.class);
@@ -15,6 +15,7 @@
*/
package com.intellij.testFramework.fixtures.impl;
import com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.util.Disposer;
import com.intellij.testFramework.EdtTestUtil;
@@ -31,6 +32,11 @@ public class BaseFixture implements IdeaTestFixture {
private boolean myDisposed;
private final Disposable myTestRootDisposable = Disposer.newDisposable();
static {
// to setup thread factory even when running a single test
IdeaForkJoinWorkerThreadFactory.setupForkJoinCommonPool();
}
@Override
public void setUp() throws Exception {
Assert.assertFalse("setUp() already has been called", myInitialized);