mobile/android/tests/background/junit3/src/sync/helpers/ExpectFetchDelegate.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 java.util.HashMap;
     8 import org.mozilla.gecko.sync.repositories.domain.Record;
    10 public class ExpectFetchDelegate extends DefaultFetchDelegate {
    11   private HashMap<String, Record> expect = new HashMap<String, Record>();
    13   public ExpectFetchDelegate(Record[] records) {
    14     for(int i = 0; i < records.length; i++) {
    15       expect.put(records[i].guid, records[i]);
    16     }
    17   }
    19   @Override
    20   public void onFetchedRecord(Record record) {
    21     this.records.add(record);
    22   }
    24   @Override
    25   public void onFetchCompleted(final long fetchEnd) {
    26     super.onDone(this.records, this.expect, fetchEnd);
    27   }
    29   public Record recordAt(int i) {
    30     return this.records.get(i);
    31   }
    32 }

mercurial