Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
65,500
void (final int index, final String text) { setDocumentText(index, text, myJUnitDocuments); }
setJUnitTextValue
65,501
void (final int index, final String text, final Object[] documents) { final Object document = documents[index]; if (document instanceof PlainDocument) { try { ((PlainDocument)document).remove(0, ((PlainDocument)document).getLength()); ((PlainDocument)document).insertString(0, text, null); } catch (BadLocationException ...
setDocumentText
65,502
void (final String testObject) { setType(ourTestObjects.indexOf(testObject)); }
setTestType
65,503
void (JComboBox<Integer> comboBox, Module module, @Nullable Runnable onDone) { Object selectedItem = comboBox.getSelectedItem(); ReadAction.nonBlocking(() -> { final DefaultComboBoxModel<Integer> aModel = new DefaultComboBoxModel<>(); aModel.addElement(ALL_IN_PACKAGE); aModel.addElement(DIR); aModel.addElement(PATTERN)...
reloadTestKindModel
65,504
boolean (boolean wholeProjectSelected) { return wholeProjectSelected && (myType == ALL_IN_PACKAGE || myType == PATTERN || myType == CATEGORY || myType == TAGS || myType == UNIQUE_ID); }
disableModuleClasspath
65,505
void (List<SettingsEditorFragment<JUnitConfiguration, ?>> fragments, SettingsEditorFragment<JUnitConfiguration, ModuleClasspathCombo> moduleClasspath, CommonParameterFragments<JUnitConfiguration> commonParameterFragments) { DefaultJreSelector jreSelector = DefaultJreSelector.fromModuleDependencies(moduleClasspath.compo...
customizeFragments
65,506
boolean () { return true; }
isInplaceValidationSupported
65,507
boolean (PsiElement member) { if (member instanceof PsiMethod method) { if (JUnitUtil.isTestMethodOrConfig(method)){ return true; } } return false; }
value
65,508
String () { return JUnitBundle.message("unused.declaration.junit.test.entry.point"); }
getDisplayName
65,509
boolean (@NotNull RefElement refElement, @NotNull PsiElement psiElement) { return isEntryPoint(psiElement); }
isEntryPoint
65,510
boolean (@NotNull PsiElement psiElement) { if (psiElement instanceof PsiClass) { final PsiClass aClass = (PsiClass)psiElement; if (JUnitUtil.isTestClass(aClass, false, true)) { final boolean isJUnit5 = JUnitUtil.isJUnit5(aClass); if (!PsiClassUtil.isRunnableClass(aClass, !isJUnit5, true)) { final PsiClass topLevelClass...
isEntryPoint
65,511
boolean (PsiClass psiClass) { return !psiClass.hasModifierProperty(PsiModifier.ABSTRACT); }
accept
65,512
int (PsiMember member) { PsiClass container = null; if (member instanceof PsiClass) { container = (PsiClass)member; } else if (member instanceof PsiMethod) { container = member.getContainingClass(); } if (container != null && JUnitUtil.isJUnit5TestClass(container, false) && !JUnitUtil.isJUnit4TestClass(container, false...
getMinVisibilityLevel
65,513
String () { return JUnitBundle.message("junit.entry.point.suggest.package.private.visibility.junit5"); }
getTitle
65,514
String () { return "junit"; }
getId
65,515
boolean () { return ADD_JUNIT_TO_ENTRIES; }
isSelected
65,516
void (boolean selected) { ADD_JUNIT_TO_ENTRIES = selected; }
setSelected
65,517
String[] () { return new String[]{"org.junit.Rule", "org.junit.ClassRule", "org.junit.experimental.theories.DataPoint", "org.junit.experimental.theories.DataPoints"}; }
getIgnoreAnnotations
65,518
boolean (@NotNull PsiElement element) { return element instanceof PsiParameter && isParameterUsedInParameterizedPresentation((PsiParameter)element) || isReferencedInsideEnumSourceAnnotation(element) || isReferencedInsideMethodSourceAnnotation(element); }
isImplicitUsage
65,519
boolean (PsiParameter parameter) { PsiElement declarationScope = parameter.getDeclarationScope(); if (declarationScope instanceof PsiMethod method) { PsiAnnotation annotation = method.getModifierList().findAnnotation(ORG_JUNIT_JUPITER_PARAMS_PARAMETERIZED_TEST); if (annotation != null) { PsiAnnotationMemberValue attrib...
isParameterUsedInParameterizedPresentation
65,520
boolean (@NotNull PsiElement element) { if (element instanceof PsiEnumConstant) { PsiClass psiClass = ((PsiEnumConstant)element).getContainingClass(); return psiClass != null && CachedValuesManager.getCachedValue(psiClass, () -> CachedValueProvider.Result.create(isEnumClassReferencedInEnumSourceAnnotation(psiClass), Ps...
isReferencedInsideEnumSourceAnnotation
65,521
boolean (@NotNull PsiElement element) { if (element instanceof PsiMethod psiMethod) { return CachedValuesManager.getCachedValue(psiMethod, () -> CachedValueProvider.Result.create(isReferencedInsideMethodSourceAnnotation(psiMethod), PsiModificationTracker.MODIFICATION_COUNT)); } return false; }
isReferencedInsideMethodSourceAnnotation
65,522
boolean (@NotNull PsiMethod psiMethod) { String methodName = psiMethod.getName(); PsiClass psiClass = psiMethod.getContainingClass(); if (psiMethod.getAnnotation(ORG_JUNIT_JUPITER_PARAMS_PROVIDER_METHOD_SOURCE) != null) return false; if (psiMethod.getParameterList().getParametersCount() != 0) return false; if (!TestUti...
isReferencedInsideMethodSourceAnnotation
65,523
boolean (PsiClass psiClass) { String className = psiClass.getName(); if (className == null) { return false; } SearchScope useScope = psiClass.getUseScope(); if (!shouldCheckClassUsages(psiClass, className, useScope)) { return false; } return ReferencesSearch.search(psiClass, useScope, false) .anyMatch(reference -> { Ps...
isEnumClassReferencedInEnumSourceAnnotation
65,524
boolean (PsiClass psiClass, String name, SearchScope useScope) { if (!(useScope instanceof LocalSearchScope)) { PsiSearchHelper searchHelper = PsiSearchHelper.getInstance(psiClass.getProject()); if (PsiSearchHelper.SearchCostResult.ZERO_OCCURRENCES == searchHelper.isCheapEnoughToSearch(JUnitCommonClassNames.ORG_JUNIT_J...
shouldCheckClassUsages
65,525
boolean (@NotNull PsiElement element) { return false; }
isImplicitRead
65,526
boolean (@NotNull PsiElement element) { return element instanceof PsiParameter && AnnotationUtil.isAnnotated((PsiParameter)element, MOCKITO_MOCK, 0) || element instanceof PsiField && AnnotationUtil.isAnnotated((PsiField)element, INJECTED_FIELD_ANNOTATIONS, 0) || element instanceof PsiField && MetaAnnotationUtil.isMetaA...
isImplicitWrite
65,527
boolean (@NotNull PsiElement element) { return isImplicitWrite(element); }
isImplicitlyNotNullInitialized
65,528
GlobalSearchScope () { final JUnitConfiguration.Data persistentData = getConfiguration().getPersistentData(); final String testObject = persistentData.TEST_OBJECT; //ignore invisible setting if (JUnitConfiguration.TEST_CATEGORY.equals(testObject) || JUnitConfiguration.TEST_PATTERN.equals(testObject) || JUnitConfigurati...
initScope
65,529
void (DefaultActionGroup actionGroup, JComponent parent, TestConsoleProperties target) { super.appendAdditionalActions(actionGroup, parent, target); actionGroup.add(createIncludeNonStartedInRerun(target)); }
appendAdditionalActions
65,530
SMTestLocator () { return JavaTestLocator.INSTANCE; }
getTestLocator
65,531
AbstractRerunFailedTestsAction (ConsoleView consoleView) { return new RerunFailedTestsAction(consoleView, this); }
createRerunFailedTestsAction
65,532
boolean () { final String mode = getConfiguration().getRepeatMode(); return RepeatCount.UNLIMITED.equals(mode) || RepeatCount.UNTIL_FAILURE.equals(mode) || RepeatCount.UNTIL_SUCCESS.equals(mode); }
isUndefined
65,533
MyRunProfile (@NotNull ExecutionEnvironment environment) { final JUnitConfiguration configuration = (JUnitConfiguration)myConsoleProperties.getConfiguration(); final TestMethods testMethods = new TestMethods(configuration, environment, getFailedTests(configuration.getProject())); return new MyRunProfile(configuration) ...
getRunProfile
65,534
RunProfileState (@NotNull Executor executor, @NotNull ExecutionEnvironment env) { testMethods.clear(); return testMethods; }
getState
65,535
URL () { return JUnit5Migration.class.getResource("JUnit4__5.xml"); }
getMigrationMap
65,536
List<String> (@NotNull Project project, @NotNull List<? extends Couple<String>> testFqns, byte frameworkId) { TestDiscoveryIndex instance = TestDiscoveryIndex.getInstance(project); Set<String> result = new HashSet<>(); for (Couple<String> test : testFqns) { result.addAll(instance.getAffectedFiles(test, frameworkId)); }...
getAffectedFilePaths
65,537
List<String> (@NotNull Project project, @NotNull String testClassName, byte frameworkId) { return Collections.emptyList(); }
getAffectedFilePathsByClassName
65,538
List<String> (@NotNull Project project, @NotNull Collection<String> paths) { return Collections.emptyList(); // todo[batkovich]: implement, please }
getFilesWithoutTests
65,539
boolean () { return false; }
isRemote
65,540
String (JUnitConfiguration configuration) { JUnitConfiguration.Data data = configuration.getPersistentData(); if (data == null) return null; final GlobalSearchScope globalSearchScope = TestObject.getScopeForJUnit(configuration); boolean isMethodConfiguration = JUnitConfiguration.TEST_METHOD.equals(data.TEST_OBJECT); bo...
getDisabledConditionValue
65,541
boolean (String[] anno, PsiElement psiElement) { ArrayList<PsiModifierListOwner> listOwners = new ArrayList<>(); if (psiElement instanceof PsiMethod) { listOwners.add((PsiMethod)psiElement); } if (psiElement instanceof PsiClass) { listOwners.add((PsiClass)psiElement); } return ContainerUtil.exists(anno, an -> MetaAnnot...
isDisabledCondition
65,542
String (PsiElement element) { if (isDisabledCondition(DISABLED_COND_ANNO, element)) { return "org.junit.*Disabled*Condition"; } if (isDisabledCondition(ENABLED_COND_ANNO, element)) { return "org.junit.*Enabled*Condition"; } if (isDisabledCondition(SCRIPT_COND_ANNO, element)) { return "org.junit.*DisabledIfCondition"; }...
getDisabledCondition
65,543
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { String[] nodeIds = getNodeIds(context); if (nodeIds == null || nodeIds.length == 0) return false; final JUnitConfiguration.Data data = configuration.getPersistentData(); data.setUniqueIds...
setupConfigurationFromContext
65,544
String (@NotNull AbstractTestProxy selectedProxy, @NotNull JUnitConfiguration configuration) { GlobalSearchScope searchScope = configuration.getSearchScope(); if (searchScope != null) { Location<?> location = selectedProxy.getLocation(configuration.getProject(), searchScope); if (location instanceof MethodLocation meth...
getGeneratedName
65,545
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context, @NotNull PsiElement element) { return Arrays.equals(configuration.getPersistentData().getUniqueIds(), getNodeIds(context)); }
isConfiguredByElement
65,546
String[] (ConfigurationContext context) { DataContext dataContext = context.getDataContext(); AbstractTestProxy[] testProxies = dataContext.getData(AbstractTestProxy.DATA_KEYS); if (testProxies == null) return null; Module module; RunConfiguration runConfiguration = dataContext.getData(RunConfiguration.DATA_KEY); if (r...
getNodeIds
65,547
boolean (String type, ConfigurationContext context) { return JUnitConfiguration.TEST_UNIQUE_ID.equals(type); }
isApplicableTestType
65,548
boolean (@NotNull ConfigurationFromContext self, @NotNull ConfigurationFromContext other) { return self.isProducedBy(UniqueIdConfigurationProducer.class) && (other.isProducedBy(TestInClassConfigurationProducer.class) || other.isProducedBy(PatternConfigurationProducer.class)); }
shouldReplace
65,549
boolean (String type, ConfigurationContext context) { return JUnitConfiguration.TEST_PACKAGE.equals(type); }
isApplicableTestType
65,550
boolean (@NotNull JUnitConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { PsiPackage psiPackage = AbstractJavaTestConfigurationProducer.checkPackage(context.getPsiLocation()); if (psiPackage == null) return false; sourceElement.set(psiPackage); if (!LocationUti...
setupConfigurationFromContext
65,551
boolean (ConfigurationFromContext self, ConfigurationFromContext other) { return !other.isProducedBy(AbstractAllInDirectoryConfigurationProducer.class) && !other.isProducedBy(PatternConfigurationProducer.class); }
isPreferredConfiguration
65,552
String () { return "JUnit5"; }
getName
65,553
String () { return JUnitUtil.TEST5_ANNOTATION; }
getMarkerClassFQName
65,554
boolean (@NotNull PsiElement clazz) { return isFrameworkApplicable(clazz, JUnitUtil.CUSTOM_TESTABLE_ANNOTATION) || //check explicit jupiter to support library with broken dependency isFrameworkApplicable(clazz, JUnitUtil.TEST5_ANNOTATION); }
isFrameworkAvailable
65,555
boolean (Project project, GlobalSearchScope scope) { return true; }
shouldRunSingleClassAsJUnit5
65,556
ExternalLibraryDescriptor () { return JUnitExternalLibraryDescriptor.JUNIT5; }
getFrameworkLibraryDescriptor
65,557
String () { return null; }
getDefaultSuperClass
65,558
boolean (PsiClass clazz, boolean canBePotential) { if (canBePotential) return isUnderTestSources(clazz); if (!isFrameworkAvailable(clazz)) return false; return JUnitUtil.isJUnit5TestClass(clazz, false); }
isTestClass
65,559
PsiMethod (@NotNull PsiClass clazz) { for (PsiMethod each : clazz.getMethods()) { if (AnnotationUtil.isAnnotated(each, JUnitUtil.BEFORE_EACH_ANNOTATION_NAME, 0)) return each; } return null; }
findSetUpMethod
65,560
PsiMethod (@NotNull PsiClass clazz) { for (PsiMethod each : clazz.getMethods()) { if (each.hasModifierProperty(PsiModifier.STATIC) && AnnotationUtil.isAnnotated(each, JUnitUtil.BEFORE_ALL_ANNOTATION_NAME, 0)) return each; } return null; }
findBeforeClassMethod
65,561
PsiMethod (@NotNull PsiClass clazz) { for (PsiMethod each : clazz.getMethods()) { if (AnnotationUtil.isAnnotated(each, JUnitUtil.AFTER_EACH_ANNOTATION_NAME, 0)) return each; } return null; }
findTearDownMethod
65,562
PsiMethod (@NotNull PsiClass clazz) { for (PsiMethod each : clazz.getMethods()) { if (each.hasModifierProperty(PsiModifier.STATIC) && AnnotationUtil.isAnnotated(each, JUnitUtil.AFTER_ALL_ANNOTATION_NAME, 0)) return each; } return null; }
findAfterClassMethod
65,563
boolean (PsiElement element) { if (element instanceof PsiMethod method) { final PsiMethod ignoredTestMethod = AnnotationUtil.isAnnotated(method, "org.junit.jupiter.api.Disabled", 0) ? JUnitUtil.getTestMethod(element) : null; return ignoredTestMethod != null; } return false; }
isIgnoredMethod
65,564
boolean () { return true; }
acceptNestedClasses
65,565
FileTemplateDescriptor () { return new FileTemplateDescriptor("JUnit5 SetUp Method.java"); }
getSetUpMethodFileTemplateDescriptor
65,566
FileTemplateDescriptor () { return new FileTemplateDescriptor("JUnit5 BeforeAll Method.java"); }
getBeforeClassMethodFileTemplateDescriptor
65,567
FileTemplateDescriptor () { return new FileTemplateDescriptor("JUnit5 TearDown Method.java"); }
getTearDownMethodFileTemplateDescriptor
65,568
FileTemplateDescriptor () { return new FileTemplateDescriptor("JUnit5 AfterAll Method.java"); }
getAfterClassMethodFileTemplateDescriptor
65,569
FileTemplateDescriptor () { return new FileTemplateDescriptor("JUnit5 Test Method.java"); }
getTestMethodFileTemplateDescriptor
65,570
FileTemplateDescriptor () { return new FileTemplateDescriptor("JUnit5 Test Class.java"); }
getTestClassFileTemplateDescriptor
65,571
boolean (PsiClass psiClass) { return AnnotationUtil.isAnnotated(psiClass, "org.junit.platform.suite.api.Suite", AnnotationUtil.CHECK_HIERARCHY); }
isSuiteClass
65,572
SourceScope () { final JUnitConfiguration.Data data = getConfiguration().getPersistentData(); return data.getScope().getSourceScope(getConfiguration()); }
getSourceScope
65,573
String () { return JUnitBundle.message("action.text.test.tags", getConfiguration().getPersistentData().getTags()); }
suggestActionName
65,574
boolean (JUnitConfiguration configuration, PsiClass testClass, PsiMethod testMethod, PsiPackage testPackage, PsiDirectory testDir) { return false; }
isConfiguredByElement
65,575
RefactoringElementListener (final PsiElement element) { return null; }
getListener
65,576
boolean (@NotNull RunProfile profile) { return profile instanceof JUnitConfiguration; }
validForProfile
65,577
String () { return "junit"; }
getThreadName
65,578
String () { return "JUnitDebug"; }
getRunnerId
65,579
DependencyScope (@NotNull Library library) { VirtualFile[] files = library.getFiles(OrderRootType.CLASSES); long testJars = Arrays.stream(files).filter(JUnitDependencyScopeSuggester::isTestJarRoot).count(); long regularJars = files.length - testJars; return testJars > regularJars ? DependencyScope.TEST : null; }
getDefaultDependencyScope
65,580
boolean (VirtualFile file) { for (String marker : JUNIT_JAR_MARKERS) { if (LibraryUtil.isClassAvailableInLibrary(Collections.singletonList(file), marker)) { return true; } } return false; }
isTestJarRoot
65,581
String (JUnitConfiguration.Data data) { return ""; }
getPackageName
65,582
boolean (Set<Location<?>> classNames) { return super.filterOutputByDirectoryForJunit5(classNames) && classNames.isEmpty(); }
filterOutputByDirectoryForJunit5
65,583
boolean () { return true; }
requiresSmartMode
65,584
void (Module module, Set<Location<?>> classes) { searchTests(module, null, classes, true); }
searchTests5
65,585
void (Module module, TestClassFilter classFilter, Set<Location<?>> classes) { searchTests(module, classFilter, classes, false); }
searchTests
65,586
void (Module module, TestClassFilter classFilter, Set<Location<?>> classes, boolean junit5) { JUnitConfiguration.Data data = getConfiguration().getPersistentData(); Project project = getConfiguration().getProject(); for (String className : data.getPatterns()) { final PsiClass psiClass = ReadAction.compute(() -> getTest...
searchTests
65,587
String (Set<Location<?>> foundClasses, String packageName) { return foundClasses.isEmpty() ? getConfiguration().getPersistentData().getPatternPresentation() : ""; }
getFilters
65,588
PsiClass (Project project, String className) { SourceScope sourceScope = getSourceScope(); GlobalSearchScope searchScope = sourceScope != null ? sourceScope.getGlobalSearchScope() : GlobalSearchScope.allScope(project); return JavaExecutionUtil.findMainClass(project, className.contains(",") ? StringUtil.getPackageName(c...
getTestClass
65,589
boolean (Module module) { return module != null; }
configureByModule
65,590
String () { return null; }
suggestActionName
65,591
RefactoringElementListener (PsiElement element) { final RefactoringElementListenerComposite composite = new RefactoringElementListenerComposite(); final JUnitConfiguration.Data data = getConfiguration().getPersistentData(); final Set<String> patterns = data.getPatterns(); for (final String pattern : patterns) { final P...
getListener
65,592
void (String qualifiedName) { final Set<String> replaced = new LinkedHashSet<>(); for (String currentPattern : patterns) { if (myOldName.equals(currentPattern)) { replaced.add(qualifiedName); myOldName = qualifiedName; } else { replaced.add(currentPattern); } } patterns.clear(); patterns.addAll(replaced); }
setName
65,593
PsiClass () { return testClass; }
getPsiElement
65,594
void (PsiClass psiElement) { if (psiElement == testClass) { setName(psiElement.getQualifiedName()); } }
setPsiElement
65,595
boolean (JUnitConfiguration configuration, PsiClass testClass, PsiMethod testMethod, PsiPackage testPackage, PsiDirectory testDir) { return false; }
isConfiguredByElement
65,596
Set<Module> (String packageName) { Set<Module> result = new HashSet<>(); final SourceScope sourceScope = getSourceScope(); final Project project = getConfiguration().getProject(); if (sourceScope != null && packageName != null && JUnitStarter.JUNIT5_PARAMETER.equals(getRunner())) { final PsiPackage aPackage = JavaPsiFa...
collectPackageModules
65,597
void (Map<Module, List<String>> perModule, Module module, String name) { perModule.computeIfAbsent(module, elemList -> new ArrayList<>()).add(name); }
fillForkModule
65,598
Module[] () { final SourceScope sourceScope = getSourceScope(); return sourceScope != null ? sourceScope.getModulesToCompile() : Module.EMPTY_ARRAY; }
getModulesToCompile
65,599
SourceScope () { return SourceScope.modules(getConfiguration().getModules()); }
getSourceScope