use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testMarkAllReadWithSameNoOfRecordsAsLimit.
public void testMarkAllReadWithSameNoOfRecordsAsLimit() throws InterruptedException {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setLimit(4);
executeMarkAllRead(dbq);
assertEquals(0, entryManager.getUnreadArticleCount());
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testIsMarkAllReadPossibleWithLimit.
public void testIsMarkAllReadPossibleWithLimit() {
Feed f1 = findFeedByArticleAtomId("atomid1");
DBQuery dbq = new DBQuery(entryManager, null, f1.getId());
dbq.setLimit(4);
assertTrue(entryManager.isMarkAllReadPossible(dbq));
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testMarkAllReadWithLimitDescending.
public void testMarkAllReadWithLimitDescending() throws InterruptedException {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setSortOrderAscending(false);
dbq.setLimit(1);
executeMarkAllRead(dbq);
assertEquals(3, entryManager.getUnreadArticleCount());
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testIsMarkAllReadPossible.
public void testIsMarkAllReadPossible() {
Feed f1 = findFeedByArticleAtomId("atomid1");
DBQuery dbq = new DBQuery(entryManager, null, f1.getId());
assertTrue(entryManager.isMarkAllReadPossible(dbq));
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method testMarkAllReadWithFeed.
public void testMarkAllReadWithFeed() {
Feed f1 = findFeedByArticleAtomId("atomid1");
Feed f2 = findFeedByArticleAtomId("atomid2");
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setFilterFeedId(f1.getId());
assertEquals(4, entryManager.getMarkAllReadCount(dbq));
// one read and two unread articles in this feed
dbq.setFilterFeedId(f2.getId());
assertEquals(0, entryManager.getMarkAllReadCount(dbq));
// non-existent feed
dbq.setFilterFeedId(999l);
assertEquals(0, entryManager.getMarkAllReadCount(dbq));
}
Aggregations