Fixed race condition in testMarkAllItemsReadSameFeed

This commit is contained in:
daniel oeh 2013-10-12 00:30:24 +02:00
parent df9f6661e1
commit 05c62ca32f
1 changed files with 2 additions and 2 deletions

View File

@ -708,7 +708,7 @@ public class DBWriterTest extends InstrumentationTestCase {
}
}
public void testMarkAllItemsReadSameFeed() {
public void testMarkAllItemsReadSameFeed() throws InterruptedException, ExecutionException, TimeoutException {
final Context context = getInstrumentation().getTargetContext();
final int NUM_ITEMS = 10;
Feed feed = new Feed("url", new Date(), "title");
@ -728,7 +728,7 @@ public class DBWriterTest extends InstrumentationTestCase {
assertTrue(item.getId() != 0);
}
DBWriter.markAllItemsRead(context);
DBWriter.markAllItemsRead(context).get(TIMEOUT, TimeUnit.SECONDS);
List<FeedItem> loadedItems = DBReader.getFeedItemList(context, feed);
for (FeedItem item : loadedItems) {
assertTrue(item.isRead());