michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: package org.mozilla.gecko.background.sync.helpers; michael@0: michael@0: import static junit.framework.Assert.assertEquals; michael@0: michael@0: import java.util.HashSet; michael@0: import java.util.Set; michael@0: michael@0: import junit.framework.AssertionFailedError; michael@0: michael@0: public class ExpectNoGUIDsSinceDelegate extends DefaultGuidsSinceDelegate { michael@0: michael@0: public Set ignore = new HashSet(); michael@0: michael@0: @Override michael@0: public void onGuidsSinceSucceeded(String[] guids) { michael@0: AssertionFailedError err = null; michael@0: try { michael@0: int nonIgnored = 0; michael@0: for (int i = 0; i < guids.length; i++) { michael@0: if (!ignore.contains(guids[i])) { michael@0: nonIgnored++; michael@0: } michael@0: } michael@0: assertEquals(0, nonIgnored); michael@0: } catch (AssertionFailedError e) { michael@0: err = e; michael@0: } michael@0: performNotify(err); michael@0: } michael@0: }