// Test that the jar content ordering when processing a single directory is sorted
@Test publicvoid testSingleDir() throws IOException {
mkdir("testjar/Ctest1", "testjar/Btest2/subdir1", "testjar/Atest3");
touch("testjar/Ctest1/testfile1", "testjar/Ctest1/testfile2", "testjar/Ctest1/testfile3");
touch("testjar/Btest2/subdir1/testfileC", "testjar/Btest2/subdir1/testfileB", "testjar/Btest2/subdir1/testfileA");
touch("testjar/Atest3/fileZ", "testjar/Atest3/fileY", "testjar/Atest3/fileX");
// Test that when specifying multiple directories or releases that the sort // ordering is done on each directory and release, reserving the order of // the directories/releases specified on the command line
@Test publicvoid testMultiDirWithReleases() throws IOException {
mkdir("testjar/foo/classes", "testjar/foo11/classes/Zclasses", "testjar/foo11/classes/Yclasses", "testjar/foo17/classes/Bclasses", "testjar/foo17/classes/Aclasses");
touch("testjar/foo/classes/testfile1", "testjar/foo/classes/testfile2");
touch("testjar/foo11/classes/Zclasses/testfile1", "testjar/foo11/classes/Zclasses/testfile2");
touch("testjar/foo11/classes/Yclasses/testfileA", "testjar/foo11/classes/Yclasses/testfileB");
touch("testjar/foo17/classes/Bclasses/testfile1", "testjar/foo17/classes/Bclasses/testfile2");
touch("testjar/foo17/classes/Aclasses/testfileA", "testjar/foo17/classes/Aclasses/testfileB");
// the run method catches IOExceptions, we need to expose them
ByteArrayOutputStream baes = new ByteArrayOutputStream();
PrintStream err = new PrintStream(baes);
PrintStream saveErr = System.err;
System.setErr(err); int rc = JAR_TOOL.run(out, err, cmdline.split(" +"));
System.setErr(saveErr); if (rc != 0) {
String s = baes.toString(); if (s.startsWith("java.util.zip.ZipException: duplicate entry: ")) { thrownew ZipException(s);
} thrownew IOException(s);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-09)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.