Пример #1
0
 private static void assertModuleLibDepPath(
     LibraryOrderEntry lib, OrderRootType type, List<String> paths) {
   if (paths == null) return;
   assertUnorderedPathsAreEqual(Arrays.asList(lib.getRootUrls(type)), paths);
   // also check the library because it may contain slight different set of urls (e.g. with
   // duplicates)
   assertUnorderedPathsAreEqual(Arrays.asList(lib.getLibrary().getUrls(type)), paths);
 }
Пример #2
0
  protected void assertModuleGroupPath(String moduleName, String... expected) {
    String[] path = ModuleManager.getInstance(myProject).getModuleGroupPath(getModule(moduleName));

    if (expected.length == 0) {
      assertNull(path);
    } else {
      assertNotNull(path);
      assertOrderedElementsAreEqual(Arrays.asList(path), expected);
    }
  }
Пример #3
0
  protected void executeGoal(String relativePath, String goal) {
    VirtualFile dir = myProjectRoot.findFileByRelativePath(relativePath);

    MavenRunnerParameters rp =
        new MavenRunnerParameters(true, dir.getPath(), Arrays.asList(goal), null);
    MavenRunnerSettings rs = new MavenRunnerSettings();
    MavenExecutor e =
        new MavenExternalExecutor(
            myProject, rp, getMavenGeneralSettings(), rs, new SoutMavenConsole());

    e.execute(new EmptyProgressIndicator());
  }
Пример #4
0
  protected void assertContentRoots(String moduleName, String... expectedRoots) {
    List<String> actual = new ArrayList<String>();
    for (ContentEntry e : getContentRoots(moduleName)) {
      actual.add(e.getUrl());
    }

    for (int i = 0; i < expectedRoots.length; i++) {
      expectedRoots[i] = VfsUtil.pathToUrl(expectedRoots[i]);
    }

    assertUnorderedPathsAreEqual(actual, Arrays.asList(expectedRoots));
  }
Пример #5
0
  private static void doAssertContentFolders(
      ContentEntry e, final List<? extends ContentFolder> folders, String... expected) {
    List<String> actual = new ArrayList<String>();
    for (ContentFolder f : folders) {
      String rootUrl = e.getUrl();
      String folderUrl = f.getUrl();

      if (folderUrl.startsWith(rootUrl)) {
        int length = rootUrl.length() + 1;
        folderUrl = folderUrl.substring(Math.min(length, folderUrl.length()));
      }

      actual.add(folderUrl);
    }

    assertOrderedElementsAreEqual(actual, Arrays.asList(expected));
  }
Пример #6
0
 protected void readProjects(List<VirtualFile> files, String... profiles) {
   myProjectsManager.resetManagedFilesAndProfilesInTests(files, Arrays.asList(profiles));
   waitForReadingCompletion();
 }
Пример #7
0
 protected void importProjects(VirtualFile... files) {
   doImportProjects(Arrays.asList(files));
 }
Пример #8
0
 protected void assertContentRootExcludes(
     String moduleName, String contentRoot, String... expectedExcudes) {
   ContentEntry root = getContentRoot(moduleName, contentRoot);
   doAssertContentFolders(root, Arrays.asList(root.getExcludeFolders()), expectedExcudes);
 }