diff options
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java index 1ea2dc6250..03823aaf47 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/EmptyTreeIteratorTest.java @@ -43,17 +43,26 @@ package org.eclipse.jgit.treewalk; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + 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 { + @Test public void testAtEOF() throws Exception { final EmptyTreeIterator etp = new EmptyTreeIterator(); assertTrue(etp.first()); assertTrue(etp.eof()); } + @Test public void testCreateSubtreeIterator() throws Exception { final EmptyTreeIterator etp = new EmptyTreeIterator(); final ObjectReader reader = db.newObjectReader(); @@ -64,6 +73,7 @@ public class EmptyTreeIteratorTest extends RepositoryTestCase { assertTrue(sub instanceof EmptyTreeIterator); } + @Test public void testEntryObjectId() throws Exception { final EmptyTreeIterator etp = new EmptyTreeIterator(); assertSame(ObjectId.zeroId(), etp.getEntryObjectId()); @@ -72,6 +82,7 @@ public class EmptyTreeIteratorTest extends RepositoryTestCase { assertEquals(ObjectId.zeroId(), ObjectId.fromRaw(etp.idBuffer())); } + @Test public void testNextDoesNothing() throws Exception { final EmptyTreeIterator etp = new EmptyTreeIterator(); etp.next(1); @@ -85,6 +96,7 @@ public class EmptyTreeIteratorTest extends RepositoryTestCase { assertEquals(ObjectId.zeroId(), ObjectId.fromRaw(etp.idBuffer())); } + @Test public void testBackDoesNothing() throws Exception { final EmptyTreeIterator etp = new EmptyTreeIterator(); etp.back(1); @@ -98,6 +110,7 @@ public class EmptyTreeIteratorTest extends RepositoryTestCase { assertEquals(ObjectId.zeroId(), ObjectId.fromRaw(etp.idBuffer())); } + @Test public void testStopWalkCallsParent() throws Exception { final boolean called[] = new boolean[1]; assertFalse(called[0]); |