Search in sources :

Example 16 with DBQuery

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());
}
Also used : DBQuery(com.newsrob.DBQuery)

Example 17 with DBQuery

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));
}
Also used : DBQuery(com.newsrob.DBQuery) Feed(com.newsrob.Feed)

Example 18 with DBQuery

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());
}
Also used : DBQuery(com.newsrob.DBQuery)

Example 19 with DBQuery

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));
}
Also used : DBQuery(com.newsrob.DBQuery) Feed(com.newsrob.Feed)

Example 20 with DBQuery

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));
}
Also used : DBQuery(com.newsrob.DBQuery) Feed(com.newsrob.Feed)

Aggregations

DBQuery (com.newsrob.DBQuery)32 Feed (com.newsrob.Feed)7 Intent (android.content.Intent)3 Entry (com.newsrob.Entry)2 ArrayList (java.util.ArrayList)2 AppWidgetManager (android.appwidget.AppWidgetManager)1 Cursor (android.database.Cursor)1 Bundle (android.os.Bundle)1 TypedValue (android.util.TypedValue)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 ProgressBar (android.widget.ProgressBar)1 RemoteViews (android.widget.RemoteViews)1 TextView (android.widget.TextView)1 Date (java.util.Date)1