@Override
  protected void setUp() throws Exception {
    super.setUp();
    myFilesToDelete.add(new File(FileUtilRt.getTempDirectory()));
    if (ourTestCase != null) {
      String message =
          "Previous test "
              + ourTestCase
              + " hasn't called tearDown(). Probably overridden without super call.";
      ourTestCase = null;
      fail(message);
    }
    IdeaLogger.ourErrorsOccurred = null;

    LOG.info(getClass().getName() + ".setUp()");

    initApplication();

    myEditorListenerTracker = new EditorListenerTracker();
    myThreadTracker = new ThreadTracker();

    setUpProject();

    storeSettings();
    ourTestCase = this;
    if (myProject != null) {
      ProjectManagerEx.getInstanceEx().openTestProject(myProject);
      CodeStyleSettingsManager.getInstance(myProject).setTemporarySettings(new CodeStyleSettings());
      InjectedLanguageManagerImpl.pushInjectors(getProject());
    }

    DocumentCommitThread.getInstance().clearQueue();
    UIUtil.dispatchAllInvocationEvents();
  }
  private void disposeProject(@NotNull List<Throwable> exceptions) {
    try {
      DocumentCommitThread.getInstance().clearQueue();
      // sometimes SwingUtilities maybe confused about EDT at this point
      if (SwingUtilities.isEventDispatchThread()) {
        UIUtil.dispatchAllInvocationEvents();
      }
    } catch (Throwable e) {
      exceptions.add(e);
    }

    Project project = myProject;
    if (project == null) {
      return;
    }

    closeAndDisposeProjectAndCheckThatNoOpenProjects(project, exceptions);
    myProject = null;
  }