Updated JUnit tests for Bug 8890. RCL_2_0
authorstechong
Thu, 16 Apr 2009 14:40:22 -0500
branchRCL_2_0
changeset 100 b7cd497951b7
parent 99 3604ec4c983e
child 101 508f2f2592b2
Updated JUnit tests for Bug 8890.
core/com.nokia.carbide.cpp.news.reader.tests/src/com/nokia/carbide/cpp/news/reader/tests/FeedManagerTest.java
--- a/core/com.nokia.carbide.cpp.news.reader.tests/src/com/nokia/carbide/cpp/news/reader/tests/FeedManagerTest.java	Thu Apr 16 14:39:51 2009 -0500
+++ b/core/com.nokia.carbide.cpp.news.reader.tests/src/com/nokia/carbide/cpp/news/reader/tests/FeedManagerTest.java	Thu Apr 16 14:40:22 2009 -0500
@@ -120,19 +120,20 @@
 		}
 	}
 
-	public void testRemoveNewsFeedEntry() {
+	public void testMarkEntryAsRead() {
 		try {
 			feedManager.loadFeeds();
 			List<CarbideSyndFeed> newsFeeds = feedManager.getNewsFeeds();
 			if (newsFeeds != null && newsFeeds.size() > 0) {
 				CarbideSyndFeed feed = newsFeeds.get(0);
-				List<CarbideSyndEntry> feedEntries = feed.getEntries();
-				if (feedEntries != null && feedEntries.size() > 0) {
+				List<CarbideSyndEntry> feedEntries = feed.getUnreadEntries();
+				while (feedEntries != null && feedEntries.size() > 0) {
 					int oldCount = feed.getUnreadEntries().size();
 					CarbideSyndEntry feedEntry = feedEntries.get(0);
-					feedManager.removeNewsFeedEntry(feedEntries, feedEntry.getTitle());
+					feedManager.markEntryAsRead(feedEntries, feedEntry.getTitle());
 					int newCount = feed.getUnreadEntries().size();
-					assertTrue(newCount > oldCount);
+					assertTrue(newCount < oldCount);
+					feedEntries = feed.getUnreadEntries();
 				}
 			}
 		} catch (Exception e) {