]> source.dussan.org Git - jgit.git/commitdiff
Move base test classes to the junit bundle for reuse for Java 7 tests 02/9402/8
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Sun, 30 Dec 2012 12:31:07 +0000 (13:31 +0100)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Mon, 4 Feb 2013 06:24:56 +0000 (07:24 +0100)
Change-Id: Iedb54eb9d8396bc3ae66d8754c1527fd9ca655f9

117 files changed:
org.eclipse.jgit.junit/META-INF/MANIFEST.MF
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java [new file with mode: 0644]
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SampleDataRepositoryTestCase.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BlameCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BranchCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CleanCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitAndLogCommandTests.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CommitOnlyTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/DiffCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/FetchCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/GarbageCollectCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/GitConstructionTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/HugeFileTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/InitCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LogCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LsRemoteCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NotesCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandWithRebaseTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PushCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ReflogCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RenameBranchCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RevertCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RmCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashApplyCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashCreateCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashDropCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StashListCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StatusCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/TagCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/blame/BlameGeneratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffEntryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/PatchIdDiffFormatterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/events/ConfigChangeEventTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreNodeTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/BranchTrackingStatusTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutMaliciousPathTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexModificationTimesTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/MergeHeadMsgTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RacyGitTests.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RefTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogConfigTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ReflogResolveTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryCacheTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryResolveTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java [deleted file]
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SampleDataRepositoryTestCase.java [deleted file]
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SquashCommitMsgTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0002_TreeTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/ResolveMergerTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SquashMessageFormatterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/DefaultNoteMergerTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapMergerTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/notes/NoteMapTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitListTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/GCTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/LockFileTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ObjectDirectoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackIndexTestCase.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackReverseIndexTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/PackWriterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ReflogReaderTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0003_BasicTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0004_PackReaderTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/WindowCacheGetTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/WindowCacheReconfigureTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleStatusTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/BundleWriterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushProcessTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/ForPathTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/NameConflictTreeWalkTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/TreeWalkBasicDiffTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/IndexDiffFilterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/NotTreeFilterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/TreeFilterTest.java

index d937398a02045e17c3f399837b407803450ed2f4..21db4579a48581732a91c0a3b8e80c4a62c18288 100644 (file)
@@ -7,7 +7,9 @@ Bundle-Localization: plugin
 Bundle-Vendor: %provider_name
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.jgit.diff;version="[2.3.0,2.4.0)",
+Import-Package: org.eclipse.jgit.api;version="[2.3.0,2.4.0)",
+ org.eclipse.jgit.api.errors;version="[2.3.0,2.4.0)",
+ org.eclipse.jgit.diff;version="[2.3.0,2.4.0)",
  org.eclipse.jgit.dircache;version="[2.3.0,2.4.0)",
  org.eclipse.jgit.errors;version="[2.3.0,2.4.0)",
  org.eclipse.jgit.fnmatch;version="[2.3.0,2.4.0)",
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
new file mode 100644 (file)
index 0000000..067f128
--- /dev/null
@@ -0,0 +1,498 @@
+/*
+ * Copyright (C) 2009, Google Inc.
+ * 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.
+ *
+ * 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.junit;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Map;
+import java.util.TreeSet;
+
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.dircache.DirCacheBuilder;
+import org.eclipse.jgit.dircache.DirCacheCheckout;
+import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.FileMode;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.ObjectInserter;
+import org.eclipse.jgit.lib.RefUpdate;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.storage.file.FileRepository;
+import org.eclipse.jgit.treewalk.FileTreeIterator;
+import org.eclipse.jgit.util.FileUtils;
+import org.junit.Before;
+
+/**
+ * Base class for most JGit unit tests.
+ *
+ * Sets up a predefined test repository and has support for creating additional
+ * repositories and destroying them when the tests are finished.
+ */
+public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
+       protected static void copyFile(final File src, final File dst)
+                       throws IOException {
+               final FileInputStream fis = new FileInputStream(src);
+               try {
+                       final FileOutputStream fos = new FileOutputStream(dst);
+                       try {
+                               final byte[] buf = new byte[4096];
+                               int r;
+                               while ((r = fis.read(buf)) > 0) {
+                                       fos.write(buf, 0, r);
+                               }
+                       } finally {
+                               fos.close();
+                       }
+               } finally {
+                       fis.close();
+               }
+       }
+
+       protected File writeTrashFile(final String name, final String data)
+                       throws IOException {
+               return JGitTestUtil.writeTrashFile(db, name, data);
+       }
+
+       protected File writeTrashFile(final String subdir, final String name,
+                       final String data)
+                       throws IOException {
+               return JGitTestUtil.writeTrashFile(db, subdir, name, data);
+       }
+
+       protected String read(final String name) throws IOException {
+               return JGitTestUtil.read(db, name);
+       }
+
+       protected void deleteTrashFile(final String name) throws IOException {
+               JGitTestUtil.deleteTrashFile(db, name);
+       }
+
+       protected static void checkFile(File f, final String checkData)
+                       throws IOException {
+               Reader r = new InputStreamReader(new FileInputStream(f), "ISO-8859-1");
+               try {
+                       char[] data = new char[(int) f.length()];
+                       if (f.length() !=  r.read(data))
+                               throw new IOException("Internal error reading file data from "+f);
+                       assertEquals(checkData, new String(data));
+               } finally {
+                       r.close();
+               }
+       }
+
+       /** Test repository, initialized for this test case. */
+       protected FileRepository db;
+
+       /** Working directory of {@link #db}. */
+       protected File trash;
+
+       @Override
+       @Before
+       public void setUp() throws Exception {
+               super.setUp();
+               db = createWorkRepository();
+               trash = db.getWorkTree();
+       }
+
+       public static final int MOD_TIME = 1;
+
+       public static final int SMUDGE = 2;
+
+       public static final int LENGTH = 4;
+
+       public static final int CONTENT_ID = 8;
+
+       public static final int CONTENT = 16;
+
+       public static final int ASSUME_UNCHANGED = 32;
+
+       /**
+        * Represent the state of the index in one String. This representation is
+        * useful when writing tests which do assertions on the state of the index.
+        * By default information about path, mode, stage (if different from 0) is
+        * included. A bitmask controls which additional info about
+        * modificationTimes, smudge state and length is included.
+        * <p>
+        * The format of the returned string is described with this BNF:
+        *
+        * <pre>
+        * result = ( "[" path mode stage? time? smudge? length? sha1? content? "]" )* .
+        * mode = ", mode:" number .
+        * stage = ", stage:" number .
+        * time = ", time:t" timestamp-index .
+        * smudge = "" | ", smudged" .
+        * length = ", length:" number .
+        * sha1 = ", sha1:" hex-sha1 .
+        * content = ", content:" blob-data .
+        * </pre>
+        *
+        * 'stage' is only presented when the stage is different from 0. All
+        * reported time stamps are mapped to strings like "t0", "t1", ... "tn". The
+        * smallest reported time-stamp will be called "t0". This allows to write
+        * assertions against the string although the concrete value of the time
+        * stamps is unknown.
+        *
+        * @param repo
+        *            the repository the index state should be determined for
+        *
+        * @param includedOptions
+        *            a bitmask constructed out of the constants {@link #MOD_TIME},
+        *            {@link #SMUDGE}, {@link #LENGTH}, {@link #CONTENT_ID} and
+        *            {@link #CONTENT} controlling which info is present in the
+        *            resulting string.
+        * @return a string encoding the index state
+        * @throws IllegalStateException
+        * @throws IOException
+        */
+       public String indexState(Repository repo, int includedOptions)
+                       throws IllegalStateException, IOException {
+               DirCache dc = repo.readDirCache();
+               StringBuilder sb = new StringBuilder();
+               TreeSet<Long> timeStamps = null;
+
+               // iterate once over the dircache just to collect all time stamps
+               if (0 != (includedOptions & MOD_TIME)) {
+                       timeStamps = new TreeSet<Long>();
+                       for (int i=0; i<dc.getEntryCount(); ++i)
+                               timeStamps.add(Long.valueOf(dc.getEntry(i).getLastModified()));
+               }
+
+               // iterate again, now produce the result string
+               for (int i=0; i<dc.getEntryCount(); ++i) {
+                       DirCacheEntry entry = dc.getEntry(i);
+                       sb.append("["+entry.getPathString()+", mode:" + entry.getFileMode());
+                       int stage = entry.getStage();
+                       if (stage != 0)
+                               sb.append(", stage:" + stage);
+                       if (0 != (includedOptions & MOD_TIME)) {
+                               sb.append(", time:t"+
+                                       timeStamps.headSet(Long.valueOf(entry.getLastModified())).size());
+                       }
+                       if (0 != (includedOptions & SMUDGE))
+                               if (entry.isSmudged())
+                                       sb.append(", smudged");
+                       if (0 != (includedOptions & LENGTH))
+                               sb.append(", length:"
+                                               + Integer.toString(entry.getLength()));
+                       if (0 != (includedOptions & CONTENT_ID))
+                               sb.append(", sha1:" + ObjectId.toString(entry.getObjectId()));
+                       if (0 != (includedOptions & CONTENT)) {
+                               sb.append(", content:"
+                                               + new String(db.open(entry.getObjectId(),
+                                                               Constants.OBJ_BLOB).getCachedBytes(), "UTF-8"));
+                       }
+                       if (0 != (includedOptions & ASSUME_UNCHANGED))
+                               sb.append(", assume-unchanged:"
+                                               + Boolean.toString(entry.isAssumeValid()));
+                       sb.append("]");
+               }
+               return sb.toString();
+       }
+
+       /**
+        * Represent the state of the index in one String. This representation is
+        * useful when writing tests which do assertions on the state of the index.
+        * By default information about path, mode, stage (if different from 0) is
+        * included. A bitmask controls which additional info about
+        * modificationTimes, smudge state and length is included.
+        * <p>
+        * The format of the returned string is described with this BNF:
+        *
+        * <pre>
+        * result = ( "[" path mode stage? time? smudge? length? sha1? content? "]" )* .
+        * mode = ", mode:" number .
+        * stage = ", stage:" number .
+        * time = ", time:t" timestamp-index .
+        * smudge = "" | ", smudged" .
+        * length = ", length:" number .
+        * sha1 = ", sha1:" hex-sha1 .
+        * content = ", content:" blob-data .
+        * </pre>
+        *
+        * 'stage' is only presented when the stage is different from 0. All
+        * reported time stamps are mapped to strings like "t0", "t1", ... "tn". The
+        * smallest reported time-stamp will be called "t0". This allows to write
+        * assertions against the string although the concrete value of the time
+        * stamps is unknown.
+        *
+        * @param includedOptions
+        *            a bitmask constructed out of the constants {@link #MOD_TIME},
+        *            {@link #SMUDGE}, {@link #LENGTH}, {@link #CONTENT_ID} and
+        *            {@link #CONTENT} controlling which info is present in the
+        *            resulting string.
+        * @return a string encoding the index state
+        * @throws IllegalStateException
+        * @throws IOException
+        */
+       public String indexState(int includedOptions)
+                       throws IllegalStateException, IOException {
+               return indexState(db, includedOptions);
+       }
+
+       /**
+        * Resets the index to represent exactly some filesystem content. E.g. the
+        * following call will replace the index with the working tree content:
+        * <p>
+        * <code>resetIndex(new FileSystemIterator(db))</code>
+        * <p>
+        * This method can be used by testcases which first prepare a new commit
+        * somewhere in the filesystem (e.g. in the working-tree) and then want to
+        * have an index which matches their prepared content.
+        *
+        * @param treeItr
+        *            a {@link FileTreeIterator} which determines which files should
+        *            go into the new index
+        * @throws FileNotFoundException
+        * @throws IOException
+        */
+       protected void resetIndex(FileTreeIterator treeItr)
+                       throws FileNotFoundException, IOException {
+               ObjectInserter inserter = db.newObjectInserter();
+               DirCacheBuilder builder = db.lockDirCache().builder();
+               DirCacheEntry dce;
+
+               while (!treeItr.eof()) {
+                       long len = treeItr.getEntryLength();
+
+                       dce = new DirCacheEntry(treeItr.getEntryPathString());
+                       dce.setFileMode(treeItr.getEntryFileMode());
+                       dce.setLastModified(treeItr.getEntryLastModified());
+                       dce.setLength((int) len);
+                       FileInputStream in = new FileInputStream(treeItr.getEntryFile());
+                       dce.setObjectId(inserter.insert(Constants.OBJ_BLOB, len, in));
+                       in.close();
+                       builder.add(dce);
+                       treeItr.next(1);
+               }
+               builder.commit();
+               inserter.flush();
+               inserter.release();
+       }
+
+       /**
+        * Helper method to map arbitrary objects to user-defined names. This can be
+        * used create short names for objects to produce small and stable debug
+        * output. It is guaranteed that when you lookup the same object multiple
+        * times even with different nameTemplates this method will always return
+        * the same name which was derived from the first nameTemplate.
+        * nameTemplates can contain "%n" which will be replaced by a running number
+        * before used as a name.
+        *
+        * @param l
+        *            the object to lookup
+        * @param nameTemplate
+        *            the name for that object. Can contain "%n" which will be
+        *            replaced by a running number before used as a name. If the
+        *            lookup table already contains the object this parameter will
+        *            be ignored
+        * @param lookupTable
+        *            a table storing object-name mappings.
+        * @return a name of that object. Is not guaranteed to be unique. Use
+        *         nameTemplates containing "%n" to always have unique names
+        */
+       public static String lookup(Object l, String nameTemplate,
+                       Map<Object, String> lookupTable) {
+               String name = lookupTable.get(l);
+               if (name == null) {
+                       name = nameTemplate.replaceAll("%n",
+                                       Integer.toString(lookupTable.size()));
+                       lookupTable.put(l, name);
+               }
+               return name;
+       }
+
+       /**
+        * Waits until it is guaranteed that a subsequent file modification has a
+        * younger modification timestamp than the modification timestamp of the
+        * given file. This is done by touching a temporary file, reading the
+        * lastmodified attribute and, if needed, sleeping. After sleeping this loop
+        * starts again until the filesystem timer has advanced enough.
+        *
+        * @param lastFile
+        *            the file on which we want to wait until the filesystem timer
+        *            has advanced more than the lastmodification timestamp of this
+        *            file
+        * @return return the last measured value of the filesystem timer which is
+        *         greater than then the lastmodification time of lastfile.
+        * @throws InterruptedException
+        * @throws IOException
+        */
+       public static long fsTick(File lastFile) throws InterruptedException,
+                       IOException {
+               long sleepTime = 1;
+               if (lastFile != null && !lastFile.exists())
+                       throw new FileNotFoundException(lastFile.getPath());
+               File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null);
+               try {
+                       long startTime = (lastFile == null) ? tmp.lastModified() : lastFile
+                                       .lastModified();
+                       long actTime = tmp.lastModified();
+                       while (actTime <= startTime) {
+                               Thread.sleep(sleepTime);
+                               sleepTime *= 5;
+                               tmp.setLastModified(System.currentTimeMillis());
+                               actTime = tmp.lastModified();
+                       }
+                       return actTime;
+               } finally {
+                       FileUtils.delete(tmp);
+               }
+       }
+
+       protected void createBranch(ObjectId objectId, String branchName)
+                       throws IOException {
+               RefUpdate updateRef = db.updateRef(branchName);
+               updateRef.setNewObjectId(objectId);
+               updateRef.update();
+       }
+
+       protected void checkoutBranch(String branchName)
+                       throws IllegalStateException, IOException {
+               RevWalk walk = new RevWalk(db);
+               RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD));
+               RevCommit branch = walk.parseCommit(db.resolve(branchName));
+               DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree().getId(),
+                               db.lockDirCache(), branch.getTree().getId());
+               dco.setFailOnConflict(true);
+               dco.checkout();
+               walk.release();
+               // update the HEAD
+               RefUpdate refUpdate = db.updateRef(Constants.HEAD);
+               refUpdate.link(branchName);
+       }
+
+       /**
+        * Writes a number of files in the working tree. The first content specified
+        * will be written into a file named '0', the second into a file named "1"
+        * and so on. If <code>null</code> is specified as content then this file is
+        * skipped.
+        *
+        * @param ensureDistinctTimestamps
+        *            if set to <code>true</code> then between two write operations
+        *            this method will wait to ensure that the second file will get
+        *            a different lastmodification timestamp than the first file.
+        * @param contents
+        *            the contents which should be written into the files
+        * @return the File object associated to the last written file.
+        * @throws IOException
+        * @throws InterruptedException
+        */
+       protected File writeTrashFiles(boolean ensureDistinctTimestamps,
+                       String... contents)
+                       throws IOException, InterruptedException {
+                               File f = null;
+                               for (int i = 0; i < contents.length; i++)
+                                       if (contents[i] != null) {
+                                               if (ensureDistinctTimestamps && (f != null))
+                                                       fsTick(f);
+                                               f = writeTrashFile(Integer.toString(i), contents[i]);
+                                       }
+                               return f;
+                       }
+
+       /**
+        * Commit a file with the specified contents on the specified branch,
+        * creating the branch if it didn't exist before.
+        * <p>
+        * It switches back to the original branch after the commit if there was
+        * one.
+        *
+        * @param filename
+        * @param contents
+        * @param branch
+        * @return the created commit
+        */
+       protected RevCommit commitFile(String filename, String contents, String branch) {
+               try {
+                       Git git = new Git(db);
+                       String originalBranch = git.getRepository().getFullBranch();
+                       if (git.getRepository().getRef(branch) == null)
+                               git.branchCreate().setName(branch).call();
+                       git.checkout().setName(branch).call();
+                       writeTrashFile(filename, contents);
+                       git.add().addFilepattern(filename).call();
+                       RevCommit commit = git.commit()
+                                       .setMessage(branch + ": " + filename).call();
+                       if (originalBranch != null)
+                               git.checkout().setName(originalBranch).call();
+                       return commit;
+               } catch (IOException e) {
+                       throw new RuntimeException(e);
+               } catch (GitAPIException e) {
+                       throw new RuntimeException(e);
+               }
+       }
+
+       protected DirCacheEntry createEntry(final String path, final FileMode mode) {
+               return createEntry(path, mode, DirCacheEntry.STAGE_0, path);
+       }
+
+       protected DirCacheEntry createEntry(final String path, final FileMode mode,
+                       final String content) {
+               return createEntry(path, mode, DirCacheEntry.STAGE_0, content);
+       }
+
+       protected DirCacheEntry createEntry(final String path, final FileMode mode,
+                       final int stage, final String content) {
+               final DirCacheEntry entry = new DirCacheEntry(path, stage);
+               entry.setFileMode(mode);
+               entry.setObjectId(new ObjectInserter.Formatter().idFor(
+                               Constants.OBJ_BLOB, Constants.encode(content)));
+               return entry;
+       }
+}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SampleDataRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SampleDataRepositoryTestCase.java
new file mode 100644 (file)
index 0000000..fb4b9e9
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * 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.junit;
+
+import java.io.File;
+
+
+/** Test case which includes C Git generated pack files for testing. */
+public abstract class SampleDataRepositoryTestCase extends RepositoryTestCase {
+       @Override
+       public 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.getObjectDatabase().getDirectory(), "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"));
+       }
+}
index f2377f160e8435a84d299b32a5bee04fa3528c1b..275b7adf7b2b80943bb211122a70abb30385c579 100644 (file)
@@ -57,12 +57,12 @@ import org.eclipse.jgit.api.errors.NoFilepatternException;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.treewalk.TreeWalk;
index a0a4ddcbf7396d12774a9c8f172f14c1d0b56987..910e3a958d4fddace9046f1735e33546af528b2a 100644 (file)
@@ -55,7 +55,7 @@ import org.eclipse.jgit.api.errors.PatchApplyException;
 import org.eclipse.jgit.api.errors.PatchFormatException;
 import org.eclipse.jgit.diff.DiffFormatterReflowTest;
 import org.eclipse.jgit.diff.RawText;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Test;
 
 public class ApplyCommandTest extends RepositoryTestCase {
index fd726ba931a194678caff9e1463172031a946fb8..7b2e85f0032218c3cf4581ac419853337c2af979 100644 (file)
@@ -46,7 +46,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import org.eclipse.jgit.blame.BlameResult;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Test;
 
index b000fe24e5cdd7aabce045127cf3bf51a57293b9..c2c8317d94675f81e27f12fdc89608b3fff45d40 100644 (file)
@@ -59,12 +59,12 @@ import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.api.errors.NotMergedException;
 import org.eclipse.jgit.api.errors.RefAlreadyExistsException;
 import org.eclipse.jgit.api.errors.RefNotFoundException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.transport.FetchResult;
index 3f0bc043ac979995fffa4eeca8e4ff24deb353b0..fb98c2fb8993357e1ca91f51ea5634c50ab55df5 100644 (file)
@@ -63,11 +63,11 @@ import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.api.errors.RefNotFoundException;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.transport.RefSpec;
index 7984d9f2421bde93210d65f0474f8a16f2758cb5..0130bdf4d9d277deb0f0f837079cf743e314053f 100644 (file)
@@ -56,11 +56,11 @@ import org.eclipse.jgit.api.ResetCommand.ResetType;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.ReflogReader;
index 0405783bbb65090cec37ede5cc67d38b769f88b8..7cca4b9e4bd07bf352ce95f2b3d9658402127f39 100644 (file)
@@ -51,7 +51,7 @@ import java.util.TreeSet;
 
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.errors.NoWorkTreeException;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Before;
 import org.junit.Test;
 
index 7370091d545f5e9686efac32345568efe9c4a7f3..99e05d4d556510883273e5790e961122cd4f94fc 100644 (file)
@@ -57,6 +57,7 @@ import java.util.Map;
 import org.eclipse.jgit.api.ListBranchCommand.ListMode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
@@ -64,7 +65,6 @@ import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
index 2eaec1476f3a8b9ef04dd3237a41863848a3cc87..07e3c480f80a5a40a53e2f14c318cb5792d20a01 100644 (file)
@@ -56,11 +56,11 @@ import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.api.errors.NoMessageException;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.MissingObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.PersonIdent;
 import org.eclipse.jgit.lib.RefUpdate;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.ReflogReader;
 import org.eclipse.jgit.treewalk.TreeWalk;
index 45f312f38ccce8c052c502eb46e0225d22053d2e..0b523f4f3c7f6b15f2ed72d51898c2f05b9ba19b 100644 (file)
@@ -57,6 +57,7 @@ import org.eclipse.jgit.diff.DiffEntry;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
@@ -65,7 +66,6 @@ import org.eclipse.jgit.lib.PersonIdent;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.RefUpdate.Result;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.submodule.SubmoduleWalk;
index 24ca21a97108703948fb0cc571ad194d63add03e..b885504199c8398f7522815e6170e5cc311736bc 100644 (file)
@@ -51,10 +51,10 @@ import java.io.File;
 import java.io.IOException;
 
 import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.junit.Test;
index 1aa74e89142b8e3138da5c33f8a59404c9720d06..c5608b3f1ee84f7c0191313fa204e6f181b47796 100644 (file)
@@ -54,9 +54,9 @@ import java.util.List;
 
 import org.eclipse.jgit.diff.DiffEntry;
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectReader;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.eclipse.jgit.treewalk.AbstractTreeIterator;
 import org.eclipse.jgit.treewalk.CanonicalTreeParser;
index 6545c375fbe22d49327330402590b99506de9903..abfbd1548d007a4a947e632650c3a141317c5ff0 100644 (file)
@@ -49,9 +49,9 @@ import java.net.URISyntaxException;
 
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.transport.RefSpec;
index 3823f37abae3d6db20127e2b47dc4abc69d798b2..47ebb6b2a3f71473cbe5be19ab353be5dcaf8692 100644 (file)
@@ -47,7 +47,7 @@ import static org.junit.Assert.assertTrue;
 import java.util.Date;
 import java.util.Properties;
 
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.util.GitDateParser;
 import org.junit.Before;
 import org.junit.Test;
index d8e1a058f76f98e38f789e466e7634e7cb850439..8d7758cb7a5c34370385734885d04bcc5a060c54 100644 (file)
@@ -51,8 +51,8 @@ import org.eclipse.jgit.api.ListBranchCommand.ListMode;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.errors.RepositoryNotFoundException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
index 273b09ded8be8d66784fb08b2fb31cf4aa1f6cf2..5449d02a0846e3bf526c862d14666db9d7e8ea9a 100644 (file)
@@ -50,7 +50,7 @@ import java.util.Arrays;
 import java.util.Collection;
 
 import org.eclipse.jgit.api.ResetCommand.ResetType;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Ignore;
 import org.junit.Test;
 
index 7db9ce71c13fd202d2ae74eb12dade978e62b07f..3296717c0ec63bebeb9b50e5b01bc0c0d4fc503b 100644 (file)
@@ -50,8 +50,8 @@ import java.io.IOException;
 
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Before;
 import org.junit.Test;
 
index b9dc4265d053b4235ab083ffd1b5d7edc8c4a3c1..1f53645562feaac252886a6124d6e902af19f18d 100644 (file)
@@ -50,8 +50,8 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Ref;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Test;
 
index ac563b061831d7669cc195bc48f1b6881287a097..991214d581d7bf2ff009ccea1e6ffc9617f77eff 100644 (file)
@@ -48,10 +48,10 @@ import static org.junit.Assert.assertNotNull;
 import java.io.File;
 import java.util.Collection;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.RefUpdate;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class LsRemoteCommandTest extends RepositoryTestCase {
index f4e418def57cc497d4b1ff4d2fc2c488d723462a..dfd5c5476175c568dd42c7475e740543d0f37c8d 100644 (file)
@@ -55,10 +55,10 @@ import java.util.Iterator;
 import org.eclipse.jgit.api.MergeCommand.FastForwardMode;
 import org.eclipse.jgit.api.MergeResult.MergeStatus;
 import org.eclipse.jgit.api.errors.InvalidMergeHeadsException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.merge.MergeStrategy;
 import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
 import org.eclipse.jgit.revwalk.RevCommit;
index 5afb1e8800b28fed74a232fed7eca3803e8b4705..6ddf89c4a4d59f1310c6b34092c21a122c51fcce 100644 (file)
@@ -45,7 +45,7 @@ package org.eclipse.jgit.api;
 import static org.junit.Assert.assertEquals;
 import java.util.List;
 
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.notes.Note;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Before;
index 43b632d2c8957a60898157c8bdec2bd7386ad8cc..dbda852850568a2ab2253e8a1bf3e0175fcb0353 100644 (file)
@@ -52,10 +52,10 @@ import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEntry;
 import org.eclipse.jgit.errors.NoWorkTreeException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.ObjectReader;
 import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Before;
index 53df6098007b5f52e82b52e0fce00bb229f43b21..771769717f8a5d98b5965cf6077b0f60eb501840 100644 (file)
@@ -56,12 +56,12 @@ import java.io.IOException;
 import org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode;
 import org.eclipse.jgit.api.MergeResult.MergeStatus;
 import org.eclipse.jgit.api.errors.NoHeadException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevWalk;
index 6978136479c537bc4e536c03bab413294e585dd5..e87eb1113b679bfad41d344c23e9fff491d67ad8 100644 (file)
@@ -57,12 +57,12 @@ import java.io.IOException;
 import org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode;
 import org.eclipse.jgit.api.MergeResult.MergeStatus;
 import org.eclipse.jgit.api.RebaseResult.Status;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.merge.MergeStrategy;
 import org.eclipse.jgit.revwalk.RevCommit;
index d6d14276b086a5f94c3a7855cd096d49bd08e474..7f20bb8f1e52f9d9a86fb9275132d0a91e350990 100644 (file)
@@ -52,10 +52,10 @@ import java.net.URISyntaxException;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.errors.MissingObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.transport.PushResult;
index fbaef76e1c2bc7d67a5ba8f2c35c4c39b10c6385..e08fa54d8ad36820c4ba1279e2f6a4506cb2bfa4 100644 (file)
@@ -67,12 +67,12 @@ import org.eclipse.jgit.api.errors.RefNotFoundException;
 import org.eclipse.jgit.api.errors.UnmergedPathsException;
 import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
 import org.eclipse.jgit.dircache.DirCacheCheckout;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.PersonIdent;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.merge.MergeStrategy;
 import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
 import org.eclipse.jgit.revwalk.RevCommit;
index 1502436642d4b8a1bb379834b788ca6d47a60ceb..a43e0369c4e63327bc54801a78bbce16a2ae3881 100644 (file)
@@ -47,9 +47,9 @@ import static org.junit.Assert.assertNotNull;
 
 import java.util.Collection;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.ReflogEntry;
 import org.junit.Before;
index 2309a7cce014baf2413117b5ff8846acbddfb8c8..181e4a135ad6dda8ffb9991b36d8b0b42c5295b6 100644 (file)
@@ -47,9 +47,9 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Before;
index dd6fc67c7b1457c84ada4c949dccc6fe26badd49..da57cb324983874abf223939d113e38078cb1f72 100644 (file)
@@ -61,10 +61,10 @@ import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
 import org.eclipse.jgit.dircache.DirCacheEntry;
 import org.eclipse.jgit.errors.AmbiguousObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.eclipse.jgit.treewalk.TreeWalk;
index a36a28c6b62a894507d5a89b525f7dafc2bbd844..228e11dfb7190713ec2f826d2e0a5dc7c4a405ac 100644 (file)
  */
 package org.eclipse.jgit.api;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
@@ -53,11 +57,11 @@ import org.eclipse.jgit.api.ResetCommand.ResetType;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.dircache.DirCache;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.ReflogReader;
@@ -131,7 +135,7 @@ public class RevertCommandTest extends RepositoryTestCase {
 
                doRevertAndCheckResult(git, sideCommit,
                                MergeFailureReason.DIRTY_INDEX);
-       }
+}
 
        @Test
        public void testRevertDirtyWorktree() throws Exception {
index 0323ba3f8a3b617199291a7b0656ec38e8b08105..09bad55f5748366602fa5df1b1002e74fb4e4b85 100644 (file)
@@ -50,7 +50,7 @@ import java.io.IOException;
 
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Before;
 import org.junit.Test;
 
index ce7959fcbe770ba01e5944f51c68ddb57ed377c3..4dfac1447db5b5d08aa696ff98fa4f53bd21004f 100644 (file)
@@ -56,9 +56,9 @@ import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.api.errors.NoHeadException;
 import org.eclipse.jgit.api.errors.StashApplyFailureException;
 import org.eclipse.jgit.internal.JGitText;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.util.FileUtils;
 import org.junit.Before;
index d481390e6860b00506638c4fd0fc50025a6b6f45..f91229d84e6c3808a22258f989c705e2c64e95f9 100644 (file)
@@ -54,11 +54,11 @@ import java.util.List;
 
 import org.eclipse.jgit.api.errors.UnmergedPathsException;
 import org.eclipse.jgit.diff.DiffEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.PersonIdent;
 import org.eclipse.jgit.lib.Ref;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.eclipse.jgit.storage.file.ReflogEntry;
index b60af64a82b6b5262b4963722ae063217a60d501..571ff6d7b05eb891c1290526833980a84e04a9a8 100644 (file)
@@ -52,10 +52,10 @@ import java.io.File;
 import java.util.List;
 
 import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Ref;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.ReflogEntry;
 import org.eclipse.jgit.storage.file.ReflogReader;
index 8d7ecada17595e123e4b709a33481a6a1df48ad5..a7e0ab9f51310b026b15f16dd6f47913a843dc6c 100644 (file)
@@ -49,10 +49,10 @@ import static org.junit.Assert.assertTrue;
 import java.util.Collection;
 import java.util.Iterator;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.RefUpdate.Result;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Test;
 
index 7856b0d8717ce2b769558a22f640237ee27db4e5..e98263a2ac766b80b9c9397458d96e38e1810350 100644 (file)
@@ -54,7 +54,7 @@ import java.util.Set;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.NoFilepatternException;
 import org.eclipse.jgit.errors.NoWorkTreeException;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Test;
 
 public class StatusCommandTest extends RepositoryTestCase {
index b417b44851039ab6c155003203c58f1d9f8709cb..b9838b1712ad279072cbfbda0c951b31a7713823 100644 (file)
@@ -51,9 +51,9 @@ import java.util.List;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.api.errors.InvalidTagNameException;
 import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.junit.Test;
index d021282b4b9b5876d9283fa3f3e97be43ae37950..a7bce1e11ed3332251cefc51a5588a28dc384911 100644 (file)
@@ -49,8 +49,8 @@ import static org.junit.Assert.assertTrue;
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.blame.BlameGenerator;
 import org.eclipse.jgit.blame.BlameResult;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Test;
 
index 4c9c54f21441047b651990a1f7e1a51a8be0dc10..5694e8337fc8591ca93d0f90cf86d55a50d0be1b 100644 (file)
@@ -60,8 +60,8 @@ import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.treewalk.EmptyTreeIterator;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
index 4c98418492ff0f774f7fe34fd81449dfc9f882c8..820c0c6d786d11657356bf0a4720ee0fc013e9d7 100644 (file)
@@ -51,11 +51,11 @@ import java.io.File;
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;
 import org.eclipse.jgit.dircache.DirCacheIterator;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.patch.FileHeader;
 import org.eclipse.jgit.patch.HunkHeader;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
index 00546a5aa4f54dc10746780d75c2e570ce2d19b1..ce283ae4f9a4ae8510b1c099d353d7b23c07f412 100644 (file)
@@ -48,7 +48,7 @@ import java.io.File;
 
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.dircache.DirCacheIterator;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
 import org.eclipse.jgit.treewalk.filter.PathFilter;
 import org.junit.Test;
index 6b35a2bd3b2d27a696c8c74f9d99b73bdb49c633..e83ef772ff0303bf2313e5eedaf0e3052cf2dfac 100644 (file)
@@ -51,12 +51,12 @@ import static org.junit.Assert.fail;
 import java.util.List;
 
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.AbbreviatedObjectId;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Before;
 import org.junit.Test;
 
index 487f04329da5e2ca7630b5d215122caa36ec7756..6ac718ec5b3e0e8cdd0479b88bc1247883fd5139 100644 (file)
@@ -50,9 +50,9 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class DirCacheBasicTest extends RepositoryTestCase {
index 84a22368015480ff0aa1cc82fb5fd4a473d26fd8..254431f74b6d91850be1a0e92d0d0f8c20f64f8b 100644 (file)
@@ -51,8 +51,8 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.Collections;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
 import org.junit.Test;
index c64ca88f0dead956ebde7eb921cba56b6fd9d89c..a502db3ac1fc17d187936f4042dbe32411111908 100644 (file)
@@ -57,9 +57,9 @@ import java.io.File;
 import org.eclipse.jgit.events.IndexChangedEvent;
 import org.eclipse.jgit.events.IndexChangedListener;
 import org.eclipse.jgit.events.ListenerList;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class DirCacheBuilderTest extends RepositoryTestCase {
index a4bb559da949dd30f62986826657d8d47ddc2214..0b43b2311a8db8b94422f41169fe19171d99b9c5 100644 (file)
@@ -47,8 +47,8 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class DirCacheFindTest extends RepositoryTestCase {
index 6b3f700d203ad6b4d5d1fd8e1935c5c8566cb836..8d29a7318865b3aa2eec53140006ed429bb1d076 100644 (file)
@@ -53,8 +53,8 @@ import java.io.File;
 import java.util.Collections;
 
 import org.eclipse.jgit.junit.JGitTestUtil;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.AbstractTreeIterator;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
index c38e601a37e527db3291f134a24c00f86eae562a..ef3e61144d3e0e54d2096abbbc5a9c4294f904ba 100644 (file)
@@ -51,8 +51,8 @@ import static org.junit.Assert.assertTrue;
 import java.io.IOException;
 
 import org.eclipse.jgit.errors.CorruptObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class DirCacheLargePathTest extends RepositoryTestCase {
index 99291dd7cf7d55d786681a39db9c2c45b3de8d8b..89d7bed8b7acfda766080ed722ec8c383b9fe30e 100644 (file)
@@ -53,8 +53,8 @@ import static org.junit.Assert.assertSame;
 import java.io.IOException;
 
 import org.eclipse.jgit.errors.CorruptObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class DirCacheTreeTest extends RepositoryTestCase {
index 6a93e714cb1b08db49c0fed15d2565d151b1a373..3c1f231db3f9718a1ac89c1ee286a090d726da22 100644 (file)
@@ -46,7 +46,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
 import org.junit.Test;
 
index fcc8d2b0ec03325ae839dc5751523b288d38bf81..881b01c312ab842286ba50c1cac3085203307f34 100644 (file)
@@ -51,8 +51,8 @@ import java.io.File;
 import java.io.IOException;
 
 import org.eclipse.jgit.errors.CorruptObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.eclipse.jgit.treewalk.WorkingTreeIterator;
index bc18d5f3303db5cac21c4fbf45686b84c2ae60c6..e261b96732ce7f242c0f4ee88c8375765956d71c 100644 (file)
@@ -46,6 +46,7 @@ package org.eclipse.jgit.lib;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevWalk;
index fb9cc2cbfcaa527918fc11f24c2dc716f644c893..d95eee2b26a9d61fb34a34ed8b668067ddc5db73 100644 (file)
@@ -49,6 +49,7 @@ import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.api.errors.GitAPIException;
 import org.eclipse.jgit.dircache.InvalidPathException;
 import org.eclipse.jgit.junit.MockSystemReader;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.eclipse.jgit.util.SystemReader;
 import org.junit.Test;
index 3142995f29896bfe35fa28fb79d38bfc52b8df14..cb2ae64db2c57f43149b7a05c98851072fbda1e3 100644 (file)
@@ -71,6 +71,7 @@ import org.eclipse.jgit.dircache.DirCacheEntry;
 import org.eclipse.jgit.errors.CheckoutConflictException;
 import org.eclipse.jgit.errors.CorruptObjectException;
 import org.eclipse.jgit.errors.NoWorkTreeException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
 import org.eclipse.jgit.treewalk.TreeWalk;
index 1f25700dd4ed7d69e7a7c80c5162144b89671d6b..6040dfed787bb607e7e6795c9d9266d46aa9032a 100644 (file)
@@ -64,6 +64,7 @@ import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.merge.MergeStrategy;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
index b24b5a7983fefa8b83aa4f43bb00ce495078cff6..c6f02f4a4933d403b6c18e8310598759a0793be2 100644 (file)
@@ -42,6 +42,7 @@ import static org.junit.Assert.assertTrue;
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Test;
 
 public class IndexModificationTimesTest extends RepositoryTestCase {
index ed1f96776bbd7a7a4444831b366a1e6b4ae1af39..4f26a27ef64e4ded57a1281cb31f4f706eaef00f 100644 (file)
@@ -51,6 +51,7 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collections;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Test;
 
 public class MergeHeadMsgTest extends RepositoryTestCase {
index 13f17550d13eafba93a80a6156a38a00a497cc0c..99d6801f30a0e79267d86b12222c889d70e0d875 100644 (file)
@@ -51,6 +51,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.TreeSet;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
 import org.eclipse.jgit.treewalk.FileTreeIteratorWithTimeControl;
 import org.eclipse.jgit.treewalk.NameConflictTreeWalk;
index c1cd596d0b2893ecfbb7a1856696b6f60f48b390..7c06e86915335353a11f07e69f410f690bd8d6d1 100644 (file)
@@ -59,6 +59,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.Map;
 
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.Ref.Storage;
 import org.eclipse.jgit.lib.RefUpdate.Result;
 import org.junit.Test;
index bfd8c9ffdd79df7992a6a44781e071d0012ebb8a..cf8d42f724bcf338aaf4a83bb40e038a9b8fee59 100644 (file)
@@ -51,6 +51,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
 import org.junit.Test;
 
index 80cd163f03b5d150c7e6526569f1121ea479360d..75d74fca7ff4c80c1e99db8c10993b287337a56d 100644 (file)
@@ -49,6 +49,7 @@ import static org.junit.Assert.fail;
 
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.errors.RevisionSyntaxException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Test;
 
index b399bf0b39211cede9d3af72181264237dcc528a..aad5bfc8366ba222e63910b3aa79701e109df789 100644 (file)
@@ -55,6 +55,7 @@ import java.io.File;
 import java.io.IOException;
 
 import org.eclipse.jgit.errors.RepositoryNotFoundException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.RepositoryCache.FileKey;
 import org.junit.Test;
 
index 12b9dc94cc0fc854d4fe9ca9a991862716f8e3d6..381e1317b1efb6b61ae829a62df3918a07e5f3de 100644 (file)
@@ -59,6 +59,7 @@ import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.errors.AmbiguousObjectException;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.RevisionSyntaxException;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Test;
 
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
deleted file mode 100644 (file)
index 16051bf..0000000
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- * Copyright (C) 2009, Google Inc.
- * 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.
- *
- * 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 static org.junit.Assert.assertEquals;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.Map;
-import java.util.TreeSet;
-
-import org.eclipse.jgit.api.Git;
-import org.eclipse.jgit.api.errors.GitAPIException;
-import org.eclipse.jgit.dircache.DirCache;
-import org.eclipse.jgit.dircache.DirCacheBuilder;
-import org.eclipse.jgit.dircache.DirCacheCheckout;
-import org.eclipse.jgit.dircache.DirCacheEntry;
-import org.eclipse.jgit.junit.JGitTestUtil;
-import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
-import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.jgit.revwalk.RevWalk;
-import org.eclipse.jgit.storage.file.FileRepository;
-import org.eclipse.jgit.treewalk.FileTreeIterator;
-import org.eclipse.jgit.util.FileUtils;
-import org.junit.Before;
-
-/**
- * Base class for most JGit unit tests.
- *
- * Sets up a predefined test repository and has support for creating additional
- * repositories and destroying them when the tests are finished.
- */
-public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
-       protected static void copyFile(final File src, final File dst)
-                       throws IOException {
-               final FileInputStream fis = new FileInputStream(src);
-               try {
-                       final FileOutputStream fos = new FileOutputStream(dst);
-                       try {
-                               final byte[] buf = new byte[4096];
-                               int r;
-                               while ((r = fis.read(buf)) > 0) {
-                                       fos.write(buf, 0, r);
-                               }
-                       } finally {
-                               fos.close();
-                       }
-               } finally {
-                       fis.close();
-               }
-       }
-
-       protected File writeTrashFile(final String name, final String data)
-                       throws IOException {
-               return JGitTestUtil.writeTrashFile(db, name, data);
-       }
-
-       protected File writeTrashFile(final String subdir, final String name,
-                       final String data)
-                       throws IOException {
-               return JGitTestUtil.writeTrashFile(db, subdir, name, data);
-       }
-
-       protected String read(final String name) throws IOException {
-               return JGitTestUtil.read(db, name);
-       }
-
-       protected void deleteTrashFile(final String name) throws IOException {
-               JGitTestUtil.deleteTrashFile(db, name);
-       }
-
-       protected static void checkFile(File f, final String checkData)
-                       throws IOException {
-               Reader r = new InputStreamReader(new FileInputStream(f), "ISO-8859-1");
-               try {
-                       char[] data = new char[(int) f.length()];
-                       if (f.length() !=  r.read(data))
-                               throw new IOException("Internal error reading file data from "+f);
-                       assertEquals(checkData, new String(data));
-               } finally {
-                       r.close();
-               }
-       }
-
-       /** Test repository, initialized for this test case. */
-       protected FileRepository db;
-
-       /** Working directory of {@link #db}. */
-       protected File trash;
-
-       @Override
-       @Before
-       public void setUp() throws Exception {
-               super.setUp();
-               db = createWorkRepository();
-               trash = db.getWorkTree();
-       }
-
-       public static final int MOD_TIME = 1;
-
-       public static final int SMUDGE = 2;
-
-       public static final int LENGTH = 4;
-
-       public static final int CONTENT_ID = 8;
-
-       public static final int CONTENT = 16;
-
-       public static final int ASSUME_UNCHANGED = 32;
-
-       /**
-        * Represent the state of the index in one String. This representation is
-        * useful when writing tests which do assertions on the state of the index.
-        * By default information about path, mode, stage (if different from 0) is
-        * included. A bitmask controls which additional info about
-        * modificationTimes, smudge state and length is included.
-        * <p>
-        * The format of the returned string is described with this BNF:
-        *
-        * <pre>
-        * result = ( "[" path mode stage? time? smudge? length? sha1? content? "]" )* .
-        * mode = ", mode:" number .
-        * stage = ", stage:" number .
-        * time = ", time:t" timestamp-index .
-        * smudge = "" | ", smudged" .
-        * length = ", length:" number .
-        * sha1 = ", sha1:" hex-sha1 .
-        * content = ", content:" blob-data .
-        * </pre>
-        *
-        * 'stage' is only presented when the stage is different from 0. All
-        * reported time stamps are mapped to strings like "t0", "t1", ... "tn". The
-        * smallest reported time-stamp will be called "t0". This allows to write
-        * assertions against the string although the concrete value of the time
-        * stamps is unknown.
-        *
-        * @param repo
-        *            the repository the index state should be determined for
-        *
-        * @param includedOptions
-        *            a bitmask constructed out of the constants {@link #MOD_TIME},
-        *            {@link #SMUDGE}, {@link #LENGTH}, {@link #CONTENT_ID} and
-        *            {@link #CONTENT} controlling which info is present in the
-        *            resulting string.
-        * @return a string encoding the index state
-        * @throws IllegalStateException
-        * @throws IOException
-        */
-       public String indexState(Repository repo, int includedOptions)
-                       throws IllegalStateException, IOException {
-               DirCache dc = repo.readDirCache();
-               StringBuilder sb = new StringBuilder();
-               TreeSet<Long> timeStamps = null;
-
-               // iterate once over the dircache just to collect all time stamps
-               if (0 != (includedOptions & MOD_TIME)) {
-                       timeStamps = new TreeSet<Long>();
-                       for (int i=0; i<dc.getEntryCount(); ++i)
-                               timeStamps.add(Long.valueOf(dc.getEntry(i).getLastModified()));
-               }
-
-               // iterate again, now produce the result string
-               for (int i=0; i<dc.getEntryCount(); ++i) {
-                       DirCacheEntry entry = dc.getEntry(i);
-                       sb.append("["+entry.getPathString()+", mode:" + entry.getFileMode());
-                       int stage = entry.getStage();
-                       if (stage != 0)
-                               sb.append(", stage:" + stage);
-                       if (0 != (includedOptions & MOD_TIME)) {
-                               sb.append(", time:t"+
-                                       timeStamps.headSet(Long.valueOf(entry.getLastModified())).size());
-                       }
-                       if (0 != (includedOptions & SMUDGE))
-                               if (entry.isSmudged())
-                                       sb.append(", smudged");
-                       if (0 != (includedOptions & LENGTH))
-                               sb.append(", length:"
-                                               + Integer.toString(entry.getLength()));
-                       if (0 != (includedOptions & CONTENT_ID))
-                               sb.append(", sha1:" + ObjectId.toString(entry.getObjectId()));
-                       if (0 != (includedOptions & CONTENT)) {
-                               sb.append(", content:"
-                                               + new String(db.open(entry.getObjectId(),
-                                                               Constants.OBJ_BLOB).getCachedBytes(), "UTF-8"));
-                       }
-                       if (0 != (includedOptions & ASSUME_UNCHANGED))
-                               sb.append(", assume-unchanged:"
-                                               + Boolean.toString(entry.isAssumeValid()));
-                       sb.append("]");
-               }
-               return sb.toString();
-       }
-
-       /**
-        * Represent the state of the index in one String. This representation is
-        * useful when writing tests which do assertions on the state of the index.
-        * By default information about path, mode, stage (if different from 0) is
-        * included. A bitmask controls which additional info about
-        * modificationTimes, smudge state and length is included.
-        * <p>
-        * The format of the returned string is described with this BNF:
-        *
-        * <pre>
-        * result = ( "[" path mode stage? time? smudge? length? sha1? content? "]" )* .
-        * mode = ", mode:" number .
-        * stage = ", stage:" number .
-        * time = ", time:t" timestamp-index .
-        * smudge = "" | ", smudged" .
-        * length = ", length:" number .
-        * sha1 = ", sha1:" hex-sha1 .
-        * content = ", content:" blob-data .
-        * </pre>
-        *
-        * 'stage' is only presented when the stage is different from 0. All
-        * reported time stamps are mapped to strings like "t0", "t1", ... "tn". The
-        * smallest reported time-stamp will be called "t0". This allows to write
-        * assertions against the string although the concrete value of the time
-        * stamps is unknown.
-        *
-        * @param includedOptions
-        *            a bitmask constructed out of the constants {@link #MOD_TIME},
-        *            {@link #SMUDGE}, {@link #LENGTH}, {@link #CONTENT_ID} and
-        *            {@link #CONTENT} controlling which info is present in the
-        *            resulting string.
-        * @return a string encoding the index state
-        * @throws IllegalStateException
-        * @throws IOException
-        */
-       public String indexState(int includedOptions)
-                       throws IllegalStateException, IOException {
-               return indexState(db, includedOptions);
-       }
-
-       /**
-        * Resets the index to represent exactly some filesystem content. E.g. the
-        * following call will replace the index with the working tree content:
-        * <p>
-        * <code>resetIndex(new FileSystemIterator(db))</code>
-        * <p>
-        * This method can be used by testcases which first prepare a new commit
-        * somewhere in the filesystem (e.g. in the working-tree) and then want to
-        * have an index which matches their prepared content.
-        *
-        * @param treeItr
-        *            a {@link FileTreeIterator} which determines which files should
-        *            go into the new index
-        * @throws FileNotFoundException
-        * @throws IOException
-        */
-       protected void resetIndex(FileTreeIterator treeItr)
-                       throws FileNotFoundException, IOException {
-               ObjectInserter inserter = db.newObjectInserter();
-               DirCacheBuilder builder = db.lockDirCache().builder();
-               DirCacheEntry dce;
-
-               while (!treeItr.eof()) {
-                       long len = treeItr.getEntryLength();
-
-                       dce = new DirCacheEntry(treeItr.getEntryPathString());
-                       dce.setFileMode(treeItr.getEntryFileMode());
-                       dce.setLastModified(treeItr.getEntryLastModified());
-                       dce.setLength((int) len);
-                       FileInputStream in = new FileInputStream(treeItr.getEntryFile());
-                       dce.setObjectId(inserter.insert(Constants.OBJ_BLOB, len, in));
-                       in.close();
-                       builder.add(dce);
-                       treeItr.next(1);
-               }
-               builder.commit();
-               inserter.flush();
-               inserter.release();
-       }
-
-       /**
-        * Helper method to map arbitrary objects to user-defined names. This can be
-        * used create short names for objects to produce small and stable debug
-        * output. It is guaranteed that when you lookup the same object multiple
-        * times even with different nameTemplates this method will always return
-        * the same name which was derived from the first nameTemplate.
-        * nameTemplates can contain "%n" which will be replaced by a running number
-        * before used as a name.
-        *
-        * @param l
-        *            the object to lookup
-        * @param nameTemplate
-        *            the name for that object. Can contain "%n" which will be
-        *            replaced by a running number before used as a name. If the
-        *            lookup table already contains the object this parameter will
-        *            be ignored
-        * @param lookupTable
-        *            a table storing object-name mappings.
-        * @return a name of that object. Is not guaranteed to be unique. Use
-        *         nameTemplates containing "%n" to always have unique names
-        */
-       public static String lookup(Object l, String nameTemplate,
-                       Map<Object, String> lookupTable) {
-               String name = lookupTable.get(l);
-               if (name == null) {
-                       name = nameTemplate.replaceAll("%n",
-                                       Integer.toString(lookupTable.size()));
-                       lookupTable.put(l, name);
-               }
-               return name;
-       }
-
-       /**
-        * Waits until it is guaranteed that a subsequent file modification has a
-        * younger modification timestamp than the modification timestamp of the
-        * given file. This is done by touching a temporary file, reading the
-        * lastmodified attribute and, if needed, sleeping. After sleeping this loop
-        * starts again until the filesystem timer has advanced enough.
-        *
-        * @param lastFile
-        *            the file on which we want to wait until the filesystem timer
-        *            has advanced more than the lastmodification timestamp of this
-        *            file
-        * @return return the last measured value of the filesystem timer which is
-        *         greater than then the lastmodification time of lastfile.
-        * @throws InterruptedException
-        * @throws IOException
-        */
-       public static long fsTick(File lastFile) throws InterruptedException,
-                       IOException {
-               long sleepTime = 1;
-               if (lastFile != null && !lastFile.exists())
-                       throw new FileNotFoundException(lastFile.getPath());
-               File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null);
-               try {
-                       long startTime = (lastFile == null) ? tmp.lastModified() : lastFile
-                                       .lastModified();
-                       long actTime = tmp.lastModified();
-                       while (actTime <= startTime) {
-                               Thread.sleep(sleepTime);
-                               sleepTime *= 5;
-                               tmp.setLastModified(System.currentTimeMillis());
-                               actTime = tmp.lastModified();
-                       }
-                       return actTime;
-               } finally {
-                       FileUtils.delete(tmp);
-               }
-       }
-
-       protected void createBranch(ObjectId objectId, String branchName)
-                       throws IOException {
-               RefUpdate updateRef = db.updateRef(branchName);
-               updateRef.setNewObjectId(objectId);
-               updateRef.update();
-       }
-
-       protected void checkoutBranch(String branchName)
-                       throws IllegalStateException, IOException {
-               RevWalk walk = new RevWalk(db);
-               RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD));
-               RevCommit branch = walk.parseCommit(db.resolve(branchName));
-               DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree().getId(),
-                               db.lockDirCache(), branch.getTree().getId());
-               dco.setFailOnConflict(true);
-               dco.checkout();
-               walk.release();
-               // update the HEAD
-               RefUpdate refUpdate = db.updateRef(Constants.HEAD);
-               refUpdate.link(branchName);
-       }
-
-       /**
-        * Writes a number of files in the working tree. The first content specified
-        * will be written into a file named '0', the second into a file named "1"
-        * and so on. If <code>null</code> is specified as content then this file is
-        * skipped.
-        *
-        * @param ensureDistinctTimestamps
-        *            if set to <code>true</code> then between two write operations
-        *            this method will wait to ensure that the second file will get
-        *            a different lastmodification timestamp than the first file.
-        * @param contents
-        *            the contents which should be written into the files
-        * @return the File object associated to the last written file.
-        * @throws IOException
-        * @throws InterruptedException
-        */
-       protected File writeTrashFiles(boolean ensureDistinctTimestamps,
-                       String... contents)
-                       throws IOException, InterruptedException {
-                               File f = null;
-                               for (int i = 0; i < contents.length; i++)
-                                       if (contents[i] != null) {
-                                               if (ensureDistinctTimestamps && (f != null))
-                                                       fsTick(f);
-                                               f = writeTrashFile(Integer.toString(i), contents[i]);
-                                       }
-                               return f;
-                       }
-
-       /**
-        * Commit a file with the specified contents on the specified branch,
-        * creating the branch if it didn't exist before.
-        * <p>
-        * It switches back to the original branch after the commit if there was
-        * one.
-        *
-        * @param filename
-        * @param contents
-        * @param branch
-        * @return the created commit
-        */
-       protected RevCommit commitFile(String filename, String contents, String branch) {
-               try {
-                       Git git = new Git(db);
-                       String originalBranch = git.getRepository().getFullBranch();
-                       if (git.getRepository().getRef(branch) == null)
-                               git.branchCreate().setName(branch).call();
-                       git.checkout().setName(branch).call();
-                       writeTrashFile(filename, contents);
-                       git.add().addFilepattern(filename).call();
-                       RevCommit commit = git.commit()
-                                       .setMessage(branch + ": " + filename).call();
-                       if (originalBranch != null)
-                               git.checkout().setName(originalBranch).call();
-                       return commit;
-               } catch (IOException e) {
-                       throw new RuntimeException(e);
-               } catch (GitAPIException e) {
-                       throw new RuntimeException(e);
-               }
-       }
-
-       protected DirCacheEntry createEntry(final String path, final FileMode mode) {
-               return createEntry(path, mode, DirCacheEntry.STAGE_0, path);
-       }
-
-       protected DirCacheEntry createEntry(final String path, final FileMode mode,
-                       final String content) {
-               return createEntry(path, mode, DirCacheEntry.STAGE_0, content);
-       }
-
-       protected DirCacheEntry createEntry(final String path, final FileMode mode,
-                       final int stage, final String content) {
-               final DirCacheEntry entry = new DirCacheEntry(path, stage);
-               entry.setFileMode(mode);
-               entry.setObjectId(new ObjectInserter.Formatter().idFor(
-                               Constants.OBJ_BLOB, Constants.encode(content)));
-               return entry;
-       }
-}
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
deleted file mode 100644 (file)
index b3b6691..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.junit.JGitTestUtil;
-
-/** Test case which includes C Git generated pack files for testing. */
-public abstract class SampleDataRepositoryTestCase extends RepositoryTestCase {
-       @Override
-       public 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.getObjectDatabase().getDirectory(), "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"));
-       }
-}
index 4374e4747eb87f8b54f6846f215bbd2e655691ab..3bcd787f81de0ba94fc1d5260ca6d33a277581c9 100644 (file)
@@ -49,6 +49,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Test;
 
 public class SquashCommitMsgTest extends RepositoryTestCase {
index f6371d01904c5a393975dd28f809f9b6afff8d52..2682cad0a0194fc479a7c2291928da4d18bb50ba 100644 (file)
@@ -55,6 +55,7 @@ import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.junit.Test;
 
 @SuppressWarnings("deprecation")
index 905f215f2c2abe0d2e108d6914c298dee61e10b9..4948b373d07bf3ec5c4cdd3fb512a3b616d11be3 100644 (file)
@@ -50,12 +50,12 @@ import static org.junit.Assert.assertTrue;
 
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.CommitBuilder;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.PersonIdent;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.junit.Test;
 
index 88ace76eb72d1ff7d0f5363c51dbfdfb51e4e954..434f53d4b7c32ababa6516a82c560468e63d0778 100644 (file)
@@ -47,13 +47,13 @@ import static org.junit.Assert.assertEquals;
 import java.io.IOException;
 import java.util.Arrays;
 
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectIdRef;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.SymbolicRef;
 import org.eclipse.jgit.lib.Ref.Storage;
 import org.eclipse.jgit.lib.RefUpdate;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.junit.Before;
 import org.junit.Test;
 
index 63e8c1b2f79b160e0c2df945be27f23a09db4b96..8c10c731c240dfc76347ccad24065984a3e90a1c 100644 (file)
@@ -55,7 +55,7 @@ import org.eclipse.jgit.api.MergeResult;
 import org.eclipse.jgit.api.MergeResult.MergeStatus;
 import org.eclipse.jgit.api.errors.CheckoutConflictException;
 import org.eclipse.jgit.dircache.DirCache;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
index 4f9c22eb1850beae1e66b0722599ddfb1db31e62..a06bcfff7823875dc1fadf85785468ab323ac66e 100644 (file)
@@ -52,12 +52,12 @@ import java.io.IOException;
 
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.CommitBuilder;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.PersonIdent;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.junit.Test;
 
index 4274d8baffd04a7b322800634038c75d3aefaa43..1fddcdc167692551ac5ed9cf7278cf0a5fa0fd11 100644 (file)
@@ -47,8 +47,8 @@ import static org.junit.Assert.assertEquals;
 import java.util.Arrays;
 
 import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.Ref;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.util.GitDateFormatter;
 import org.eclipse.jgit.util.GitDateFormatter.Format;
index 9956492536ac4d5115a3ac685490b7e1f57fdbdf..91608ead13b8a07ec83d70e97049bdbc95eac13f 100644 (file)
@@ -47,11 +47,11 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.ObjectReader;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.junit.After;
 import org.junit.Before;
index 9cb228405ab71914b08bf96f314d0192b115da48..8010fb1aacbe8f7c154da834011a8d022b601f09 100644 (file)
@@ -50,11 +50,11 @@ import static org.junit.Assert.fail;
 import java.io.IOException;
 import java.util.Iterator;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.ObjectReader;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.merge.MergeStrategy;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.revwalk.RevCommit;
index 84b10f3c538a3c0ce0e66bf76157ea3e8b2c42d8..c2f63d617fc4165d841158678def7a2123fd5d4c 100644 (file)
@@ -54,6 +54,7 @@ import static org.junit.Assert.assertTrue;
 import java.io.IOException;
 import java.util.Iterator;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.CommitBuilder;
 import org.eclipse.jgit.lib.Constants;
@@ -61,7 +62,6 @@ import org.eclipse.jgit.lib.MutableObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.ObjectReader;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevTree;
index 1720b26bbca024a5b980dd357e79dd0ab184d470..0ad3b77427fa7848304e850b7c9a25f4610e1755 100644 (file)
@@ -51,9 +51,9 @@ import static org.junit.Assert.assertTrue;
 import java.io.IOException;
 import java.util.List;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class FooterLineTest extends RepositoryTestCase {
index 5cbd8ebe18851dd519af6fa18b2fc567ccf9a256..5ec6eb308ec06751a35b74b9ef0046922ff5fe56 100644 (file)
@@ -47,9 +47,9 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
 import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class RevCommitListTest extends RepositoryTestCase {
index 7dff6d1ceadbbbe8bc2bead275949df103f7de9c..574f85c91afdff627f44da986715b6ab9331be4d 100644 (file)
@@ -52,12 +52,12 @@ import java.io.ByteArrayOutputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.TimeZone;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.CommitBuilder;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.PersonIdent;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class RevCommitParseTest extends RepositoryTestCase {
index c89a2873adaaedcb52fb31ecb304bac052671ace..614f49bf0381ce484955eb7b46f547795121a233 100644 (file)
@@ -51,11 +51,11 @@ import static org.junit.Assert.assertSame;
 import java.io.ByteArrayOutputStream;
 
 import org.eclipse.jgit.errors.CorruptObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.PersonIdent;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.TagBuilder;
 import org.junit.Test;
 
index 20341eef61cc7e4de38a472d8f4a38ee03291879..881deb1f5a31e39c84720c57fb40ff5aa9da938a 100644 (file)
@@ -48,10 +48,10 @@ import static org.junit.Assert.assertSame;
 import java.util.Date;
 
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.junit.TestRepository.CommitBuilder;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 
 /** Support for tests of the {@link RevWalk} class. */
 public abstract class RevWalkTestCase extends RepositoryTestCase {
index 2868d5c0d8a932d491667451463199120ad02bb0..2e3b1d1a227dbc687981cd3423cbef970485b250 100644 (file)
@@ -57,6 +57,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.MissingObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.AnyObjectId;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.NullProgressMonitor;
@@ -64,7 +65,6 @@ import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.ObjectLoader;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevObject;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.eclipse.jgit.storage.pack.PackWriter;
index 820a8ae07ee1355668b73b8779c5c622744866e5..c61ea732f8d1cff15bf1d3eae9057c368b344c1b 100644 (file)
@@ -64,6 +64,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.junit.TestRepository.BranchBuilder;
 import org.eclipse.jgit.lib.Constants;
@@ -71,7 +72,6 @@ import org.eclipse.jgit.junit.TestRepository.CommitBuilder;
 import org.eclipse.jgit.lib.AnyObjectId;
 import org.eclipse.jgit.lib.EmptyProgressMonitor;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.Ref.Storage;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.RefUpdate.Result;
index 7c76f9de80527152749dd9ef12820316123d8f3a..a5cf5cc2d786cb10ce96b2040c66721096966e34 100644 (file)
@@ -49,7 +49,7 @@ import static org.junit.Assert.fail;
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.errors.LockFailedException;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.junit.Test;
 
index 52c9ec70501854479fd5467527cbf38308fc0127..de6cd4c756cc6028c02ca4364b2204d3b44f6043 100644 (file)
 
 package org.eclipse.jgit.storage.file;
 
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
-import java.util.*;
-import java.util.concurrent.*;
-
 public class ObjectDirectoryTest extends RepositoryTestCase {
 
        @Test
index caeeb9fde282f04ec5007542d13bfdb1b8fc010c..9294172f1366470fccc8bfc1f44e52f6e6c1ae3e 100644 (file)
@@ -52,7 +52,7 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 
 import org.eclipse.jgit.errors.MissingObjectException;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.storage.file.PackIndex.MutableEntry;
 import org.junit.Test;
 
index b16c6f28d9fb838c6401c9937debd6d252988371..530636f823aaa0dc054a8921fb22cc2f042fcff2 100644 (file)
@@ -51,7 +51,7 @@ import static org.junit.Assert.fail;
 
 import org.eclipse.jgit.errors.CorruptObjectException;
 import org.eclipse.jgit.junit.JGitTestUtil;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.storage.file.PackIndex.MutableEntry;
 import org.junit.Before;
 import org.junit.Test;
index 281715f5eedd1359ac897a30d227ac4c73f9a805..4ef9698c55b9b7dd9217b184b587f29cd673757f 100644 (file)
@@ -64,13 +64,13 @@ import java.util.Set;
 
 import org.eclipse.jgit.errors.MissingObjectException;
 import org.eclipse.jgit.junit.JGitTestUtil;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.junit.TestRepository.BranchBuilder;
 import org.eclipse.jgit.lib.AnyObjectId;
 import org.eclipse.jgit.lib.NullProgressMonitor;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevObject;
index 0cce2cf255d2cf2f6fc67b886a6844e32456066f..cd56d28153a80094cbf709e958e26262d1ffd434 100644 (file)
@@ -61,6 +61,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.AnyObjectId;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
@@ -70,7 +71,6 @@ import org.eclipse.jgit.lib.RefRename;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.RefUpdate.Result;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.junit.Test;
index 8289fe46848fd5977a29bf6a254b117fd6b0cfc2..e52c89f6021ec7145f2d9c71dc17b77972ebb2e7 100644 (file)
@@ -55,10 +55,10 @@ import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.List;
 
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.PersonIdent;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.junit.Test;
 
 public class ReflogReaderTest extends SampleDataRepositoryTestCase {
index 01febcad61c4f3afbc5f3c7bbded71dff8bf7f15..f97bdd1de0aa03c5ef35fa1d97c5e8e46d437017 100644 (file)
@@ -63,6 +63,7 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.MissingObjectException;
 import org.eclipse.jgit.internal.JGitText;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.AnyObjectId;
 import org.eclipse.jgit.lib.CommitBuilder;
 import org.eclipse.jgit.lib.Constants;
@@ -74,7 +75,6 @@ import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.PersonIdent;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.TagBuilder;
 import org.eclipse.jgit.lib.Tree;
 import org.eclipse.jgit.lib.TreeFormatter;
index 798968e8b126b8a1d95bbbbc37d32e9d7e105d5f..67861f6779d1612b6382ce368ac9c00343ccddd5 100644 (file)
@@ -53,10 +53,10 @@ import java.io.File;
 import java.io.IOException;
 
 import org.eclipse.jgit.junit.JGitTestUtil;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectLoader;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.junit.Test;
 
 public class T0004_PackReaderTest extends SampleDataRepositoryTestCase {
index 54bdca9230eb83f747c7ff80ddc18ae7402df26c..98ae3dac6ae635bcd7ab20c4b4521ebc73119b8b 100644 (file)
@@ -56,10 +56,10 @@ import java.util.List;
 
 import org.eclipse.jgit.errors.CorruptObjectException;
 import org.eclipse.jgit.junit.JGitTestUtil;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectLoader;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.util.MutableInteger;
 import org.junit.Before;
 import org.junit.Test;
index 384363bb96ce13b632dcf2f7e164fd3433280990..467c1ac7b76eaf27bff5fa5d41b6d6ab1b71dc21 100644 (file)
@@ -46,7 +46,7 @@ package org.eclipse.jgit.storage.file;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.junit.Test;
 
 public class WindowCacheReconfigureTest extends RepositoryTestCase {
index 211709f49938293645f4e3a3f47bb31d2a6b6cb6..b17b991addbc388ba20fdf83c40043ee6957ff51 100644 (file)
@@ -60,12 +60,12 @@ import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
 import org.eclipse.jgit.internal.JGitText;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
 import org.junit.Test;
index 424ad01fcbbb871b7cb13f3546f4015aa331cac2..22e55fe729d11f94e0468dda456f52be7d89af60 100644 (file)
@@ -60,11 +60,11 @@ import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
 import org.eclipse.jgit.errors.ConfigInvalidException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
 import org.junit.Test;
 
index 6feefdb2d193ba28f357af0aeec202e947f47def..51c180cd9e99fa4b1e8177b37d177228d2c391a5 100644 (file)
@@ -58,13 +58,13 @@ import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.RefUpdate;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
 import org.junit.Test;
index 9191edef8b9f254168f65c6f0d7de25ea4cce6c6..b00d4528756b7bf7f139f68b9671ff2d25a5f958 100644 (file)
@@ -58,12 +58,12 @@ import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
 import org.junit.Test;
index 306236325ac39f03f084820f86dee5991156beec..eac4c873fb02cde1d2f3168157a94dd6d28d2932 100644 (file)
@@ -57,12 +57,12 @@ import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ConfigConstants;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.StoredConfig;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.FileBasedConfig;
index baa0d094d59a702e1fced0d4684794991feb7d9d..29c953f322082fb99c2bfb6c3fcd4b47bca92c07 100644 (file)
@@ -61,13 +61,13 @@ import org.eclipse.jgit.dircache.DirCacheEditor;
 import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.dircache.DirCacheEntry;
 import org.eclipse.jgit.errors.ConfigInvalidException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.Config;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.storage.file.FileRepository;
index 236f0ee0592705b8cd304f07096f21b6f8d1abb4..02ce186669953964be77e20e7c10e2bf64294017 100644 (file)
@@ -61,11 +61,11 @@ import java.util.Set;
 import org.eclipse.jgit.errors.MissingBundlePrerequisiteException;
 import org.eclipse.jgit.errors.NotSupportedException;
 import org.eclipse.jgit.errors.TransportException;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 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.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.revwalk.RevWalk;
 import org.junit.Test;
index cb527c171216ab9738d615b4921977c058295272..5836db1e60d853d2bc11912792e76da9b6af7640 100644 (file)
@@ -54,8 +54,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.transport.OpenSshConfig.Host;
 import org.eclipse.jgit.util.FileUtils;
 import org.junit.Before;
index bacdb3d91f96c2c2192e13594b141da79a886fe0..bb71e722448c2ea96aa08877fa27985bd33b20d6 100644 (file)
@@ -63,13 +63,13 @@ import java.util.zip.Deflater;
 import org.eclipse.jgit.errors.TooLargeObjectInPackException;
 import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.junit.JGitTestUtil;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.NullProgressMonitor;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.storage.file.ObjectDirectoryPackParser;
 import org.eclipse.jgit.storage.file.PackFile;
index f47401d3e10c4531537ece04845a0eea1639ff57..69824b21385ebe5b69326e40249d9cb7fcd90ca6 100644 (file)
@@ -54,13 +54,13 @@ import java.util.Map;
 
 import org.eclipse.jgit.errors.NotSupportedException;
 import org.eclipse.jgit.errors.TransportException;
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectIdRef;
 import org.eclipse.jgit.lib.ProgressMonitor;
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.RefUpdate.Result;
 import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.TextProgressMonitor;
 import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
 import org.junit.Before;
index 4e7b5e420eeb668bdd8b82493a93dcc256d3d5f9..60310b34ce857e8ef2317d1a8afe4c579a2ac8c8 100644 (file)
@@ -55,9 +55,9 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+import org.eclipse.jgit.junit.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.lib.Config;
 import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.SampleDataRepositoryTestCase;
 import org.eclipse.jgit.storage.file.FileRepository;
 import org.junit.After;
 import org.junit.Before;
index 03823aaf47bf22997d18636fb37c4d339a4db672..58aa608ff5023667ff931e49908382589d4b770b 100644 (file)
@@ -49,9 +49,9 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectReader;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class EmptyTreeIteratorTest extends RepositoryTestCase {
index a416c742f8e7eb4edf3a52e0f589248e64e92d04..6014f3b60e2d3fd59adb141930a2bbdf49dbe398 100644 (file)
@@ -62,11 +62,11 @@ import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
 import org.eclipse.jgit.errors.CorruptObjectException;
 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
 import org.eclipse.jgit.errors.MissingObjectException;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectReader;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.treewalk.WorkingTreeIterator.MetadataDiff;
 import org.eclipse.jgit.treewalk.filter.PathFilter;
index 7dd343b9f5b7d0ab7a7fdb54d5aa749434332086..59c4a8d1bbc956f0316d9cdf03f0dbe156a2c0f9 100644 (file)
@@ -49,11 +49,11 @@ import static org.junit.Assert.assertEquals;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
 import org.eclipse.jgit.lib.ObjectReader;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class ForPathTest extends RepositoryTestCase {
index 3f37e867975d74e4d40e0dc794809d6b2a313be6..54c217276dd5db491c09a2ceacf17b33548e7a72 100644 (file)
@@ -50,8 +50,8 @@ import static org.junit.Assert.assertTrue;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
 import org.eclipse.jgit.dircache.DirCacheIterator;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class NameConflictTreeWalkTest extends RepositoryTestCase {
index ddb31b14d1c46a5b97e29baab356bac1bf381281..acbbb39aad36a9831c4eb317ade6e152f235a32b 100644 (file)
@@ -53,8 +53,8 @@ import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
 import org.eclipse.jgit.dircache.DirCacheEntry;
 import org.eclipse.jgit.dircache.DirCacheIterator;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Test;
 
 public class PostOrderTreeWalkTest extends RepositoryTestCase {
index edec6b04787f6630d36188d31db16127398350fe..b52a727d8d6b27c801a1973cc10eb620b57b80b8 100644 (file)
@@ -50,10 +50,10 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.lib.Tree;
 import org.eclipse.jgit.treewalk.filter.TreeFilter;
 import org.junit.Test;
index ee33c29eba48980a11d7e92ef05721151a4520ff..c95274f68ffa40bb853b2865931897ca540027a0 100644 (file)
@@ -52,7 +52,7 @@ import java.io.File;
 
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.dircache.DirCacheIterator;
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.eclipse.jgit.treewalk.FileTreeIterator;
 import org.eclipse.jgit.treewalk.TreeWalk;
index 818941915a49d906b1c35e20250ad31587d202c3..f7a7fb8a976cd233627cb384c836687aaf5e4075 100644 (file)
@@ -50,7 +50,7 @@ import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.junit.Test;
 
index 2ff9179bdbf8d30d2775c09b533e5a36fa5e0148..6c3b62a62b39969e4c5fb174a4fa65945f2f29a1 100644 (file)
@@ -53,10 +53,10 @@ import java.util.List;
 import org.eclipse.jgit.dircache.DirCache;
 import org.eclipse.jgit.dircache.DirCacheBuilder;
 import org.eclipse.jgit.dircache.DirCacheEntry;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.ObjectInserter;
-import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.junit.Test;
 
index 03c8e73374903f1f18c88713f29ce1141cd3d365..09007e7cb56e0698cd99c3c1ef3299e206c1d625 100644 (file)
@@ -47,7 +47,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-import org.eclipse.jgit.lib.RepositoryTestCase;
+import org.eclipse.jgit.junit.RepositoryTestCase;
 import org.eclipse.jgit.treewalk.EmptyTreeIterator;
 import org.eclipse.jgit.treewalk.TreeWalk;
 import org.junit.Test;