summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-12-22 13:39:38 -0800
committerShawn O. Pearce <spearce@spearce.org>2010-12-22 13:39:38 -0800
commitedeea800a6b482cc721ac11b8d767ca0392947f8 (patch)
tree18d1fb442f4fe5f82c8e558b5d11d473a9a8a756
parent0cd76ab65dedc8af8f5fc7c9bf1bfa4c20e58d8a (diff)
downloadjgit-edeea800a6b482cc721ac11b8d767ca0392947f8.tar.gz
jgit-edeea800a6b482cc721ac11b8d767ca0392947f8.zip
DirCacheIteratorTest: Use newInCore instead of disk
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>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
index 9390e29819..99acd528c9 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
@@ -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" };