diff options
Diffstat (limited to 'platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy')
-rw-r--r-- | platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy index 37e35f1b9b76..5f5d122ba318 100644 --- a/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy +++ b/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy @@ -88,26 +88,29 @@ abstract class AbstractExternalSystemTest extends UsefulTestCase { @Override protected void tearDown() throws Exception { - project = null - UIUtil.invokeAndWaitIfNeeded { - try { - externalSystemManagerEP.unregisterExtension(externalSystemManager) - testFixture.tearDown(); - testFixture = null; + try { + project = null + UIUtil.invokeAndWaitIfNeeded { + try { + externalSystemManagerEP.unregisterExtension(externalSystemManager) + testFixture.tearDown(); + testFixture = null; + } + catch (Exception e) { + throw new RuntimeException(e); + } } - catch (Exception e) { - throw new RuntimeException(e); + + if (!FileUtil.delete(projectDir) && projectDir.exists()) { + System.err.println("Cannot delete " + projectDir); + //printDirectoryContent(myDir); + projectDir.deleteOnExit(); } } - - if (!FileUtil.delete(projectDir) && projectDir.exists()) { - System.err.println("Cannot delete " + projectDir); - //printDirectoryContent(myDir); - projectDir.deleteOnExit(); + finally { + super.tearDown(); + resetClassFields(getClass()); } - - super.tearDown(); - resetClassFields(getClass()); } private void resetClassFields(@Nullable Class<?> aClass) { |