From 66b131cf55a33848fa48bfde83fe418cb0aa8860 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 10 Oct 2013 15:50:38 +0400 Subject: [PATCH] test fix --- .../com/intellij/codeInsight/daemon/JobUtilTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/JobUtilTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/JobUtilTest.java index dbe744e0a78d..f9b3c2784e82 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/JobUtilTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/JobUtilTest.java @@ -178,13 +178,14 @@ public class JobUtilTest extends PlatformTestCase { // generally we know nothing about current thread since FJP can help others task to execute while in current context } ProgressIndicator actualIndicator = ProgressManager.getInstance().getProgressIndicator(); - assertTrue(actualIndicator instanceof SensitiveProgressWrapper); - actualIndicator = ((SensitiveProgressWrapper)actualIndicator).getOriginalProgressIndicator(); - if (progress != null) { - assertSame(progress, actualIndicator); + if (progress == null) { + assertNotNull(actualIndicator); + assertTrue(actualIndicator instanceof ProgressIndicatorBase); } else { - assertNotNull(actualIndicator); + assertTrue(actualIndicator instanceof SensitiveProgressWrapper); + ProgressIndicator original = ((SensitiveProgressWrapper)actualIndicator).getOriginalProgressIndicator(); + assertSame(progress, original); } // there can be read access even if we didn't ask for it (e.g. when task under read action steals others work) assertTrue(!runInReadAction || ApplicationManager.getApplication().isReadAccessAllowed());