/** * Sends a jsonobject to the method and checks that it can parse it correctly * * @throws JSONException */ public void testParseJsonAndDraw() throws JSONException { String jsonresponse = "{\"result\":[{\"time\":\"2012-10-10 12:48:11\",\"name\":\"Arne\",\"lat\":\"57685535\",\"lng\":\"11977898\"},{\"time\":\"2012-10-10 12:48:41\",\"name\":\"Anna\",\"lat\":\"57685534\",\"lng\":\"11977897\"},{\"time\":\"2012-10-10 12:57:36\",\"name\":\"Kalle\",\"lat\":\"57685533\",\"lng\":\"11977896\"}]}"; JSONObject jsonobject = new JSONObject(jsonresponse); activity.parseJsonAndDraw(jsonobject); assertEquals(SIZEOFJSONARRAY, activity.getSizeOfJsonArray()); }