@Override public void tearDown() throws Exception { Project project = getProject(); CodeStyleSettingsManager.getInstance(project).dropTemporarySettings(); CodeStyleSettings oldCodeStyleSettings = myOldCodeStyleSettings; myOldCodeStyleSettings = null; List<Throwable> exceptions = new SmartList<Throwable>(); try { UsefulTestCase.doCheckForSettingsDamage(oldCodeStyleSettings, getCurrentCodeStyleSettings(), exceptions); LightPlatformTestCase.doTearDown(project, LightPlatformTestCase.getApplication(), true, exceptions); super.tearDown(); InjectedLanguageManagerImpl.checkInjectorsAreDisposed(project); PersistentFS.getInstance().clearIdCache(); PlatformTestCase.cleanupApplicationCaches(project); } finally { CompoundRuntimeException.throwIfNotEmpty(exceptions); } }
@Override protected void tearDown() throws Exception { try { ModuleManager moduleManager = ModuleManager.getInstance(myProject); List<Throwable> errors = null; AccessToken token = WriteAction.start(); try { for (Module module : myModulesToDispose) { try { String moduleName = module.getName(); if (moduleManager.findModuleByName(moduleName) != null) { moduleManager.disposeModule(module); } } catch (Throwable e) { if (errors == null) { errors = new SmartList<Throwable>(); } errors.add(e); } } } finally { token.finish(); } CompoundRuntimeException.throwIfNotEmpty(errors); } finally { myModulesToDispose.clear(); super.tearDown(); } }
@Override protected void tearDown() throws Exception { try { if (!myModulesToDispose.isEmpty()) { List<Throwable> errors = new SmartList<>(); WriteAction.run(() -> { ModuleManager moduleManager = ModuleManager.getInstance(myProject); for (Module module : myModulesToDispose) { try { String moduleName = module.getName(); if (moduleManager.findModuleByName(moduleName) != null) { moduleManager.disposeModule(module); } } catch (Throwable e) { errors.add(e); } } }); CompoundRuntimeException.throwIfNotEmpty(errors); } } finally { myModulesToDispose.clear(); super.tearDown(); } }
private static void rethrowExceptions(List<Throwable> exceptions) { if (exceptions == null) return; ProcessCanceledException pce = ContainerUtil.findInstance(exceptions, ProcessCanceledException.class); if (pce != null) throw pce; CompoundRuntimeException.throwIfNotEmpty(exceptions); }
@Override protected void tearDown() throws Exception { try { if(!myModulesToDispose.isEmpty()) { List<Throwable> errors = new SmartList<>(); WriteAction.run(() -> { ModuleManager moduleManager = ModuleManager.getInstance(myProject); for(Module module : myModulesToDispose) { try { String moduleName = module.getName(); if(moduleManager.findModuleByName(moduleName) != null) { moduleManager.disposeModule(module); } } catch(Throwable e) { errors.add(e); } } }); CompoundRuntimeException.throwIfNotEmpty(errors); } } finally { myModulesToDispose.clear(); super.tearDown(); } }
protected void throwExceptionsIfAny() { synchronized (myException) { CompoundRuntimeException.throwIfNotEmpty(myException); } }
public static void closeAndDisposeProjectAndCheckThatNoOpenProjects(@NotNull Project projectToClose) { List<Throwable> exceptions = new SmartList<Throwable>(); closeAndDisposeProjectAndCheckThatNoOpenProjects(projectToClose, exceptions); CompoundRuntimeException.throwIfNotEmpty(exceptions); }