]> source.dussan.org Git - jgit.git/commitdiff
DirCacheIteratorTest: Use newInCore instead of disk 67/2167/1
authorShawn O. Pearce <spearce@spearce.org>
Wed, 22 Dec 2010 21:39:38 +0000 (13:39 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 22 Dec 2010 21:39:38 +0000 (13:39 -0800)
Avoid the dependency on the local filesystem by using only an in-core
DirCache instance.  Each test case builds up the index from scratch
anyway through a DirCacheBuilder.

Change-Id: I5decf6bffc3ed35bf1d3e4ad5cc095891c80b772
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java

index 9390e2981908ba1377e654738b96de19c262f045..99acd528c98a7f023540b6212acc980a0de4c09b 100644 (file)
@@ -52,7 +52,7 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
 
 public class DirCacheIteratorTest extends RepositoryTestCase {
        public void testEmptyTree_NoTreeWalk() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
                assertEquals(0, dc.getEntryCount());
 
                final DirCacheIterator i = new DirCacheIterator(dc);
@@ -60,7 +60,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
        }
 
        public void testEmptyTree_WithTreeWalk() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
                assertEquals(0, dc.getEntryCount());
 
                final TreeWalk tw = new TreeWalk(db);
@@ -69,7 +69,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
        }
 
        public void testNoSubtree_NoTreeWalk() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
 
                final String[] paths = { "a.", "a0b" };
                final DirCacheEntry[] ents = new DirCacheEntry[paths.length];
@@ -94,7 +94,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
        }
 
        public void testNoSubtree_WithTreeWalk() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
 
                final String[] paths = { "a.", "a0b" };
                final FileMode[] modes = { FileMode.EXECUTABLE_FILE, FileMode.GITLINK };
@@ -126,7 +126,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
        }
 
        public void testSingleSubtree_NoRecursion() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
 
                final String[] paths = { "a.", "a/b", "a/c", "a/d", "a0b" };
                final DirCacheEntry[] ents = new DirCacheEntry[paths.length];
@@ -169,7 +169,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
        }
 
        public void testSingleSubtree_Recursive() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
 
                final FileMode mode = FileMode.REGULAR_FILE;
                final String[] paths = { "a.", "a/b", "a/c", "a/d", "a0b" };
@@ -203,7 +203,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
        }
 
        public void testTwoLevelSubtree_Recursive() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
 
                final FileMode mode = FileMode.REGULAR_FILE;
                final String[] paths = { "a.", "a/b", "a/c/e", "a/c/f", "a/d", "a0b" };
@@ -236,7 +236,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
        }
 
        public void testTwoLevelSubtree_FilterPath() throws Exception {
-               final DirCache dc = db.readDirCache();
+               final DirCache dc = DirCache.newInCore();
 
                final FileMode mode = FileMode.REGULAR_FILE;
                final String[] paths = { "a.", "a/b", "a/c/e", "a/c/f", "a/d", "a0b" };