mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
IJPL-53: Implement ThreadingSupport via new lock.
- Prepare for switchable RW Lock implementation. GitOrigin-RevId: 5765bdfda788fe64455e5d91121fc084585cb739
This commit is contained in:
committed by
intellij-monorepo-bot
parent
38432f73a5
commit
e1592f02ff
@@ -71,7 +71,7 @@ public final class CucumberMain {
|
||||
try {
|
||||
UITestUtil.replaceIdeEventQueueSafely();
|
||||
EdtInvocationManager.invokeAndWaitIfNeeded(() -> {
|
||||
IdeEventQueue.getInstance().getRwLockHolder().runWriteIntentReadAction(() -> {
|
||||
IdeEventQueue.getInstance().getThreadingSupport().runWriteIntentReadAction(() -> {
|
||||
try {
|
||||
RuntimeOptions runtimeOptions = new RuntimeOptions(new ArrayList<>(Arrays.asList(argv)));
|
||||
MultiLoader resourceLoader = new MultiLoader(classLoader) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.intellij.ide.dnd.DnDManagerImpl
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ThreadingSupport
|
||||
import com.intellij.openapi.application.TransactionGuard
|
||||
import com.intellij.openapi.application.TransactionGuardImpl
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx
|
||||
@@ -80,7 +81,7 @@ class IdeEventQueue private constructor() : EventQueue() {
|
||||
private val activityListeners = ContainerUtil.createLockFreeCopyOnWriteList<Runnable>()
|
||||
|
||||
@Internal
|
||||
val rwLockHolder: RwLockHolder = RwLockHolder
|
||||
val threadingSupport: ThreadingSupport = RwLockHolder
|
||||
val keyEventDispatcher: IdeKeyEventDispatcher = IdeKeyEventDispatcher(this)
|
||||
val mouseEventDispatcher: IdeMouseEventDispatcher = IdeMouseEventDispatcher()
|
||||
val popupManager: IdePopupManager = IdePopupManager()
|
||||
@@ -143,7 +144,7 @@ class IdeEventQueue private constructor() : EventQueue() {
|
||||
val systemEventQueue = Toolkit.getDefaultToolkit().systemEventQueue
|
||||
assert(systemEventQueue !is IdeEventQueue) { systemEventQueue }
|
||||
systemEventQueue.push(this)
|
||||
rwLockHolder.postInit(Thread.currentThread())
|
||||
threadingSupport.postInit(Thread.currentThread())
|
||||
EDT.updateEdt()
|
||||
replaceDefaultKeyboardFocusManager()
|
||||
addDispatcher(WindowsAltSuppressor(), null)
|
||||
@@ -581,8 +582,8 @@ class IdeEventQueue private constructor() : EventQueue() {
|
||||
}
|
||||
|
||||
when {
|
||||
e is MouseEvent -> rwLockHolder.runWithImplicitRead { dispatchMouseEvent(e) }
|
||||
e is KeyEvent -> rwLockHolder.runWithImplicitRead { dispatchKeyEvent(e) }
|
||||
e is MouseEvent -> threadingSupport.runWithImplicitRead { dispatchMouseEvent(e) }
|
||||
e is KeyEvent -> threadingSupport.runWithImplicitRead { dispatchKeyEvent(e) }
|
||||
appIsLoaded() -> {
|
||||
val app = ApplicationManagerEx.getApplicationEx()
|
||||
if (e is ComponentEvent) {
|
||||
@@ -590,9 +591,9 @@ class IdeEventQueue private constructor() : EventQueue() {
|
||||
(app.serviceIfCreated<WindowManager>() as? WindowManagerEx)?.dispatchComponentEvent(e)
|
||||
}
|
||||
}
|
||||
rwLockHolder.runWithoutImplicitRead { defaultDispatchEvent(e) }
|
||||
threadingSupport.runWithoutImplicitRead { defaultDispatchEvent(e) }
|
||||
}
|
||||
else -> rwLockHolder.runWithoutImplicitRead { defaultDispatchEvent(e) }
|
||||
else -> threadingSupport.runWithoutImplicitRead { defaultDispatchEvent(e) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,8 @@ package com.intellij.testFramework;
|
||||
|
||||
import com.intellij.ide.IdeEventQueue;
|
||||
import com.intellij.mock.MockApplication;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ex.ApplicationEx;
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
||||
import com.intellij.openapi.application.impl.ApplicationImpl;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.util.ThrowableRunnable;
|
||||
@@ -18,7 +15,6 @@ import org.jetbrains.annotations.TestOnly;
|
||||
import javax.swing.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import static com.intellij.testFramework.UITestUtil.replaceIdeEventQueueSafely;
|
||||
import static com.intellij.testFramework.UITestUtil.setupEventQueue;
|
||||
|
||||
public final class EdtTestUtil {
|
||||
@@ -64,7 +60,7 @@ public final class EdtTestUtil {
|
||||
else if (EDT.isCurrentThreadEdt()) {
|
||||
if (writeIntent) {
|
||||
setupEventQueue();
|
||||
IdeEventQueue.getInstance().getRwLockHolder().runWriteIntentReadAction(() -> {
|
||||
IdeEventQueue.getInstance().getThreadingSupport().runWriteIntentReadAction(() -> {
|
||||
runnable.run();
|
||||
return null;
|
||||
});
|
||||
@@ -80,7 +76,7 @@ public final class EdtTestUtil {
|
||||
() -> {
|
||||
try {
|
||||
setupEventQueue();
|
||||
IdeEventQueue.getInstance().getRwLockHolder().runWriteIntentReadAction(() -> {
|
||||
IdeEventQueue.getInstance().getThreadingSupport().runWriteIntentReadAction(() -> {
|
||||
runnable.run();
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -116,27 +116,27 @@ final class JUnit5RunInEdtTest {
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
MethodLevelAnnotationTest() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@Test
|
||||
void testMethod() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -149,7 +149,7 @@ final class JUnit5RunInEdtTest {
|
||||
@ExtendWith(EmptyTestTemplateInvocationContextProvider.class)
|
||||
void testTemplate() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@@ -158,7 +158,7 @@ final class JUnit5RunInEdtTest {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
return List.of(DynamicTest.dynamicTest("dynamic test", () -> {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -166,14 +166,14 @@ final class JUnit5RunInEdtTest {
|
||||
@AfterEach
|
||||
void afterEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@AfterAll
|
||||
static void afterAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,27 +184,27 @@ final class JUnit5RunInEdtTest {
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
MethodLevelAnnotationTestWithDefaultWriteIntent() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@Test
|
||||
void testMethod() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -217,7 +217,7 @@ final class JUnit5RunInEdtTest {
|
||||
@ExtendWith(EmptyTestTemplateInvocationContextProvider.class)
|
||||
void testTemplate() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@@ -226,7 +226,7 @@ final class JUnit5RunInEdtTest {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
return List.of(DynamicTest.dynamicTest("dynamic test", () -> {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -234,14 +234,14 @@ final class JUnit5RunInEdtTest {
|
||||
@AfterEach
|
||||
void afterEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt
|
||||
@AfterAll
|
||||
static void afterAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,27 +252,27 @@ final class JUnit5RunInEdtTest {
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.True)
|
||||
MethodLevelAnnotationTestWithPerMethodWriteIntent() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.True)
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.True)
|
||||
@Test
|
||||
void testMethod() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -285,7 +285,7 @@ final class JUnit5RunInEdtTest {
|
||||
@ExtendWith(EmptyTestTemplateInvocationContextProvider.class)
|
||||
void testTemplate() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.True)
|
||||
@@ -294,7 +294,7 @@ final class JUnit5RunInEdtTest {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
return List.of(DynamicTest.dynamicTest("dynamic test", () -> {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -302,14 +302,14 @@ final class JUnit5RunInEdtTest {
|
||||
@AfterEach
|
||||
void afterEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.True)
|
||||
@AfterAll
|
||||
static void afterAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,27 +321,27 @@ final class JUnit5RunInEdtTest {
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.False)
|
||||
MethodLevelAnnotationTestWithoutPerMethodWriteIntent() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.False)
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.False)
|
||||
@Test
|
||||
void testMethod() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -354,7 +354,7 @@ final class JUnit5RunInEdtTest {
|
||||
@ExtendWith(EmptyTestTemplateInvocationContextProvider.class)
|
||||
void testTemplate() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.False)
|
||||
@@ -363,7 +363,7 @@ final class JUnit5RunInEdtTest {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
return List.of(DynamicTest.dynamicTest("dynamic test", () -> {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -371,14 +371,14 @@ final class JUnit5RunInEdtTest {
|
||||
@AfterEach
|
||||
void afterEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@RunMethodInEdt(writeIntent = RunMethodInEdt.WriteIntentMode.False)
|
||||
@AfterAll
|
||||
static void afterAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,31 +388,31 @@ final class JUnit5RunInEdtTest {
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
ClassLevelAnnotationTest() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMethod() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(EmptyTestTemplateInvocationContextProvider.class)
|
||||
void testTemplate() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@TestFactory
|
||||
@@ -420,20 +420,20 @@ final class JUnit5RunInEdtTest {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
return List.of(DynamicTest.dynamicTest("dynamic test", () -> {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void afterEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void afterAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,31 +443,31 @@ final class JUnit5RunInEdtTest {
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
ClassLevelAnnotationTestWithGlobalWriteIntent() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void beforeEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMethod() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
@ExtendWith(EmptyTestTemplateInvocationContextProvider.class)
|
||||
void testTemplate() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@TestFactory
|
||||
@@ -475,20 +475,20 @@ final class JUnit5RunInEdtTest {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
return List.of(DynamicTest.dynamicTest("dynamic test", () -> {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void afterEach() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
static void afterAll() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertTrue(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ final class JUnit5RunInEdtTest {
|
||||
@Test
|
||||
void testMethod() {
|
||||
Assertions.assertTrue(EDT.isCurrentThreadEdt());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getRwLockHolder().isWriteIntentLocked());
|
||||
Assertions.assertFalse(IdeEventQueue.getInstance().getThreadingSupport().isWriteIntentLocked());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user