summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/PackWriterTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefUpdateTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogReaderTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java22
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SampleDataRepositoryTestCase.java77
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0002_Tree.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0004_PackReader.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0008_testparserev.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/WindowCacheGetTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/BundleWriterTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java4
16 files changed, 97 insertions, 40 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/PackWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/PackWriterTest.java
index 7032907496..ca626d4db5 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/PackWriterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/PackWriterTest.java
@@ -65,7 +65,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.transport.IndexPack;
import org.eclipse.jgit.util.JGitTestUtil;
-public class PackWriterTest extends RepositoryTestCase {
+public class PackWriterTest extends SampleDataRepositoryTestCase {
private static final List<ObjectId> EMPTY_LIST_OBJECT = Collections
.<ObjectId> emptyList();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java
index d7b6193ce1..67ed6abb21 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java
@@ -56,7 +56,7 @@ import org.eclipse.jgit.lib.RefUpdate.Result;
* Misc tests for refs. A lot of things are tested elsewhere so not having a
* test for a ref related method, does not mean it is untested.
*/
-public class RefTest extends RepositoryTestCase {
+public class RefTest extends SampleDataRepositoryTestCase {
public void testReadAllIncludingSymrefs() throws Exception {
ObjectId masterId = db.resolve("refs/heads/master");
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefUpdateTest.java
index 3704c56173..fa77c6a8d2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefUpdateTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefUpdateTest.java
@@ -54,7 +54,7 @@ import org.eclipse.jgit.lib.RefUpdate.Result;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
-public class RefUpdateTest extends RepositoryTestCase {
+public class RefUpdateTest extends SampleDataRepositoryTestCase {
private RefUpdate updateRef(final String name) throws IOException {
final RefUpdate ref = db.updateRef(name);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
index f3b150fa45..8e5f6fc83b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
@@ -54,8 +54,7 @@ public class ReflogConfigTest extends RepositoryTestCase {
// check that there are no entries in the reflog and turn off writing
// reflogs
- assertTrue("there should be no entries in reflog", db.getReflogReader(
- Constants.HEAD).getReverseEntries().size() == 0);
+ assertNull(db.getReflogReader(Constants.HEAD));
db.getConfig().setBoolean("core", null, "logallrefupdates", false);
// do one commit and check that reflog size is 0: no reflogs should be
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogReaderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogReaderTest.java
index 1f2f25d5e2..6144851fcd 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogReaderTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogReaderTest.java
@@ -53,7 +53,7 @@ import java.util.List;
import org.eclipse.jgit.lib.ReflogReader.Entry;
-public class ReflogReaderTest extends RepositoryTestCase {
+public class ReflogReaderTest extends SampleDataRepositoryTestCase {
static byte[] oneLine = "da85355dfc525c9f6f3927b876f379f46ccf826e 3e7549db262d1e836d9bf0af7e22355468f1717c A O Thor Too <authortoo@wri.tr> 1243028200 +0200\tcommit: Add a toString for debugging to RemoteRefUpdate\n"
.getBytes();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java
index ecbb7e073a..c5c6d998bb 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java
@@ -1,7 +1,6 @@
/*
* Copyright (C) 2009, Google Inc.
- * Copyright (C) 2008-2009, Jonas Fonseca <fonseca@diku.dk>
- * Copyright (C) 2007-2009, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2007-2008, Robin Rosenberg <robin.rosenberg@dewire.com>
* Copyright (C) 2006-2007, Shawn O. Pearce <spearce@spearce.org>
* Copyright (C) 2009, Yann Simon <yann.simon.fr@gmail.com>
* and other copyright owners as documented in the project's IP log.
@@ -55,7 +54,6 @@ import java.io.InputStreamReader;
import java.io.Reader;
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
-import org.eclipse.jgit.util.JGitTestUtil;
/**
* Base class for most JGit unit tests.
@@ -114,23 +112,5 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
super.setUp();
db = createWorkRepository();
trash = db.getWorkDir();
-
- final String[] packs = {
- "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f",
- "pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371",
- "pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745",
- "pack-546ff360fe3488adb20860ce3436a2d6373d2796",
- "pack-cbdeda40019ae0e6e789088ea0f51f164f489d14",
- "pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa",
- "pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12"
- };
- final File packDir = new File(db.getObjectsDirectory(), "pack");
- for (String n : packs) {
- copyFile(JGitTestUtil.getTestResourceFile(n + ".pack"), new File(packDir, n + ".pack"));
- copyFile(JGitTestUtil.getTestResourceFile(n + ".idx"), new File(packDir, n + ".idx"));
- }
-
- copyFile(JGitTestUtil.getTestResourceFile("packed-refs"), new File(db
- .getDirectory(), "packed-refs"));
}
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SampleDataRepositoryTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SampleDataRepositoryTestCase.java
new file mode 100644
index 0000000000..10c005679b
--- /dev/null
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SampleDataRepositoryTestCase.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2009, Google Inc.
+ * Copyright (C) 2008-2009, Jonas Fonseca <fonseca@diku.dk>
+ * Copyright (C) 2007-2009, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2006-2007, Shawn O. Pearce <spearce@spearce.org>
+ * and other copyright owners as documented in the project's IP log.
+ *
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Distribution License v1.0 which
+ * accompanies this distribution, is reproduced below, and is
+ * available at http://www.eclipse.org/org/documents/edl-v10.php
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Eclipse Foundation, Inc. nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.eclipse.jgit.lib;
+
+import java.io.File;
+
+import org.eclipse.jgit.util.JGitTestUtil;
+
+/** Test case which includes C Git generated pack files for testing. */
+public abstract class SampleDataRepositoryTestCase extends RepositoryTestCase {
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ final String[] packs = {
+ "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f",
+ "pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371",
+ "pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745",
+ "pack-546ff360fe3488adb20860ce3436a2d6373d2796",
+ "pack-cbdeda40019ae0e6e789088ea0f51f164f489d14",
+ "pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa",
+ "pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12"
+ };
+ final File packDir = new File(db.getObjectsDirectory(), "pack");
+ for (String n : packs) {
+ copyFile(JGitTestUtil.getTestResourceFile(n + ".pack"), new File(packDir, n + ".pack"));
+ copyFile(JGitTestUtil.getTestResourceFile(n + ".idx"), new File(packDir, n + ".idx"));
+ }
+
+ copyFile(JGitTestUtil.getTestResourceFile("packed-refs"), new File(db
+ .getDirectory(), "packed-refs"));
+ }
+}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0002_Tree.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0002_Tree.java
index 66c3c75f18..7731880fd6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0002_Tree.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0002_Tree.java
@@ -49,7 +49,7 @@ import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
-public class T0002_Tree extends RepositoryTestCase {
+public class T0002_Tree extends SampleDataRepositoryTestCase {
private static final ObjectId SOME_FAKE_ID = ObjectId.fromString(
"0123456789abcdef0123456789abcdef01234567");
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java
index f7346a61fb..d1dfdf4fae 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java
@@ -55,7 +55,7 @@ import java.io.PrintWriter;
import org.eclipse.jgit.errors.ConfigInvalidException;
-public class T0003_Basic extends RepositoryTestCase {
+public class T0003_Basic extends SampleDataRepositoryTestCase {
public void test001_Initalize() {
final File gitdir = new File(trash, ".git");
final File objects = new File(gitdir, "objects");
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0004_PackReader.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0004_PackReader.java
index be801e4940..b78b7b8554 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0004_PackReader.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0004_PackReader.java
@@ -51,7 +51,7 @@ import java.io.IOException;
import org.eclipse.jgit.util.JGitTestUtil;
-public class T0004_PackReader extends RepositoryTestCase {
+public class T0004_PackReader extends SampleDataRepositoryTestCase {
private static final String PACK_NAME = "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f";
private static final File TEST_PACK = JGitTestUtil.getTestResourceFile(PACK_NAME + ".pack");
private static final File TEST_IDX = JGitTestUtil.getTestResourceFile(PACK_NAME + ".idx");
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0008_testparserev.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0008_testparserev.java
index ac730ff6a2..ba8dbdb7b8 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0008_testparserev.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0008_testparserev.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2009, Google Inc.
* Copyright (C) 2008, Jonas Fonseca <fonseca@diku.dk>
* Copyright (C) 2007-2008, Robin Rosenberg <robin.rosenberg@dewire.com>
* Copyright (C) 2006, Shawn O. Pearce <spearce@spearce.org>
@@ -47,7 +48,7 @@ package org.eclipse.jgit.lib;
import java.io.IOException;
-public class T0008_testparserev extends RepositoryTestCase {
+public class T0008_testparserev extends SampleDataRepositoryTestCase {
public void testObjectId_existing() throws IOException {
assertEquals("49322bb17d3acc9146f98c97d078513228bbf3c0",db.resolve("49322bb17d3acc9146f98c97d078513228bbf3c0").name());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/WindowCacheGetTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/WindowCacheGetTest.java
index 55b568d8fd..8ff022ddc4 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/WindowCacheGetTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/WindowCacheGetTest.java
@@ -54,7 +54,7 @@ import org.eclipse.jgit.errors.CorruptObjectException;
import org.eclipse.jgit.util.JGitTestUtil;
import org.eclipse.jgit.util.MutableInteger;
-public class WindowCacheGetTest extends RepositoryTestCase {
+public class WindowCacheGetTest extends SampleDataRepositoryTestCase {
private List<TestObject> toLoad;
@Override
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java
index 0e50220067..690b166cbc 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java
@@ -56,10 +56,10 @@ import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectWriter;
import org.eclipse.jgit.lib.PersonIdent;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
import org.eclipse.jgit.treewalk.TreeWalk;
-public class SimpleMergeTest extends RepositoryTestCase {
+public class SimpleMergeTest extends SampleDataRepositoryTestCase {
public void testOurs() throws IOException {
Merger ourMerger = MergeStrategy.OURS.newMerger(db);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/BundleWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/BundleWriterTest.java
index 39ea2f2e42..2d6aa28d5a 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/BundleWriterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/BundleWriterTest.java
@@ -60,11 +60,11 @@ import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
-public class BundleWriterTest extends RepositoryTestCase {
+public class BundleWriterTest extends SampleDataRepositoryTestCase {
public void testWrite0() throws Exception {
// Create a tiny bundle, (well one of) the first commits only
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java
index 4a47456f69..8e997e3f8c 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java
@@ -54,12 +54,12 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
import org.eclipse.jgit.lib.TextProgressMonitor;
import org.eclipse.jgit.lib.RefUpdate.Result;
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
-public class PushProcessTest extends RepositoryTestCase {
+public class PushProcessTest extends SampleDataRepositoryTestCase {
private PushProcess process;
private MockTransport transport;
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java
index 75e661bcf9..e3518251fe 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java
@@ -49,9 +49,9 @@ import java.util.Collection;
import java.util.Collections;
import org.eclipse.jgit.lib.RepositoryConfig;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
-public class TransportTest extends RepositoryTestCase {
+public class TransportTest extends SampleDataRepositoryTestCase {
private Transport transport;
private RemoteConfig remoteConfig;