diff options
author | Chris Aniszczyk <caniszczyk@gmail.com> | 2011-06-19 08:58:25 -0500 |
---|---|---|
committer | Chris Aniszczyk <caniszczyk@gmail.com> | 2011-06-20 10:25:50 -0500 |
commit | 65606dc08637de23d0486d84709f2f33a1bcc9a3 (patch) | |
tree | 5c7fb4fbbd02a2fd625c8c6720d74f0c45752929 /org.eclipse.jgit.test/tst | |
parent | b19924f150f463c5962e6d4c2c20ae42226f9a09 (diff) | |
download | jgit-65606dc08637de23d0486d84709f2f33a1bcc9a3.tar.gz jgit-65606dc08637de23d0486d84709f2f33a1bcc9a3.zip |
Refactor out ReflogEntry
It's useful to have ReflogEntry refactored out so it can be
used by clients via the JGit API.
Change-Id: I03044df9af9f9547777545b7c9b93bdf5f8b7cb5
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java | 14 | ||||
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ReflogReaderTest.java | 13 |
2 files changed, 13 insertions, 14 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java index fe8bdeb424..780fde3c61 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefUpdateTest.java @@ -121,14 +121,14 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase { assertNotSame(newid, r.getObjectId()); assertSame(ObjectId.class, r.getObjectId().getClass()); assertEquals(newid, r.getObjectId()); - List<org.eclipse.jgit.storage.file.ReflogReader.Entry> reverseEntries1 = db.getReflogReader("refs/heads/abc").getReverseEntries(); - org.eclipse.jgit.storage.file.ReflogReader.Entry entry1 = reverseEntries1.get(0); + List<org.eclipse.jgit.storage.file.ReflogEntry> reverseEntries1 = db.getReflogReader("refs/heads/abc").getReverseEntries(); + org.eclipse.jgit.storage.file.ReflogEntry entry1 = reverseEntries1.get(0); assertEquals(1, reverseEntries1.size()); assertEquals(ObjectId.zeroId(), entry1.getOldId()); assertEquals(r.getObjectId(), entry1.getNewId()); assertEquals(new PersonIdent(db).toString(), entry1.getWho().toString()); assertEquals("", entry1.getComment()); - List<org.eclipse.jgit.storage.file.ReflogReader.Entry> reverseEntries2 = db.getReflogReader("HEAD").getReverseEntries(); + List<org.eclipse.jgit.storage.file.ReflogEntry> reverseEntries2 = db.getReflogReader("HEAD").getReverseEntries(); assertEquals(0, reverseEntries2.size()); } @@ -334,7 +334,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase { // the branch HEAD referred to is left untouched assertEquals(pid, db.resolve("refs/heads/master")); ReflogReader reflogReader = new ReflogReader(db, "HEAD"); - org.eclipse.jgit.storage.file.ReflogReader.Entry e = reflogReader.getReverseEntries().get(0); + org.eclipse.jgit.storage.file.ReflogEntry e = reflogReader.getReverseEntries().get(0); assertEquals(pid, e.getOldId()); assertEquals(ppid, e.getNewId()); assertEquals("GIT_COMMITTER_EMAIL", e.getWho().getEmailAddress()); @@ -364,7 +364,7 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase { // the branch HEAD referred to is left untouched assertNull(db.resolve("refs/heads/unborn")); ReflogReader reflogReader = new ReflogReader(db, "HEAD"); - org.eclipse.jgit.storage.file.ReflogReader.Entry e = reflogReader.getReverseEntries().get(0); + org.eclipse.jgit.storage.file.ReflogEntry e = reflogReader.getReverseEntries().get(0); assertEquals(ObjectId.zeroId(), e.getOldId()); assertEquals(ppid, e.getNewId()); assertEquals("GIT_COMMITTER_EMAIL", e.getWho().getEmailAddress()); @@ -701,9 +701,9 @@ public class RefUpdateTest extends SampleDataRepositoryTestCase { ObjectId oldHeadId = db.resolve(Constants.HEAD); writeReflog(db, oldfromId, oldfromId, "Just a message", fromName); - List<org.eclipse.jgit.storage.file.ReflogReader.Entry> oldFromLog = db + List<org.eclipse.jgit.storage.file.ReflogEntry> oldFromLog = db .getReflogReader(fromName).getReverseEntries(); - List<org.eclipse.jgit.storage.file.ReflogReader.Entry> oldHeadLog = oldHeadId != null ? db + List<org.eclipse.jgit.storage.file.ReflogEntry> oldHeadLog = oldHeadId != null ? db .getReflogReader(Constants.HEAD).getReverseEntries() : null; assertTrue("internal check, we have a log", new File(db.getDirectory(), diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ReflogReaderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ReflogReaderTest.java index 24c6aebaf2..afb3ddd9dc 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ReflogReaderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ReflogReaderTest.java @@ -57,7 +57,6 @@ import java.util.List; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.PersonIdent; import org.eclipse.jgit.lib.SampleDataRepositoryTestCase; -import org.eclipse.jgit.storage.file.ReflogReader.Entry; import org.junit.Test; public class ReflogReaderTest extends SampleDataRepositoryTestCase { @@ -91,7 +90,7 @@ public class ReflogReaderTest extends SampleDataRepositoryTestCase { setupReflog("logs/refs/heads/master", oneLine); ReflogReader reader = new ReflogReader(db, "refs/heads/master"); - Entry e = reader.getLastEntry(); + ReflogEntry e = reader.getLastEntry(); assertEquals(ObjectId .fromString("da85355dfc525c9f6f3927b876f379f46ccf826e"), e .getOldId()); @@ -118,9 +117,9 @@ public class ReflogReaderTest extends SampleDataRepositoryTestCase { setupReflog("logs/refs/heads/master", twoLine); ReflogReader reader = new ReflogReader(db, "refs/heads/master"); - List<Entry> reverseEntries = reader.getReverseEntries(); + List<ReflogEntry> reverseEntries = reader.getReverseEntries(); assertEquals(2, reverseEntries.size()); - Entry e = reverseEntries.get(0); + ReflogEntry e = reverseEntries.get(0); assertEquals(ObjectId .fromString("c6734895958052a9dbc396cff4459dc1a25029ab"), e .getOldId()); @@ -153,9 +152,9 @@ public class ReflogReaderTest extends SampleDataRepositoryTestCase { public void testReadWhileAppendIsInProgress() throws Exception { setupReflog("logs/refs/heads/master", twoLineWithAppendInProgress); ReflogReader reader = new ReflogReader(db, "refs/heads/master"); - List<Entry> reverseEntries = reader.getReverseEntries(); + List<ReflogEntry> reverseEntries = reader.getReverseEntries(); assertEquals(2, reverseEntries.size()); - Entry e = reverseEntries.get(0); + ReflogEntry e = reverseEntries.get(0); assertEquals(ObjectId .fromString("c6734895958052a9dbc396cff4459dc1a25029ab"), e .getOldId()); @@ -191,7 +190,7 @@ public class ReflogReaderTest extends SampleDataRepositoryTestCase { public void testReadLineWithMissingComment() throws Exception { setupReflog("logs/refs/heads/master", oneLineWithoutComment); final ReflogReader reader = db.getReflogReader("master"); - Entry e = reader.getLastEntry(); + ReflogEntry e = reader.getLastEntry(); assertEquals(ObjectId .fromString("da85355dfc525c9f6f3927b876f379f46ccf826e"), e .getOldId()); |