|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 package org.mozilla.gecko.background.sync.helpers; |
|
5 |
|
6 import static junit.framework.Assert.assertEquals; |
|
7 |
|
8 import java.util.HashSet; |
|
9 import java.util.Set; |
|
10 |
|
11 import junit.framework.AssertionFailedError; |
|
12 |
|
13 public class ExpectNoGUIDsSinceDelegate extends DefaultGuidsSinceDelegate { |
|
14 |
|
15 public Set<String> ignore = new HashSet<String>(); |
|
16 |
|
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 } |