mobile/android/tests/background/junit3/src/sync/helpers/ExpectNoGUIDsSinceDelegate.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/ExpectNoGUIDsSinceDelegate.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     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 static junit.framework.Assert.assertEquals;
    1.10 +
    1.11 +import java.util.HashSet;
    1.12 +import java.util.Set;
    1.13 +
    1.14 +import junit.framework.AssertionFailedError;
    1.15 +
    1.16 +public class ExpectNoGUIDsSinceDelegate extends DefaultGuidsSinceDelegate {
    1.17 +
    1.18 +  public Set<String> ignore = new HashSet<String>();
    1.19 +
    1.20 +  @Override
    1.21 +  public void onGuidsSinceSucceeded(String[] guids) {
    1.22 +    AssertionFailedError err = null;
    1.23 +    try {
    1.24 +      int nonIgnored = 0;
    1.25 +      for (int i = 0; i < guids.length; i++) {
    1.26 +        if (!ignore.contains(guids[i])) {
    1.27 +          nonIgnored++;
    1.28 +        }
    1.29 +      }
    1.30 +      assertEquals(0, nonIgnored);
    1.31 +    } catch (AssertionFailedError e) {
    1.32 +      err = e;
    1.33 +    }
    1.34 +    performNotify(err);
    1.35 +  }
    1.36 +}

mercurial