Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
270,200
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(false); }
update
270,201
void (@NotNull AnActionEvent e) { }
actionPerformed
270,202
void () { MouseShortcut mouseShortcut = new MouseShortcut(MouseEvent.BUTTON1, 0, 1); assertEquals("The same MouseShortcut should be equals to itself", mouseShortcut, mouseShortcut); mouseShortcut = new MouseShortcut(MouseEvent.BUTTON2, 0, 1); assertEquals("The same MouseShortcut should be equals to itself", mouseShortc...
testTheSameMouseShortcutIsEqual
270,203
void () { assertEquals("Mouse shortcuts with equal data are equal", new MouseShortcut(MouseEvent.BUTTON1, 0, 1), new MouseShortcut(MouseEvent.BUTTON1, 0, 1)); assertEquals("Mouse shortcuts with equal data are equal", new MouseShortcut(MouseEvent.BUTTON2, InputEvent.ALT_DOWN_MASK, 2), new MouseShortcut(MouseEvent.BUTTON...
testEqualMouseShortcutsAreEqual
270,204
void () { MouseShortcut mouseShortcut = new MouseShortcut(MouseEvent.BUTTON2, InputEvent.ALT_DOWN_MASK, 2); PressureShortcut pressureShortcut = new PressureShortcut(1); assertNotEquals("MouseShortcut is not equal to PressureShortcut", mouseShortcut, pressureShortcut); assertNotEquals("MouseShortcut is not equal to Pres...
testSubclassesOfMouseEventsAreNotEqualToMouseEvents
270,205
void () { PressureShortcut pressureShortcut = new PressureShortcut(1); PressureShortcut anotherPressureShortcut = new PressureShortcut(1); assertEquals("Pressure shortcuts with the same data are equal", pressureShortcut, anotherPressureShortcut); }
testPressureShortcutsWithTheSameDataAreEqual
270,206
void () { PressureShortcut pressureShortcut = new PressureShortcut(1); PressureShortcut anotherPressureShortcut = new PressureShortcut(2); assertNotEquals("Pressure shortcuts with different data are not equal", pressureShortcut, anotherPressureShortcut); assertNotEquals("Pressure shortcuts with different data are not e...
testUnequalPressureShortcuts
270,207
AnAction (@NotNull Runnable runnable) { return new AnAction() { @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(true); } @Override public void actionPerformed(@NotNull AnActionEvent e) { runnable.run(); } }; }
createAction
270,208
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(true); }
update
270,209
void (@NotNull AnActionEvent e) { runnable.run(); }
actionPerformed
270,210
void () { press(); release(); press(); assertInvocationCounts(0, 0, 0, 0); release(); assertInvocationCounts(0, 1, 0, 0); }
testShiftShiftSuccessfulCase
270,211
void () { press(); release(); press(); timeStep(400); release(); assertInvocationCounts(0, 0, 0, 0); }
testLongSecondClick
270,212
void () { press(); release(); press(); key(); assertInvocationCounts(0, 0, 1, 0); release(); assertInvocationCounts(0, 0, 1, 0); }
testShiftShiftKeySuccessfulCase
270,213
void () { press(); key(); assertInvocationCounts(1, 0, 0, 0); release(); }
testShiftKey
270,214
void () { press(); release(); press(); key(2); assertInvocationCounts(0, 0, 2, 0); release(); assertInvocationCounts(0, 0, 2, 0); }
testRepeatedInvocationOnKeyHold
270,215
void () { press(); release(); press(); otherKey(); key(); release(); assertInvocationCounts(1, 0, 0, 1); }
testNoTriggeringAfterUnrelatedAction
270,216
void () { press(); release(); press(); dispatchEvent(KeyEvent.KEY_PRESSED, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK, KeyEvent.VK_CONTROL, KeyEvent.CHAR_UNDEFINED); dispatchEvent(KeyEvent.KEY_PRESSED, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK, KeyEvent.VK_BACK_SPACE, '\b'); dispatchEvent(KeyEvent.KEY_TYPED, Input...
testShiftShiftOtherModifierNoAction
270,217
void (int shiftKeyCount, int shiftShiftCount, int shiftShiftKeyCount, int shiftOtherKeyCount) { assertEquals(shiftKeyCount, myShiftKeyActionInvocationCount); assertEquals(shiftShiftCount, myShiftShiftActionInvocationCount); assertEquals(shiftShiftKeyCount, myShiftShiftKeyActionInvocationCount); assertEquals(shiftOtherK...
assertInvocationCounts
270,218
void () { dispatchEvent(KeyEvent.KEY_PRESSED, InputEvent.SHIFT_MASK, KeyEvent.VK_SHIFT, KeyEvent.CHAR_UNDEFINED); }
press
270,219
void () { dispatchEvent(KeyEvent.KEY_RELEASED, 0, KeyEvent.VK_SHIFT, KeyEvent.CHAR_UNDEFINED); }
release
270,220
void (int id, int modifiers, int keyCode, char keyChar) { IdeEventQueue.getInstance().dispatchEvent(new KeyEvent(myComponent, id, Clock.getTime(), modifiers, keyCode, keyChar)); }
dispatchEvent
270,221
void () { key(1, false); }
key
270,222
void (int repeat) { key(repeat, false); }
key
270,223
void () { key(1, true); }
otherKey
270,224
void (int repeat, boolean otherKey) { for (int i = 0; i < repeat; i++) { dispatchEvent(KeyEvent.KEY_PRESSED, InputEvent.SHIFT_MASK, otherKey ? KeyEvent.VK_ENTER : KeyEvent.VK_BACK_SPACE, otherKey ? '\n' : '\b'); dispatchEvent(KeyEvent.KEY_TYPED, InputEvent.SHIFT_MASK, 0, otherKey ? '\n' : '\b'); } dispatchEvent(KeyEven...
key
270,225
void (long step) { Clock.setTime(myCurrentTime += step); }
timeStep
270,226
void () { assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_PRESSED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON2))); MouseEvent mouseEvent = new MouseEvent(myEventSource, MouseEvent.MOUSE_RELEASED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON2); assertTrue(!myDispatcher.dispatchMouseEve...
testActionTriggering
270,227
void () { assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_PRESSED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON2))); MouseEvent dragEvent = new MouseEvent(myEventSource, MouseEvent.MOUSE_DRAGGED, 0, 0, 0, 0, 0, false, MouseEvent.BUTTON2); assertFalse(myDispatcher.dispatchMouseEvent...
testActionBlocking
270,228
void () { assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_PRESSED, 0, 0, 0, 0, 1, false, MouseEvent.BUTTON1))); assertFalse(myDispatcher.dispatchMouseEvent(new MouseEvent(myEventSource, MouseEvent.MOUSE_RELEASED, 0, InputEvent.CTRL_MASK, 0, 0, 1, false, MouseEvent.BUTTON1))); ...
testModifiersArePickedAtMousePressed
270,229
void (@NotNull AnActionEvent e) { myActionExecutionCount++; }
actionPerformed
270,230
void () { assertTrue(myParent.hasOwnActionId(ACTION_1)); assertTrue(myParent.hasOwnActionId(ACTION_2)); assertFalse(myParent.hasOwnActionId(ACTION_NON_EXISTENT)); assertSameElements(myParent.getShortcuts(ACTION_1), shortcut1); assertSameElements(myParent.getShortcuts(ACTION_2), shortcut2); assertSameElements(myParent.g...
testParentAndChildShortcuts
270,231
void () { myParent.removeShortcut(ACTION_1, shortcut1); assertFalse(myParent.hasOwnActionId(ACTION_1)); assertTrue(myParent.hasOwnActionId(ACTION_2)); assertFalse(myParent.hasOwnActionId(ACTION_NON_EXISTENT)); assertSameElements(myParent.getShortcuts(ACTION_1)); assertSameElements(myParent.getShortcuts(ACTION_2), short...
testRemovingShortcutsFromParentAndChild
270,232
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); myParent.addShortcut(ACTION_1, shortcut1); assertThat(myParent.hasOwnActionId(ACTION_1)).isTrue(); assertThat(myChild.hasOwnActionId(ACTION_1)).isFalse(); assertThat(myChild.getShortcuts(ACTION_1)).containsExactly(shortcut1); // should not have any ...
testRemovingShortcutFromChildWhenInheritedDontChangeTheListIfShortcutIsAbsent
270,233
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); myParent.addShortcut(ACTION_2, shortcut2); myParent.addShortcut(ACTION_2, shortcutA); myParent.addShortcut(ACTION_2, shortcutB); myChild.removeShortcut(ACTION_2, shortcut2); assertThat(myChild.getShortcuts(ACTION_2)).containsExactly(shortcutA, short...
testRemovingShortcutFirst
270,234
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); MouseShortcut mouseShortcut = new MouseShortcut(1, InputEvent.BUTTON2_MASK, 1); myParent.addShortcut(ACTION_2, mouseShortcut); assertThat(myChild.getActionIds(mouseShortcut)).containsExactly(ACTION_2); myChild.removeShortcut(ACTION_2, mouseShortcut)...
testRemoveMouseShortcut
270,235
void () { MouseShortcut mouseShortcut = new MouseShortcut(MouseEvent.BUTTON1, 0, 1); myParent.addShortcut(ACTION_2, mouseShortcut); Keymap grandChild = myChild.deriveKeymap("GrandChild"); grandChild.removeShortcut(ACTION_2, mouseShortcut); grandChild.addShortcut(ACTION_1, mouseShortcut); assertThat(grandChild.getAction...
testChangingMouseShortcutInGrandChild
270,236
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); myParent.addShortcut(ACTION_2, shortcut2); myParent.addShortcut(ACTION_2, shortcutA); myParent.addShortcut(ACTION_2, shortcutB); myChild.removeShortcut(ACTION_2, shortcutB); assertThat(myChild.getShortcuts(ACTION_2)).containsExactly(shortcut2, short...
testRemovingShortcutLast
270,237
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); myParent.addShortcut(ACTION_1, shortcut1); myParent.addShortcut(ACTION_1, shortcut2); assertTrue(myParent.hasOwnActionId(ACTION_1)); assertSameElements(myParent.getShortcuts(ACTION_1), shortcut1, shortcut2); assertFalse(myChild.hasOwnActionId(ACTION...
testRemovingShortcutFromChildWhenInherited
270,238
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); String BASE = "BASE_ACTION"; String DEPENDENT = "DEPENDENT_ACTION"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE, DEPENDENT); try { myParent.addShortcut(BASE, shortcut1); myParent.addShortcut(BASE, shortcut2); assertTrue(myParent.hasOwnActionI...
testRemovingShortcutFromChildWhenInheritedAndBound
270,239
void () { KeymapImpl standalone = new KeymapImpl(); standalone.setName("standalone"); String BASE1 = "BASE_ACTION1"; String DEPENDENT1 = "DEPENDENT_ACTION1"; String BASE2 = "BASE_ACTION2"; String DEPENDENT2 = "DEPENDENT_ACTION2"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE1, DEPENDENT1); KeymapManagerEx.getInsta...
testRemovingShortcutNotInheritedBoundAndNotBound
270,240
void () { assertSameElements(myChild.getShortcuts(ACTION_1), shortcut1, shortcutA); assertSameElements(myChild.getActionIds(shortcut1), ACTION_1); assertSameElements(myChild.getActionIds(shortcutA), ACTION_1); assertTrue(myChild.hasOwnActionId(ACTION_1)); myChild.clearOwnActionsId(ACTION_1); assertSameElements(myChild....
testResettingMappingInChild
270,241
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); String BASE = "BASE_ACTION"; String DEPENDENT = "DEPENDENT_ACTION"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE, DEPENDENT); try { assertSameElements(myParent.getShortcuts(BASE)); assertSameElements(myParent.getShortcuts(DEPENDENT)); assertSa...
testChangingAndResettingBoundShortcutsInParentKeymap
270,242
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); String BASE = "BASE_ACTION"; String DEPENDENT = "DEPENDENT_ACTION"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE, DEPENDENT); try { assertSameElements(myParent.getShortcuts(BASE)); assertSameElements(myParent.getShortcuts(DEPENDENT)); assertSa...
testChangingAndResettingBoundShortcutsInChildKeymap
270,243
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); String BASE = "BASE_ACTION"; String DEPENDENT = "DEPENDENT_ACTION"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE, DEPENDENT); try { assertSameElements(myParent.getShortcuts(BASE)); assertSameElements(myParent.getShortcuts(DEPENDENT)); assertSa...
testRemovingChildMappingIsTheSameAsResetting
270,244
void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); KeymapImpl myGrandChild = myChild.deriveKeymap("GrandChild"); assertSame(myChild, myGrandChild.getParent()); String BASE = "BASE_ACTION"; String DEPENDENT = "DEPENDENT_ACTION"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE, DEPENDENT); try { //...
testLookingForShortcutsInParentFirstAndOnlyThenConsiderBoundActions
270,245
void () { Keymap grandChild = myChild.deriveKeymap("GrandChild"); Runnable task = () -> { for (int i = 0; i < 1000; i++) { assertEquals(Shortcut.EMPTY_ARRAY, grandChild.getShortcuts("none")); List<Shortcut> shortcuts = Arrays.asList(grandChild.getShortcuts(ACTION_1)); assertTrue(shortcuts.size() >= 2 && shortcuts.size(...
testParallelGetShortcuts
270,246
ShortcutRestrictions (String actionId) { return ACTION_WITH_FIXED_SHORTCUTS.equals(actionId) ? new ShortcutRestrictions(false, false, false, false, false, false) : ShortcutRestrictions.NO_RESTRICTIONS; }
getForActionId
270,247
void (@TestDisposable @NotNull Disposable testDisposable, @NotNull ActionShortcutRestrictions restrictions) { ServiceContainerUtil .replaceService(ApplicationManager.getApplication(), ActionShortcutRestrictions.class, restrictions, testDisposable); }
setRestrictions
270,248
void () { doTest(null, Arrays.asList( ACTION_WITHOUT_TEXT_AND_DESCRIPTION, ACTION_WITH_TEXT_ONLY, ACTION_WITH_TEXT_AND_DESCRIPTION, EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED_IN_PARENT, ACTION_WITH_USE_SHORTCUT_OF_NON_EXISTENT_ACTION, AC...
testVariousActionsArePresent
270,249
List<DynamicTest> () { ActionManager manager = ActionManager.getInstance(); List<NamedFailure> failures = new ArrayList<>(); for (String id : ContainerUtil.sorted(manager.getActionIdList(""))) { if (ACTION_WITHOUT_TEXT_AND_DESCRIPTION.equals(id)) { continue; } try { AnAction stub = manager.getActionOrStub(id); AnAction...
testPresentation
270,250
void (String name, String message, Object expected, Object actual) { if (!Objects.equals(expected, actual)) { LOG.debug(name + " updated: "+ message + "; old:" + expected + "; new:" + actual); } }
checkPresentationProperty
270,251
void () { doTest("Dummy", // all below actions should still be present, as they contain 'Dummy' in their actionId Arrays.asList( ACTION_WITHOUT_TEXT_AND_DESCRIPTION, ACTION_WITH_TEXT_ONLY, ACTION_WITH_TEXT_AND_DESCRIPTION, EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTEN...
testFiltering
270,252
void (String filter, List<String> idsThatMustBePresent, List<String> idsThatMustNotBePresent) { if (filter != null) { myActionsTree.filter(filter, new QuickList[0]); } List<String> missing = new ArrayList<>(); List<String> present = new ArrayList<>(); for (String actionId : idsThatMustBePresent) { if (!myActionsTree.ge...
doTest
270,253
void (@NotNull AnActionEvent e) { }
actionPerformed
270,254
void () { Disposer.dispose(disposable); }
tearDown
270,255
void () { ExtensionsAreaImpl extensionsArea = new ExtensionsAreaImpl(new ExtensionPointImplTest.MyComponentManager()); int numEP = extensionsArea.getNameToPointMap().size(); registerInterfaceExtension(extensionsArea); assertEquals("Additional EP available", numEP + 1, extensionsArea.getNameToPointMap().size()); assertT...
testCreateAndAccess
270,256
void (@NotNull ExtensionsAreaImpl extensionsArea) { extensionsArea.registerExtensionPoint(EXTENSION_POINT_NAME_1, Integer.class.getName(), ExtensionPoint.Kind.INTERFACE, false); }
registerInterfaceExtension
270,257
void () { ExtensionsAreaImpl extensionsArea = new ExtensionsAreaImpl(new ExtensionPointImplTest.MyComponentManager()); registerInterfaceExtension(extensionsArea); extensionsArea.registerExtensionPoint(EXTENSION_POINT_NAME_1, Boolean.class.getName(), ExtensionPoint.Kind.INTERFACE, false); fail("Should not allow duplicat...
testInvalidActions
270,258
void () { ExtensionsAreaImpl extensionsArea = new ExtensionsAreaImpl(new ExtensionPointImplTest.MyComponentManager()); int numEP = extensionsArea.getNameToPointMap().size(); registerInterfaceExtension(extensionsArea); final boolean[] removed = {true}; ExtensionPointImpl<Object> point = extensionsArea.getExtensionPoint(...
testUnregisterEP
270,259
void (@NotNull Object extension, @NotNull PluginDescriptor pluginDescriptor) { removed[0] = false; }
extensionAdded
270,260
void (@NotNull Object extension, @NotNull PluginDescriptor pluginDescriptor) { removed[0] = true; }
extensionRemoved
270,261
void () { ExtensionsAreaImpl extensionsArea = new ExtensionsAreaImpl(new ExtensionPointImplTest.MyComponentManager()); extensionsArea.registerExtensionPoint("plugin.ep1", TestExtensionClassOne.class.getName(), ExtensionPoint.Kind.BEAN_CLASS, false); registerExtension(extensionsArea, "plugin", "<plugin:ep1 xmlns:plugin=...
testExtensionsNamespaces
270,262
void () { ExtensionsAreaImpl extensionsArea = new ExtensionsAreaImpl(new ExtensionPointImplTest.MyComponentManager()); extensionsArea.registerExtensionPoint("ep1", TestExtensionClassOne.class.getName(), ExtensionPoint.Kind.BEAN_CLASS, false); registerExtension(extensionsArea, "", "<extension point=\"ep1\" order=\"LAST\...
testExtensionsWithOrdering
270,263
void () { ExtensionsAreaImpl extensionsArea = new ExtensionsAreaImpl(new ExtensionPointImplTest.MyComponentManager()); extensionsArea.registerExtensionPoint("ep1", TestExtensionClassOne.class.getName(), ExtensionPoint.Kind.BEAN_CLASS, false); registerExtension(extensionsArea, "", "<extension point=\"ep1\" id=\"_7\" ord...
testExtensionsWithOrderingUpdate
270,264
void (ExtensionsAreaImpl area, @NotNull String pluginName, @NotNull String extensionElement) { String moduleXml = "<idea-plugin><extensions>" + extensionElement + "</extensions></idea-plugin>"; PluginId id = PluginId.getId(pluginName); IdeaPluginDescriptorImpl pluginDescriptor = PluginDescriptorTestKt.readDescriptorFor...
registerExtension
270,265
DumbServiceSyncTaskQueue () { return myService; }
service
270,266
void () { final AtomicBoolean secondTaskCompleted = new AtomicBoolean(false); // Run two tasks one after another. Then terminate the first (parent) task and check that the second (child) task complete successfully service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull Progr...
testCanceledTasksDoesNotTerminateFollowingTasks
270,267
void (@NotNull ProgressIndicator indicator) { service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { secondTaskCompleted.set(true); } }); // cancel parent task now. The child task should complete successfully throw new ProcessCanceledException...
performInDumbMode
270,268
void (@NotNull ProgressIndicator indicator) { secondTaskCompleted.set(true); }
performInDumbMode
270,269
void () { final Ref<Boolean> myInnerRunning = new Ref<>(null); service().runTaskSynchronously(new DumbModeTask() { boolean myIsRunning = false; @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { myIsRunning = true; try { service().runTaskSynchronously(new DumbModeTask() { @Override public v...
testRecursionIsBlocked
270,270
void (@NotNull ProgressIndicator indicator) { myIsRunning = true; try { service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { //the task execution must be postponed, so the captured closure will evaluate to `false` myInnerRunning.set(myIsRunn...
performInDumbMode
270,271
void (@NotNull ProgressIndicator indicator) { //the task execution must be postponed, so the captured closure will evaluate to `false` myInnerRunning.set(myIsRunning); }
performInDumbMode
270,272
void () { List<Integer> disposeLog = new ArrayList<>(); List<Integer> childLog = new ArrayList<>(); service().runTaskSynchronously(new DumbModeTaskWithEquivalentObject("parent") { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { for (int i = 0; i < 100; i++) { int taskId = i; service().ru...
testEquivalentTasksAreMerged
270,273
void (@NotNull ProgressIndicator indicator) { for (int i = 0; i < 100; i++) { int taskId = i; service().runTaskSynchronously(new DumbModeTaskWithEquivalentObject("child") { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { childLog.add(taskId); } @Override public void dispose() { disposeLo...
performInDumbMode
270,274
void (@NotNull ProgressIndicator indicator) { childLog.add(taskId); }
performInDumbMode
270,275
void () { disposeLog.add(taskId); }
dispose
270,276
void () { List<Integer> childLog = new ArrayList<>(); service().runTaskSynchronously(new DumbModeTaskWithEquivalentObject("parent") { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { final String commonEquivalence = "child"; DumbModeTask taskA = new DumbModeTaskWithEquivalentObject(common...
testDifferentClassesWithSameEquivalentAreNotMerged
270,277
void (@NotNull ProgressIndicator indicator) { final String commonEquivalence = "child"; DumbModeTask taskA = new DumbModeTaskWithEquivalentObject(commonEquivalence) { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { childLog.add(1); } }; DumbModeTask taskB = new DumbModeTaskWithEquivalent...
performInDumbMode
270,278
void (@NotNull ProgressIndicator indicator) { childLog.add(1); }
performInDumbMode
270,279
void (@NotNull ProgressIndicator indicator) { childLog.add(-1); }
performInDumbMode
270,280
void () { List<Integer> childLog = new ArrayList<>(); service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { for (int i = 0; i < 100; i++) { int taskId = i; service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDum...
testNonEquivalentTasksAreNotMerged
270,281
void (@NotNull ProgressIndicator indicator) { for (int i = 0; i < 100; i++) { int taskId = i; service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { childLog.add(taskId); } }); } }
performInDumbMode
270,282
void (@NotNull ProgressIndicator indicator) { childLog.add(taskId); }
performInDumbMode
270,283
void () { while (true) { try (@Nullable QueuedDumbModeTask nextTask = myQueue.extractNextTask()) { if (nextTask == null) return; nextTask.executeTask(); } } }
runAllTasks
270,284
void () { List<Integer> childLog = new ArrayList<>(); for (int i = 0; i < 100; i++) { int taskId = i; myQueue.addTask(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { childLog.add(taskId); } }); } runAllTasks(); Assert.assertEquals("Every child task are not unique, al...
testDumbModeTasksAreNotMergedByDefault
270,285
void (@NotNull ProgressIndicator indicator) { childLog.add(taskId); }
performInDumbMode
270,286
void () { while (true) { try (MergingTaskQueue.QueuedTask<?> nextTask = myQueue.extractNextTask()) { if (nextTask == null) return; nextTask.executeTask(); } } }
runAllTasks
270,287
void () { }
dispose
270,288
void (@NotNull ProgressIndicator indicator) { if (performLog != null) performLog.add(taskId); }
perform
270,289
void () { if (disposeLog != null) disposeLog.add(taskId); }
dispose
270,290
void () { List<Integer> disposeLog = new ArrayList<>(); List<Integer> childLog = new ArrayList<>(); for (int i = 0; i < 100; i++) { int taskId = i; myQueue.addTask(new TaskWithEquivalentObject("child") { @Override public void perform(@NotNull ProgressIndicator indicator) { childLog.add(taskId); } @Override public void ...
testEquivalentTasksAreMerged
270,291
void (@NotNull ProgressIndicator indicator) { childLog.add(taskId); }
perform
270,292
void () { disposeLog.add(taskId); }
dispose
270,293
void () { List<Integer> disposeLog = new ArrayList<>(); List<Integer> childLog = new ArrayList<>(); for (int i = 0; i < 100; i++) { myQueue.addTask(new LoggingTask(i, childLog, disposeLog, (thiz, other) -> other /* always merges */)); } runAllTasks(); Assert.assertEquals("Only one child task should run, but were: " + c...
testCanReturnThatAsResultOfTryMerge
270,294
void () { List<Integer> disposeLog = new ArrayList<>(); List<Integer> childLog = new ArrayList<>(); for (int i = 0; i < 100; i++) { myQueue.addTask(new LoggingTask(i, childLog, disposeLog, (thiz, other) -> thiz /* always merges */)); } runAllTasks(); Assert.assertEquals("Only one child task should run, but were: " + ch...
testCanReturnThisAsResultOfTryMerge
270,295
void () { List<Integer> childLog = new ArrayList<>(); final String commonEquivalence = "child"; TaskWithEquivalentObject taskA = new TaskWithEquivalentObject(commonEquivalence) { @Override public void perform(@NotNull ProgressIndicator indicator) { childLog.add(1); } }; TaskWithEquivalentObject taskB = new TaskWithEqui...
testDifferentClassesWithSameEquivalentAreNotMerged
270,296
void (@NotNull ProgressIndicator indicator) { childLog.add(1); }
perform
270,297
void (@NotNull ProgressIndicator indicator) { childLog.add(-1); }
perform
270,298
void () { List<Integer> childLog = new ArrayList<>(); for (int i = 0; i < 100; i++) { int taskId = i; myQueue.addTask(new TaskWithEquivalentObject("child" + i) { @Override public void perform(@NotNull ProgressIndicator indicator) { childLog.add(taskId); } }); } runAllTasks(); Assert.assertEquals("Every child task are n...
testNonEquivalentTasksAreNotMerged
270,299
void (@NotNull ProgressIndicator indicator) { childLog.add(taskId); }
perform