Search in sources :

Example 21 with DBQuery

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

Example 22 with DBQuery

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

Example 23 with DBQuery

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

Example 24 with DBQuery

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

Example 25 with DBQuery

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

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