/**
* Tests performance of {@link com.db.oliviergoutay.greendao_vs_realm.greendao.GreenDaoDailyMealManager#updateDatabase(DailyMealApi)}
*/
@MediumTest
public void testUpdateDatabasePerformance() throws InterruptedException {
CountDownLatch countDownLatch = new CountDownLatch(1);
greenDaoDailyMealManager.setTestCountDownLatch(countDownLatch);
long start = System.currentTimeMillis();
greenDaoDailyMealManager.updateDatabase(getMockDailyMealForDate(new Date()));
countDownLatch.await();
long end = System.currentTimeMillis();
Log.i(TAG, "Insert of 1 DailyMealApi took : " + (end - start) + " milliseconds");
//Check time is less than 3000 millis
assertTrue(3000 > end - start);
//Check all were inserted
assertEquals(1, dao.getDailyMealDao().loadAll().size());
assertEquals(4, dao.getMealDao().loadAll().size());
}
GreenDaoPerformanceTest.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:GreenDao-vs-Realm
作者:
评论列表
文章目录