mobile/android/tests/background/junit3/src/sync/helpers/ExpectInvalidRequestFetchDelegate.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/tests/background/junit3/src/sync/helpers/ExpectInvalidRequestFetchDelegate.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +package org.mozilla.gecko.background.sync.helpers;
     1.8 +
     1.9 +import org.mozilla.gecko.sync.repositories.InvalidRequestException;
    1.10 +import org.mozilla.gecko.sync.repositories.domain.Record;
    1.11 +
    1.12 +public class ExpectInvalidRequestFetchDelegate extends DefaultFetchDelegate {
    1.13 +  public static final String LOG_TAG = "ExpInvRequestFetchDel";
    1.14 +
    1.15 +  @Override
    1.16 +  public void onFetchFailed(Exception ex, Record rec) {
    1.17 +    if (ex instanceof InvalidRequestException) {
    1.18 +      onDone();
    1.19 +    } else {
    1.20 +      performNotify("Expected InvalidRequestException but got ", ex);
    1.21 +    }
    1.22 +  }
    1.23 +
    1.24 +  private void onDone() {
    1.25 +    performNotify();
    1.26 +  }
    1.27 +}

mercurial