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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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 org.json.simple.JSONArray;
michael@0 7 import org.json.simple.JSONObject;
michael@0 8 import org.mozilla.gecko.sync.repositories.domain.HistoryRecord;
michael@0 9
michael@0 10 public class HistoryHelpers {
michael@0 11
michael@0 12 @SuppressWarnings("unchecked")
michael@0 13 private static JSONArray getVisits1() {
michael@0 14 JSONArray json = new JSONArray();
michael@0 15 JSONObject obj = new JSONObject();
michael@0 16 obj.put("date", 1320087601465600000L);
michael@0 17 obj.put("type", 2L);
michael@0 18 json.add(obj);
michael@0 19 obj = new JSONObject();
michael@0 20 obj.put("date", 1320084970724990000L);
michael@0 21 obj.put("type", 1L);
michael@0 22 json.add(obj);
michael@0 23 obj = new JSONObject();
michael@0 24 obj.put("date", 1319764134412287000L);
michael@0 25 obj.put("type", 1L);
michael@0 26 json.add(obj);
michael@0 27 obj = new JSONObject();
michael@0 28 obj.put("date", 1319681306455594000L);
michael@0 29 obj.put("type", 2L);
michael@0 30 json.add(obj);
michael@0 31 return json;
michael@0 32 }
michael@0 33
michael@0 34 @SuppressWarnings("unchecked")
michael@0 35 private static JSONArray getVisits2() {
michael@0 36 JSONArray json = new JSONArray();
michael@0 37 JSONObject obj = new JSONObject();
michael@0 38 obj = new JSONObject();
michael@0 39 obj.put("date", 1319764134412345000L);
michael@0 40 obj.put("type", 4L);
michael@0 41 json.add(obj);
michael@0 42 obj = new JSONObject();
michael@0 43 obj.put("date", 1319681306454321000L);
michael@0 44 obj.put("type", 3L);
michael@0 45 json.add(obj);
michael@0 46 return json;
michael@0 47 }
michael@0 48
michael@0 49 public static HistoryRecord createHistory1() {
michael@0 50 HistoryRecord record = new HistoryRecord();
michael@0 51 record.title = "History 1";
michael@0 52 record.histURI = "http://history.page1.com";
michael@0 53 record.visits = getVisits1();
michael@0 54 return record;
michael@0 55 }
michael@0 56
michael@0 57
michael@0 58 public static HistoryRecord createHistory2() {
michael@0 59 HistoryRecord record = new HistoryRecord();
michael@0 60 record.title = "History 2";
michael@0 61 record.histURI = "http://history.page2.com";
michael@0 62 record.visits = getVisits2();
michael@0 63 return record;
michael@0 64 }
michael@0 65
michael@0 66 public static HistoryRecord createHistory3() {
michael@0 67 HistoryRecord record = new HistoryRecord();
michael@0 68 record.title = "History 3";
michael@0 69 record.histURI = "http://history.page3.com";
michael@0 70 record.visits = getVisits2();
michael@0 71 return record;
michael@0 72 }
michael@0 73
michael@0 74 public static HistoryRecord createHistory4() {
michael@0 75 HistoryRecord record = new HistoryRecord();
michael@0 76 record.title = "History 4";
michael@0 77 record.histURI = "http://history.page4.com";
michael@0 78 record.visits = getVisits1();
michael@0 79 return record;
michael@0 80 }
michael@0 81
michael@0 82 public static HistoryRecord createHistory5() {
michael@0 83 HistoryRecord record = new HistoryRecord();
michael@0 84 record.title = "History 5";
michael@0 85 record.histURI = "http://history.page5.com";
michael@0 86 record.visits = getVisits2();
michael@0 87 return record;
michael@0 88 }
michael@0 89
michael@0 90 }

mercurial