public void test_optLong() {
Exception ex = null;
try {
JSONObject jObject = new JSONObject("{\"long\":1}");
assertTrue(jObject.optLong("long") == 1);
assertTrue(jObject.optLong("long2", 2) == 2);
assertTrue(jObject.optLong("long2") == 0);
} catch (Exception ex1) {
ex = ex1;
ex.printStackTrace();