public Collection<Module> getValidModules() {
    if (TEST_PACKAGE.equals(myData.TEST_OBJECT) || TEST_PATTERN.equals(myData.TEST_OBJECT)) {
      return Arrays.asList(ModuleManager.getInstance(getProject()).getModules());
    }
    try {
      myData.getTestObject(getProject(), this).checkConfiguration();
    } catch (RuntimeConfigurationError e) {
      return Arrays.asList(ModuleManager.getInstance(getProject()).getModules());
    } catch (RuntimeConfigurationException e) {
      // ignore
    }

    return JavaRunConfigurationModule.getModulesForClass(getProject(), myData.getMainClassName());
  }
 public TestObject getTestObject() {
   return myData.getTestObject(getProject(), this);
 }
 public void checkConfiguration() throws RuntimeConfigurationException {
   myData.getTestObject(getProject(), this).checkConfiguration();
   JavaRunConfigurationExtensionManager.checkConfigurationIsValid(this);
 }
 public RefactoringElementListener getRefactoringElementListener(final PsiElement element) {
   final RefactoringElementListener listener =
       myData.getTestObject(getProject(), this).getListener(element, this);
   return RunConfigurationExtension.wrapRefactoringElementListener(element, this, listener);
 }