Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
270,000
void () { assertEquals("matches", pastParticiple("matches")); assertEquals("equals", pastParticiple("equals")); assertEquals("of", pastParticiple("of")); assertEquals("проблем", pastParticiple("проблем")); assertEquals("string1", pastParticiple("string1")); }
testIgnore
270,001
boolean () { return super.shouldRunTest() && IoTestUtil.isSymLinkCreationSupported; }
shouldRunTest
270,002
void () { assertEquals(myNonContentVFile, ProjectRootUtil.findSymlinkedFileInContent(getProject(), myNonContentVFile)); }
testNoFilesInContent
270,003
void () { doTestLinkedDirInProjectRoots(true); }
testLinkedDirInContent
270,004
void () { doTestLinkedDirInProjectRoots(false); }
testLinkedDirInLibrary
270,005
void (boolean content) { String linkedPath = (content ? myContentDir : myLibraryDir).getPath() + "/linked"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath, true); VirtualFile linkedVFile = VfsUtil.findFileByIoFile(new File(linkedPath, myNonContentFile.getName()), true); assertEquals(linkedVFile, Project...
doTestLinkedDirInProjectRoots
270,006
void () { String linkedPath = myContentDir.getPath() + "/linked.txt"; IoTestUtil.createSymLink(myNonContentVFile.getPath(), linkedPath, true); VirtualFile linkedVFile = VfsUtil.findFileByIoFile(new File(linkedPath), true); assertEquals(linkedVFile, ProjectRootUtil.findSymlinkedFileInContent(getProject(), myNonContentVF...
_testLinkedFileInSources
270,007
void () { String linkedPath1 = myContentDir.getPath() + "/linked1"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath1, true); VirtualFile linkedVFile1 = VfsUtil.findFileByIoFile(new File(linkedPath1, myNonContentFile.getName()), true); assertNotNull(linkedVFile1); String linkedPath2 = myContentDir.getPath...
testWhenSeveralLinkedAlwaysReturnTheSameFile
270,008
void () { doTestLinkedAndCanonicalUnderRoot(true); }
testLinkedAndCanonicalUnderContent
270,009
void () { doTestLinkedAndCanonicalUnderRoot(false); }
testLinkedAndCanonicalUnderLibraryRoot
270,010
void (boolean content) { String linkedPath = myContentDir.getPath() + "/linked"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath, true); VirtualFile linkedVFile = VfsUtil.findFileByIoFile(new File(linkedPath, myNonContentFile.getName()), true); assertEquals(linkedVFile, ProjectRootUtil.findSymlinkedFileI...
doTestLinkedAndCanonicalUnderRoot
270,011
void () { VirtualFile file1 = myFixture.configureByText("file1.txt", "").getVirtualFile(); VirtualFile file2 = myFixture.configureByText("file2.txt", "").getVirtualFile(); SyntheticLibrary lib1 = SyntheticLibrary.newImmutableLibrary(Arrays.asList(file1, file2)); SyntheticLibrary lib2 = SyntheticLibrary.newImmutableLibr...
testEquality
270,012
void () { LightVirtualFile file = new LightVirtualFile(getTestName(false)); Document d1 = EditorFactory.getInstance().createDocument(""); Document d2 = EditorFactory.getInstance().createDocument(""); FileEditor fileEditor = new IncorrectFileEditor(file, d1, d2); runWithCurrentEditor(fileEditor, () -> { WriteAction.run(...
testIncorrectFileEditorDoesNotCauseHanging
270,013
void () { UndoManagerImpl undoManager = getUndoManager(); FileEditor fileEditor = undoManager.getEditorProvider().getCurrentEditor(getProject()); assertTrue(undoManager.isUndoAvailable(fileEditor)); undoManager.undo(fileEditor); }
undo
270,014
void (FileEditor currentEditor, Runnable task) { UndoManagerImpl undoManager = getUndoManager(); try { undoManager.setOverriddenEditorProvider(new CurrentEditorProvider() { @Override public @Nullable FileEditor getCurrentEditor(@Nullable Project project) { return currentEditor; } }); task.run(); } finally { undoManager...
runWithCurrentEditor
270,015
UndoManagerImpl () { return (UndoManagerImpl)UndoManager.getInstance(getProject()); }
getUndoManager
270,016
VirtualFile () { return myFile; }
getFile
270,017
JComponent () { return myComponent; }
getComponent
270,018
String () { return "testEditor"; }
getName
270,019
FileEditorState (@NotNull FileEditorStateLevel level) { return new State(); }
getState
270,020
void (@NotNull FileEditorState state) {}
setState
270,021
boolean () { return false; }
isModified
270,022
boolean () { return true; }
isValid
270,023
void (@NotNull PropertyChangeListener listener) {}
addPropertyChangeListener
270,024
void (@NotNull PropertyChangeListener listener) {}
removePropertyChangeListener
270,025
void () {}
dispose
270,026
boolean (@NotNull FileEditorState otherState, @NotNull FileEditorStateLevel level) { return false; }
canBeMergedWith
270,027
void () { UpdateSettings.getInstance().setWhatsNewShownFor(0); System.clearProperty("idea.updates.url"); }
tearDown
270,028
void () { BuildNumber release = fromString("212.4746.92"); assertFalse(UpdateCheckerService.shouldShowWhatsNew(release, false)); // release 1st launch assertFalse(UpdateCheckerService.shouldShowWhatsNew(release, false)); // release 2nd launch }
newReleaseInstallation
270,029
void () { BuildNumber beta = fromString("212.4638.7"), release = fromString("212.4746.92"); assertFalse(UpdateCheckerService.shouldShowWhatsNew(beta, true)); // EAP 1st launch assertFalse(UpdateCheckerService.shouldShowWhatsNew(beta, true)); // EAP 2nd launch assertFalse(UpdateCheckerService.shouldShowWhatsNew(release,...
newEapInstallation
270,030
void () { BuildNumber previous = fromString("211.7628.21"), release = fromString("212.4746.92"); assertFalse(UpdateCheckerService.shouldShowWhatsNew(previous, false)); // previous version last launch assertTrue(UpdateCheckerService.shouldShowWhatsNew(release, false)); // release 1st launch assertFalse(UpdateCheckerServ...
updateReleaseToRelease
270,031
void () { BuildNumber previous = fromString("211.7628.21"), beta = fromString("212.4638.7"), release = fromString("212.4746.92"); assertFalse(UpdateCheckerService.shouldShowWhatsNew(previous, false)); // previous version last launch assertFalse(UpdateCheckerService.shouldShowWhatsNew(beta, true)); // EAP 1st launch ass...
updateReleaseToEapToRelease
270,032
void () { BuildNumber previous = fromString("211.7628.21"), release = fromString("212.4746.92"); String historicProperty = "ide.updates.whats.new.shown.for"; PropertiesComponent properties = PropertiesComponent.getInstance(); try { properties.setValue(historicProperty, previous.getBaselineVersion(), 0); assertTrue(Upda...
whatsNewSettingsMigration
270,033
void () { ProgressManager.getInstance(); }
initProgressManager
270,034
void () { Clock.reset(); }
reset
270,035
void () { int period = 10; int times = 10; CancellationCheck cancellation = new CancellationCheck(times * period); runWithCheckCancellation(cancellation, period, times, 1); }
testNormal
270,036
void () { int period = 10; int times = 5; CancellationCheck cancellation = new CancellationCheck(times * period); runWithCheckCancellation(cancellation, period, times, 3); }
testReentrant
270,037
void () { DefaultLogger.disableStderrDumping(getTestRootDisposable()); CancellationCheck cancellation = new CancellationCheck(1); assertThrows(Throwable.class, "AWT-EventQueue-0 last checkCanceled was ", () -> { runWithCheckCancellation(cancellation, 10, 1, 1); }); }
testExceededThreshold
270,038
void () { DefaultLogger.disableStderrDumping(getTestRootDisposable()); CancellationCheck cancellation = new CancellationCheck(1000); try { cancellation.withCancellationCheck(() -> { Clock.setTime(1L); myProgressIndicator.checkCanceled(); Clock.setTime(10L); myProgressIndicator.checkCanceled(); Clock.setTime(1000L); myP...
testTraceLastCheck
270,039
void (CancellationCheck cancellation, int period, int times, int depth) { Clock.setTime(1L); cancellation.withCancellationCheck(() -> { for (int attempt = 0; attempt < times * 2; attempt++) { myProgressIndicator.checkCanceled(); Clock.setTime(Clock.getTime() + period); if (depth - 1 > 0) { runWithCheckCancellation(canc...
runWithCheckCancellation
270,040
void () { Semaphore mayStop = new Semaphore(1); ProgressIndicatorBase progress = new ProgressIndicatorBase(); Future<?> task = startBackgroundProcess(progress, () -> ProgressSuspender.markSuspendable(progress, ""), () -> workUntilStopped(mayStop, progress)); suspendProgressAndRun(progress, () -> { mayStop.up(); letBack...
testSuspendResumeWork
270,041
void () { Semaphore mayStop1 = new Semaphore(1); Semaphore mayStop2 = new Semaphore(1); ProgressIndicatorBase progress = new ProgressIndicatorBase(); Ref<Future<?>> innerTask = Ref.create(); Future<?> task = startBackgroundProcess( progress, () -> { ProgressSuspender.markSuspendable(progress, ""); innerTask.set(startBa...
testForkedThreadsAreSuspendedIfCheckCanceledIsCalledOnSuspendedIndicator
270,042
void () { Semaphore mayStop1 = new Semaphore(1); Semaphore mayStop2 = new Semaphore(1); ProgressIndicatorBase taskProgress = new ProgressIndicatorBase(); Future<?> task = startBackgroundProcess( taskProgress, () -> ProgressSuspender.markSuspendable(taskProgress, ""), () -> ProgressManager.getInstance().executeNonCancel...
testUnrelatedThreadsAreNotSuspendedEvenWhenHavingSameNestedIndicator
270,043
void (Future<?> task) { try { task.get(1, TimeUnit.SECONDS); } catch (Exception e) { throw new RuntimeException(e); } }
assertThreadCompleted
270,044
void () { TimeoutUtil.sleep(10); }
letBackgroundThreadsSuspend
270,045
void (ProgressIndicatorBase progress, Runnable runnable) { ProgressSuspender suspender = ProgressSuspender.getSuspender(progress); suspender.suspendProcess(""); try { runnable.run(); } finally { suspender.resumeProcess(); } }
suspendProgressAndRun
270,046
void (Semaphore mayStop, ProgressIndicator indicator) { while (true) { boolean released = mayStop.waitFor(1); maybeSuspend(indicator); if (released) { break; } } }
workUntilStopped
270,047
void (ProgressIndicator indicator) { indicator.checkCanceled(); }
maybeSuspend
270,048
void () { ProgressIndicator pib = new ProgressIndicatorBase(); pib.cancel(); try { pib.checkCanceled(); fail("Please restore ProgressIndicatorBase.checkCanceled() check!"); } catch(ProcessCanceledException ex) { boolean hasStackFrame = ex.getStackTrace().length != 0; assertTrue("Should have stackframe", hasStackFrame);...
testCheckCanceledHasStackFrame
270,049
void () { for (int i=0; i<1000;i++) { final ProgressIndicatorBase indicator = new ProgressIndicatorBase(); ProgressManager.getInstance().runProcess(() -> { ProgressManager.checkCanceled(); // checkCanceled() must have caught just canceled indicator assertThrows(ProcessCanceledException.class, () -> { indicator.cancel()...
testProgressManagerCheckCanceledWorksRightAfterIndicatorBeenCanceled
270,050
void () { prevTime = now = 0; final long warmupEnd = System.currentTimeMillis() + 1000; final LongArrayList times = new LongArrayList(); final long end = warmupEnd + 1000; ApplicationManagerEx.getApplicationEx().runProcessWithProgressSynchronously(() -> { final Alarm alarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, g...
testCheckCanceledGranularity
270,051
void (@NotNull ProgressIndicator indicator) { insideReadAction.set(true); waitForPCE(); }
computeInReadAction
270,052
void (@NotNull ProgressIndicator indicator) { }
onCanceled
270,053
void (@NotNull ProgressIndicator indicator) { assertFalse(afterContinuation.get()); }
onCanceled
270,054
void () { final long warmupEnd = System.currentTimeMillis() + 1000; checkCanceledCalled = false; final ProgressIndicatorBase myIndicator = new ProgressIndicatorBase(); taskCanceled = taskSucceeded = false; exception = null; final long end = warmupEnd + 10000; Future<?> future = ((ProgressManagerImpl)ProgressManager.get...
testProgressManagerCheckCanceledDoesNotDelegateToProgressIndicatorIfThereAreNoCanceledIndicators
270,055
void (@NotNull ProgressIndicator indicator) { try { ApplicationManager.getApplication().assertIsNonDispatchThread(); assertSame(indicator, myIndicator); while (System.currentTimeMillis() < end) { ProgressManager.checkCanceled(); } } catch (ProcessCanceledException e) { exception = e; checkCanceledCalled = true; throw e...
run
270,056
void () { taskCanceled = true; }
onCancel
270,057
void () { taskSucceeded = true; }
onSuccess
270,058
void () { checkCanceledCalled = false; ProgressIndicator indicator = new ProgressIndicatorStub() { @Override public void checkCanceled() throws ProcessCanceledException { checkCanceledCalled = true; if (myFlag) throw new ProcessCanceledException(); } }; ensureCheckCanceledCalled(indicator); }
testPerverseIndicator
270,059
void (@NotNull ProgressIndicator indicator) { myFlag = false; JobScheduler.getScheduler().schedule(() -> myFlag = true, 100, TimeUnit.MILLISECONDS); TestTimeOut t = TestTimeOut.setTimeout(10, TimeUnit.SECONDS); assertThrows(ProcessCanceledException.class, () -> ProgressManager.getInstance().executeProcessUnderProgress(...
ensureCheckCanceledCalled
270,060
void () { checkCanceledCalled = false; ProgressIndicator indicator = new ProgressIndicatorStub() { @Override public void checkCanceled() throws ProcessCanceledException { checkCanceledCalled = true; if (myFlag) throw new ProcessCanceledException(); } @Override public void cancel() { } }; ensureCheckCanceledCalled(indic...
testExtremelyPerverseIndicatorWhichCancelMethodIsNoop
270,061
void () { }
cancel
270,062
void () { checkCanceledCalled = false; ProgressManager.getInstance().executeProcessUnderProgress(() -> { assertFalse(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); assertTrue(indicator != null && ...
testNestedIndicatorsAreCanceledRight
270,063
void () { EmptyProgressIndicator indicator1 = new EmptyProgressIndicator(); DelegatingProgressIndicator indicator2 = new DelegatingProgressIndicator(indicator1); final DelegatingProgressIndicator indicator3 = new DelegatingProgressIndicator(indicator2); ProgressManager.getInstance().executeProcessUnderProgress(() -> { ...
testWrappedIndicatorsAreSortedRight
270,064
void () { PlatformTestUtil.startPerformanceTest("executeProcessUnderProgress", 400, () -> { EmptyProgressIndicator indicator = new EmptyProgressIndicator(); for (int i=0;i<100000;i++) { ProgressManager.getInstance().executeProcessUnderProgress(EmptyRunnable.getInstance(), indicator); } }).assertTiming(); }
testProgressPerformance
270,065
void () { final ProgressIndicator progress = new ProgressIndicatorBase(){ @Override protected boolean isCancelable() { return true; } }; assertThrows(ProcessCanceledException.class, () -> ProgressManager.getInstance().executeProcessUnderProgress(() -> { assertFalse(CoreProgressManager.threadsUnderCanceledIndicator.cont...
testWrapperIndicatorGotCanceledTooWhenInnerIndicatorHas
270,066
boolean () { return true; }
isCancelable
270,067
void () { ProgressIndicator base = new EmptyProgressIndicator(); ProgressIndicator wrapper = new SensitiveProgressWrapper(base); wrapper.cancel(); assertTrue(wrapper.isCanceled()); assertFalse(base.isCanceled()); assertThrows(ProcessCanceledException.class, () -> ProgressManager.getInstance().executeProcessUnderProgres...
testCheckCanceledAfterWrappedIndicatorIsCanceledAndBaseIndicatorIsNotCanceled
270,068
void () { //noinspection InfiniteLoopStatement while (true) { ProgressManager.checkCanceled(); } }
waitForPCE
270,069
void () { ProgressIndicator indicator = new DaemonProgressIndicator(); for (int i=0;i<10000;i++) { indicator = new SensitiveProgressWrapper(indicator); } ProgressManager.getInstance().executeProcessUnderProgress(() -> { ProgressIndicator progressIndicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); assert...
testSOEUnderExtremelyNestedWrappedIndicator
270,070
void () { final int count = 10; new BombedProgressIndicator(count).runBombed(() -> { for (int i = 0; i < count * 2; i++) { TimeoutUtil.sleep(10); try { ProgressManager.checkCanceled(); if (i >= count) { assertThrows(ProcessCanceledException.class, () -> ProgressManager.checkCanceled()); } } catch (ProcessCanceledExcept...
testBombedIndicator
270,071
void (@NotNull ProgressIndicatorEx delegate) { throw new RuntimeException(); }
addStateDelegate
270,072
void (@NotNull TaskInfo task) { }
finish
270,073
boolean (@NotNull TaskInfo task) { throw new RuntimeException(); }
isFinished
270,074
boolean () { throw new RuntimeException(); }
wasStarted
270,075
void () { throw new RuntimeException(); }
processFinish
270,076
void (@NotNull ProgressIndicator indicator) { }
initStateFrom
270,077
void () { }
start
270,078
void () { }
stop
270,079
void (String text) { throw new RuntimeException(); }
setText
270,080
String () { throw new RuntimeException(); }
getText
270,081
String () { throw new RuntimeException(); }
getText2
270,082
void (String text) { throw new RuntimeException(); }
setText2
270,083
double () { throw new RuntimeException(); }
getFraction
270,084
void (double fraction) { throw new RuntimeException(); }
setFraction
270,085
void () { throw new RuntimeException(); }
pushState
270,086
void () { throw new RuntimeException(); }
popState
270,087
void () { throw new RuntimeException(); }
startNonCancelableSection
270,088
void () { throw new RuntimeException(); }
finishNonCancelableSection
270,089
boolean () { return false; }
isModal
270,090
ModalityState () { throw new RuntimeException(); }
getModalityState
270,091
void (ProgressIndicator modalityProgress) { throw new RuntimeException(); }
setModalityProgress
270,092
boolean () { throw new RuntimeException(); }
isIndeterminate
270,093
void (boolean indeterminate) { throw new RuntimeException(); }
setIndeterminate
270,094
boolean () { throw new RuntimeException(); }
isPopupWasShown
270,095
boolean () { throw new RuntimeException(); }
isShowing
270,096
boolean () { return true; }
isRunning
270,097
void () { myCanceled = true; ProgressManager.canceled(this); }
cancel
270,098
boolean () { return myCanceled; }
isCanceled
270,099
void () { assertEquals(ModalityState.nonModal(), ModalityState.defaultModalityState()); ProgressManager.getInstance().run(new Task.Modal(getProject(), "", false) { @Override public void run(@NotNull ProgressIndicator indicator) { try { assertFalse(ModalityState.nonModal().equals(ModalityState.defaultModalityState())); ...
testDefaultModalityWithNestedProgress