From 753c71ff310fec2a2303bb96fcbf1b4554552674 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Mon, 22 Dec 2014 19:21:57 +0100 Subject: [PATCH] track running test: cleanup user selection (allow to track further) when newly started test equals to selection (IDEA-124030) --- .../junit2/ui/actions/RunningTestTracker.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/junit/src/com/intellij/execution/junit2/ui/actions/RunningTestTracker.java b/plugins/junit/src/com/intellij/execution/junit2/ui/actions/RunningTestTracker.java index 5c4e5f6ce0cf..01c553f32d03 100644 --- a/plugins/junit/src/com/intellij/execution/junit2/ui/actions/RunningTestTracker.java +++ b/plugins/junit/src/com/intellij/execution/junit2/ui/actions/RunningTestTracker.java @@ -60,13 +60,18 @@ class RunningTestTracker extends JUnitAdapter implements TestFrameworkPropertyLi public void onTestChanged(final TestEvent event) { if (event instanceof StateChangedEvent) { final TestProxy proxy = event.getSource(); - if (proxy == myLastRan && !isRunningState(proxy)) { - if (myLastSelected == proxy){ + final boolean isRunning = isRunningState(proxy); + if (isRunning) { + if (proxy.isLeaf()) { + myLastRan = proxy; + } + if (myLastSelected == proxy) { myLastSelected = null; } + } + else if (proxy == myLastRan) { myLastRan = null; } - if (proxy.isLeaf() && isRunningState(proxy)) myLastRan = proxy; myTrackingPolicy.applyTo(proxy); } } -- 2.32.0