oi.release();
}
assertEquals(ObjectId
.fromString("00b1f73724f493096d1ffa0b0f1f1482dbb8c936"), treeId);
final CommitBuilder c1 = new CommitBuilder();
c1.setAuthor(new PersonIdent(author, 1154236443000L, -4 * 60));
c1.setCommitter(new PersonIdent(committer, 1154236443000L, -4 * 60));
c1.setMessage("A Commit\n");
c1.setTreeId(treeId);
assertEquals(treeId, c1.getTreeId());
ObjectId actid1 = insertCommit(c1);
final ObjectId cmtid1 = ObjectId
.fromString("803aec4aba175e8ab1d666873c984c0308179099");
assertEquals(cmtid1, actid1);
final CommitBuilder c2 = new CommitBuilder();
c2.setAuthor(new PersonIdent(author, 1154236443000L, -4 * 60));
c2.setCommitter(new PersonIdent(committer, 1154236443000L, -4 * 60));
c2.setMessage("A Commit 2\n");
c2.setTreeId(treeId);
assertEquals(treeId, c2.getTreeId());
c2.setParentIds(actid1);
ObjectId actid2 = insertCommit(c2);
final ObjectId cmtid2 = ObjectId
.fromString("95d068687c91c5c044fb8c77c5154d5247901553");
assertEquals(cmtid2, actid2);
RevCommit rm2 = parseCommit(cmtid2);
assertNotSame(c2, rm2); // assert the parsed objects is not from the
// cache
assertEquals(c2.getAuthor(), rm2.getAuthorIdent());
assertEquals(actid2, rm2.getId());
assertEquals(c2.getMessage(), rm2.getFullMessage());
assertEquals(c2.getTreeId(), rm2.getTree().getId());
assertEquals(1, rm2.getParentCount());
assertEquals(actid1, rm2.getParent(0));
final CommitBuilder c3 = new CommitBuilder();
c3.setAuthor(new PersonIdent(author, 1154236443000L, -4 * 60));
c3.setCommitter(new PersonIdent(committer, 1154236443000L, -4 * 60));
c3.setMessage("A Commit 3\n");
c3.setTreeId(treeId);
assertEquals(treeId, c3.getTreeId());
c3.setParentIds(actid1, actid2);
ObjectId actid3 = insertCommit(c3);
final ObjectId cmtid3 = ObjectId
.fromString("ce6e1ce48fbeeb15a83f628dc8dc2debefa066f4");
assertEquals(cmtid3, actid3);
RevCommit rm3 = parseCommit(cmtid3);
assertNotSame(c3, rm3); // assert the parsed objects is not from the
// cache
assertEquals(c3.getAuthor(), rm3.getAuthorIdent());
assertEquals(actid3, rm3.getId());
assertEquals(c3.getMessage(), rm3.getFullMessage());
assertEquals(c3.getTreeId(), rm3.getTree().getId());
assertEquals(2, rm3.getParentCount());
assertEquals(actid1, rm3.getParent(0));
assertEquals(actid2, rm3.getParent(1));
final CommitBuilder c4 = new CommitBuilder();
c4.setAuthor(new PersonIdent(author, 1154236443000L, -4 * 60));
c4.setCommitter(new PersonIdent(committer, 1154236443000L, -4 * 60));
c4.setMessage("A Commit 4\n");
c4.setTreeId(treeId);
assertEquals(treeId, c3.getTreeId());
c4.setParentIds(actid1, actid2, actid3);
ObjectId actid4 = insertCommit(c4);
final ObjectId cmtid4 = ObjectId
.fromString("d1fca9fe3fef54e5212eb67902c8ed3e79736e27");
assertEquals(cmtid4, actid4);
RevCommit rm4 = parseCommit(cmtid4);
assertNotSame(c4, rm3); // assert the parsed objects is not from the
// cache
assertEquals(c4.getAuthor(), rm4.getAuthorIdent());
assertEquals(actid4, rm4.getId());
assertEquals(c4.getMessage(), rm4.getFullMessage());
assertEquals(c4.getTreeId(), rm4.getTree().getId());
assertEquals(3, rm4.getParentCount());
assertEquals(actid1, rm4.getParent(0));
assertEquals(actid2, rm4.getParent(1));
assertEquals(actid3, rm4.getParent(2));
}