use of com.intellij.execution.configurations.RuntimeConfigurationException in project intellij-community by JetBrains.
the class TestNGTestClass method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
final TestData data = myConfig.getPersistantData();
final SourceScope scope = data.getScope().getSourceScope(myConfig);
if (scope == null) {
throw new RuntimeConfigurationException("Invalid scope specified");
}
final PsiManager manager = PsiManager.getInstance(myConfig.getProject());
final PsiClass psiClass = ClassUtil.findPsiClass(manager, data.getMainClassName(), null, true, scope.getGlobalSearchScope());
if (psiClass == null)
throw new RuntimeConfigurationException("Class '" + data.getMainClassName() + "' not found");
}
use of com.intellij.execution.configurations.RuntimeConfigurationException in project intellij-community by JetBrains.
the class TestNGTestMethod method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
final TestData data = myConfig.getPersistantData();
final SourceScope scope = data.getScope().getSourceScope(myConfig);
if (scope == null) {
throw new RuntimeConfigurationException("Invalid scope specified");
}
PsiClass psiClass = JavaPsiFacade.getInstance(myConfig.getProject()).findClass(data.getMainClassName(), scope.getGlobalSearchScope());
if (psiClass == null)
throw new RuntimeConfigurationException("Class '" + data.getMainClassName() + "' not found");
PsiMethod[] methods = psiClass.findMethodsByName(data.getMethodName(), true);
if (methods.length == 0) {
throw new RuntimeConfigurationException("Method '" + data.getMethodName() + "' not found");
}
for (PsiMethod method : methods) {
if (!method.hasModifierProperty(PsiModifier.PUBLIC)) {
throw new RuntimeConfigurationException("Non public method '" + data.getMethodName() + "'specified");
}
}
}
use of com.intellij.execution.configurations.RuntimeConfigurationException in project intellij-community by JetBrains.
the class TestNGTestPackage method checkConfiguration.
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
final TestData data = myConfig.getPersistantData();
PsiPackage psiPackage = JavaPsiFacade.getInstance(myConfig.getProject()).findPackage(data.getPackageName());
if (psiPackage == null)
throw new RuntimeConfigurationException("Package '" + data.getPackageName() + "' not found");
}
use of com.intellij.execution.configurations.RuntimeConfigurationException in project intellij-community by JetBrains.
the class GantRunner method ensureRunnerConfigured.
@Override
public void ensureRunnerConfigured(@NotNull GroovyScriptRunConfiguration configuration) throws RuntimeConfigurationException {
Project project = configuration.getProject();
if (GantUtils.getSDKInstallPath(configuration.getModule(), project).isEmpty()) {
RuntimeConfigurationException e = new RuntimeConfigurationException("Gant is not configured");
e.setQuickFix(() -> ShowSettingsUtil.getInstance().editConfigurable(project, new GantConfigurable(project)));
throw e;
}
}
use of com.intellij.execution.configurations.RuntimeConfigurationException in project intellij-community by JetBrains.
the class DefaultGroovyScriptRunner method ensureRunnerConfigured.
@Override
public void ensureRunnerConfigured(@NotNull GroovyScriptRunConfiguration configuration) throws RuntimeConfigurationException {
Module module = configuration.getModule();
if (module == null) {
throw new RuntimeConfigurationException("Module is not specified");
}
if (LibrariesUtil.getGroovyHomePath(module) == null) {
RuntimeConfigurationException e = new RuntimeConfigurationException("Groovy is not configured for module '" + module.getName() + "'");
e.setQuickFix(() -> ModulesConfigurator.showDialog(module.getProject(), module.getName(), ClasspathEditor.NAME));
throw e;
}
}
Aggregations