aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2011-08-18 03:43:38 -0400
committerCode Review <codereview-daemon@eclipse.org>2011-08-18 03:43:38 -0400
commit12bb76380fa48c47ef00565f9af20df9df0871f7 (patch)
tree55f8b4d23a5597ea0996c9a5559a3bb8323bcd8e /org.eclipse.jgit.test/tst
parenta7aaf88b2e573ecd998afaa5852c1835990755a6 (diff)
parent74333e63b60440be5ff9f591f2203b635e26e3a0 (diff)
downloadjgit-12bb76380fa48c47ef00565f9af20df9df0871f7.tar.gz
jgit-12bb76380fa48c47ef00565f9af20df9df0871f7.zip
Merge "PackWriter: Make want/have actual sets"
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java
index fb78ec02c7..b609b4766b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java
@@ -55,11 +55,11 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
-import java.util.LinkedList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.junit.JGitTestUtil;
@@ -79,8 +79,8 @@ import org.junit.Test;
public class PackWriterTest extends SampleDataRepositoryTestCase {
- private static final List<ObjectId> EMPTY_LIST_OBJECT = Collections
- .<ObjectId> emptyList();
+ private static final Set<ObjectId> EMPTY_SET_OBJECT = Collections
+ .<ObjectId> emptySet();
private static final List<RevObject> EMPTY_LIST_REVS = Collections
.<RevObject> emptyList();
@@ -162,7 +162,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
*/
@Test
public void testWriteEmptyPack1() throws IOException {
- createVerifyOpenPack(EMPTY_LIST_OBJECT, EMPTY_LIST_OBJECT, false, false);
+ createVerifyOpenPack(EMPTY_SET_OBJECT, EMPTY_SET_OBJECT, false, false);
assertEquals(0, writer.getObjectCount());
assertEquals(0, pack.getObjectCount());
@@ -195,7 +195,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
final ObjectId nonExisting = ObjectId
.fromString("0000000000000000000000000000000000000001");
try {
- createVerifyOpenPack(EMPTY_LIST_OBJECT, Collections.nCopies(1,
+ createVerifyOpenPack(EMPTY_SET_OBJECT, Collections.singleton(
nonExisting), false, false);
fail("Should have thrown MissingObjectException");
} catch (MissingObjectException x) {
@@ -212,7 +212,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
public void testIgnoreNonExistingObjects() throws IOException {
final ObjectId nonExisting = ObjectId
.fromString("0000000000000000000000000000000000000001");
- createVerifyOpenPack(EMPTY_LIST_OBJECT, Collections.nCopies(1,
+ createVerifyOpenPack(EMPTY_SET_OBJECT, Collections.singleton(
nonExisting), false, true);
// shouldn't throw anything
}
@@ -451,10 +451,10 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
// TODO: testWritePackDeltasDepth()
private void writeVerifyPack1() throws IOException {
- final LinkedList<ObjectId> interestings = new LinkedList<ObjectId>();
+ final HashSet<ObjectId> interestings = new HashSet<ObjectId>();
interestings.add(ObjectId
.fromString("82c6b885ff600be425b4ea96dee75dca255b69e7"));
- createVerifyOpenPack(interestings, EMPTY_LIST_OBJECT, false, false);
+ createVerifyOpenPack(interestings, EMPTY_SET_OBJECT, false, false);
final ObjectId expectedOrder[] = new ObjectId[] {
ObjectId.fromString("82c6b885ff600be425b4ea96dee75dca255b69e7"),
@@ -474,10 +474,10 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
private void writeVerifyPack2(boolean deltaReuse) throws IOException {
config.setReuseDeltas(deltaReuse);
- final LinkedList<ObjectId> interestings = new LinkedList<ObjectId>();
+ final HashSet<ObjectId> interestings = new HashSet<ObjectId>();
interestings.add(ObjectId
.fromString("82c6b885ff600be425b4ea96dee75dca255b69e7"));
- final LinkedList<ObjectId> uninterestings = new LinkedList<ObjectId>();
+ final HashSet<ObjectId> uninterestings = new HashSet<ObjectId>();
uninterestings.add(ObjectId
.fromString("540a36d136cf413e4b064c2b0e0a4db60f77feab"));
createVerifyOpenPack(interestings, uninterestings, false, false);
@@ -502,10 +502,10 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
}
private void writeVerifyPack4(final boolean thin) throws IOException {
- final LinkedList<ObjectId> interestings = new LinkedList<ObjectId>();
+ final HashSet<ObjectId> interestings = new HashSet<ObjectId>();
interestings.add(ObjectId
.fromString("82c6b885ff600be425b4ea96dee75dca255b69e7"));
- final LinkedList<ObjectId> uninterestings = new LinkedList<ObjectId>();
+ final HashSet<ObjectId> uninterestings = new HashSet<ObjectId>();
uninterestings.add(ObjectId
.fromString("c59759f143fb1fe21c197981df75a7ee00290799"));
createVerifyOpenPack(interestings, uninterestings, thin, false);
@@ -531,8 +531,8 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
.computeName().name());
}
- private void createVerifyOpenPack(final Collection<ObjectId> interestings,
- final Collection<ObjectId> uninterestings, final boolean thin,
+ private void createVerifyOpenPack(final Set<ObjectId> interestings,
+ final Set<ObjectId> uninterestings, final boolean thin,
final boolean ignoreMissingUninteresting)
throws MissingObjectException, IOException {
NullProgressMonitor m = NullProgressMonitor.INSTANCE;