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

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     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