From e58025f3b89f8ab67a71c8e50f4aec435c952bcb Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sat, 16 Jun 2012 13:30:21 +0200 Subject: [PATCH] added unit test for mercurial log command paging --- .../scm/repository/spi/HgLogCommandTest.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/HgLogCommandTest.java b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/HgLogCommandTest.java index 90c504bb80..a822d2ad01 100644 --- a/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/HgLogCommandTest.java +++ b/scm-plugins/scm-hg-plugin/src/test/java/sonia/scm/repository/spi/HgLogCommandTest.java @@ -102,6 +102,40 @@ public class HgLogCommandTest extends AbstractHgCommandTestBase assertEquals("0:a9bacaf1b7fa", result.getChangesets().get(2).getId()); } + + /** + * Method description + * + * + * @throws IOException + */ + @Test + public void testGetAllWithPaging() throws IOException, RepositoryException + { + LogCommandRequest request = new LogCommandRequest(); + + request.setPagingStart(1); + request.setPagingLimit(2); + + ChangesetPagingResult result = + new HgLogCommand(handler, new HgContext(), repository, + repositoryDirectory).getChangesets(request); + + assertNotNull(result); + assertEquals(5, result.getTotal()); + assertEquals(2, result.getChangesets().size()); + + Changeset c1 = result.getChangesets().get(0); + + assertNotNull(c1); + assertEquals("3:542bf4893dd2", c1.getId()); + + Changeset c2 = result.getChangesets().get(1); + + assertNotNull(c2); + assertEquals("2:79b6baf49711", c2.getId()); + } + /** * Method description *