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