Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
17,500
boolean () { return false; }
isSearchInLibraries
17,501
PsiElementVisitor (final @NotNull ProblemsHolder holder, final boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitAnnotation(@NotNull PsiAnnotation annotation) { if (TestNGUtil.TEST_ANNOTATION_FQN.equals(annotation.getQualifiedName())) { final PsiAnnotationMemberValue provider = annotati...
buildVisitor
17,502
void (@NotNull PsiAnnotation annotation) { if (TestNGUtil.TEST_ANNOTATION_FQN.equals(annotation.getQualifiedName())) { final PsiAnnotationMemberValue provider = annotation.findDeclaredAttributeValue("dataProvider"); if (provider != null && !TestNGUtil.isDisabled(annotation)) { for (PsiReference reference : provider.get...
visitAnnotation
17,503
CreateMethodQuickFix (PsiAnnotationMemberValue provider, @NotNull PsiClass providerClass, PsiClass topLevelClass) { final String name = StringUtil.unquoteString(provider.getText()); FileTemplateDescriptor templateDesc = new TestNGFramework().getParametersMethodFileTemplateDescriptor(); assert templateDesc != null; fina...
createMethodFix
17,504
String () { return TestNGUtil.TESTNG_GROUP_NAME; }
getGroupDisplayName
17,505
String () { return "JUnitTestNG"; }
getShortName
17,506
String () { return TestngBundle.message("intention.family.name.convert.testcase.to.testng"); }
getFamilyName
17,507
boolean () { return false; }
startInWriteAction
17,508
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { final PsiClass psiClass = PsiTreeUtil.getParentOfType(previewDescriptor.getPsiElement(), PsiClass.class); if (psiClass == null) return IntentionPreviewInfo.EMPTY; doFix(project, psiClass); return IntentionPreviewInfo.DIFF; }
generatePreview
17,509
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiClass psiClass = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), PsiClass.class); if (psiClass == null || !TestNGUtil.checkTestNGInClasspath(psiClass)) return; if (!FileModificationService.getInstance().preparePsiElementsForWrite(...
applyFix
17,510
void (@NotNull Project project, PsiClass psiClass) { try { final PsiManager manager = PsiManager.getInstance(project); final PsiElementFactory factory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory(); final PsiJavaFile javaFile = (PsiJavaFile)psiClass.getContainingFile(); for (PsiMethod method : ps...
doFix
17,511
boolean (PsiMethodCallExpression expression) { final PsiExpression[] expressions = expression.getArgumentList().getExpressions(); if (expressions.length == 4) { return true; } final PsiMethod method = expression.resolveMethod(); LOG.assertTrue(method != null); for (PsiParameter parameter : method.getParameterList().get...
hasMessage
17,512
void (PsiMethod method) { method.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitExpressionStatement(@NotNull PsiExpressionStatement statement) { PsiExpression expression = statement.getExpression(); if (expression instanceof PsiMethodCallExpression methodCall) { if (methodCall.getArgumentL...
convertJUnitConstructor
17,513
void (@NotNull PsiExpressionStatement statement) { PsiExpression expression = statement.getExpression(); if (expression instanceof PsiMethodCallExpression methodCall) { if (methodCall.getArgumentList().getExpressionCount() == 1) { PsiMethod resolved = methodCall.resolveMethod(); if (resolved != null && "junit.framework...
visitExpressionStatement
17,514
PsiMethodCallExpression[] (PsiMethod method) { return SyntaxTraverser.psiTraverser(method).filter(PsiMethodCallExpression.class) .filter(methodCall -> { final PsiMethod method1 = methodCall.resolveMethod(); if (method1 != null) { final PsiClass containingClass = method1.getContainingClass(); if (containingClass != null...
getTestCaseCalls
17,515
String () { return TestNGUtil.TESTNG_GROUP_NAME; }
getGroupDisplayName
17,516
String () { return "ConvertOldAnnotations"; }
getShortName
17,517
PsiElementVisitor (@NotNull final ProblemsHolder holder, final boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitAnnotation(final @NotNull PsiAnnotation annotation) { final String qualifiedName = annotation.getQualifiedName(); if (Comparing.strEqual(qualifiedName, "org.testng.annotation...
buildVisitor
17,518
String () { return TestngBundle.message("intention.family.name.convert.old.configuration.testng.annotations"); }
getFamilyName
17,519
boolean () { return false; }
startInWriteAction
17,520
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { final PsiAnnotation annotation = (PsiAnnotation)previewDescriptor.getPsiElement(); doFix(annotation); return IntentionPreviewInfo.DIFF; }
generatePreview
17,521
void (@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { final PsiAnnotation annotation = (PsiAnnotation)descriptor.getPsiElement(); if (!TestNGUtil.checkTestNGInClasspath(annotation)) return; if (!FileModificationService.getInstance().preparePsiElementsForWrite(annotation)) return; WriteAct...
applyFix
17,522
void (PsiAnnotation annotation) { final PsiModifierList modifierList = PsiTreeUtil.getParentOfType(annotation, PsiModifierList.class); LOG.assertTrue(modifierList != null); try { convertOldAnnotationAttributeToAnnotation(modifierList, annotation, "beforeTest", "@org.testng.annotations.BeforeTest"); convertOldAnnotation...
doFix
17,523
String () { return TestNGUtil.TESTNG_GROUP_NAME; }
getGroupDisplayName
17,524
String () { return "ConvertJavadoc"; }
getShortName
17,525
PsiElementVisitor (@NotNull final ProblemsHolder holder, final boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitDocTag(final @NotNull PsiDocTag tag) { if (tag.getName().startsWith(TESTNG_PREFIX)) { holder.registerProblem(tag, TestngBundle.message("inspection.message.testng.javadoc.can....
buildVisitor
17,526
String () { return TestngBundle.message("intention.family.name.convert.testng.javadoc.to.annotations"); }
getFamilyName
17,527
boolean () { return false; }
startInWriteAction
17,528
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { final PsiDocTag tag = (PsiDocTag)previewDescriptor.getPsiElement(); doFix(project, tag); return IntentionPreviewInfo.DIFF; }
generatePreview
17,529
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiDocTag tag = (PsiDocTag)descriptor.getPsiElement(); if (!TestNGUtil.checkTestNGInClasspath(tag)) return; if (!FileModificationService.getInstance().preparePsiElementsForWrite(tag)) return; WriteAction.run(() -> doFix(project, tag)); }
applyFix
17,530
void (@NotNull Project project, PsiDocTag tag) { final PsiMember member = PsiTreeUtil.getParentOfType(tag, PsiMember.class); LOG.assertTrue(member != null); @NonNls String annotationName = getFQAnnotationName(tag); final StringBuilder annotationText = new StringBuilder("@"); annotationText.append(annotationName); final...
doFix
17,531
String (PsiDocTag tag) { @NonNls String annotationName = StringUtil.capitalize(tag.getName().substring(TESTNG_PREFIX.length())); int dash = annotationName.indexOf('-'); if (dash > -1) { annotationName = annotationName.substring(0, dash) + Character.toUpperCase(annotationName.charAt(dash + 1)) + annotationName.substring...
getFQAnnotationName
17,532
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { return new ExpectedExceptionNeverThrownVisitor(holder); }
buildVisitor
17,533
void (@NotNull PsiMethod method) { super.visitMethod(method); final PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, "org.testng.annotations.Test"); if (annotation == null) { return; } final PsiAnnotationMemberValue value = annotation.findDeclaredAttributeValue("expectedExceptions"); if (value == null) ...
visitMethod
17,534
void (PsiAnnotationMemberValue annotationMemberValue, PsiMethod method, List<PsiClassType> exceptionsThrown) { if (!(annotationMemberValue instanceof PsiClassObjectAccessExpression classObjectAccessExpression)) { return; } final PsiTypeElement operand = classObjectAccessExpression.getOperand(); final PsiType type = ope...
checkAnnotationMemberValue
17,535
String () { return TestngBundle.message("checkbox.testng.test"); }
getElementDescription
17,536
String () { return "TestNGMethodNamingConvention"; }
getShortName
17,537
NamingConventionBean () { return new NamingConventionBean("[a-z][A-Za-z_\\d]*", 4, 64); }
createDefaultBean
17,538
boolean (PsiMethod member) { return TestNGUtil.hasTest(member); }
isApplicable
17,539
String () { return TestNGUtil.TESTNG_GROUP_NAME; }
getGroupDisplayName
17,540
String () { return "dependsOnMethodTestNG"; }
getShortName
17,541
boolean () { return true; }
isEnabledByDefault
17,542
void (InspectionManager manager, PsiClass psiClass, String methodName, PsiAnnotationMemberValue value, List<ProblemDescriptor> problemDescriptors, boolean onTheFly) { LOGGER.debug("Found dependsOnMethods with text: " + methodName); if (!methodName.isEmpty() && methodName.charAt(methodName.length() - 1) == ')') { LOGGER...
checkMethodNameDependency
17,543
String () { return TestNGUtil.TESTNG_GROUP_NAME; }
getGroupDisplayName
17,544
String () { return SHORT_NAME; }
getShortName
17,545
boolean () { return true; }
isEnabledByDefault
17,546
OptPane () { return OptPane.pane( OptPane.string("groups", TestngBundle.message("inspection.depends.on.groups.defined.groups.panel.title"), 30) ); }
getOptionsPane
17,547
OptionController () { return super.getOptionController().onValue( "groups", () -> StringUtil.join(ArrayUtilRt.toStringArray(groups), ","), value -> { groups.clear(); if (!StringUtil.isEmptyOrSpaces(value)) { ContainerUtil.addAll(groups, value.split("[, ]")); } }); }
getOptionController
17,548
String () { return TestngBundle.message("inspection.depends.on.groups.add.as.defined.test.group.fix", myGroupName); }
getName
17,549
String () { return TestngBundle.message("inspection.depends.on.groups.family.name"); }
getFamilyName
17,550
void (@NotNull Project project, @NotNull ProblemDescriptor problemDescriptor) { groups.add(myGroupName); //correct save settings ProjectInspectionProfileManager.getInstance(project).fireProfileChanged(); //TODO lesya /* try { inspectionProfile.save(); } catch (IOException e) { Messages.showErrorDialog(project, e.getMes...
applyFix
17,551
boolean () { return false; }
startInWriteAction
17,552
boolean (@NotNull PsiType type, @NotNull PsiAnnotation annotation) { if (type instanceof PsiArrayType) { return isSuitableInnerType(((PsiArrayType)type).getComponentType(), annotation); } if (type instanceof PsiClassType) { final PsiClassType.ClassResolveResult resolveResult = ((PsiClassType)type).resolveGenerics(); fi...
isSuitableReturnType
17,553
boolean (@NotNull PsiType type, @NotNull PsiAnnotation annotation) { if (!(type instanceof PsiArrayType)) { Module module = ModuleUtilCore.findModuleForPsiElement(annotation); if (module == null) return false; return supportOneDimensional(module); } final PsiType componentType = type.getDeepComponentType(); if (!(compo...
isSuitableInnerType
17,554
boolean (@NotNull Module module) { return TestNGUtil.isVersionOrGreaterThan(module.getProject(), module, 6, 10, 0); }
supportOneDimensional
17,555
boolean (PsiElement member) { if (member instanceof PsiMethod method) { return TestNGUtil.hasTest(method, false) || TestNGUtil.hasConfig(method); } return false; }
value
17,556
String () { return TestNGUtil.TESTNG_GROUP_NAME; }
getGroupDisplayName
17,557
String () { return "UndeclaredTests"; }
getShortName
17,558
String () { return TestngBundle.message("inspection.undeclared.test.register", myClassName); }
getName
17,559
String () { return TestngBundle.message("inspection.undeclared.test.register.test"); }
getFamilyName
17,560
void (@NotNull final Project project, @NotNull ProblemDescriptor descriptor) { final PsiClass psiClass = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), PsiClass.class); LOG.assertTrue(psiClass != null); final String testngXmlPath = new SuiteBrowser(project).showDialog(); if (testngXmlPath == null) return; fina...
applyFix
17,561
boolean () { return false; }
startInWriteAction
17,562
void (final XmlFile testngXML, final PsiClass psiClass) { final XmlTag rootTag = testngXML.getDocument().getRootTag(); if (rootTag != null && rootTag.getName().equals("suite")) { try { XmlTag testTag = rootTag.findFirstSubTag("test"); if (testTag == null) { testTag = (XmlTag)rootTag.add(rootTag.createChildTag("test", r...
patchTestngXml
17,563
String () { return TestngBundle.message("inspection.undeclared.test.create.suite.fix"); }
getFamilyName
17,564
void (@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { final PsiClass psiClass = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), PsiClass.class); final VirtualFile file = FileChooser.chooseFile(FileChooserDescriptorFactory.createSingleFolderDescriptor(), project, null); if (file !=...
applyFix
17,565
boolean () { return false; }
startInWriteAction
17,566
boolean () { return ADD_TESTNG_TO_ENTRIES; }
isSelected
17,567
void (boolean selected) { ADD_TESTNG_TO_ENTRIES = selected; }
setSelected
17,568
String () { return TestngBundle.message("testng.entry.point.test.cases"); }
getDisplayName
17,569
boolean (@NotNull RefElement refElement, @NotNull PsiElement psiElement) { return isEntryPoint(psiElement); }
isEntryPoint
17,570
boolean (@NotNull PsiElement psiElement) { if (psiElement instanceof PsiModifierListOwner) { if (TestNGUtil.hasTest((PsiModifierListOwner)psiElement, true, false, TestNGUtil.hasDocTagsSupport)) return true; return TestNGUtil.hasConfig((PsiModifierListOwner)psiElement); } return false; }
isEntryPoint
17,571
MyRunProfile (@NotNull ExecutionEnvironment environment) { final TestNGConfiguration configuration = (TestNGConfiguration)myConsoleProperties.getConfiguration(); final List<AbstractTestProxy> failedTests = getFailedTests(configuration.getProject()); return new MyRunProfile(configuration) { @Override public Module @NotN...
getRunProfile
17,572
RunProfileState (@NotNull Executor executor, @NotNull ExecutionEnvironment env) { return new TestNGRunnableState(env, configuration) { @Override public SearchForTestsTask createSearchingForTestsTask() { return createSearchingForTestsTask(new LocalTargetEnvironment(new LocalTargetEnvironmentRequest())); } @Override publ...
getState
17,573
SearchForTestsTask () { return createSearchingForTestsTask(new LocalTargetEnvironment(new LocalTargetEnvironmentRequest())); }
createSearchingForTestsTask
17,574
SearchForTestsTask (@NotNull TargetEnvironment targetEnvironment) { return new SearchingForTestsTask(getServerSocket(), getConfiguration(), myTempFile) { @Override protected void fillTestObjects(final Map<PsiClass, Map<PsiMethod, List<String>>> classes) throws CantRunException { final HashMap<PsiClass, Map<PsiMethod, L...
createSearchingForTestsTask
17,575
void (Map<PsiClass, Map<PsiMethod, List<String>>> classes, GlobalSearchScope scope, Project project, AbstractTestProxy proxy) { final Location location = proxy.getLocation(project, scope); if (location != null) { final PsiElement element = location.getPsiElement(); if (element instanceof PsiMethod psiMethod && element....
includeFailedTestWithDependencies
17,576
void (Location location, List<String> strings) { if (location instanceof PsiMemberParameterizedLocation) { final String paramSetName = ((PsiMemberParameterizedLocation)location).getParamSetName(); if (paramSetName != null) { strings.add(TestNGConfigurationProducer.getInvocationNumber(paramSetName)); } } }
setupParameterName
17,577
Set<String> (TestNGConfiguration configuration) { return configuration.getPersistantData().getPatterns(); }
getPattern
17,578
boolean (RunConfiguration configuration) { return configuration instanceof TestNGConfiguration && TestType.PATTERN.getType().equals(((TestNGConfiguration)configuration).getPersistantData().TEST_OBJECT); }
isPatternBasedConfiguration
17,579
AbstractTestNGPatternConfigurationProducer () { return RunConfigurationProducer.getInstance(TestNGPatternConfigurationProducer.class); }
getPatternBasedProducer
17,580
ConfigurationType () { return TestNGConfigurationType.getInstance(); }
getConfigurationType
17,581
boolean (TestNGConfiguration configuration) { return TestType.PATTERN.getType().equals(configuration.getPersistantData().TEST_OBJECT); }
isPatternBasedConfiguration
17,582
Set<String> (TestNGConfiguration configuration) { return configuration.getPersistantData().getPatterns(); }
getPatterns
17,583
ExternalClassResolveResult (@NotNull String shortClassName, @NotNull ThreeState isAnnotation, @NotNull Module contextModule) { if (TEST_NG_ANNOTATIONS.contains(shortClassName)) { return new ExternalClassResolveResult("org.testng.annotations." + shortClassName, TESTNG_DESCRIPTOR); } return null; }
resolveClass
17,584
String[] (@NotNull PsiFile file) { return TestNGUtil.CONFIG_ANNOTATIONS_FQN; }
getAnnotations
17,585
int () { return listenerList.size(); }
getSize
17,586
Object (int i) { return listenerList.get(i); }
getElementAt
17,587
void (List<String> listenerList) { this.listenerList.clear(); this.listenerList.addAll(listenerList); fireContentsChanged(this, 0, 0); }
setListenerList
17,588
List<String> () { return listenerList; }
getListenerList
17,589
void (String listener) { listenerList.add(listener); fireContentsChanged(this, 0, 0); }
addListener
17,590
void (int rowIndex) { listenerList.remove(rowIndex); fireContentsChanged(this, 0, 0); }
removeListener
17,591
String () { return type; }
getType
17,592
int () { return value; }
getValue
17,593
String () { return myConfig.getPersistantData().getSuiteName(); }
getGeneratedName
17,594
String () { String suiteName = myConfig.getPersistantData().getSuiteName(); if (!suiteName.isEmpty()) { VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(suiteName); if (virtualFile != null) { return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), myConfig....
getActionName
17,595
boolean (PsiElement element) { final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element); return virtualFile != null && Comparing.strEqual(myConfig.getPersistantData().getSuiteName(), virtualFile.getPath()); }
isConfiguredByElement
17,596
TestSearchScope () { return TEST_SEARCH_SCOPE.getScope(); }
getScope
17,597
void (TestSearchScope testseachscope) { TEST_SEARCH_SCOPE.setScope(testseachscope); }
setScope
17,598
String () { return PROPERTIES_FILE == null ? "" : PROPERTIES_FILE; }
getPropertiesFile
17,599
String () { return OUTPUT_DIRECTORY == null ? "" : OUTPUT_DIRECTORY; }
getOutputDirectory