use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testExtractFileFromNonExistentJar.
public void testExtractFileFromNonExistentJar() throws IOException {
String jar = getAbsolutePath("junit.jar");
JpsArtifact a = addArtifact(root().extractedDir(jar, "/junit/textui/"));
buildArtifacts(a);
assertEmptyOutput(a);
buildAllAndAssertUpToDate();
FileUtil.copy(new File(getJUnitJarPath()), new File(jar));
buildArtifacts(a);
assertOutput(a, fs().file("ResultPrinter.class").file("TestRunner.class"));
buildAllAndAssertUpToDate();
delete(jar);
buildArtifacts(a);
assertEmptyOutput(a);
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testRenameFile.
public void testRenameFile() throws Exception {
final String file = createFile("a/a.txt");
final JpsArtifact a = addArtifact(root().parentDirCopy(file));
buildAll();
assertOutput(a, fs().file("a.txt"));
rename(file, "b.txt");
buildAll();
assertOutput(a, fs().file("b.txt"));
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testUpdateFileIfCaseOfLetterInNameChanged.
//IDEADEV-25840
public void testUpdateFileIfCaseOfLetterInNameChanged() throws Exception {
final String file = createFile("a/a.txt");
final JpsArtifact a = addArtifact("a", root().parentDirCopy(file));
buildAll();
assertOutput(a, fs().file("a.txt"));
rename(file, "A.txt");
buildAll();
assertOutput(a, fs().file("A.txt"));
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method _testFilesCopiedToTwoDifferentPlacesInArtifact.
//todo[nik] fix
//ZD-51993
public void _testFilesCopiedToTwoDifferentPlacesInArtifact() {
final String fileA = createFile("res/a.txt", "0");
final String fileB = createFile("res/b.txt", "0");
String dir = PathUtil.getParentPath(fileA);
JpsArtifact a = addArtifact("a", root().dir("d").dirCopy(dir).end().archive("a.zip").dirCopy(dir));
buildAll();
change(fileA, "1");
buildAll();
assertOutput(a, fs().dir("d").file("a.txt", "1").file("b.txt", "0").end().archive("a.zip").file("a.txt", "1").file("b.txt", "0"));
change(fileB, "1");
buildAll();
assertOutput(a, fs().dir("d").file("a.txt", "1").file("b.txt", "1").end().archive("a.zip").file("a.txt", "1").file("b.txt", "1"));
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testPackChangedFile.
public void testPackChangedFile() {
String file1 = createFile("dir/a.txt", "aaa");
createFile("dir/b.txt", "bbb");
final JpsArtifact a = addArtifact(archive("a.jar").parentDirCopy(file1));
buildAll();
assertOutput(a, fs().archive("a.jar").file("a.txt", "aaa").file("b.txt", "bbb"));
buildAllAndAssertUpToDate();
change(file1, "xxx");
buildAll();
assertDeletedAndCopied("out/artifacts/a/a.jar", "dir/a.txt", "dir/b.txt");
assertOutput(a, fs().archive("a.jar").file("a.txt", "xxx").file("b.txt", "bbb"));
buildAllAndAssertUpToDate();
}
Aggregations