use of com.newsrob.IEntryModelUpdateListener in project newsrob by marianokamp.
the class MarkAllReadDbQueryTests method executeMarkAllRead.
private void executeMarkAllRead(DBQuery dbq) throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
entryManager.addListener(new IEntryModelUpdateListener() {
@Override
public void statusUpdated() {
}
@Override
public void modelUpdated(String atomId) {
}
@Override
public void modelUpdated() {
latch.countDown();
}
@Override
public void modelUpdateStarted(boolean fastSyncOnly) {
}
@Override
public void modelUpdateFinished(ModelUpdateResult result) {
}
});
entryManager.requestMarkAllAsRead(dbq);
latch.await(3, TimeUnit.SECONDS);
}
use of com.newsrob.IEntryModelUpdateListener in project newsrob by marianokamp.
the class PinTests method executeMarkAllRead.
private void executeMarkAllRead(DBQuery dbq) throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
entryManager.addListener(new IEntryModelUpdateListener() {
@Override
public void statusUpdated() {
}
@Override
public void modelUpdated(String atomId) {
}
@Override
public void modelUpdated() {
latch.countDown();
}
@Override
public void modelUpdateStarted(boolean fastSyncOnly) {
}
@Override
public void modelUpdateFinished(ModelUpdateResult result) {
}
});
entryManager.requestMarkAllAsRead(dbq);
latch.await(3, TimeUnit.SECONDS);
}
use of com.newsrob.IEntryModelUpdateListener in project newsrob by marianokamp.
the class MarkReadUntilHereUITests method doReadUntilHereWithConfirmationDialog.
private void doReadUntilHereWithConfirmationDialog(boolean positive) throws InterruptedException {
setMarkAllReadConfirmationThreshold(1);
final CountDownLatch latch = new CountDownLatch(1);
entryManager.addListener(new IEntryModelUpdateListener() {
@Override
public void statusUpdated() {
}
@Override
public void modelUpdated(String atomId) {
}
@Override
public void modelUpdated() {
latch.countDown();
}
@Override
public void modelUpdateStarted(boolean fastSyncOnly) {
}
@Override
public void modelUpdateFinished(ModelUpdateResult result) {
}
});
sendKeys("DPAD_DOWN DPAD_DOWN DPAD_DOWN DPAD_DOWN");
assertEquals(3, getActivity().getListView().getSelectedItemPosition());
getInstrumentation().waitForIdleSync();
getInstrumentation().invokeContextMenuAction(getActivity(), 112, 0);
getInstrumentation().waitForIdleSync();
if (positive)
sendKeys("DPAD_CENTER");
else
sendKeys("DPAD_RIGHT DPAD_RIGHT DPAD_CENTER");
getInstrumentation().waitForIdleSync();
boolean reachedZero = latch.await(3000, TimeUnit.MILLISECONDS);
if (positive)
// Scream if timeout
assertTrue(reachedZero);
}
use of com.newsrob.IEntryModelUpdateListener in project newsrob by marianokamp.
the class MarkReadUntilHereUITests method executeMarkReadUntilHereOnCurrentSelection.
private void executeMarkReadUntilHereOnCurrentSelection() throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
entryManager.addListener(new IEntryModelUpdateListener() {
@Override
public void statusUpdated() {
}
@Override
public void modelUpdated(String atomId) {
}
@Override
public void modelUpdated() {
latch.countDown();
}
@Override
public void modelUpdateStarted(boolean fastSyncOnly) {
}
@Override
public void modelUpdateFinished(ModelUpdateResult result) {
}
});
getInstrumentation().invokeContextMenuAction(getActivity(), 112, 0);
getInstrumentation().waitForIdleSync();
// Scream if timeout
assertTrue(latch.await(3, TimeUnit.SECONDS));
}
use of com.newsrob.IEntryModelUpdateListener in project newsrob by marianokamp.
the class LikeStateTests method testUpdateNotification.
public void testUpdateNotification() {
entryManager.addListener(new IEntryModelUpdateListener() {
@Override
public void statusUpdated() {
}
@Override
public void modelUpdated(String atomId) {
modelUpdatedStringCalled = true;
}
@Override
public void modelUpdated() {
modelUpdatedCalled = true;
}
@Override
public void modelUpdateStarted(boolean fastSyncOnly) {
}
@Override
public void modelUpdateFinished(ModelUpdateResult result) {
}
});
Entry e = findEntryNotLikedNotLikePending();
assertTrue(modelUpdatedCalled);
}
Aggregations