Fixed race condition in testMarkAllItemsReadSameFeed
This commit is contained in:
parent
df9f6661e1
commit
05c62ca32f
@ -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 Context context = getInstrumentation().getTargetContext();
|
||||||
final int NUM_ITEMS = 10;
|
final int NUM_ITEMS = 10;
|
||||||
Feed feed = new Feed("url", new Date(), "title");
|
Feed feed = new Feed("url", new Date(), "title");
|
||||||
@ -728,7 +728,7 @@ public class DBWriterTest extends InstrumentationTestCase {
|
|||||||
assertTrue(item.getId() != 0);
|
assertTrue(item.getId() != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBWriter.markAllItemsRead(context);
|
DBWriter.markAllItemsRead(context).get(TIMEOUT, TimeUnit.SECONDS);
|
||||||
List<FeedItem> loadedItems = DBReader.getFeedItemList(context, feed);
|
List<FeedItem> loadedItems = DBReader.getFeedItemList(context, feed);
|
||||||
for (FeedItem item : loadedItems) {
|
for (FeedItem item : loadedItems) {
|
||||||
assertTrue(item.isRead());
|
assertTrue(item.isRead());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user