ProjectWizardTestCase: call tearDown even when some invokeLater throws exceptions
authorpeter <peter@jetbrains.com>
Wed, 5 Aug 2015 20:05:30 +0000 (22:05 +0200)
committerpeter <peter@jetbrains.com>
Wed, 5 Aug 2015 20:05:30 +0000 (22:05 +0200)
java/testFramework/src/com/intellij/ide/projectWizard/ProjectWizardTestCase.java

index 764834ef96e04771e9cd87ba4df009833f760045..fc43f57f4c4bdb85894c57c7f574a95ecb9ad510 100644 (file)
@@ -214,10 +214,14 @@ public abstract class ProjectWizardTestCase<T extends AbstractProjectWizard> ext
       }
     });
     SelectTemplateSettings.getInstance().setLastTemplate(null, null);
-    UIUtil.dispatchAllInvocationEvents();
-    Thread.sleep(2000); //wait for JBCardLayout release timers
-    UIUtil.dispatchAllInvocationEvents();
-    super.tearDown();
+    try {
+      UIUtil.dispatchAllInvocationEvents();
+      Thread.sleep(2000); //wait for JBCardLayout release timers
+      UIUtil.dispatchAllInvocationEvents();
+    }
+    finally {
+      super.tearDown();
+    }
   }
 
   protected Module importModuleFrom(ProjectImportProvider provider, String path) {