Better logging

This commit is contained in:
Denis Fokin
2016-10-03 12:45:28 +03:00
parent f1d7f84820
commit da707e6b0a
@@ -18,6 +18,7 @@ package com.intellij.openapi.application.impl;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.application.ModalityStateListener;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.SkipInHeadlessEnvironment;
import org.jetbrains.annotations.NotNull;
@@ -38,6 +39,8 @@ import static com.intellij.openapi.application.impl.LaterInvocatorTest.flushSwin
@SkipInHeadlessEnvironment
public class PerProjectLaterInvocatorTest extends PlatformTestCase {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.application.impl.PerProjectLaterInvocatorTest");
private final static Object lock = new Object();
@SuppressWarnings("EmptySynchronizedStatement") private static Runnable blockEDT = () -> {synchronized(lock){}};
@@ -176,8 +179,9 @@ public class PerProjectLaterInvocatorTest extends PlatformTestCase {
AtomicInteger enteringIndex = new AtomicInteger(-1);
ModalityStateListener modalityStateListener = entering -> {
if (entering != enteringOrder[enteringIndex.incrementAndGet()])
throw new RuntimeException("Trying to enter a modal state. Wrong order of the modalityStateListener invocations. Step #" + enteringIndex.get());
if (entering != enteringOrder[enteringIndex.incrementAndGet()]) {
throw new RuntimeException("Entrance index: " + enteringIndex + "; value: " + entering + " expected value: " + enteringOrder[enteringIndex.get()]);
}
};
Disposable emptyDisposal = () -> {};