コード例 #1
0
 public String getPatternPresentation() {
   final List<String> enabledTests = new ArrayList<String>();
   for (String pattern : myPattern) {
     enabledTests.add(pattern);
   }
   return StringUtil.join(enabledTests, "||");
 }
コード例 #2
0
 private static void buildPythonPath(
     Project project, GeneralCommandLine commandLine, PythonRunParams config) {
   Sdk pythonSdk = PythonSdkType.findSdkByPath(config.getSdkHome());
   if (pythonSdk != null) {
     List<String> pathList = Lists.newArrayList(getAddedPaths(pythonSdk));
     pathList.addAll(collectPythonPath(project, config));
     initPythonPath(commandLine, config.isPassParentEnvs(), pathList, config.getSdkHome());
   }
 }
コード例 #3
0
  public ExecutionResult execute(Executor executor, CommandLinePatcher... patchers)
      throws ExecutionException {
    final ProcessHandler processHandler = startProcess(patchers);
    final ConsoleView console =
        createAndAttachConsole(myConfig.getProject(), processHandler, executor);

    List<AnAction> actions = Lists.newArrayList(createActions(console, processHandler));

    return new DefaultExecutionResult(
        console, processHandler, actions.toArray(new AnAction[actions.size()]));
  }
コード例 #4
0
ファイル: MvcFramework.java プロジェクト: Zeratyl-SK/consulo
 private static void removeModuleOutput(Module module, List<VirtualFile> from) {
   CompilerPathsManager compilerPathsManager =
       CompilerPathsManager.getInstance(module.getProject());
   for (ContentFolderType contentFolderType : ContentFolderType.ALL_SOURCE_ROOTS) {
     from.remove(compilerPathsManager.getCompilerOutput(module, contentFolderType));
   }
 }
コード例 #5
0
ファイル: MvcFramework.java プロジェクト: Zeratyl-SK/consulo
 private static void retainOnlyJarsAndDirectories(List<VirtualFile> woSdk) {
   for (Iterator<VirtualFile> iterator = woSdk.iterator(); iterator.hasNext(); ) {
     VirtualFile file = iterator.next();
     final VirtualFile local = ArchiveVfsUtil.getVirtualFileForJar(file);
     final boolean dir = file.isDirectory();
     final String name = file.getName();
     if (LOG.isDebugEnabled()) {
       LOG.debug(
           "Considering: "
               + file.getPath()
               + "; local="
               + local
               + "; dir="
               + dir
               + "; name="
               + name);
     }
     if (dir || local != null) {
       continue;
     }
     if (name.endsWith(".jar")) {
       continue;
     }
     LOG.debug("Removing");
     iterator.remove();
   }
 }
コード例 #6
0
  @Override
  public void readExternal(Element element) throws InvalidDataException {
    PathMacroManager.getInstance(getProject()).expandPaths(element);
    super.readExternal(element);
    JavaRunConfigurationExtensionManager.getInstance().readExternal(this, element);
    readModule(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<String>();
      for (Object o : patternsElement.getChildren(PATTERN_EL_NAME)) {
        Element patternElement = (Element) o;
        tests.add(patternElement.getAttributeValue(TEST_CLASS_ATT_NAME));
      }
      getPersistantData().setPatterns(tests);
    }
  }
コード例 #7
0
ファイル: MvcFramework.java プロジェクト: Zeratyl-SK/consulo
  protected List<File> getImplicitClasspathRoots(@NotNull Module module) {
    final List<File> toExclude = new ArrayList<File>();

    VirtualFile sdkRoot = getSdkRoot(module);
    if (sdkRoot != null) toExclude.add(VfsUtil.virtualToIoFile(sdkRoot));

    ContainerUtil.addIfNotNull(getCommonPluginsDir(module), toExclude);
    final VirtualFile appRoot = findAppRoot(module);
    if (appRoot != null) {
      VirtualFile pluginDir = appRoot.findChild(MvcModuleStructureUtil.PLUGINS_DIRECTORY);
      if (pluginDir != null) toExclude.add(VfsUtil.virtualToIoFile(pluginDir));

      VirtualFile libDir = appRoot.findChild("lib");
      if (libDir != null) toExclude.add(VfsUtil.virtualToIoFile(libDir));
    }

    final Library library = MvcModuleStructureUtil.findUserLibrary(module, getUserLibraryName());
    if (library != null) {
      for (VirtualFile file : library.getFiles(OrderRootType.CLASSES)) {
        toExclude.add(VfsUtil.virtualToIoFile(PathUtil.getLocalFile(file)));
      }
    }
    return toExclude;
  }
コード例 #8
0
 private static void removeModuleOutput(Module module, List<VirtualFile> from) {
   final CompilerModuleExtension extension =
       ModuleRootManager.getInstance(module).getModuleExtension(CompilerModuleExtension.class);
   from.remove(extension.getCompilerOutputPath());
   from.remove(extension.getCompilerOutputPathForTests());
 }