Exemplo n.º 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);
 }
Exemplo n.º 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);
    }
  }
Exemplo n.º 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());
  }
Exemplo n.º 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));
  }
Exemplo n.º 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));
  }
Exemplo n.º 6
0
 protected void readProjects(List<VirtualFile> files, String... profiles) {
   myProjectsManager.resetManagedFilesAndProfilesInTests(files, Arrays.asList(profiles));
   waitForReadingCompletion();
 }
Exemplo n.º 7
0
 protected void importProjects(VirtualFile... files) {
   doImportProjects(Arrays.asList(files));
 }
Exemplo n.º 8
0
 protected void assertContentRootExcludes(
     String moduleName, String contentRoot, String... expectedExcudes) {
   ContentEntry root = getContentRoot(moduleName, contentRoot);
   doAssertContentFolders(root, Arrays.asList(root.getExcludeFolders()), expectedExcudes);
 }