コード例 #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);
 }