From 85079402ffa78dad8881eb0d48a32eb3eee8b919 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 07 Nov 2011 21:19:13 -0500
Subject: [PATCH] Set resource cache duration to 90 days instead of 120 mins (issue 17)
---
tests/com/gitblit/tests/SyndicationUtilsTest.java | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/tests/com/gitblit/tests/SyndicationUtilsTest.java b/tests/com/gitblit/tests/SyndicationUtilsTest.java
index 64b99bd..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;
@@ -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