diff options
Diffstat (limited to 'org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java')
-rw-r--r-- | org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java index 35467c6304..6f32bfaa52 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java @@ -348,7 +348,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitBazAndFooSlashBar(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x/ --format=zip master", db).outBytes(); - String[] expect = { "x/baz", "x/foo/", "x/foo/bar" }; + String[] expect = { "x/", "x/baz", "x/foo/", "x/foo/bar" }; String[] actual = listZipEntries(result); Arrays.sort(expect); @@ -361,7 +361,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitBazAndFooSlashBar(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x/ --format=tar master", db).outBytes(); - String[] expect = { "x/baz", "x/foo/", "x/foo/bar" }; + String[] expect = { "x/", "x/baz", "x/foo/", "x/foo/bar" }; String[] actual = listTarEntries(result); Arrays.sort(expect); @@ -380,7 +380,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitFoo(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x// --format=zip master", db).outBytes(); - String[] expect = { "x//foo" }; + String[] expect = { "x/", "x//foo" }; assertArrayEquals(expect, listZipEntries(result)); } @@ -389,7 +389,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { commitFoo(); byte[] result = CLIGitCommand.executeRaw( "git archive --prefix=x// --format=tar master", db).outBytes(); - String[] expect = { "x//foo" }; + String[] expect = { "x/", "x//foo" }; assertArrayEquals(expect, listTarEntries(result)); } @@ -529,7 +529,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { @Test public void testArchiveWithLongFilename() throws Exception { StringBuilder filename = new StringBuilder(); - List<String> l = new ArrayList<String>(); + List<String> l = new ArrayList<>(); for (int i = 0; i < 20; i++) { filename.append("1234567890/"); l.add(filename.toString()); @@ -549,7 +549,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { @Test public void testTarWithLongFilename() throws Exception { StringBuilder filename = new StringBuilder(); - List<String> l = new ArrayList<String>(); + List<String> l = new ArrayList<>(); for (int i = 0; i < 20; i++) { filename.append("1234567890/"); l.add(filename.toString()); @@ -691,7 +691,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { } private static String[] listZipEntries(byte[] zipData) throws IOException { - List<String> l = new ArrayList<String>(); + List<String> l = new ArrayList<>(); ZipInputStream in = new ZipInputStream( new ByteArrayInputStream(zipData)); @@ -706,6 +706,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { ExecutorService executor = Executors.newSingleThreadExecutor(); return executor.submit(new Callable<Object>() { + @Override public Object call() throws IOException { try { stream.write(data); @@ -718,7 +719,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { } private String[] listTarEntries(byte[] tarData) throws Exception { - List<String> l = new ArrayList<String>(); + List<String> l = new ArrayList<>(); Process proc = spawnAssumingCommandPresent("tar", "tf", "-"); BufferedReader reader = readFromProcess(proc); OutputStream out = proc.getOutputStream(); @@ -749,7 +750,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { continue; // found! - List<String> l = new ArrayList<String>(); + List<String> l = new ArrayList<>(); BufferedReader reader = new BufferedReader( new InputStreamReader(in, "UTF-8")); String line; @@ -764,7 +765,7 @@ public class ArchiveTest extends CLIRepositoryTestCase { private String[] tarEntryContent(byte[] tarData, String path) throws Exception { - List<String> l = new ArrayList<String>(); + List<String> l = new ArrayList<>(); Process proc = spawnAssumingCommandPresent("tar", "Oxf", "-", path); BufferedReader reader = readFromProcess(proc); OutputStream out = proc.getOutputStream(); |