public void testExtractDirectoryFromExcludedJar() throws IOException {
   String jarPath = createFile("dir/lib/j.jar");
   FileUtil.copy(new File(getJUnitJarPath()), new File(jarPath));
   JpsModule module = addModule("m");
   String libDir = PathUtil.getParentPath(jarPath);
   module.getContentRootsList().addUrl(JpsPathUtil.pathToUrl(PathUtil.getParentPath(libDir)));
   module.getExcludeRootsList().addUrl(JpsPathUtil.pathToUrl(libDir));
   final JpsArtifact a = addArtifact("a", root().extractedDir(jarPath, "/junit/textui/"));
   buildAll();
   assertOutput(a, fs().file("ResultPrinter.class").file("TestRunner.class"));
 }
  public void testCopyExcludedFile() {
    // excluded files under non-excluded directory should not be copied
    final String file = createFile("xxx/excluded/a.txt");
    createFile("xxx/b.txt");
    createFile("xxx/CVS");
    final String dir = PathUtil.getParentPath(PathUtil.getParentPath(file));

    JpsModule module = addModule("myModule");
    module.getContentRootsList().addUrl(JpsPathUtil.pathToUrl(dir));
    module.getExcludeRootsList().addUrl(JpsPathUtil.pathToUrl(PathUtil.getParentPath(file)));

    final JpsArtifact a = addArtifact(root().dirCopy(dir));
    buildAll();
    assertOutput(a, fs().file("b.txt"));
  }
  public void testCopyExcludedFolder() {
    // explicitly added excluded files should be copied (e.g. compile output)
    final String file = createFile("xxx/excluded/a.txt");
    createFile("xxx/excluded/CVS");
    final String excluded = PathUtil.getParentPath(file);
    final String dir = PathUtil.getParentPath(excluded);

    final JpsModule module = addModule("myModule");
    module.getContentRootsList().addUrl(JpsPathUtil.pathToUrl(dir));
    module.getExcludeRootsList().addUrl(JpsPathUtil.pathToUrl(excluded));

    final JpsArtifact a = addArtifact(root().dirCopy(excluded));
    buildAll();
    assertOutput(a, fs().file("a.txt"));
  }