Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
17,400
|
TestData () { return data; }
|
getPersistantData
|
17,401
|
Collection<Module> () { //TODO add handling for package return JavaRunConfigurationModule.getModulesForClass(getProject(), data.getMainClassName()); }
|
getValidModules
|
17,402
|
String () { return TestNGTestObject.fromConfig(this).getGeneratedName(); }
|
suggestedName
|
17,403
|
String () { return TestNGTestObject.fromConfig(this).getActionName(); }
|
getActionName
|
17,404
|
void (@Nullable String value) { data.setVMParameters(value); }
|
setVMParameters
|
17,405
|
String () { return data.getVMParameters(); }
|
getVMParameters
|
17,406
|
void (String value) { data.setProgramParameters(value); }
|
setProgramParameters
|
17,407
|
String () { return data.getProgramParameters(); }
|
getProgramParameters
|
17,408
|
void (String value) { data.setWorkingDirectory(value); }
|
setWorkingDirectory
|
17,409
|
String () { return data.getWorkingDirectory(); }
|
getWorkingDirectory
|
17,410
|
void (@NotNull Map<String, String> envs) { data.setEnvs(envs); }
|
setEnvs
|
17,411
|
void (boolean passParentEnvs) { data.PASS_PARENT_ENVS = passParentEnvs; }
|
setPassParentEnvs
|
17,412
|
boolean () { return data.PASS_PARENT_ENVS; }
|
isPassParentEnvs
|
17,413
|
boolean () { return ALTERNATIVE_JRE_PATH_ENABLED; }
|
isAlternativeJrePathEnabled
|
17,414
|
void (boolean enabled) { this.ALTERNATIVE_JRE_PATH_ENABLED = enabled; }
|
setAlternativeJrePathEnabled
|
17,415
|
String () { return ALTERNATIVE_JRE_PATH != null ? new AlternativeJrePathConverter().fromString(ALTERNATIVE_JRE_PATH) : null; }
|
getAlternativeJrePath
|
17,416
|
void (String path) { String collapsedPath = path != null ? new AlternativeJrePathConverter().toString(path) : null; boolean changed = !Objects.equals(ALTERNATIVE_JRE_PATH, collapsedPath); this.ALTERNATIVE_JRE_PATH = collapsedPath; ApplicationConfiguration.onAlternativeJreChanged(changed, getProject()); }
|
setAlternativeJrePath
|
17,417
|
String () { return !data.TEST_OBJECT.equals(TestType.CLASS.getType()) && !data.TEST_OBJECT.equals(TestType.METHOD.getType()) ? null : data.getMainClassName(); }
|
getRunClass
|
17,418
|
String () { return !data.TEST_OBJECT.equals(TestType.PACKAGE.getType()) ? null : data.getPackageName(); }
|
getPackage
|
17,419
|
void (PsiClass psiclass) { setModule(data.setMainClass(psiclass)); data.TEST_OBJECT = TestType.CLASS.getType(); setGeneratedName(); }
|
beClassConfiguration
|
17,420
|
boolean (PsiElement element) { return TestNGTestObject.fromConfig(this).isConfiguredByElement(element); }
|
isConfiguredByElement
|
17,421
|
String () { return getPersistantData().TEST_OBJECT; }
|
getTestType
|
17,422
|
String (String paramSetName) { return TestNGConfigurationProducer.getInvocationNumber(paramSetName); }
|
prepareParameterizedParameter
|
17,423
|
TestSearchScope () { return getPersistantData().getScope(); }
|
getTestSearchScope
|
17,424
|
void (TestSearchScope searchScope) { getPersistantData().setScope(searchScope); }
|
setSearchScope
|
17,425
|
void (Module module, PsiPackage pkg) { data.setPackage(pkg); setModule(module); data.TEST_OBJECT = TestType.PACKAGE.getType(); setGeneratedName(); }
|
setPackageConfiguration
|
17,426
|
void (Location<PsiMethod> location) { setModule(data.setTestMethod(location)); setGeneratedName(); }
|
beMethodConfiguration
|
17,427
|
void (PsiClass psiclass) { setModule(data.setMainClass(psiclass)); data.TEST_OBJECT = TestType.CLASS.getType(); setGeneratedName(); }
|
setClassConfiguration
|
17,428
|
void (Location<PsiMethod> location) { setModule(data.setTestMethod(location)); setGeneratedName(); }
|
setMethodConfiguration
|
17,429
|
void (List<PsiClass> classes, PsiMethod method) { data.TEST_OBJECT = TestType.PATTERN.getType(); final String suffix; if (method != null) { data.METHOD_NAME = method.getName(); suffix = "," + data.METHOD_NAME; } else { suffix = ""; } LinkedHashSet<String> patterns = new LinkedHashSet<>(); for (PsiClass pattern : classes) { patterns.add(JavaExecutionUtil.getRuntimeQualifiedName(pattern) + suffix); } data.setPatterns(patterns); final Module module = RunConfigurationProducer.getInstance(AbstractTestNGPatternConfigurationProducer.class) .findModule(this, getConfigurationModule().getModule(), patterns); if (module == null) { data.setScope(TestSearchScope.WHOLE_PROJECT); setModule(null); } else { setModule(module); } setGeneratedName(); }
|
bePatternConfiguration
|
17,430
|
void (@NotNull Element element) { super.readExternal(element); JavaRunConfigurationExtensionManager.getInstance().readExternal(this, element); DefaultJDOMExternalizer.readExternal(this, element); DefaultJDOMExternalizer.readExternal(getPersistantData(), element); EnvironmentVariablesComponent.readExternal(element, getPersistantData().getEnvs()); Map<String, String> properties = getPersistantData().TEST_PROPERTIES; properties.clear(); Element propertiesElement = element.getChild("properties"); if (propertiesElement != null) { List<Element> children = propertiesElement.getChildren("property"); for (Element property : children) { properties.put(property.getAttributeValue("name"), property.getAttributeValue("value")); } } List<String> listeners = getPersistantData().TEST_LISTENERS; listeners.clear(); Element listenersElement = element.getChild("listeners"); if (listenersElement != null) { List<Element> children = listenersElement.getChildren("listener"); for (Element listenerClassName : children) { listeners.add(listenerClassName.getAttributeValue("class")); } } final Element patternsElement = element.getChild(PATTERNS_EL_NAME); if (patternsElement != null) { final LinkedHashSet<String> tests = new LinkedHashSet<>(); for (Element patternElement : patternsElement.getChildren(PATTERN_EL_NAME)) { tests.add(patternElement.getAttributeValue(TEST_CLASS_ATT_NAME)); } getPersistantData().setPatterns(tests); } }
|
readExternal
|
17,431
|
boolean (@NotNull Field field) { return "TEST_OBJECT".equals(field.getName()) || super.test(field); }
|
test
|
17,432
|
RefactoringElementListener (final PsiElement element) { if (data.TEST_OBJECT.equals(TestType.PACKAGE.getType())) { if (!(element instanceof PsiPackage)) return null; final RefactoringElementListener listener = RefactoringListeners.getListener((PsiPackage)element, myPackage); return RunConfigurationExtension.wrapRefactoringElementListener(element, this, listener); } else if (data.TEST_OBJECT.equals(TestType.CLASS.getType())) { if (!(element instanceof PsiClass) && !(element instanceof PsiPackage)) return null; final RefactoringElementListener listener = RefactoringListeners.getClassOrPackageListener(element, myClass); return RunConfigurationExtension.wrapRefactoringElementListener(element, this, listener); } else if (data.TEST_OBJECT.equals(TestType.METHOD.getType())) { if (!(element instanceof PsiMethod method)) { final RefactoringElementListener listener = RefactoringListeners.getClassOrPackageListener(element, myClass); return RunConfigurationExtension.wrapRefactoringElementListener(element, this, listener); } if (!method.getName().equals(data.getMethodName())) return null; if (!method.getContainingClass().equals(myClass.getPsiElement())) return null; class Listener extends RefactoringElementAdapter implements UndoRefactoringElementListener { @Override public void elementRenamedOrMoved(@NotNull final PsiElement newElement) { data.setTestMethod(PsiLocation.fromPsiElement((PsiMethod)newElement)); } @Override public void undoElementMovedOrRenamed(@NotNull PsiElement newElement, @NotNull String oldQualifiedName) { final int methodIdx = oldQualifiedName.indexOf("#") + 1; if (methodIdx <= 0 || methodIdx >= oldQualifiedName.length()) return; data.METHOD_NAME = oldQualifiedName.substring(methodIdx); } } return RunConfigurationExtension.wrapRefactoringElementListener(element, this, new Listener()); } return null; }
|
getRefactoringElementListener
|
17,433
|
void (@NotNull final PsiElement newElement) { data.setTestMethod(PsiLocation.fromPsiElement((PsiMethod)newElement)); }
|
elementRenamedOrMoved
|
17,434
|
void (@NotNull PsiElement newElement, @NotNull String oldQualifiedName) { final int methodIdx = oldQualifiedName.indexOf("#") + 1; if (methodIdx <= 0 || methodIdx >= oldQualifiedName.length()) return; data.METHOD_NAME = oldQualifiedName.substring(methodIdx); }
|
undoElementMovedOrRenamed
|
17,435
|
boolean () { return false; }
|
collectOutputFromProcessHandler
|
17,436
|
SMTRunnerConsoleProperties (@NotNull Executor executor) { return new TestNGConsoleProperties(this, executor); }
|
createTestConsoleProperties
|
17,437
|
byte () { return 0x1; }
|
getTestFrameworkId
|
17,438
|
Set<String> () { if (!TestType.GROUP.getType().equals(data.TEST_OBJECT)) { return null; } Set<String> groups = StringUtil.split(data.getGroupName(), ",").stream() .map(String::trim) .filter(StringUtil::isNotEmpty) .collect(Collectors.toSet()); return groups.isEmpty() ? null : groups; }
|
calculateGroupNames
|
17,439
|
void (PsiLocation<PsiMethod> position) { beMethodConfiguration(position); getPersistantData().TEST_OBJECT = TestType.SOURCE.getType(); }
|
beFromSourcePosition
|
17,440
|
String () { return TESTNG_TEST_FRAMEWORK_NAME; }
|
getFrameworkName
|
17,441
|
boolean (Module module) { return module != null && getConfiguration().getPersistantData().getScope() != TestSearchScope.WHOLE_PROJECT; }
|
configureByModule
|
17,442
|
void (JavaParameters javaParameters, Module module) { javaParameters.getClassPath().addFirst(PathUtil.getJarPathForClass(RemoteTestNGStarter.class)); }
|
configureRTClasspath
|
17,443
|
List<String> (String parameters) { try { Integer.parseInt(parameters); return super.getNamedParams(parameters); } catch (NumberFormatException e) { return Arrays.asList(parameters.split(" ")); } }
|
getNamedParams
|
17,444
|
String () { return "none"; }
|
getForkMode
|
17,445
|
void () { super.onFound(); writeClassesPerModule(myClasses); }
|
onFound
|
17,446
|
void (Map<PsiClass, Map<PsiMethod, List<String>>> classes) { if (forkPerModule()) { final Map<Module, List<String>> perModule = new TreeMap<>((o1, o2) -> StringUtil.compare(o1.getName(), o2.getName(), true)); for (final PsiClass psiClass : classes.keySet()) { final Module module = ModuleUtilCore.findModuleForPsiElement(psiClass); if (module != null) { List<String> list = perModule.get(module); if (list == null) { list = new ArrayList<>(); perModule.put(module, list); } list.add(psiClass.getQualifiedName()); } } try { writeClassesPerModule(getConfiguration().getPackage(), getJavaParameters(), perModule, ""); } catch (Exception e) { LOG.error(e); } } }
|
writeClassesPerModule
|
17,447
|
String () { return "testng"; }
|
getFrameworkId
|
17,448
|
void (ParametersList parametersList, String tempFilePath) { parametersList.add(new CompositeParameterTargetedValue("-temp")); parametersList.add(new CompositeParameterTargetedValue().addPathPart(tempFilePath)); }
|
passTempFile
|
17,449
|
TestNGConfiguration () { return config; }
|
getConfiguration
|
17,450
|
TestSearchScope () { return getConfiguration().getPersistantData().getScope(); }
|
getScope
|
17,451
|
void (List<String> options) { TestData data = getConfiguration().getPersistantData(); if (TestType.METHOD.getType().equals(data.TEST_OBJECT) || TestType.CLASS.getType().equals(data.TEST_OBJECT)) { options.add(StringUtil.getPackageName(data.MAIN_CLASS_NAME)); } else if (TestType.PACKAGE.getType().equals(data.TEST_OBJECT)){ PsiPackage aPackage = JavaPsiFacade.getInstance(getConfiguration().getProject()).findPackage(data.PACKAGE_NAME); if (aPackage != null) { SourceScope sourceScope = data.getScope().getSourceScope(getConfiguration()); if (sourceScope != null) { collectSubPackages(options, aPackage, sourceScope.getGlobalSearchScope()); } } } }
|
collectPackagesToOpen
|
17,452
|
boolean () { return getConfiguration().isUseModulePath(); }
|
useModulePath
|
17,453
|
boolean (@NotNull RunProfile profile) { return profile instanceof TestNGConfiguration; }
|
validForProfile
|
17,454
|
String () { return "testng"; }
|
getThreadName
|
17,455
|
String () { return "TestNGDebug"; }
|
getRunnerId
|
17,456
|
void (PsiClass psiClass) { final JTextField textField = myPatternTextField.getTextField(); final String text = textField.getText(); textField.setText(text + (!text.isEmpty() ? "||" : "") + psiClass.getQualifiedName()); }
|
onClassChoosen
|
17,457
|
void (ActionEvent e) { showDialog(); }
|
actionPerformed
|
17,458
|
boolean () { return false; }
|
productionOnly
|
17,459
|
void () { final boolean allPackagesInProject = packagesInProject.isSelected() && packagePanel.isVisible(); moduleClasspath.setEnabled(!allPackagesInProject); if (allPackagesInProject) { moduleClasspath.getComponent().setSelectedItem(null); } }
|
evaluateModuleClassPath
|
17,460
|
void () { final TestType testKind = (TestType)myTestKind.getSelectedItem(); if (testKind == TestType.PACKAGE) { packagePanel.setVisible(true); packageField.setVisible(true); classField.setVisible(false); methodField.setVisible(false); groupField.setVisible(false); suiteField.setVisible(false); myPattern.setVisible(false); } else if (testKind == TestType.CLASS) { packagePanel.setVisible(false); classField.setVisible(true); methodField.setVisible(false); groupField.setVisible(false); suiteField.setVisible(false); myPattern.setVisible(false); } else if (testKind == TestType.METHOD || testKind == TestType.SOURCE) { packagePanel.setVisible(false); classField.setVisible(true); methodField.setVisible(true); groupField.setVisible(false); suiteField.setVisible(false); myPattern.setVisible(false); } else if (testKind == TestType.GROUP) { packagePanel.setVisible(true); classField.setVisible(false); methodField.setVisible(false); groupField.setVisible(true); suiteField.setVisible(false); myPattern.setVisible(false); } else if (testKind == TestType.SUITE) { packagePanel.setVisible(true); classField.setVisible(false); methodField.setVisible(false); groupField.setVisible(false); suiteField.setVisible(true); myPattern.setVisible(false); } else if (testKind == TestType.PATTERN) { packagePanel.setVisible(true); classField.setVisible(false); methodField.setVisible(false); groupField.setVisible(false); suiteField.setVisible(false); myPattern.setVisible(true); } }
|
redisplay
|
17,461
|
String () { return classField.getComponent().getText(); }
|
getClassName
|
17,462
|
ModuleDescriptionsComboBox () { return moduleClasspath.getComponent(); }
|
getModulesComponent
|
17,463
|
void (@NotNull TestNGConfiguration config) { this.config = config; model.reset(config); commonJavaParameters.reset(config); getModuleSelector().reset(config); TestData data = config.getPersistantData(); TestSearchScope scope = data.getScope(); if (scope == TestSearchScope.SINGLE_MODULE) { packagesInModule.setSelected(true); } else if (scope == TestSearchScope.MODULE_WITH_DEPENDENCIES) { packagesAcrossModules.setSelected(true); } else { packagesInProject.setSelected(true); } evaluateModuleClassPath(); alternateJDK.setPathOrName(config.getAlternativeJrePath(), config.ALTERNATIVE_JRE_PATH_ENABLED); propertiesList.clear(); propertiesList.addAll(data.TEST_PROPERTIES.entrySet()); propertiesTableModel.setParameterList(propertiesList); listenerModel.setListenerList(data.TEST_LISTENERS); myUseDefaultReportersCheckBox.setSelected(data.USE_DEFAULT_REPORTERS); myShortenCommandLineCombo.getComponent().setSelectedItem(config.getShortenCommandLine()); myUseModulePath.getComponent().setSelected(config.isUseModulePath()); if (!project.isDefault()) { SwingUtilities.invokeLater(() -> ReadAction.nonBlocking(() -> FilenameIndex.getFilesByName(project, PsiJavaModule.MODULE_INFO_FILE, GlobalSearchScope.projectScope(project)).length > 0) .expireWith(this) .finishOnUiThread(ModalityState.stateForComponent(myUseModulePath), visible -> myUseModulePath.setVisible(visible)) .submit(NonUrgentExecutor.getInstance())); } }
|
resetEditorFrom
|
17,464
|
void (@NotNull TestNGConfiguration config) { model.apply(getModuleSelector().getModule(), config); getModuleSelector().applyTo(config); TestData data = config.getPersistantData(); final TestType testKind = (TestType)myTestKind.getSelectedItem(); if (testKind != TestType.CLASS && testKind != TestType.METHOD && testKind != TestType.SOURCE) { if (packagesInProject.isSelected()) { data.setScope(TestSearchScope.WHOLE_PROJECT); } else if (packagesInModule.isSelected()) { data.setScope(TestSearchScope.SINGLE_MODULE); } else if (packagesAcrossModules.isSelected()) data.setScope(TestSearchScope.MODULE_WITH_DEPENDENCIES); } else { data.setScope(TestSearchScope.MODULE_WITH_DEPENDENCIES); } commonJavaParameters.applyTo(config); config.setAlternativeJrePath(alternateJDK.getJrePathOrName()); config.ALTERNATIVE_JRE_PATH_ENABLED = alternateJDK.isAlternativeJreSelected(); data.TEST_PROPERTIES.clear(); for (Map.Entry<String, String> entry : propertiesList) { data.TEST_PROPERTIES.put(entry.getKey(), entry.getValue()); } data.TEST_LISTENERS.clear(); data.TEST_LISTENERS.addAll(listenerModel.getListenerList()); data.USE_DEFAULT_REPORTERS = myUseDefaultReportersCheckBox.isSelected(); config.setShortenCommandLine(myShortenCommandLineCombo.getComponent().getSelectedItem()); config.setUseModulePath(myUseModulePath.isVisible() && myUseModulePath.getComponent().isSelected()); }
|
applyEditorTo
|
17,465
|
ConfigurationModuleSelector () { return moduleSelector; }
|
getModuleSelector
|
17,466
|
JComponent () { return panel; }
|
createEditor
|
17,467
|
JComponent () { return anchor; }
|
getAnchor
|
17,468
|
void (JComponent anchor) { this.anchor = anchor; methodField.setAnchor(anchor); packageField.setAnchor(anchor); groupField.setAnchor(anchor); suiteField.setAnchor(anchor); outputDirectory.setAnchor(anchor); classField.setAnchor(anchor); myPattern.setAnchor(anchor); myTestLabel.setAnchor(anchor); }
|
setAnchor
|
17,469
|
void () { myShortenCommandLineCombo = new LabeledComponent<>(); }
|
createUIComponents
|
17,470
|
void (JRadioButton[] buttons, ChangeListener changelistener) { ButtonGroup buttongroup = new ButtonGroup(); for (JRadioButton button : buttons) { button.getModel().addChangeListener(changelistener); buttongroup.add(button); } if (buttongroup.getSelection() == null) buttongroup.setSelected(buttons[0].getModel(), true); }
|
registerListener
|
17,471
|
void () { commonParametersPanel.add(commonJavaParameters, BorderLayout.CENTER); classField.setComponent(new EditorTextFieldWithBrowseButton(project, true, (declaration, place) -> { if (declaration instanceof PsiClass && place.getParent() instanceof PsiJavaCodeReferenceElement) { return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE; } try { if (declaration instanceof PsiClass && new TestClassBrowser(project, TestNGConfigurationEditor.this).getFilter().isAccepted((PsiClass)declaration)) { return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE; } } catch (MessageInfoException e) { return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE; } return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE; })); final EditorTextFieldWithBrowseButton methodEditorTextField = new EditorTextFieldWithBrowseButton(project, true, JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE, PlainTextLanguage.INSTANCE.getAssociatedFileType()); methodField.setComponent(methodEditorTextField); groupField.setComponent(new TextFieldWithBrowseButton.NoPathCompletion()); suiteField.setComponent(new TextFieldWithBrowseButton()); packageField.setVisible(true); packageField.setEnabled(true); packageField.setComponent(new EditorTextFieldWithBrowseButton(project, false)); TextFieldWithBrowseButton outputDirectoryButton = new TextFieldWithBrowseButton(); outputDirectory.setComponent(outputDirectoryButton); outputDirectoryButton.addBrowseFolderListener(TestngBundle.message("testng.output.directory.button.title"), TestngBundle.message("testng.select.output.directory"), project, FileChooserDescriptorFactory.createSingleFolderDescriptor()); moduleClasspath.setEnabled(true); propertiesTableModel = new TestNGParametersTableModel(); listenerModel = new TestNGListenersTableModel(); TextFieldWithBrowseButton textFieldWithBrowseButton = new TextFieldWithBrowseButton(); propertiesFile.setComponent(textFieldWithBrowseButton); FileChooserDescriptor propertiesFileDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) { @Override public boolean isFileVisible(VirtualFile virtualFile, boolean showHidden) { if (!showHidden && virtualFile.getName().charAt(0) == '.') return false; return virtualFile.isDirectory() || "properties".equals(virtualFile.getExtension()); } }; textFieldWithBrowseButton .addBrowseFolderListener(TestngBundle.message("testng.browse.button.title"), TestngBundle.message("testng.select.properties.file"), project, propertiesFileDescriptor); propertiesTableView = new TableView(propertiesTableModel); myPropertiesPanel.add( ToolbarDecorator.createDecorator(propertiesTableView) .setAddAction(button -> { propertiesTableModel.addParameter(); int index = propertiesTableModel.getRowCount() - 1; propertiesTableView.setRowSelectionInterval(index, index); }).setRemoveAction(button -> { int idx = propertiesTableView.getSelectedRow() - 1; for (int row : propertiesTableView.getSelectedRows()) { propertiesTableModel.removeProperty(row); } if (idx > -1) propertiesTableView.setRowSelectionInterval(idx, idx); }).disableUpDownActions().createPanel(), BorderLayout.CENTER); myListenersList = new JBList(listenerModel); myListenersPanel.add( ToolbarDecorator.createDecorator(myListenersList).setAddAction(new AddActionButtonRunnable()) .setRemoveAction(button -> { int idx = myListenersList.getSelectedIndex() - 1; for (int row : myListenersList.getSelectedIndices()) { listenerModel.removeListener(row); } if (idx > -1) myListenersList.setSelectedIndex(idx); }).setAddActionUpdater(e -> !project.isDefault()).disableUpDownActions().createPanel(), BorderLayout.CENTER); }
|
createView
|
17,472
|
boolean (VirtualFile virtualFile, boolean showHidden) { if (!showHidden && virtualFile.getName().charAt(0) == '.') return false; return virtualFile.isDirectory() || "properties".equals(virtualFile.getExtension()); }
|
isFileVisible
|
17,473
|
void (TestType type) { //LOGGER.info("onTypeChanged with " + type); myTestKind.setSelectedItem(type); if (type == TestType.PACKAGE) { packageField.setEnabled(true); classField.setEnabled(false); methodField.setEnabled(false); groupField.setEnabled(false); suiteField.setEnabled(false); myPattern.setEnabled(false); } else if (type == TestType.CLASS) { packageField.setEnabled(false); classField.setEnabled(true); methodField.setEnabled(false); groupField.setEnabled(false); suiteField.setEnabled(false); myPattern.setEnabled(false); } else if (type == TestType.METHOD || type == TestType.SOURCE) { packageField.setEnabled(false); classField.setEnabled(true); methodField.setEnabled(true); groupField.setEnabled(false); suiteField.setEnabled(false); myPattern.setEnabled(false); } else if (type == TestType.GROUP) { groupField.setEnabled(true); packageField.setVisible(false); classField.setEnabled(false); methodField.setEnabled(false); suiteField.setEnabled(false); myPattern.setEnabled(false); } else if (type == TestType.SUITE) { suiteField.setEnabled(true); packageField.setVisible(false); classField.setEnabled(false); methodField.setEnabled(false); groupField.setEnabled(false); myPattern.setEnabled(false); } else if (type == TestType.PATTERN) { myPattern.setEnabled(true); suiteField.setEnabled(false); packageField.setVisible(false); classField.setEnabled(false); methodField.setEnabled(false); groupField.setEnabled(false); } redisplay(); evaluateModuleClassPath(); }
|
onTypeChanged
|
17,474
|
GlobalSearchScope (Module[] modules) { if (modules == null || modules.length == 0) return null; GlobalSearchScope[] scopes = ContainerUtil.map2Array(modules, GlobalSearchScope.class, GlobalSearchScope::moduleWithDependenciesAndLibrariesScope); return GlobalSearchScope.union(scopes); }
|
getSearchScope
|
17,475
|
String () { GlobalSearchScope searchScope = getSearchScope(config.getModules()); if (searchScope == null) { searchScope = GlobalSearchScope.allScope(project); } final TestListenerFilter filter = new TestListenerFilter(searchScope, project); TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project) .createWithInnerClassesScopeChooser(TestngBundle.message("testng.config.editor.dialog.title.choose.listener.class"), filter.getScope(), filter, null); chooser.showDialog(); PsiClass psiclass = chooser.getSelected(); if (psiclass == null) { return null; } else { return JavaExecutionUtil.getRuntimeQualifiedName(psiclass); } }
|
selectListenerClass
|
17,476
|
void (AnActionButton button) { final String className = selectListenerClass(); if (className != null) { listenerModel.addListener(className); LOGGER.info("Adding listener " + className + " to configuration."); } }
|
run
|
17,477
|
Condition<PsiMethod> (PsiClass testClass) { return TestNGUtil::hasTest; }
|
getFilter
|
17,478
|
String () { return TestNGConfigurationEditor.this.getClassName(); }
|
getClassName
|
17,479
|
ConfigurationModuleSelector () { return moduleSelector; }
|
getModuleSelector
|
17,480
|
String () { return list.getSelectedValue(); }
|
getSelected
|
17,481
|
String (PsiClass[] classes, JComponent component) { GroupList groupList = new GroupList(classes); DialogBuilder builder = new DialogBuilder(component); builder.setCenterPanel(groupList); builder.setPreferredFocusComponent(groupList.list); builder.setTitle(TestngBundle.message("testng.choose.test.group")); return builder.show() != 0 ? null : groupList.getSelected(); }
|
showDialog
|
17,482
|
String () { ClassFilter.ClassFilterWithScope filter; try { filter = getFilter(); } catch (MessageInfoException e) { MessagesEx.MessageInfo message = e.getMessageInfo(); message.showNow(); return null; } TreeClassChooser chooser = TreeClassChooserFactory.getInstance(getProject()).createWithInnerClassesScopeChooser( TestngBundle.message("test.class.browser.dialog.title.choose.test.class"), filter.getScope(), filter, null); init(chooser); chooser.showDialog(); PsiClass psiclass = chooser.getSelected(); if (psiclass == null) { return null; } else { onClassChoosen(psiclass); return psiclass.getQualifiedName(); } }
|
showDialog
|
17,483
|
void (PsiClass psiClass) { }
|
onClassChoosen
|
17,484
|
PsiClass (String className) { return editor.getModuleSelector().findClass(className); }
|
findClass
|
17,485
|
GlobalSearchScope (Module[] modules) { if (modules == null || modules.length == 0) return null; GlobalSearchScope[] scopes = ContainerUtil.map2Array(modules, GlobalSearchScope.class, module -> GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module)); return GlobalSearchScope.union(scopes); }
|
getSearchScope
|
17,486
|
void (TreeClassChooser chooser) { String s = getText(); PsiClass psiclass = findClass(s); if (psiclass == null) return; PsiDirectory psidirectory = psiclass.getContainingFile().getContainingDirectory(); if (psidirectory != null) chooser.selectDirectory(psidirectory); chooser.select(psiclass); }
|
init
|
17,487
|
String () { TestClassFilter filter; Module module = editor.getModuleSelector().getModule(); if (module == null) { filter = new TestClassFilter(GlobalSearchScope.projectScope(getProject()), getProject(), false); } else { filter = new TestClassFilter(GlobalSearchScope.moduleScope(module), getProject(), false); } PsiClass[] classes = TestNGUtil.getAllTestClasses(filter, true); if(classes == null || classes.length == 0) { Messages.showMessageDialog(getField(), TestngBundle.message("testng.group.browser.no.tests.found.in.project"), TestngBundle.message("testng.group.browser.cannot.browse.groups"), Messages.getInformationIcon()); return null; } else { return GroupList.showDialog(classes, getField()); } }
|
showDialog
|
17,488
|
String () { PackageChooserDialog chooser = new PackageChooserDialog(TestngBundle.message("package.browser.dialog.title.choose.package"), getProject()); chooser.show(); PsiPackage psiPackage = chooser.getSelectedPackage(); String packageName = psiPackage == null ? null : psiPackage.getQualifiedName(); return packageName; }
|
showDialog
|
17,489
|
String () { FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false) { @Override public boolean isFileVisible(VirtualFile virtualFile, boolean showHidden) { if(!showHidden && virtualFile.getName().charAt(0) == '.') return false; return virtualFile.isDirectory() || "xml".equals(virtualFile.getExtension()) || "yaml".equals(virtualFile.getExtension()); } }; descriptor.setDescription((TestngBundle.message("testng.suite.browser.select.xml.or.yaml.suite.file"))); descriptor.setTitle(TestngBundle.message("testng.suite.browser.select.suite")); VirtualFile file = FileChooser.chooseFile(descriptor, getProject(), null); return file != null ? file.getPath() : null; }
|
showDialog
|
17,490
|
boolean (VirtualFile virtualFile, boolean showHidden) { if(!showHidden && virtualFile.getName().charAt(0) == '.') return false; return virtualFile.isDirectory() || "xml".equals(virtualFile.getExtension()) || "yaml".equals(virtualFile.getExtension()); }
|
isFileVisible
|
17,491
|
TestSearchScope () { return TestSearchScope.MODULE_WITH_DEPENDENCIES; }
|
getScope
|
17,492
|
boolean () { return getConfiguration().getConfigurationModule().getModule() == null; }
|
forkPerModule
|
17,493
|
void () { super.onFound(); writeClassesPerModule(myClasses); }
|
onFound
|
17,494
|
ConfigurationFactory () { return TestNGConfigurationType.getInstance().getConfigurationFactories()[0]; }
|
getConfigurationFactory
|
17,495
|
void (JavaTestConfigurationBase configuration, PsiLocation<PsiMethod> position) { ((TestNGConfiguration)configuration).beFromSourcePosition(position); }
|
setPosition
|
17,496
|
boolean (@NotNull Location<PsiMethod> method) { //TODO return TestNGUtil.hasTest(method.getPsiElement()); }
|
isApplicable
|
17,497
|
RunProfileState (Location<PsiMethod> @NotNull [] testMethods, Module module, RunConfiguration configuration, ExecutionEnvironment environment) { TestData data = ((TestNGConfiguration)configuration).getPersistantData(); data.setPatterns(collectMethodPatterns(testMethods)); data.TEST_OBJECT = TestType.PATTERN.type; return new TestNGRunnableState(environment, (TestNGConfiguration)configuration); }
|
createProfile
|
17,498
|
boolean (@NotNull VirtualFile file) { return myFileIndex.isInContent(file) && TestNGUtil.isTestngSuiteFile(file); }
|
contains
|
17,499
|
boolean (@NotNull Module aModule) { return true; }
|
isSearchInModuleContent
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.