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