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 org.json.simple.JSONArray; michael@0: import org.json.simple.JSONObject; michael@0: import org.mozilla.gecko.sync.repositories.domain.HistoryRecord; michael@0: michael@0: public class HistoryHelpers { michael@0: michael@0: @SuppressWarnings("unchecked") michael@0: private static JSONArray getVisits1() { michael@0: JSONArray json = new JSONArray(); michael@0: JSONObject obj = new JSONObject(); michael@0: obj.put("date", 1320087601465600000L); michael@0: obj.put("type", 2L); michael@0: json.add(obj); michael@0: obj = new JSONObject(); michael@0: obj.put("date", 1320084970724990000L); michael@0: obj.put("type", 1L); michael@0: json.add(obj); michael@0: obj = new JSONObject(); michael@0: obj.put("date", 1319764134412287000L); michael@0: obj.put("type", 1L); michael@0: json.add(obj); michael@0: obj = new JSONObject(); michael@0: obj.put("date", 1319681306455594000L); michael@0: obj.put("type", 2L); michael@0: json.add(obj); michael@0: return json; michael@0: } michael@0: michael@0: @SuppressWarnings("unchecked") michael@0: private static JSONArray getVisits2() { michael@0: JSONArray json = new JSONArray(); michael@0: JSONObject obj = new JSONObject(); michael@0: obj = new JSONObject(); michael@0: obj.put("date", 1319764134412345000L); michael@0: obj.put("type", 4L); michael@0: json.add(obj); michael@0: obj = new JSONObject(); michael@0: obj.put("date", 1319681306454321000L); michael@0: obj.put("type", 3L); michael@0: json.add(obj); michael@0: return json; michael@0: } michael@0: michael@0: public static HistoryRecord createHistory1() { michael@0: HistoryRecord record = new HistoryRecord(); michael@0: record.title = "History 1"; michael@0: record.histURI = "http://history.page1.com"; michael@0: record.visits = getVisits1(); michael@0: return record; michael@0: } michael@0: michael@0: michael@0: public static HistoryRecord createHistory2() { michael@0: HistoryRecord record = new HistoryRecord(); michael@0: record.title = "History 2"; michael@0: record.histURI = "http://history.page2.com"; michael@0: record.visits = getVisits2(); michael@0: return record; michael@0: } michael@0: michael@0: public static HistoryRecord createHistory3() { michael@0: HistoryRecord record = new HistoryRecord(); michael@0: record.title = "History 3"; michael@0: record.histURI = "http://history.page3.com"; michael@0: record.visits = getVisits2(); michael@0: return record; michael@0: } michael@0: michael@0: public static HistoryRecord createHistory4() { michael@0: HistoryRecord record = new HistoryRecord(); michael@0: record.title = "History 4"; michael@0: record.histURI = "http://history.page4.com"; michael@0: record.visits = getVisits1(); michael@0: return record; michael@0: } michael@0: michael@0: public static HistoryRecord createHistory5() { michael@0: HistoryRecord record = new HistoryRecord(); michael@0: record.title = "History 5"; michael@0: record.histURI = "http://history.page5.com"; michael@0: record.visits = getVisits2(); michael@0: return record; michael@0: } michael@0: michael@0: }