Search in sources :

Example 11 with RuntimeConfigurationException

use of com.intellij.execution.configurations.RuntimeConfigurationException in project intellij-community by JetBrains.

the class PyCCRunTestConfiguration method checkConfiguration.

@Override
public void checkConfiguration() throws RuntimeConfigurationException {
    super.checkConfiguration();
    String message = "Select valid path to the file with tests";
    VirtualFile testsFile = LocalFileSystem.getInstance().findFileByPath(myPathToTest);
    if (testsFile == null) {
        throw new RuntimeConfigurationException(message);
    }
    VirtualFile taskDir = StudyUtils.getTaskDir(testsFile);
    if (taskDir == null) {
        throw new RuntimeConfigurationException(message);
    }
    if (StudyUtils.getTask(myProject, taskDir) == null) {
        throw new RuntimeConfigurationException(message);
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) RuntimeConfigurationException(com.intellij.execution.configurations.RuntimeConfigurationException)

Aggregations

RuntimeConfigurationException (com.intellij.execution.configurations.RuntimeConfigurationException)11 ApplicationConfiguration (com.intellij.execution.application.ApplicationConfiguration)2 SourceScope (com.intellij.execution.testframework.SourceScope)2 Module (com.intellij.openapi.module.Module)2 CantRunException (com.intellij.execution.CantRunException)1 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)1 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)1 ComponentSet (com.intellij.flex.model.bc.ComponentSet)1 FlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)1 JSPackageIndex (com.intellij.lang.javascript.index.JSPackageIndex)1 JSPackageIndexInfo (com.intellij.lang.javascript.index.JSPackageIndexInfo)1 JSClass (com.intellij.lang.javascript.psi.ecmal4.JSClass)1 Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiElement (com.intellij.psi.PsiElement)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 THashSet (gnu.trove.THashSet)1 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1