Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
65,600
void (JavaParameters javaParameters, Module module) { final String path = System.getProperty(DEBUG_RT_PATH); javaParameters.getClassPath().addFirst(path != null ? path : PathUtil.getJarPathForClass(JUnitStarter.class)); //include junit5 listeners for the case custom junit 5 engines would be detected on runtime javaPara...
configureRTClasspath
65,601
void (JavaParameters javaParameters, Module module) { if (module != null) { JavaParameters parameters = myAdditionalJarsForModuleFork.get(module); if (parameters != null) { boolean toModulePath = parameters.getClassPath().isEmpty(); PathsList sourcePath = toModulePath ? parameters.getModulePath() : parameters.getClassP...
appendDownloadedDependenciesForForkedConfigurations
65,602
File () { File junit4Rt = new File(PathUtil.getJarPathForClass(JUnit4IdeaTestRunner.class)); String junit4Name = junit4Rt.getName(); String junit5Name = junit4Rt.isDirectory() ? junit4Name.replace("junit", "junit.v5") : junit4Name.replace("junit", "junit5"); return new File(junit4Rt.getParent(), junit5Name); }
getJUnit5RtFile
65,603
List<String> (@NotNull Module module) { return ContainerUtil.map(OrderEnumerator.orderEntries(module) .withoutSdk() .withoutLibraries() .withoutDepModules().classes().getRoots(), root -> "\u002B" + root.getPath()); }
composeDirectoryFilter
65,604
void (JavaParameters javaParameters, GlobalSearchScope globalSearchScope, JavaPsiFacade psiFacade, String moduleName) { ReadAction.run(() -> DumbModeAccessType.RELIABLE_DATA_ONLY.ignoreDumbMode(() -> { PsiJavaModule launcherModule = psiFacade.findModule(moduleName, globalSearchScope); if (launcherModule != null) { Java...
ensureSpecifiedModuleOnModulePath
65,605
boolean () { ClassLoader loader = TestClassCollector.createUsersClassLoader(myConfiguration); try { Class<?> aClass = loader.loadClass("junit.runner.Version"); Method id = aClass.getDeclaredMethod("id"); Object result = id.invoke(null); return result instanceof String && VersionComparatorUtil.compare("4.12", (String)re...
isAcceptableVintageVersion
65,606
boolean (GlobalSearchScope globalSearchScope, JavaPsiFacade psiFacade) { return JUnitUtil.hasPackageWithDirectories(psiFacade, "org.junit.platform.engine", globalSearchScope); }
hasJUnit5EnginesAPI
65,607
String (String className, GlobalSearchScope globalSearchScope, Project project) { VirtualFile root = ReadAction.nonBlocking(() -> { PsiClass psiClass = DumbService.getInstance(project).computeWithAlternativeResolveEnabled(() -> JavaPsiFacade.getInstance(project).findClass(className, globalSearchScope) ); VirtualFile vi...
getLibraryVersion
65,608
GlobalSearchScope (@Nullable Module module, Project project) { return module != null ? GlobalSearchScope.moduleRuntimeScope(module, true) : GlobalSearchScope.allScope(project); }
getScopeForJUnit
65,609
GlobalSearchScope (JUnitConfiguration configuration) { return getScopeForJUnit(configuration.getConfigurationModule().getModule(), configuration.getProject()); }
getScopeForJUnit
65,610
boolean () { return getConfiguration().isUseModulePath(); }
useModulePath
65,611
boolean () { return JUnitStarter.JUNIT5_PARAMETER.equals(getRunner()); }
isIdBasedTestTree
65,612
String () { return getConfiguration().getForkMode(); }
getForkMode
65,613
TestObject (final String id, final JUnitConfiguration configuration, @NotNull ExecutionEnvironment environment) { if (JUnitConfiguration.TEST_METHOD.equals(id)) { return new TestMethod(configuration, environment); } if (JUnitConfiguration.TEST_CLASS.equals(id)) { return new TestClass(configuration, environment); } if (...
fromString
65,614
PsiElement (Object element) { if (element instanceof String qName) { SourceScope scope = getSourceScope(); Project project = getConfiguration().getProject(); int idx = qName.indexOf(','); String className = idx > 0 ? qName.substring(0, idx) : qName; return DumbService.getInstance(project).computeWithAlternativeResolveE...
retrievePsiElement
65,615
void () { super.deleteTempFiles(); if (myListenersFile != null) { FileUtil.delete(myListenersFile); } }
deleteTempFiles
65,616
String () { return JUNIT_TEST_FRAMEWORK_NAME; }
getFrameworkName
65,617
String () { return "junit"; }
getFrameworkId
65,618
void (ParametersList parametersList, String tempFilePath) { parametersList.add(new CompositeParameterTargetedValue().addLocalPart("@").addPathPart(tempFilePath)); }
passTempFile
65,619
JUnitConfiguration () { return myConfiguration; }
getConfiguration
65,620
TestSearchScope () { return getConfiguration().getPersistentData().getScope(); }
getScope
65,621
void (String forkMode, File tempFile, JavaParameters parameters) { parameters.getProgramParametersList().add("@@@" + forkMode + ',' + tempFile.getAbsolutePath()); if (getForkSocket() != null) { parameters.getProgramParametersList().add(ForkedDebuggerHelper.DEBUG_SOCKET + getForkSocket().getLocalPort()); } }
passForkMode
65,622
String () { synchronized (LOCK) { if (myRunner == null) { myRunner = ProgressManager.getInstance() .runProcessWithProgressSynchronously(() -> ReadAction.nonBlocking(this::getRunnerInner).executeSynchronously(), JUnitBundle.message("dialog.title.preparing.test"), true, myConfiguration.getProject()); } return myRunner; }...
getRunner
65,623
String () { Project project = myConfiguration.getProject(); LOG.assertTrue(!DumbService.getInstance(project).isAlternativeResolveEnabled()); final GlobalSearchScope globalSearchScope = getScopeForJUnit(myConfiguration); JUnitConfiguration.Data data = myConfiguration.getPersistentData(); if (JUnitConfiguration.TEST_CATE...
getRunnerInner
65,624
boolean (GlobalSearchScope globalSearchScope) { Project project = myConfiguration.getProject(); JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project); Boolean isCustomJUnit5UsingPsi = ReadAction.nonBlocking(() -> { if (DumbService.isDumb(project)) { return null; } return findCustomJunit5TestEngineUsingPsi(global...
isCustomJUnit5
65,625
boolean (@NotNull GlobalSearchScope globalSearchScope, @NotNull JavaPsiFacade psiFacade) { boolean hasPlatformEngine = ReadAction.compute(() -> { PsiPackage aPackage = psiFacade.findPackage(JUnitCommonClassNames.ORG_JUNIT_PLATFORM_ENGINE); return aPackage != null && aPackage.getDirectories(globalSearchScope).length > 0...
findCustomJUnit5TestEngineUsingClassLoader
65,626
boolean (@NotNull GlobalSearchScope globalSearchScope, @NotNull Project project, @NotNull JavaPsiFacade psiFacade) { PsiClass testEngine = psiFacade.findClass(JUnitCommonClassNames.ORG_JUNIT_PLATFORM_ENGINE_TEST_ENGINE, globalSearchScope); if (testEngine == null) return false; Collection<VirtualFile> files = FilenameIn...
findCustomJunit5TestEngineUsingPsi
65,627
boolean (PsiClass testEngine, @NotNull PsiReference ref) { PsiProvidesStatement providesStatement = PsiTreeUtil.getParentOfType(ref.getElement(), PsiProvidesStatement.class); if (providesStatement != null) { PsiJavaCodeReferenceElement interfaceReference = providesStatement.getInterfaceReference(); PsiReferenceList imp...
isCustomEngineProvided
65,628
boolean (@Nullable String engineImplClassName) { return !"org.junit.jupiter.engine.JupiterTestEngine".equals(engineImplClassName) && !"org.junit.vintage.engine.VintageTestEngine".equals(engineImplClassName); }
isCustomJunit5TestEngineName
65,629
boolean () { return true; }
isDumbAware
65,630
PsiElement (Object element) { if (element instanceof SMTestProxy) { JUnitConfiguration configuration = getConfiguration(); Location location = ((SMTestProxy)element).getLocation(configuration.getProject(), configuration.getConfigurationModule().getSearchScope()); if (location != null) { return location.getPsiElement();...
retrievePsiElement
65,631
SourceScope () { final JUnitConfiguration.Data data = getConfiguration().getPersistentData(); return data.getScope().getSourceScope(getConfiguration()); }
getSourceScope
65,632
boolean (Module module) { return super.configureByModule(module) && getConfiguration().getPersistentData().getScope() != TestSearchScope.WHOLE_PROJECT; }
configureByModule
65,633
String (AbstractTestProxy testInfo, Project project, GlobalSearchScope searchScope) { final Location location = testInfo.getLocation(project, searchScope); final PsiElement element = location != null ? location.getPsiElement() : null; if (element instanceof PsiMethod) { String nodeId = TestUniqueId.getEffectiveNodeId(t...
getTestPresentation
65,634
String () { return ActionsBundle.message("action.RerunFailedTests.text"); }
suggestActionName
65,635
boolean (@NotNull RunnerAndConfigurationSettings settings, @Nullable RunContentDescriptor descriptor) { return settings.getConfiguration() instanceof JUnitConfiguration; }
isApplicable
65,636
PsiElement (@NotNull RunDashboardRunConfigurationNode node) { RunConfiguration runConfiguration = node.getConfigurationSettings().getConfiguration(); if (!(runConfiguration instanceof JUnitConfiguration jUnitConfiguration)) return null; String runClassName = jUnitConfiguration.getRunClass(); if (runClassName == null) r...
getPsiElement
65,637
void (List<String> options) { options.add(StringUtil.getPackageName(getConfiguration().getPersistentData().getMainClassName())); }
collectPackagesToOpen
65,638
String () { String forkMode = super.getForkMode(); return JUnitConfiguration.FORK_KLASS.equals(forkMode) ? JUnitConfiguration.FORK_REPEAT : forkMode; }
getForkMode
65,639
String () { String name = getConfiguration().getPersistentData().MAIN_CLASS_NAME; if (name != null && name.endsWith(".")) { return name; } return JavaExecutionUtil.getShortClassName(name); }
suggestActionName
65,640
RefactoringElementListener (final PsiElement element) { return RefactoringListeners.getClassOrPackageListener(element, getConfiguration().myClass); }
getListener
65,641
boolean (final JUnitConfiguration configuration, PsiClass testClass, PsiMethod testMethod, PsiPackage testPackage, PsiDirectory testDir) { if (testClass == null) { return false; } if (testMethod != null) { // 'test class' configuration is not equal to the 'test method' configuration! return false; } return Objects.equa...
isConfiguredByElement
65,642
RunConfiguration (@NotNull Project project) { return new JUnitConfiguration("", project, this); }
createTemplateConfiguration
65,643
String () { return "JUnit"; }
getId
65,644
boolean () { return true; }
isEditableInDumbMode
65,645
String () { return JUnitBundle.message("junit.configuration.display.name"); }
getDisplayName
65,646
String () { return JUnitBundle.message("junit.configuration.description"); }
getConfigurationTypeDescription
65,647
Icon () { return AllIcons.RunConfigurations.Junit; }
getIcon
65,648
ConfigurationFactory[] () { return new ConfigurationFactory[]{myFactory}; }
getConfigurationFactories
65,649
String () { return "reference.dialogs.rundebug.JUnit"; }
getHelpTopic
65,650
String () { return "JUnit"; }
getId
65,651
String () { String id = getId(); return id.equals("JUnit") ? "junit" : id; }
getTag
65,652
boolean () { return true; }
isDumbAware
65,653
ConfigurationFactory () { return myFactory; }
getFactory
65,654
JUnitConfigurationType () { return ConfigurationTypeUtil.findConfigurationType(JUnitConfigurationType.class); }
getInstance
65,655
String (AbstractTestProxy testInfo, Project project, GlobalSearchScope searchScope) { String nodeId = testInfo.getUserData(SMTestProxy.NODE_ID); if (nodeId != null) { Location location = testInfo.getLocation(project, searchScope); if (location == null) return nodeId; PsiElement psiElement = location.getPsiElement(); UM...
getEffectiveNodeId
65,656
String () { return ProgramRunnerUtil.shortenName(getConfiguration().getName(), 2); }
suggestActionName
65,657
RefactoringElementListener (final PsiElement element) { return null; }
getListener
65,658
boolean (final JUnitConfiguration configuration, PsiClass testClass, PsiMethod testMethod, PsiPackage testPackage, PsiDirectory testDir) { return false; }
isConfiguredByElement
65,659
String () { return "JUnit" + myVersion; }
getPresentableName
65,660
ConfigurationFactory () { return JUnitConfigurationType.getInstance().getFactory(); }
getConfigurationFactory
65,661
String (PsiMember psiMember) { return psiMember instanceof PsiMethod ? JUnitConfiguration.Data.getMethodPresentation((PsiMethod)psiMember) : super.getMethodPresentation(psiMember); }
getMethodPresentation
65,662
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { final LinkedHashSet<String> classes = new LinkedHashSet<>(); final PsiElement element = checkPatterns(context, classes); if (element == null) { return false; } JavaPsiFacade psiFacade = J...
setupConfigurationFromContext
65,663
boolean (String type, ConfigurationContext context) { return JUnitConfiguration.TEST_PATTERN.equals(type); }
isApplicableTestType
65,664
Module (JUnitConfiguration configuration, Module contextModule) { final Set<String> patterns = configuration.getPersistentData().getPatterns(); return findModule(configuration, contextModule, patterns); }
findModule
65,665
boolean (@NotNull JUnitConfiguration unitConfiguration, @NotNull ConfigurationContext context) { if (!isApplicableTestType(unitConfiguration.getTestType(), context)) return false; if (differentParamSet(unitConfiguration, context.getLocation())) return false; final Set<String> patterns = unitConfiguration.getPersistentD...
isConfigurationFromContext
65,666
boolean (PsiMember psiElement) { if (JUnitUtil.isJUnit5(psiElement)) { return true; } return super.isRequiredVisibility(psiElement); }
isRequiredVisibility
65,667
String () { return JUnitBundle.message("action.text.test.category", getConfiguration().getPersistentData().getCategory()); }
suggestActionName
65,668
boolean (JUnitConfiguration configuration, PsiClass testClass, PsiMethod testMethod, PsiPackage testPackage, PsiDirectory testDir) { return false; }
isConfiguredByElement
65,669
RefactoringElementListener (final PsiElement element) { return RefactoringListeners.getClassOrPackageListener(element, getConfiguration().myCategory); }
getListener
65,670
ConfigurationFactory () { return JUnitConfigurationType.getInstance().getConfigurationFactories()[0]; }
getConfigurationFactory
65,671
String () { return JUnitBundle.message("action.text.test.unknown.target"); }
suggestActionName
65,672
RefactoringElementListener (PsiElement element) { return null; }
getListener
65,673
boolean (JUnitConfiguration configuration, PsiClass testClass, PsiMethod testMethod, PsiPackage testPackage, PsiDirectory testDir) { return false; }
isConfiguredByElement
65,674
SourceScope () { final String dirName = getConfiguration().getPersistentData().getDirName(); final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(dirName)); final Project project = getConfiguration().getProject(); final GlobalSearchScope globalSearchScope = file == null...
getSourceScope
65,675
GlobalSearchScope () { return globalSearchScope; }
getGlobalSearchScope
65,676
Project () { return project; }
getProject
65,677
GlobalSearchScope () { final Module module = getConfiguration().getConfigurationModule().getModule(); return module != null ? GlobalSearchScope.moduleWithLibrariesScope(module) : GlobalSearchScope.allScope(project); }
getLibrariesScope
65,678
Module[] () { final Collection<Module> validModules = getConfiguration().getValidModules(); return validModules.toArray(Module.EMPTY_ARRAY); }
getModulesToCompile
65,679
Module (Module module) { try { PsiDirectory directory = getDirectory(getConfiguration().getPersistentData()); return ModuleUtilCore.findModuleForPsiElement(directory); } catch (CantRunException e) { return module; } }
getModuleWithTestsToFilter
65,680
boolean (Module module) { return module != null; }
configureByModule
65,681
GlobalSearchScope (JUnitConfiguration.Data data) { return GlobalSearchScope.allScope(getConfiguration().getProject()); }
filterScope
65,682
boolean () { return true; }
requiresSmartMode
65,683
boolean (Set<Location<?>> classNames) { return true; }
filterOutputByDirectoryForJunit5
65,684
String (Set<Location<?>> foundClasses, String packageName) { return foundClasses.isEmpty() ? super.getFilters(foundClasses, packageName) : StringUtil.join(foundClasses, CLASS_NAME_FUNCTION, "||"); }
getFilters
65,685
void (PsiDirectory directory, Condition<? super PsiClass> acceptAsTest, Set<Location<?>> classes) { PsiDirectory[] subDirectories = ReadAction.compute(() -> directory.getSubdirectories()); for (PsiDirectory subDirectory : subDirectories) { collectClassesRecursively(subDirectory, acceptAsTest, classes); } PsiFile[] file...
collectClassesRecursively
65,686
void (PsiClass aClass, Condition<? super PsiClass> acceptAsTest, Set<Location<?>> classes) { if (Registry.is("junit4.accept.inner.classes", true)) { classes.addAll(ReadAction.compute(() -> JBTreeTraverser.of(PsiClass::getInnerClasses) .withRoot(aClass).filter(acceptAsTest).map(psiClass -> PsiLocation.fromPsiElement(psi...
collectInnerClasses
65,687
String () { final JUnitConfiguration.Data data = getConfiguration().getPersistentData(); final String dirName = data.getDirName(); return dirName.isEmpty() ? TestRunnerBundle.message("all.tests.scope.presentable.text") : ExecutionBundle.message("test.in.scope.presentable.text", StringUtil.getShortName(FileUtil.toSystem...
suggestActionName
65,688
boolean (JUnitConfiguration configuration, PsiClass testClass, PsiMethod testMethod, PsiPackage testPackage, PsiDirectory testDir) { return JUnitConfiguration.TEST_DIRECTORY.equals(configuration.getPersistentData().TEST_OBJECT) && testDir != null && VfsUtilCore.pathEqualsTo(testDir.getVirtualFile(), configuration.getPe...
isConfiguredByElement
65,689
boolean (String type, ConfigurationContext context) { return JUnitConfiguration.TEST_DIRECTORY.equals(type); }
isApplicableTestType
65,690
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { final Project project = configuration.getProject(); final PsiElement element = context.getPsiLocation(); if (!(element instanceof PsiDirectory)) return false; final PsiPackage aPackage = ...
setupConfigurationFromContext
65,691
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { return myDelegate.setupConfigurationFromContext(configuration, context, sourceElement); }
setupConfigurationFromContext
65,692
void (@NotNull ConfigurationFromContext configuration, @NotNull ConfigurationContext fromContext, @NotNull Runnable performRunnable) { myDelegate.onFirstRun(configuration, fromContext, performRunnable); }
onFirstRun
65,693
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context) { String[] nodeIds = UniqueIdConfigurationProducer.getNodeIds(context); if (nodeIds != null && nodeIds.length > 0) return false; return super.isConfigurationFromContext(configuration, context); }
isConfigurationFromContext
65,694
boolean (String type, ConfigurationContext context) { return myDelegate.isApplicableTestType(type, context); }
isApplicableTestType
65,695
ConfigurationFactory () { return JUnitConfigurationType.getInstance().getConfigurationFactories()[0]; }
getConfigurationFactory
65,696
boolean (String type, ConfigurationContext context) { return JUnitConfiguration.TEST_CLASS.equals(type) || JUnitConfiguration.TEST_METHOD.equals(type); }
isApplicableTestType
65,697
boolean (PsiMember psiElement) { if (JUnitUtil.isJUnit5(psiElement)) { return true; } return super.isRequiredVisibility(psiElement); }
isRequiredVisibility
65,698
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { return super.setupConfigurationFromContext(configuration, context, sourceElement); }
setupConfigurationFromContext
65,699
String () { return "JUnit4"; }
getName