From b5dc0f202ad7ad76fe9e16df24a70cf5dc23e791 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 15 Jan 2014 18:29:12 +0400 Subject: [PATCH] fixed debugger tests correctness --- .../ExecutionWithDebuggerToolsTestCase.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/java/testFramework/src/com/intellij/debugger/ExecutionWithDebuggerToolsTestCase.java b/java/testFramework/src/com/intellij/debugger/ExecutionWithDebuggerToolsTestCase.java index bccbfe5425b1..26e0eb52d34a 100644 --- a/java/testFramework/src/com/intellij/debugger/ExecutionWithDebuggerToolsTestCase.java +++ b/java/testFramework/src/com/intellij/debugger/ExecutionWithDebuggerToolsTestCase.java @@ -44,6 +44,7 @@ import com.intellij.openapi.projectRoots.impl.ProjectJdkImpl; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; +import com.intellij.testFramework.CompositeException; import com.intellij.ui.classFilter.ClassFilter; import com.intellij.util.IJSwingUtilities; import com.intellij.util.ui.UIUtil; @@ -61,7 +62,7 @@ public abstract class ExecutionWithDebuggerToolsTestCase extends ExecutionTestCa private final SynchronizationBasedSemaphore myScriptRunnablesSema = new SynchronizationBasedSemaphore(); protected static final int RATHER_LATER_INVOKES_N = 10; public DebugProcessImpl myDebugProcess = null; - + private final CompositeException exception = new CompositeException(); private class InvokeRatherLaterRequest { private final DebuggerCommandImpl myDebuggerCommand; @@ -103,6 +104,12 @@ public abstract class ExecutionWithDebuggerToolsTestCase extends ExecutionTestCa }); } + @Override + protected void tearDown() throws Exception { + super.tearDown(); + if (!exception.isEmpty()) throw exception; + } + protected void onBreakpoint(SuspendContextRunnable runnable) { if (myPauseScriptListener == null) { final DebugProcessImpl debugProcess = getDebugProcess(); @@ -124,8 +131,12 @@ public abstract class ExecutionWithDebuggerToolsTestCase extends ExecutionTestCa suspendContextRunnable.run(suspendContext); } catch (Exception e) { + exception.add(e); error(e); } + catch (AssertionError e) { + exception.add(e); + } if (myScriptRunnables.isEmpty()) { myScriptRunnablesSema.up();