else if (mark.getName().equals("BookMark3"))
bookMark3 = (IBookMark) mark;
}
/* Preferences */
IPreferencesScope prefs1 = NewsModel.getDefault().getEntityScope(bookMark1);
IPreferencesScope prefs2 = NewsModel.getDefault().getEntityScope(bookMark2);
IPreferencesScope prefs3 = NewsModel.getDefault().getEntityScope(bookMark3);
/* Setup Retention */
prefs1.putBoolean(DefaultPreferences.DEL_NEWS_BY_AGE_STATE, true);
prefs2.putBoolean(DefaultPreferences.DEL_NEWS_BY_AGE_STATE, true);
prefs3.putBoolean(DefaultPreferences.DEL_NEWS_BY_AGE_STATE, true);
prefs1.putBoolean(DefaultPreferences.DEL_NEWS_BY_COUNT_STATE, true);
prefs2.putBoolean(DefaultPreferences.DEL_NEWS_BY_COUNT_STATE, true);
prefs3.putBoolean(DefaultPreferences.DEL_NEWS_BY_COUNT_STATE, true);
prefs1.putBoolean(DefaultPreferences.DEL_READ_NEWS_STATE, true);
prefs2.putBoolean(DefaultPreferences.DEL_READ_NEWS_STATE, true);
prefs3.putBoolean(DefaultPreferences.DEL_READ_NEWS_STATE, true);
/* Run and Validate Retention */
prefs1.putInteger(DefaultPreferences.DEL_NEWS_BY_AGE_VALUE, 20);
prefs2.putInteger(DefaultPreferences.DEL_NEWS_BY_AGE_VALUE, 20);
prefs3.putInteger(DefaultPreferences.DEL_NEWS_BY_AGE_VALUE, 20);
prefs1.putInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE, 20);
prefs2.putInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE, 40);
prefs3.putInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE, 80);
RetentionStrategy.process(folder);
assertEquals(60, countNews(folder));
assertEquals(20, countNews(bookMark1));
assertEquals(40, countNews(bookMark2));
assertEquals(0, countNews(bookMark3));