From 074b4b4599383cd1b9ed1132c7474a5aaf292e78 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 07 Nov 2011 21:17:13 -0500 Subject: [PATCH] Updated to Wicket 1.4.19 --- tests/com/gitblit/tests/SyndicationUtilsTest.java | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/tests/com/gitblit/tests/SyndicationUtilsTest.java b/tests/com/gitblit/tests/SyndicationUtilsTest.java index 9a977b2..e0a32bf 100644 --- a/tests/com/gitblit/tests/SyndicationUtilsTest.java +++ b/tests/com/gitblit/tests/SyndicationUtilsTest.java @@ -18,7 +18,9 @@ import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Date; +import java.util.HashSet; import java.util.List; +import java.util.Set; import junit.framework.TestCase; @@ -42,8 +44,8 @@ entries.add(entry); } ByteArrayOutputStream os = new ByteArrayOutputStream(); - SyndicationUtils.toRSS("http://localhost", "Title", "Description", "Repository", entries, - os); + SyndicationUtils.toRSS("http://localhost", "", "Title", "Description", "Repository", + entries, os); String feed = os.toString(); os.close(); assertTrue(feed.indexOf("<title>Title</title>") > -1); @@ -51,10 +53,26 @@ } public void testFeedRead() throws Exception { - List<SyndicatedEntryModel> feed = SyndicationUtils.readFeed("https://localhost:8443", - "ticgit.git", "master", 5, "admin", "admin".toCharArray()); + Set<String> links = new HashSet<String>(); + for (int i = 0; i < 2; i++) { + List<SyndicatedEntryModel> feed = SyndicationUtils.readFeed("https://localhost:8443", + "ticgit.git", "master", 5, i, "admin", "admin".toCharArray()); + assertTrue(feed != null); + assertTrue(feed.size() > 0); + assertEquals(5, feed.size()); + for (SyndicatedEntryModel entry : feed) { + links.add(entry.link); + } + } + // confirm we have 10 unique commits + assertEquals("Feed pagination failed", 10, links.size()); + } + + public void testSearchFeedRead() throws Exception { + List<SyndicatedEntryModel> feed = SyndicationUtils.readSearchFeed("https://localhost:8443", + "ticgit.git", null, "documentation", null, 5, 0, "admin", "admin".toCharArray()); assertTrue(feed != null); assertTrue(feed.size() > 0); - assertEquals(5, feed.size()); + assertEquals(2, feed.size()); } } \ No newline at end of file -- Gitblit v1.9.1