Breakpoint remove should be executed in write action like breakpoint add in XDebuggerTestUtil.

This commit is contained in:
Dmitry Trofimov
2014-03-04 16:00:16 +01:00
parent f673815dac
commit ec8c8eb1ef
@@ -65,7 +65,8 @@ public class XDebuggerTestUtil {
XBreakpointManager manager = XDebuggerManager.getInstance(project).getBreakpointManager();
XLineBreakpointImpl breakpoint = (XLineBreakpointImpl)manager.findBreakpointAtLine(type, file, line);
Assert.assertNotNull(breakpoint);
Assert.assertEquals(validity ? AllIcons.Debugger.Db_verified_breakpoint : AllIcons.Debugger.Db_invalid_breakpoint, breakpoint.getIcon());
Assert
.assertEquals(validity ? AllIcons.Debugger.Db_verified_breakpoint : AllIcons.Debugger.Db_invalid_breakpoint, breakpoint.getIcon());
Assert.assertEquals(errorMessage, breakpoint.getErrorMessage());
}
@@ -303,7 +304,8 @@ public class XDebuggerTestUtil {
expectedNames.removeAll(actualNames);
UsefulTestCase.assertTrue("Missing variables:" + StringUtil.join(expectedNames, ", ")
+ "\nAll Variables: " + StringUtil.join(actualNames, ", "),
expectedNames.isEmpty());
expectedNames.isEmpty()
);
}
public static void assertSourcePosition(final XValue value, VirtualFile file, int offset) {
@@ -366,8 +368,13 @@ public class XDebuggerTestUtil {
public static void removeAllBreakpoints(@NotNull final Project project) {
final XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
XBreakpoint<?>[] breakpoints = breakpointManager.getAllBreakpoints();
for (XBreakpoint b : breakpoints) {
breakpointManager.removeBreakpoint(b);
for (final XBreakpoint b : breakpoints) {
new WriteAction() {
@Override
protected void run(Result result) throws Throwable {
breakpointManager.removeBreakpoint(b);
}
}.execute();
}
}