public void testObjectMarshallingToJson(){
  ToDoItem toDoItem=getToDoItem(REMINDER_ON);
  try {
    JSONObject json=toDoItem.toJSON();
    assertEquals(TEXT_BODY,json.getString("todotext"));
    assertEquals(REMINDER_ON,json.getBoolean("todoreminder"));
    assertEquals(String.valueOf(CURRENT_DATE.getTime()),json.getString("tododate"));
  }
 catch (  JSONException e) {
    fail("Exception thrown during test execution: " + e.getMessage());
  }
}

public void testObjectMarshallingToJson ( ) { ToDoItem toDoItem = getToDoItem ( REMINDER_ON ) ; try { JSONObject json = toDoItem . toJSON ( ) ; assertEquals ( TEXT_BODY , json . getString ( "todotext" ) ) ; assertEquals ( REMINDER_ON , json . getBoolean ( "todoreminder" ) ) ; assertEquals ( String . valueOf ( CURRENT_DATE . getTime ( ) ) , json . getString ( "tododate" ) ) ; } catch ( JSONException e ) { fail ( "Exception thrown during test execution: " + e . getMessage ( ) ) ; } }
ensure we can marshall todoitem objects to json
