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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 package org.mozilla.gecko.background.sync.helpers;
     6 import static junit.framework.Assert.assertEquals;
     8 import java.util.HashSet;
     9 import java.util.Set;
    11 import junit.framework.AssertionFailedError;
    13 public class ExpectNoGUIDsSinceDelegate extends DefaultGuidsSinceDelegate {
    15   public Set<String> ignore = new HashSet<String>();
    17   @Override
    18   public void onGuidsSinceSucceeded(String[] guids) {
    19     AssertionFailedError err = null;
    20     try {
    21       int nonIgnored = 0;
    22       for (int i = 0; i < guids.length; i++) {
    23         if (!ignore.contains(guids[i])) {
    24           nonIgnored++;
    25         }
    26       }
    27       assertEquals(0, nonIgnored);
    28     } catch (AssertionFailedError e) {
    29       err = e;
    30     }
    31     performNotify(err);
    32   }
    33 }

mercurial