diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java index e172c7d55f52..1b3f39f2546d 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java @@ -55,7 +55,9 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { } catch(ProcessCanceledException ex) { boolean isInternal = SystemProperties.getBooleanProperty("idea.is.internal", false); - assertTrue("Should have no stackframe", isInternal ? ex.getStackTrace().length != 0 : ex.getStackTrace().length == 0); + boolean isTest = SystemProperties.getBooleanProperty("idea.is.unit.test", false); + boolean hasStackFrame = ex.getStackTrace().length != 0; + assertTrue("Should have no stackframe", (isInternal || isTest) == hasStackFrame); } } @@ -112,7 +114,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { }, "", false, getProject(), null, ""); long averageDelay = PlatformTestUtil.averageAmongMedians(times.toNativeArray(), 5); System.out.println("averageDelay = " + averageDelay); - assertTrue(averageDelay < ProgressManagerImpl.CHECK_CANCELED_DELAY_MILLIS*3); + assertTrue(averageDelay < CoreProgressManager.CHECK_CANCELED_DELAY_MILLIS *3); } public void testProgressIndicatorUtilsScheduleWithWriteActionPriority() throws Throwable { @@ -133,7 +135,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { }); UIUtil.dispatchAllInvocationEvents(); while (!insideReadAction.get()) { - ; + } ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override @@ -316,11 +318,11 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { ProgressManager.getInstance().executeProcessUnderProgress(new Runnable() { @Override public void run() { - assertFalse(ProgressManagerImpl.threadsUnderCanceledIndicator.contains(Thread.currentThread())); + assertFalse(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); assertTrue(indicator != null && !indicator.isCanceled()); indicator.cancel(); - assertTrue(ProgressManagerImpl.threadsUnderCanceledIndicator.contains(Thread.currentThread())); + assertTrue(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); assertTrue(indicator.isCanceled()); final ProgressIndicatorEx nested = new ProgressIndicatorBase(); nested.addStateDelegate(new ProgressIndicatorStub() { @@ -332,7 +334,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { ProgressManager.getInstance().executeProcessUnderProgress(new Runnable() { @Override public void run() { - assertFalse(ProgressManagerImpl.threadsUnderCanceledIndicator.contains(Thread.currentThread())); + assertFalse(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); ProgressIndicator indicator2 = ProgressIndicatorProvider.getGlobalProgressIndicator(); assertTrue(indicator2 != null && !indicator2.isCanceled()); assertSame(indicator2, nested); @@ -343,7 +345,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { ProgressIndicator indicator3 = ProgressIndicatorProvider.getGlobalProgressIndicator(); assertSame(indicator, indicator3); - assertTrue(ProgressManagerImpl.threadsUnderCanceledIndicator.contains(Thread.currentThread())); + assertTrue(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); } }, new EmptyProgressIndicator()); assertFalse(checkCanceledCalled); @@ -386,10 +388,10 @@ public class ProgressIndicatorTest extends LightPlatformTestCase { ProgressManager.getInstance().executeProcessUnderProgress(new Runnable() { @Override public void run() { - assertFalse(ProgressManagerImpl.threadsUnderCanceledIndicator.contains(Thread.currentThread())); + assertFalse(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); assertTrue(!progress.isCanceled()); progress.cancel(); - assertTrue(ProgressManagerImpl.threadsUnderCanceledIndicator.contains(Thread.currentThread())); + assertTrue(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); assertTrue(progress.isCanceled()); while (true) { // wait for PCE ProgressManager.checkCanceled();