Mercurial > hg4j
diff test/org/tmatesoft/hg/test/TestCommit.java @ 660:4fd317a2fecf
Pull: phase1 get remote changes and add local revisions
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 09 Jul 2013 21:46:45 +0200 |
parents | cd77bf51b562 |
children |
line wrap: on
line diff
--- a/test/org/tmatesoft/hg/test/TestCommit.java Thu Jul 04 21:09:33 2013 +0200 +++ b/test/org/tmatesoft/hg/test/TestCommit.java Tue Jul 09 21:46:45 2013 +0200 @@ -20,7 +20,6 @@ import static org.tmatesoft.hg.repo.HgRepository.*; import java.io.File; -import java.io.IOException; import java.util.List; import org.junit.Rule; @@ -160,7 +159,7 @@ // check if cached value in hgRepo got updated errorCollector.assertEquals("branch1", hgRepo.getWorkingCopyBranchName()); // - assertHgVerifyOk(repoLoc); + RepoUtils.assertHgVerifyOk(errorCollector, repoLoc); } /** @@ -192,7 +191,7 @@ new HgCatCommand(hgRepo).file(Path.create("xx")).changeset(commitRev).execute(sink); assertArrayEquals("xyz".getBytes(), sink.toArray()); // - assertHgVerifyOk(repoLoc); + RepoUtils.assertHgVerifyOk(errorCollector, repoLoc); } /** * perform few commits one by one, into different branches @@ -240,7 +239,7 @@ errorCollector.assertEquals("FIRST", c1.getComment()); errorCollector.assertEquals("SECOND", c2.getComment()); errorCollector.assertEquals("THIRD", c3.getComment()); - assertHgVerifyOk(repoLoc); + RepoUtils.assertHgVerifyOk(errorCollector, repoLoc); } @Test @@ -289,7 +288,7 @@ errorCollector.assertEquals(csets.get(1).getNodeid(), c2); errorCollector.assertEquals(csets.get(0).getComment(), "FIRST"); errorCollector.assertEquals(csets.get(1).getComment(), "SECOND"); - assertHgVerifyOk(repoLoc); + RepoUtils.assertHgVerifyOk(errorCollector, repoLoc); // new commits are drafts by default, check our commit respects this // TODO more tests with children of changesets with draft, secret or public phases (latter - // new commit is child of public, but there are other commits with draft/secret phases - ensure they are intact) @@ -488,13 +487,7 @@ errorCollector.assertTrue(status.get(Kind.Modified).contains(dfB.getPath())); errorCollector.assertTrue(status.get(Kind.Removed).contains(dfD.getPath())); - assertHgVerifyOk(repoLoc); - } - - private void assertHgVerifyOk(File repoLoc) throws InterruptedException, IOException { - ExecHelper verifyRun = new ExecHelper(new OutputParser.Stub(), repoLoc); - verifyRun.run("hg", "verify"); - errorCollector.assertEquals("hg verify", 0, verifyRun.getExitValue()); + RepoUtils.assertHgVerifyOk(errorCollector, repoLoc); } private Transaction newTransaction(SessionContext.Source ctxSource) {