use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testIsMarkAllReadPossibleNegative.
public void testIsMarkAllReadPossibleNegative() {
Feed f2 = findFeedByArticleAtomId("atomid2");
DBQuery dbq = new DBQuery(entryManager, null, f2.getId());
assertFalse(entryManager.isMarkAllReadPossible(dbq));
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testMarkAllReadWithMoreRecordsThanLimit.
public void testMarkAllReadWithMoreRecordsThanLimit() throws InterruptedException {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setLimit(3);
executeMarkAllRead(dbq);
assertEquals(1, entryManager.getUnreadArticleCount());
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class DBQueryContentCursorTests method testContentCursorUnreadCount.
public void testContentCursorUnreadCount() {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setSortOrderAscending(true);
dbq.setShouldHideReadItemsWithoutUpdatingThePreference(true);
assertEquals(4, entryManager.getContentCount(dbq));
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class DBQueryContentCursorTests method testContentCursorOrderDescending.
public void testContentCursorOrderDescending() {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setSortOrderAscending(false);
dbq.setShouldHideReadItemsWithoutUpdatingThePreference(false);
List<String> expectedIds = new ArrayList<String>(atomIdsOrderedAscending.size());
for (String s : atomIdsOrderedAscending) expectedIds.add(0, s);
executeAndVerify(dbq, expectedIds);
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class DBQueryContentCursorTests method testContentCursorOrderDescendingWithLimit.
public void testContentCursorOrderDescendingWithLimit() {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setSortOrderAscending(false);
dbq.setShouldHideReadItemsWithoutUpdatingThePreference(false);
dbq.setLimit(1);
List<String> expectedIds = new ArrayList<String>(atomIdsOrderedAscending.size());
for (String s : atomIdsOrderedAscending) expectedIds.add(0, s);
expectedIds = expectedIds.subList(0, 1);
executeAndVerify(dbq, expectedIds);
}
Aggregations