mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
reveal the failure source earlier
This commit is contained in:
+3
-2
@@ -316,6 +316,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase {
|
||||
@Override
|
||||
public void checkCanceled() throws ProcessCanceledException {
|
||||
checkCanceledCalled = true;
|
||||
throw new RuntimeException("must not call checkCanceled()");
|
||||
}
|
||||
});
|
||||
ProgressManager.getInstance().executeProcessUnderProgress(() -> {
|
||||
@@ -617,7 +618,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase {
|
||||
try {
|
||||
Future<?> future = ApplicationManager.getApplication().executeOnPooledThread(
|
||||
() -> ProgressManager.getInstance().runProcess(
|
||||
() -> assertInvokeAndWaitWorks(),
|
||||
ProgressIndicatorTest::assertInvokeAndWaitWorks,
|
||||
ProgressWrapper.wrap(indicator)));
|
||||
future.get(2000, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
@@ -631,7 +632,7 @@ public class ProgressIndicatorTest extends LightPlatformTestCase {
|
||||
private static void assertInvokeAndWaitWorks() {
|
||||
Semaphore semaphore = new Semaphore();
|
||||
semaphore.down();
|
||||
ApplicationManager.getApplication().invokeLater(() -> semaphore.up());
|
||||
ApplicationManager.getApplication().invokeLater(semaphore::up);
|
||||
assertTrue("invokeAndWait would deadlock", semaphore.waitFor(1000));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user