GEODE-2142: removing tests so run precheckin

Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/abeaa244
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/abeaa244
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/abeaa244

Branch: refs/heads/develop
Commit: abeaa244b5c814f6040176d34551061c4b3b3b25
Parents: e220d09
Author: Udo Kohlmeyer <[email protected]>
Authored: Fri Feb 17 16:56:17 2017 -0800
Committer: Udo Kohlmeyer <[email protected]>
Committed: Mon Feb 27 07:18:55 2017 -0800

----------------------------------------------------------------------
 geode-json/src/test/java/org/json/FileTest.java |  160 ---
 .../src/test/java/org/json/JSONArrayTest.java   |  607 ---------
 .../java/org/json/JSONFunctionTestObject.java   |   17 -
 .../src/test/java/org/json/JSONObjectTest.java  | 1190 ------------------
 .../test/java/org/json/JSONStringerTest.java    |  416 ------
 .../src/test/java/org/json/JSONTokenerTest.java |  616 ---------
 .../src/test/java/org/json/ParsingTest.java     |  291 -----
 .../src/test/java/org/json/SelfUseTest.java     |  273 ----
 8 files changed, 3570 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/abeaa244/geode-json/src/test/java/org/json/FileTest.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/FileTest.java 
b/geode-json/src/test/java/org/json/FileTest.java
deleted file mode 100755
index 36fcae9..0000000
--- a/geode-json/src/test/java/org/json/FileTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.json;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.Set;
-
-public class FileTest {
-  @Test
-  public void testFile() throws IOException, JSONException {
-    String ref = "[\n" + "  {\n" + "    \"_id\": 
\"58309f3bd307b72ae49a9b23\",\n"
-        + "    \"index\": 0,\n" + "    \"guid\": 
\"5764ebd8-b333-469e-8d83-4eb5658f1566\",\n"
-        + "    \"isActive\": true,\n" + "    \"balance\": \"$1,099.93\",\n"
-        + "    \"picture\": \"http://placehold.it/32x32\",\n"; + "    \"age\": 
37,\n"
-        + "    \"eyeColor\": \"blue\",\n" + "    \"name\": \"Barrera 
Wilkerson\",\n"
-        + "    \"gender\": \"male\",\n" + "    \"company\": \"VURBO\",\n"
-        + "    \"email\": \"[email protected]\",\n"
-        + "    \"phone\": \"+1 (817) 429-2473\",\n"
-        + "    \"address\": \"522 Vanderveer Street, Detroit, Wyoming, 
4320\",\n"
-        + "    \"about\": \"Et officia aute ullamco magna adipisicing non ut 
cupidatat cupidatat aliquip. Tempor occaecat ex ad dolore aliquip mollit ea 
esse ipsum. Est incididunt sunt commodo duis est. Reprehenderit in ut 
reprehenderit ad culpa ea fugiat et est adipisicing aliquip. Id mollit 
voluptate qui pariatur officia.\\r\\n\",\n"
-        + "    \"registered\": \"2016-06-29T08:54:14 +07:00\",\n"
-        + "    \"latitude\": -87.548434,\n" + "    \"longitude\": 64.251242,\n"
-        + "    \"tags\": [\n" + "      \"aliqua\",\n" + "      \"ex\",\n" + "  
    \"sit\",\n"
-        + "      \"magna\",\n" + "      \"dolor\",\n" + "      \"laborum\",\n" 
+ "      \"non\"\n"
-        + "    ],\n" + "    \"friends\": [\n" + "      {\n" + "        \"id\": 
0,\n"
-        + "        \"name\": \"Byers Pratt\"\n" + "      },\n" + "      {\n"
-        + "        \"id\": 1,\n" + "        \"name\": \"Kennedy Contreras\"\n" 
+ "      },\n"
-        + "      {\n" + "        \"id\": 2,\n" + "        \"name\": \"Frazier 
Monroe\"\n"
-        + "      }\n" + "    ],\n"
-        + "    \"greeting\": \"Hello, Barrera Wilkerson! You have 3 unread 
messages.\",\n"
-        + "    \"favoriteFruit\": \"banana\"\n" + "  },\n" + "  {\n"
-        + "    \"_id\": \"58309f3b1f506440093a41d1\",\n" + "    \"index\": 
1,\n"
-        + "    \"guid\": \"de1a6cc9-f8b3-426e-b68a-cc30e1fff3c1\",\n" + "    
\"isActive\": false,\n"
-        + "    \"balance\": \"$3,397.60\",\n" + "    \"picture\": 
\"http://placehold.it/32x32\",\n";
-        + "    \"age\": 32,\n" + "    \"eyeColor\": \"blue\",\n"
-        + "    \"name\": \"Trisha Morris\",\n" + "    \"gender\": 
\"female\",\n"
-        + "    \"company\": \"AMTAP\",\n" + "    \"email\": 
\"[email protected]\",\n"
-        + "    \"phone\": \"+1 (805) 423-3375\",\n"
-        + "    \"address\": \"495 Tampa Court, Libertytown, New Hampshire, 
5177\",\n"
-        + "    \"about\": \"Elit culpa Lorem dolor sit laborum ut ullamco 
ullamco nostrud reprehenderit adipisicing eiusmod. Aliqua quis dolor esse sint. 
Dolore in excepteur laborum anim ut consectetur. Nisi officia est eu ex ex id. 
Ipsum duis ullamco ad ut labore dolor. In amet tempor deserunt ullamco velit eu 
fugiat.\\r\\n\",\n"
-        + "    \"registered\": \"2015-02-08T06:14:19 +08:00\",\n"
-        + "    \"latitude\": -81.956277,\n" + "    \"longitude\": 
143.685584,\n"
-        + "    \"tags\": [\n" + "      \"cillum\",\n" + "      \"ullamco\",\n"
-        + "      \"magna\",\n" + "      \"cillum\",\n" + "      
\"voluptate\",\n"
-        + "      \"magna\",\n" + "      \"exercitation\"\n" + "    ],\n" + "   
 \"friends\": [\n"
-        + "      {\n" + "        \"id\": 0,\n" + "        \"name\": \"Fuentes 
Stout\"\n"
-        + "      },\n" + "      {\n" + "        \"id\": 1,\n"
-        + "        \"name\": \"Violet Vargas\"\n" + "      },\n" + "      {\n"
-        + "        \"id\": 2,\n" + "        \"name\": \"Schmidt Wilder\"\n" + 
"      }\n"
-        + "    ],\n" + "    \"greeting\": \"Hello, Trisha Morris! You have 4 
unread messages.\",\n"
-        + "    \"favoriteFruit\": \"strawberry\"\n" + "  },\n" + "  {\n"
-        + "    \"_id\": \"58309f3beaef2f31339b3755\",\n" + "    \"index\": 
2,\n"
-        + "    \"guid\": \"0bf387b7-abc2-4828-becc-1269928f7c3d\",\n" + "    
\"isActive\": false,\n"
-        + "    \"balance\": \"$1,520.64\",\n" + "    \"picture\": 
\"http://placehold.it/32x32\",\n";
-        + "    \"age\": 37,\n" + "    \"eyeColor\": \"blue\",\n"
-        + "    \"name\": \"Deanna Santiago\",\n" + "    \"gender\": 
\"female\",\n"
-        + "    \"company\": \"MEGALL\",\n" + "    \"email\": 
\"[email protected]\",\n"
-        + "    \"phone\": \"+1 (916) 511-2291\",\n"
-        + "    \"address\": \"919 Fayette Street, Homestead, Utah, 8669\",\n"
-        + "    \"about\": \"Sit amet ex quis velit irure Lorem non quis 
aliquip dolor pariatur nulla Lorem officia. Deserunt officia sit velit labore 
sint nostrud elit aliquip labore ullamco consectetur id amet. Ullamco duis 
commodo sit incididunt. Fugiat consectetur ad incididunt officia. Sint cillum 
minim laborum laboris id cillum est exercitation in eiusmod qui.\\r\\n\",\n"
-        + "    \"registered\": \"2015-11-18T08:39:28 +08:00\",\n" + "    
\"latitude\": 79.105701,\n"
-        + "    \"longitude\": -146.901754,\n" + "    \"tags\": [\n" + "      
\"non\",\n"
-        + "      \"ullamco\",\n" + "      \"cillum\",\n" + "      \"ipsum\",\n"
-        + "      \"amet\",\n" + "      \"aliqua\",\n" + "      \"aliquip\"\n" 
+ "    ],\n"
-        + "    \"friends\": [\n" + "      {\n" + "        \"id\": 0,\n"
-        + "        \"name\": \"Hanson Anderson\"\n" + "      },\n" + "      
{\n"
-        + "        \"id\": 1,\n" + "        \"name\": \"Pollard Soto\"\n" + "  
    },\n"
-        + "      {\n" + "        \"id\": 2,\n" + "        \"name\": \"Barlow 
Campbell\"\n"
-        + "      }\n" + "    ],\n"
-        + "    \"greeting\": \"Hello, Deanna Santiago! You have 7 unread 
messages.\",\n"
-        + "    \"favoriteFruit\": \"apple\"\n" + "  },\n" + "  {\n"
-        + "    \"_id\": \"58309f3b49a68ad01346f27f\",\n" + "    \"index\": 
3,\n"
-        + "    \"guid\": \"d29c0dcc-48fb-4ca4-a63b-b47c0e6d6398\",\n" + "    
\"isActive\": false,\n"
-        + "    \"balance\": \"$2,069.96\",\n" + "    \"picture\": 
\"http://placehold.it/32x32\",\n";
-        + "    \"age\": 29,\n" + "    \"eyeColor\": \"green\",\n"
-        + "    \"name\": \"Brooks Gates\",\n" + "    \"gender\": \"male\",\n"
-        + "    \"company\": \"TERRAGEN\",\n" + "    \"email\": 
\"[email protected]\",\n"
-        + "    \"phone\": \"+1 (875) 483-2224\",\n"
-        + "    \"address\": \"562 Noll Street, Kipp, Louisiana, 7659\",\n"
-        + "    \"about\": \"Reprehenderit laboris mollit nulla commodo quis 
laborum commodo. Laborum aliquip laboris officia minim ipsum laborum ipsum 
reprehenderit quis laboris est sint culpa. Culpa magna aute mollit 
exercitation.\\r\\n\",\n"
-        + "    \"registered\": \"2016-05-04T10:34:38 +07:00\",\n" + "    
\"latitude\": 72.77079,\n"
-        + "    \"longitude\": -134.291768,\n" + "    \"tags\": [\n" + "      
\"est\",\n"
-        + "      \"sunt\",\n" + "      \"laboris\",\n" + "      \"ea\",\n" + " 
     \"proident\",\n"
-        + "      \"aute\",\n" + "      \"excepteur\"\n" + "    ],\n" + "    
\"friends\": [\n"
-        + "      {\n" + "        \"id\": 0,\n" + "        \"name\": \"Roxanne 
Morgan\"\n"
-        + "      },\n" + "      {\n" + "        \"id\": 1,\n"
-        + "        \"name\": \"Tamara Kelly\"\n" + "      },\n" + "      {\n"
-        + "        \"id\": 2,\n" + "        \"name\": \"Cleveland Bush\"\n" + 
"      }\n"
-        + "    ],\n" + "    \"greeting\": \"Hello, Brooks Gates! You have 1 
unread messages.\",\n"
-        + "    \"favoriteFruit\": \"banana\"\n" + "  },\n" + "  {\n"
-        + "    \"_id\": \"58309f3be746700e9af9a645\",\n" + "    \"index\": 
4,\n"
-        + "    \"guid\": \"54382bd6-c476-469d-9e1c-e546f959db51\",\n" + "    
\"isActive\": true,\n"
-        + "    \"balance\": \"$2,012.57\",\n" + "    \"picture\": 
\"http://placehold.it/32x32\",\n";
-        + "    \"age\": 40,\n" + "    \"eyeColor\": \"brown\",\n"
-        + "    \"name\": \"Jackie Thomas\",\n" + "    \"gender\": 
\"female\",\n"
-        + "    \"company\": \"HINWAY\",\n" + "    \"email\": 
\"[email protected]\",\n"
-        + "    \"phone\": \"+1 (843) 470-2096\",\n"
-        + "    \"address\": \"910 Emerson Place, Gwynn, Federated States Of 
Micronesia, 4688\",\n"
-        + "    \"about\": \"Id cupidatat laboris elit est eiusmod esse 
nostrud. Ex commodo nisi voluptate est nisi laborum officia sint incididunt 
pariatur qui deserunt ullamco. Fugiat proident magna ipsum sit sint id 
adipisicing sit nostrud labore sit officia. Eiusmod exercitation non enim 
excepteur amet irure ullamco consectetur cupidatat proident Lorem reprehenderit 
aliquip. Veniam esse dolor Lorem incididunt proident officia enim in incididunt 
culpa. Mollit voluptate commodo aliquip anim ipsum nostrud ut labore enim 
labore qui do minim incididunt. Quis irure proident voluptate nisi qui sunt 
aute duis irure.\\r\\n\",\n"
-        + "    \"registered\": \"2014-08-03T09:21:43 +07:00\",\n" + "    
\"latitude\": 84.871256,\n"
-        + "    \"longitude\": 2.043339,\n" + "    \"tags\": [\n" + "      
\"tempor\",\n"
-        + "      \"ut\",\n" + "      \"deserunt\",\n" + "      \"esse\",\n" + 
"      \"nostrud\",\n"
-        + "      \"dolore\",\n" + "      \"ex\"\n" + "    ],\n" + "    
\"friends\": [\n"
-        + "      {\n" + "        \"id\": 0,\n" + "        \"name\": \"Lois 
Walters\"\n"
-        + "      },\n" + "      {\n" + "        \"id\": 1,\n"
-        + "        \"name\": \"Brewer Buchanan\"\n" + "      },\n" + "      
{\n"
-        + "        \"id\": 2,\n" + "        \"name\": \"Mccormick Fleming\"\n" 
+ "      }\n"
-        + "    ],\n" + "    \"greeting\": \"Hello, Jackie Thomas! You have 2 
unread messages.\",\n"
-        + "    \"favoriteFruit\": \"banana\"\n" + "  }\n" + "]";
-
-    JSONArray x1 = (JSONArray) new JSONTokener(
-        new 
InputStreamReader(this.getClass().getResourceAsStream("/sample-01.json"))).nextValue();
-    JSONArray x2 = (JSONArray) new JSONTokener(ref).nextValue();
-
-    Assert.assertTrue(jsonEquals(x1, x2));
-  }
-
-  private boolean jsonEquals(JSONArray x1, JSONArray x2) throws JSONException {
-    if (x1.length() != x2.length()) {
-      return false;
-    }
-
-    for (int i = 0; i < x1.length(); i++) {
-      Object element1 = x1.get(i);
-      Object element2 = x2.get(i);
-      if (!jsonEquals(element1, element2)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  private boolean jsonEquals(JSONObject x1, JSONObject x2) throws 
JSONException {
-    if (x1.length() != x2.length()) {
-      return false;
-    }
-    Set<String> names = x1.keySet();
-    for (String name : names) {
-      if (!jsonEquals(x1.get(name), x2.get(name))) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  private boolean jsonEquals(Object element1, Object element2) throws 
JSONException {
-    if (!element1.getClass().equals(element2.getClass())) {
-      return false;
-    }
-    if (element1 instanceof JSONObject) {
-      return jsonEquals((JSONObject) element1, (JSONObject) element2);
-    }
-    if (element1 instanceof JSONArray) {
-      return jsonEquals((JSONArray) element1, (JSONArray) element2);
-    }
-    return element1.equals(element2);
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/abeaa244/geode-json/src/test/java/org/json/JSONArrayTest.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/JSONArrayTest.java 
b/geode-json/src/test/java/org/json/JSONArrayTest.java
deleted file mode 100755
index 88ba989..0000000
--- a/geode-json/src/test/java/org/json/JSONArrayTest.java
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-
-package org.json;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import static org.junit.Assert.*;
-
-/**
- * This black box test was written without inspecting the non-free org.json 
sourcecode.
- */
-public class JSONArrayTest {
-  @Test
-  public void testEmptyArray() throws JSONException {
-    JSONArray array = new JSONArray();
-    assertEquals(0, array.length());
-    assertEquals("", array.join(" AND "));
-    try {
-      array.get(0);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      array.getBoolean(0);
-      fail();
-    } catch (JSONException ignored) {
-    }
-
-    assertEquals("[]", array.toString());
-    assertEquals("[]", array.toString(4));
-
-    // out of bounds is co-opted with defaulting
-    assertTrue(array.isNull(0));
-    assertNull(array.opt(0));
-    assertFalse(array.optBoolean(0));
-    assertTrue(array.optBoolean(0, true));
-
-    // bogus (but documented) behaviour: returns null rather than an empty 
object!
-    assertNull(array.toJSONObject(new JSONArray()));
-  }
-
-  @Test
-  public void testEqualsAndHashCode() throws JSONException {
-    JSONArray a = new JSONArray();
-    JSONArray b = new JSONArray();
-    assertTrue(a.equals(b));
-    assertEquals("equals() not consistent with hashCode()", a.hashCode(), 
b.hashCode());
-
-    a.put(true);
-    a.put(false);
-    b.put(true);
-    b.put(false);
-    assertTrue(a.equals(b));
-    assertEquals(a.hashCode(), b.hashCode());
-
-    b.put(true);
-    assertFalse(a.equals(b));
-    assertTrue(a.hashCode() != b.hashCode());
-  }
-
-  @Test
-  public void testBooleans() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put(true);
-    array.put(false);
-    array.put(2, false);
-    array.put(3, false);
-    array.put(2, true);
-    assertEquals("[true,false,true,false]", array.toString());
-    assertEquals(4, array.length());
-    assertEquals(Boolean.TRUE, array.get(0));
-    assertEquals(Boolean.FALSE, array.get(1));
-    assertEquals(Boolean.TRUE, array.get(2));
-    assertEquals(Boolean.FALSE, array.get(3));
-    assertFalse(array.isNull(0));
-    assertFalse(array.isNull(1));
-    assertFalse(array.isNull(2));
-    assertFalse(array.isNull(3));
-    assertEquals(true, array.optBoolean(0));
-    assertEquals(false, array.optBoolean(1, true));
-    assertEquals(true, array.optBoolean(2, false));
-    assertEquals(false, array.optBoolean(3));
-    assertEquals("true", array.getString(0));
-    assertEquals("false", array.getString(1));
-    assertEquals("true", array.optString(2));
-    assertEquals("false", array.optString(3, "x"));
-    assertEquals("[\n     true,\n     false,\n     true,\n     false\n]", 
array.toString(5));
-
-    JSONArray other = new JSONArray();
-    other.put(true);
-    other.put(false);
-    other.put(true);
-    other.put(false);
-    assertTrue(array.equals(other));
-    other.put(true);
-    assertFalse(array.equals(other));
-
-    other = new JSONArray();
-    other.put("true");
-    other.put("false");
-    other.put("truE");
-    other.put("FALSE");
-    assertFalse(array.equals(other));
-    assertFalse(other.equals(array));
-    assertEquals(true, other.getBoolean(0));
-    assertEquals(false, other.optBoolean(1, true));
-    assertEquals(true, other.optBoolean(2));
-    assertEquals(false, other.getBoolean(3));
-  }
-
-  // http://code.google.com/p/android/issues/detail?id=16411
-  @Test
-  public void testCoerceStringToBoolean() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put("maybe");
-    try {
-      array.getBoolean(0);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals(false, array.optBoolean(0));
-    assertEquals(true, array.optBoolean(0, true));
-  }
-
-  @Test
-  public void testNulls() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put(3, null);
-    array.put(0, JSONObject.NULL);
-    assertEquals(4, array.length());
-    assertEquals("[null,null,null,null]", array.toString());
-
-    // there's 2 ways to represent null; each behaves differently!
-    assertEquals(JSONObject.NULL, array.get(0));
-    try {
-      array.get(1);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      array.get(2);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      array.get(3);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals(JSONObject.NULL, array.opt(0));
-    assertEquals(null, array.opt(1));
-    assertEquals(null, array.opt(2));
-    assertEquals(null, array.opt(3));
-    assertTrue(array.isNull(0));
-    assertTrue(array.isNull(1));
-    assertTrue(array.isNull(2));
-    assertTrue(array.isNull(3));
-    assertEquals("null", array.optString(0));
-    assertEquals("", array.optString(1));
-    assertEquals("", array.optString(2));
-    assertEquals("", array.optString(3));
-  }
-
-  /**
-   * Our behaviour is questioned by this bug: 
http://code.google.com/p/android/issues/detail?id=7257
-   */
-  @Test
-  public void testParseNullYieldsJSONObjectNull() throws JSONException {
-    JSONArray array = new JSONArray("[\"null\",null]");
-    array.put(null);
-    assertEquals("null", array.get(0));
-    assertEquals(JSONObject.NULL, array.get(1));
-    try {
-      array.get(2);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals("null", array.getString(0));
-    assertEquals("null", array.getString(1));
-    try {
-      array.getString(2);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testNumbers() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put(Double.MIN_VALUE);
-    array.put(9223372036854775806L);
-    array.put(Double.MAX_VALUE);
-    array.put(-0d);
-    assertEquals(4, array.length());
-
-    // toString() and getString(int) return different values for -0d
-    assertEquals("[4.9E-324,9223372036854775806,1.7976931348623157E308,-0]", 
array.toString());
-
-    assertEquals(Double.MIN_VALUE, array.get(0));
-    assertEquals(9223372036854775806L, array.get(1));
-    assertEquals(Double.MAX_VALUE, array.get(2));
-    assertEquals(-0d, array.get(3));
-    assertEquals(Double.MIN_VALUE, array.getDouble(0), 0);
-    assertEquals(9.223372036854776E18, array.getDouble(1), 0);
-    assertEquals(Double.MAX_VALUE, array.getDouble(2), 0);
-    assertEquals(-0d, array.getDouble(3), 0);
-    assertEquals(0, array.getLong(0));
-    assertEquals(9223372036854775806L, array.getLong(1));
-    assertEquals(Long.MAX_VALUE, array.getLong(2));
-    assertEquals(0, array.getLong(3));
-    assertEquals(0, array.getInt(0));
-    assertEquals(-2, array.getInt(1));
-    assertEquals(Integer.MAX_VALUE, array.getInt(2));
-    assertEquals(0, array.getInt(3));
-    assertEquals(Double.MIN_VALUE, array.opt(0));
-    assertEquals(Double.MIN_VALUE, array.optDouble(0), 0);
-    assertEquals(0, array.optLong(0, 1L));
-    assertEquals(0, array.optInt(0, 1));
-    assertEquals("4.9E-324", array.getString(0));
-    assertEquals("9223372036854775806", array.getString(1));
-    assertEquals("1.7976931348623157E308", array.getString(2));
-    assertEquals("-0.0", array.getString(3));
-
-    JSONArray other = new JSONArray();
-    other.put(Double.MIN_VALUE);
-    other.put(9223372036854775806L);
-    other.put(Double.MAX_VALUE);
-    other.put(-0d);
-    assertTrue(array.equals(other));
-    other.put(0, 0L);
-    assertFalse(array.equals(other));
-  }
-
-  @Test
-  public void testStrings() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put("true");
-    array.put("5.5");
-    array.put("9223372036854775806");
-    array.put("null");
-    array.put("5\"8' tall");
-    assertEquals(5, array.length());
-    assertEquals("[\"true\",\"5.5\",\"9223372036854775806\",\"null\",\"5\\\"8' 
tall\"]",
-        array.toString());
-
-    // although the documentation doesn't mention it, join() escapes text and 
wraps
-    // strings in quotes
-    assertEquals("\"true\" \"5.5\" \"9223372036854775806\" \"null\" \"5\\\"8' 
tall\"",
-        array.join(" "));
-
-    assertEquals("true", array.get(0));
-    assertEquals("null", array.getString(3));
-    assertEquals("5\"8' tall", array.getString(4));
-    assertEquals("true", array.opt(0));
-    assertEquals("5.5", array.optString(1));
-    assertEquals("9223372036854775806", array.optString(2, null));
-    assertEquals("null", array.optString(3, "-1"));
-    assertFalse(array.isNull(0));
-    assertFalse(array.isNull(3));
-
-    assertEquals(true, array.getBoolean(0));
-    assertEquals(true, array.optBoolean(0));
-    assertEquals(true, array.optBoolean(0, false));
-    assertEquals(0, array.optInt(0));
-    assertEquals(-2, array.optInt(0, -2));
-
-    assertEquals(5.5d, array.getDouble(1), 0);
-    assertEquals(5L, array.getLong(1));
-    assertEquals(5, array.getInt(1));
-    assertEquals(5, array.optInt(1, 3));
-
-    // The last digit of the string is a 6 but getLong returns a 7. It's 
probably parsing as a
-    // double and then converting that to a long. This is consistent with 
JavaScript.
-    assertEquals(9223372036854775807L, array.getLong(2));
-    assertEquals(9.223372036854776E18, array.getDouble(2), 0);
-    assertEquals(Integer.MAX_VALUE, array.getInt(2));
-
-    assertFalse(array.isNull(3));
-    try {
-      array.getDouble(3);
-      fail();
-    } catch (JSONException e) {
-      // expected
-    }
-    assertEquals(Double.NaN, array.optDouble(3), 0);
-    assertEquals(-1.0d, array.optDouble(3, -1.0d), 0);
-  }
-
-  @Test
-  public void testJoin() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put(null);
-    assertEquals("null", array.join(" & "));
-    array.put("\"");
-    assertEquals("null & \"\\\"\"", array.join(" & "));
-    array.put(5);
-    assertEquals("null & \"\\\"\" & 5", array.join(" & "));
-    array.put(true);
-    assertEquals("null & \"\\\"\" & 5 & true", array.join(" & "));
-    array.put(new JSONArray(Arrays.asList(true, false)));
-    assertEquals("null & \"\\\"\" & 5 & true & [true,false]", array.join(" & 
"));
-    array.put(new JSONObject(Collections.singletonMap("x", 6)));
-    assertEquals("null & \"\\\"\" & 5 & true & [true,false] & {\"x\":6}", 
array.join(" & "));
-  }
-
-  @Test
-  public void testJoinWithNull() throws JSONException {
-    JSONArray array = new JSONArray(Arrays.asList(5, 6));
-    assertEquals("5null6", array.join(null));
-  }
-
-  @Test
-  public void testJoinWithSpecialCharacters() throws JSONException {
-    JSONArray array = new JSONArray(Arrays.asList(5, 6));
-    assertEquals("5\"6", array.join("\""));
-  }
-
-  @Test
-  public void testToJSONObject() throws JSONException {
-    JSONArray keys = new JSONArray();
-    keys.put("a");
-    keys.put("b");
-
-    JSONArray values = new JSONArray();
-    values.put(5.5d);
-    values.put(false);
-
-    JSONObject object = values.toJSONObject(keys);
-    assertEquals(5.5d, object.get("a"));
-    assertEquals(false, object.get("b"));
-
-    keys.put(0, "a");
-    values.put(0, 11.0d);
-    assertEquals(5.5d, object.get("a"));
-  }
-
-  @Test
-  public void testToJSONObjectWithNulls() throws JSONException {
-    JSONArray keys = new JSONArray();
-    keys.put("a");
-    keys.put("b");
-
-    JSONArray values = new JSONArray();
-    values.put(5.5d);
-    values.put(null);
-
-    // null values are stripped!
-    JSONObject object = values.toJSONObject(keys);
-    assertEquals(1, object.length());
-    assertFalse(object.has("b"));
-    assertEquals("{\"a\":5.5}", object.toString());
-  }
-
-  @Test
-  public void testToJSONObjectMoreNamesThanValues() throws JSONException {
-    JSONArray keys = new JSONArray();
-    keys.put("a");
-    keys.put("b");
-    JSONArray values = new JSONArray();
-    values.put(5.5d);
-    JSONObject object = values.toJSONObject(keys);
-    assertEquals(1, object.length());
-    assertEquals(5.5d, object.get("a"));
-  }
-
-  @Test
-  public void testToJSONObjectMoreValuesThanNames() throws JSONException {
-    JSONArray keys = new JSONArray();
-    keys.put("a");
-    JSONArray values = new JSONArray();
-    values.put(5.5d);
-    values.put(11.0d);
-    JSONObject object = values.toJSONObject(keys);
-    assertEquals(1, object.length());
-    assertEquals(5.5d, object.get("a"));
-  }
-
-  @Test
-  public void testToJSONObjectNullKey() throws JSONException {
-    JSONArray keys = new JSONArray();
-    keys.put(JSONObject.NULL);
-    JSONArray values = new JSONArray();
-    values.put(5.5d);
-    JSONObject object = values.toJSONObject(keys);
-    assertEquals(1, object.length());
-    assertEquals(5.5d, object.get("null"));
-  }
-
-  @Test
-  public void testPutUnsupportedNumbers() throws JSONException {
-    JSONArray array = new JSONArray();
-
-    try {
-      array.put(Double.NaN);
-      fail();
-    } catch (JSONException e) {
-      // expected
-    }
-    try {
-      array.put(0, Double.NEGATIVE_INFINITY);
-      fail();
-    } catch (JSONException e) {
-      // expected
-    }
-    try {
-      array.put(0, Double.POSITIVE_INFINITY);
-      fail();
-    } catch (JSONException e) {
-      // expected
-    }
-  }
-
-  @Test
-  public void testPutUnsupportedNumbersAsObject() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put(Double.valueOf(Double.NaN));
-    array.put(Double.valueOf(Double.NEGATIVE_INFINITY));
-    array.put(Double.valueOf(Double.POSITIVE_INFINITY));
-    assertEquals(null, array.toString());
-  }
-
-  /**
-   * Although JSONArray is usually defensive about which numbers it accepts, 
it doesn't check inputs
-   * in its constructor.
-   */
-  @Test
-  public void testCreateWithUnsupportedNumbers() throws JSONException {
-    JSONArray array = new JSONArray(Arrays.asList(5.5, Double.NaN));
-    assertEquals(2, array.length());
-    assertEquals(5.5, array.getDouble(0), 0);
-    assertEquals(Double.NaN, array.getDouble(1), 0);
-  }
-
-  @Test
-  public void testToStringWithUnsupportedNumbers() throws JSONException {
-    // when the array contains an unsupported number, toString returns null!
-    JSONArray array = new JSONArray(Arrays.asList(5.5, Double.NaN));
-    assertNull(array.toString());
-  }
-
-  @Test
-  public void testListConstructorCopiesContents() throws JSONException {
-    // have to use asList instead of Collections.singleton() to allow mutation
-    // noinspection ArraysAsListWithZeroOrOneArgument
-    List<Object> contents = Arrays.<Object>asList(5);
-    JSONArray array = new JSONArray(contents);
-    contents.set(0, 10);
-    assertEquals(5, array.get(0));
-  }
-
-  @Test
-  public void testTokenerConstructor() throws JSONException {
-    JSONArray object = new JSONArray(new JSONTokener("[false]"));
-    assertEquals(1, object.length());
-    assertEquals(false, object.get(0));
-  }
-
-  @Test
-  public void testTokenerConstructorWrongType() throws JSONException {
-    try {
-      new JSONArray(new JSONTokener("{\"foo\": false}"));
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testTokenerConstructorNull() throws JSONException {
-    try {
-      new JSONArray((JSONTokener) null);
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-  }
-
-  @Test
-  public void testTokenerConstructorParseFail() {
-    try {
-      new JSONArray(new JSONTokener("["));
-      fail();
-    } catch (JSONException ignored) {
-    } catch (StackOverflowError e) {
-      fail("Stack overflowed on input: \"[\"");
-    }
-  }
-
-  @Test
-  public void testStringConstructor() throws JSONException {
-    JSONArray object = new JSONArray("[false]");
-    assertEquals(1, object.length());
-    assertEquals(false, object.get(0));
-  }
-
-  @Test
-  public void testStringConstructorWrongType() throws JSONException {
-    try {
-      new JSONArray("{\"foo\": false}");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testStringConstructorNull() throws JSONException {
-    try {
-      new JSONArray((String) null);
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-  }
-
-  @Test
-  public void testStringConstructorParseFail() {
-    try {
-      new JSONArray("[");
-      fail();
-    } catch (JSONException ignored) {
-    } catch (StackOverflowError e) {
-      fail("Stack overflowed on input: \"[\"");
-    }
-  }
-
-  @Test
-  public void testCreate() throws JSONException {
-    JSONArray array = new JSONArray(Arrays.asList(5.5, true));
-    assertEquals(2, array.length());
-    assertEquals(5.5, array.getDouble(0), 0.0);
-    assertEquals(true, array.get(1));
-    assertEquals("[5.5,true]", array.toString());
-  }
-
-  @Test
-  public void testAccessOutOfBounds() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put("foo");
-    assertEquals(null, array.opt(3));
-    assertEquals(null, array.opt(-3));
-    assertEquals("", array.optString(3));
-    assertEquals("", array.optString(-3));
-    try {
-      array.get(3);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      array.get(-3);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      array.getString(3);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      array.getString(-3);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void test_remove() throws Exception {
-    JSONArray a = new JSONArray();
-    assertEquals(null, a.remove(-1));
-    assertEquals(null, a.remove(0));
-
-    a.put("hello");
-    assertEquals(null, a.remove(-1));
-    assertEquals(null, a.remove(1));
-    assertEquals("hello", a.remove(0));
-    assertEquals(null, a.remove(0));
-  }
-
-  enum MyEnum {
-    A, B, C
-  }
-
-  // https://code.google.com/p/android/issues/detail?id=62539
-  // but changed in open-json to return toString for all enums
-  @Test
-  public void testEnums() throws Exception {
-    // This works because it's in java.* and any class in there falls back to 
toString.
-    JSONArray a1 = new 
JSONArray(java.lang.annotation.RetentionPolicy.values());
-    assertEquals("[\"SOURCE\",\"CLASS\",\"RUNTIME\"]", a1.toString());
-
-    // This doesn't because it's not.
-    JSONArray a2 = new JSONArray(MyEnum.values());
-    assertEquals("[\"A\",\"B\",\"C\"]", a2.toString());
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/abeaa244/geode-json/src/test/java/org/json/JSONFunctionTestObject.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/JSONFunctionTestObject.java 
b/geode-json/src/test/java/org/json/JSONFunctionTestObject.java
deleted file mode 100755
index 9d24487..0000000
--- a/geode-json/src/test/java/org/json/JSONFunctionTestObject.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.json;
-
-/**
- * Class to test the function hack
- */
-public class JSONFunctionTestObject {
-  private String value;
-
-  public JSONFunctionTestObject(String value) {
-    this.value = value;
-  }
-
-  @Override
-  public String toString() {
-    return value;
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/abeaa244/geode-json/src/test/java/org/json/JSONObjectTest.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/JSONObjectTest.java 
b/geode-json/src/test/java/org/json/JSONObjectTest.java
deleted file mode 100755
index c795551..0000000
--- a/geode-json/src/test/java/org/json/JSONObjectTest.java
+++ /dev/null
@@ -1,1190 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-
-package org.json;
-
-import org.junit.Test;
-
-import java.beans.IntrospectionException;
-import java.lang.reflect.InvocationTargetException;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.concurrent.TimeUnit;
-
-import static org.junit.Assert.*;
-
-/**
- * This black box test was written without inspecting the non-free org.json 
sourcecode.
- */
-public class JSONObjectTest {
-  @Test
-  public void testKeyset() throws Exception {
-    JSONObject x = new JSONObject("{'a':1, 'b':2, 'c':3}");
-    Set<String> k = new TreeSet<String>();
-    for (String kx : Arrays.asList("a", "b", "c")) {
-      k.add(kx);
-    }
-    assertEquals(x.keySet(), k);
-    x = new JSONObject("{}");
-    assertEquals(x.keySet().size(), 0);
-  }
-
-  @Test
-  public void testEmptyObject() throws JSONException {
-    JSONObject object = new JSONObject();
-    assertEquals(0, object.length());
-
-    // bogus (but documented) behaviour: returns null rather than the empty 
object!
-    assertNull(object.names());
-
-    // returns null rather than an empty array!
-    assertNull(object.toJSONArray(new JSONArray()));
-    assertEquals("{}", object.toString());
-    assertEquals("{}", object.toString(5));
-    try {
-      object.get("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getBoolean("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getDouble("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getInt("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getJSONArray("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getJSONObject("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getLong("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getString("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertFalse(object.has("foo"));
-    assertTrue(object.isNull("foo")); // isNull also means "is not present"
-    assertNull(object.opt("foo"));
-    assertEquals(false, object.optBoolean("foo"));
-    assertEquals(true, object.optBoolean("foo", true));
-    assertEquals(Double.NaN, object.optDouble("foo"), 0);
-    assertEquals(5.0, object.optDouble("foo", 5.0), 0);
-    assertEquals(0, object.optInt("foo"));
-    assertEquals(5, object.optInt("foo", 5));
-    assertEquals(null, object.optJSONArray("foo"));
-    assertEquals(null, object.optJSONObject("foo"));
-    assertEquals(0, object.optLong("foo"));
-    assertEquals(Long.MAX_VALUE - 1, object.optLong("foo", Long.MAX_VALUE - 
1));
-    assertEquals("", object.optString("foo")); // empty string is default!
-    assertEquals("bar", object.optString("foo", "bar"));
-    assertNull(object.remove("foo"));
-  }
-
-  @Test
-  public void testEqualsAndHashCode() throws JSONException {
-    JSONObject a = new JSONObject();
-    JSONObject b = new JSONObject();
-
-    // JSON object doesn't override either equals or hashCode (!)
-    assertFalse(a.equals(b));
-    assertEquals(a.hashCode(), System.identityHashCode(a));
-  }
-
-  @Test
-  public void testGet() throws JSONException {
-    JSONObject object = new JSONObject();
-    Object value = new Object();
-    object.put("foo", value);
-    object.put("bar", new Object());
-    object.put("baz", new Object());
-    assertSame(value, object.get("foo"));
-    try {
-      object.get("FOO");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.put(null, value);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.get(null);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testPut() throws JSONException {
-    JSONObject object = new JSONObject();
-    assertSame(object, object.put("foo", true));
-    object.put("foo", false);
-    assertEquals(false, object.get("foo"));
-
-    object.put("foo", 5.0d);
-    assertEquals(5.0d, object.get("foo"));
-    object.put("foo", 0);
-    assertEquals(0, object.get("foo"));
-    object.put("bar", Long.MAX_VALUE - 1);
-    assertEquals(Long.MAX_VALUE - 1, object.get("bar"));
-    object.put("baz", "x");
-    assertEquals("x", object.get("baz"));
-    object.put("bar", JSONObject.NULL);
-    assertSame(JSONObject.NULL, object.get("bar"));
-  }
-
-  @Test
-  public void testPutNullRemoves() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "bar");
-    object.put("foo", null);
-    assertEquals(0, object.length());
-    assertFalse(object.has("foo"));
-    try {
-      object.get("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testPutOpt() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "bar");
-    object.putOpt("foo", null);
-    assertEquals("bar", object.get("foo"));
-    object.putOpt(null, null);
-    assertEquals(1, object.length());
-    object.putOpt(null, "bar");
-    assertEquals(1, object.length());
-  }
-
-  @Test
-  public void testPutOptUnsupportedNumbers() throws JSONException {
-    JSONObject object = new JSONObject();
-    try {
-      object.putOpt("foo", Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.putOpt("foo", Double.NEGATIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.putOpt("foo", Double.POSITIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testRemove() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "bar");
-    assertEquals(null, object.remove(null));
-    assertEquals(null, object.remove(""));
-    assertEquals(null, object.remove("bar"));
-    assertEquals("bar", object.remove("foo"));
-    assertEquals(null, object.remove("foo"));
-  }
-
-  @Test
-  public void testBooleans() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", true);
-    object.put("bar", false);
-    object.put("baz", "true");
-    object.put("quux", "false");
-    assertEquals(4, object.length());
-    assertEquals(true, object.getBoolean("foo"));
-    assertEquals(false, object.getBoolean("bar"));
-    assertEquals(true, object.getBoolean("baz"));
-    assertEquals(false, object.getBoolean("quux"));
-    assertFalse(object.isNull("foo"));
-    assertFalse(object.isNull("quux"));
-    assertTrue(object.has("foo"));
-    assertTrue(object.has("quux"));
-    assertFalse(object.has("missing"));
-    assertEquals(true, object.optBoolean("foo"));
-    assertEquals(false, object.optBoolean("bar"));
-    assertEquals(true, object.optBoolean("baz"));
-    assertEquals(false, object.optBoolean("quux"));
-    assertEquals(false, object.optBoolean("missing"));
-    assertEquals(true, object.optBoolean("foo", true));
-    assertEquals(false, object.optBoolean("bar", true));
-    assertEquals(true, object.optBoolean("baz", true));
-    assertEquals(false, object.optBoolean("quux", true));
-    assertEquals(true, object.optBoolean("missing", true));
-
-    object.put("foo", "truE");
-    object.put("bar", "FALSE");
-    assertEquals(true, object.getBoolean("foo"));
-    assertEquals(false, object.getBoolean("bar"));
-    assertEquals(true, object.optBoolean("foo"));
-    assertEquals(false, object.optBoolean("bar"));
-    assertEquals(true, object.optBoolean("foo", false));
-    assertEquals(false, object.optBoolean("bar", false));
-  }
-
-  // http://code.google.com/p/android/issues/detail?id=16411
-  @Test
-  public void testCoerceStringToBoolean() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "maybe");
-    try {
-      object.getBoolean("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals(false, object.optBoolean("foo"));
-    assertEquals(true, object.optBoolean("foo", true));
-  }
-
-  @Test
-  public void testNumbers() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", Double.MIN_VALUE);
-    object.put("bar", 9223372036854775806L);
-    object.put("baz", Double.MAX_VALUE);
-    object.put("quux", -0d);
-    assertEquals(4, object.length());
-
-    String toString = object.toString();
-    assertTrue(toString, toString.contains("\"foo\":4.9E-324"));
-    assertTrue(toString, toString.contains("\"bar\":9223372036854775806"));
-    assertTrue(toString, toString.contains("\"baz\":1.7976931348623157E308"));
-
-    // toString() and getString() return different values for -0d!
-    assertTrue(toString, toString.contains("\"quux\":-0}") // no trailing 
decimal point
-        || toString.contains("\"quux\":-0,"));
-
-    assertEquals(Double.MIN_VALUE, object.get("foo"));
-    assertEquals(9223372036854775806L, object.get("bar"));
-    assertEquals(Double.MAX_VALUE, object.get("baz"));
-    assertEquals(-0d, object.get("quux"));
-    assertEquals(Double.MIN_VALUE, object.getDouble("foo"), 0);
-    assertEquals(9.223372036854776E18, object.getDouble("bar"), 0);
-    assertEquals(Double.MAX_VALUE, object.getDouble("baz"), 0);
-    assertEquals(-0d, object.getDouble("quux"), 0);
-    assertEquals(0, object.getLong("foo"));
-    assertEquals(9223372036854775806L, object.getLong("bar"));
-    assertEquals(Long.MAX_VALUE, object.getLong("baz"));
-    assertEquals(0, object.getLong("quux"));
-    assertEquals(0, object.getInt("foo"));
-    assertEquals(-2, object.getInt("bar"));
-    assertEquals(Integer.MAX_VALUE, object.getInt("baz"));
-    assertEquals(0, object.getInt("quux"));
-    assertEquals(Double.MIN_VALUE, object.opt("foo"));
-    assertEquals(9223372036854775806L, object.optLong("bar"));
-    assertEquals(Double.MAX_VALUE, object.optDouble("baz"), 0);
-    assertEquals(0, object.optInt("quux"));
-    assertEquals(Double.MIN_VALUE, object.opt("foo"));
-    assertEquals(9223372036854775806L, object.optLong("bar"));
-    assertEquals(Double.MAX_VALUE, object.optDouble("baz"), 0);
-    assertEquals(0, object.optInt("quux"));
-    assertEquals(Double.MIN_VALUE, object.optDouble("foo", 5.0d), 0);
-    assertEquals(9223372036854775806L, object.optLong("bar", 1L));
-    assertEquals(Long.MAX_VALUE, object.optLong("baz", 1L));
-    assertEquals(0, object.optInt("quux", -1));
-    assertEquals("4.9E-324", object.getString("foo"));
-    assertEquals("9223372036854775806", object.getString("bar"));
-    assertEquals("1.7976931348623157E308", object.getString("baz"));
-    assertEquals("-0.0", object.getString("quux"));
-  }
-
-  @Test
-  public void testFloats() throws JSONException {
-    JSONObject object = new JSONObject();
-    try {
-      object.put("foo", (Float) Float.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.put("foo", (Float) Float.NEGATIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.put("foo", (Float) Float.POSITIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testOtherNumbers() throws JSONException {
-    Number nan = new Number() {
-      public int intValue() {
-        throw new UnsupportedOperationException();
-      }
-
-      public long longValue() {
-        throw new UnsupportedOperationException();
-      }
-
-      public float floatValue() {
-        throw new UnsupportedOperationException();
-      }
-
-      public double doubleValue() {
-        return Double.NaN;
-      }
-
-      @Override
-      public String toString() {
-        return "x";
-      }
-    };
-
-    JSONObject object = new JSONObject();
-    try {
-      object.put("foo", nan);
-      fail("Object.put() accepted a NaN (via a custom Number class)");
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testForeignObjects() throws JSONException {
-    Object foreign = new Object() {
-      @Override
-      public String toString() {
-        return "x";
-      }
-    };
-
-    // foreign object types are accepted and treated as Strings!
-    JSONObject object = new JSONObject();
-    object.put("foo", foreign);
-    assertEquals("{\"foo\":\"x\"}", object.toString());
-  }
-
-  @Test
-  public void testNullKeys() {
-    try {
-      new JSONObject().put(null, false);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONObject().put(null, 0.0d);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONObject().put(null, 5);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONObject().put(null, 5L);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONObject().put(null, "foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testStrings() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "true");
-    object.put("bar", "5.5");
-    object.put("baz", "9223372036854775806");
-    object.put("quux", "null");
-    object.put("height", "5\"8' tall");
-
-    assertTrue(object.toString().contains("\"foo\":\"true\""));
-    assertTrue(object.toString().contains("\"bar\":\"5.5\""));
-    assertTrue(object.toString().contains("\"baz\":\"9223372036854775806\""));
-    assertTrue(object.toString().contains("\"quux\":\"null\""));
-    assertTrue(object.toString().contains("\"height\":\"5\\\"8' tall\""));
-
-    assertEquals("true", object.get("foo"));
-    assertEquals("null", object.getString("quux"));
-    assertEquals("5\"8' tall", object.getString("height"));
-    assertEquals("true", object.opt("foo"));
-    assertEquals("5.5", object.optString("bar"));
-    assertEquals("true", object.optString("foo", "x"));
-    assertFalse(object.isNull("foo"));
-
-    assertEquals(true, object.getBoolean("foo"));
-    assertEquals(true, object.optBoolean("foo"));
-    assertEquals(true, object.optBoolean("foo", false));
-    assertEquals(0, object.optInt("foo"));
-    assertEquals(-2, object.optInt("foo", -2));
-
-    assertEquals(5.5d, object.getDouble("bar"), 0);
-    assertEquals(5L, object.getLong("bar"));
-    assertEquals(5, object.getInt("bar"));
-    assertEquals(5, object.optInt("bar", 3));
-
-    // The last digit of the string is a 6 but getLong returns a 7. It's 
probably parsing as a
-    // double and then converting that to a long. This is consistent with 
JavaScript.
-    assertEquals(9223372036854775807L, object.getLong("baz"));
-    assertEquals(9.223372036854776E18, object.getDouble("baz"), 0);
-    assertEquals(Integer.MAX_VALUE, object.getInt("baz"));
-
-    assertFalse(object.isNull("quux"));
-    try {
-      object.getDouble("quux");
-      fail();
-    } catch (JSONException e) {
-      // expected
-    }
-    assertEquals(Double.NaN, object.optDouble("quux"), 0);
-    assertEquals(-1.0d, object.optDouble("quux", -1.0d), 0);
-
-    object.put("foo", "TRUE");
-    assertEquals(true, object.getBoolean("foo"));
-  }
-
-  @Test
-  public void testJSONObjects() throws JSONException {
-    JSONObject object = new JSONObject();
-
-    JSONArray a = new JSONArray();
-    JSONObject b = new JSONObject();
-    object.put("foo", a);
-    object.put("bar", b);
-
-    assertSame(a, object.getJSONArray("foo"));
-    assertSame(b, object.getJSONObject("bar"));
-    try {
-      object.getJSONObject("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.getJSONArray("bar");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals(a, object.optJSONArray("foo"));
-    assertEquals(b, object.optJSONObject("bar"));
-    assertEquals(null, object.optJSONArray("bar"));
-    assertEquals(null, object.optJSONObject("foo"));
-  }
-
-  @Test
-  public void testNullCoercionToString() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", JSONObject.NULL);
-    assertEquals("null", object.getString("foo"));
-  }
-
-  @Test
-  public void testArrayCoercion() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "[true]");
-    try {
-      object.getJSONArray("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testObjectCoercion() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "{}");
-    try {
-      object.getJSONObject("foo");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testAccumulateValueChecking() throws JSONException {
-    JSONObject object = new JSONObject();
-    try {
-      object.accumulate("foo", Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    object.accumulate("foo", 1);
-    try {
-      object.accumulate("foo", Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    object.accumulate("foo", 2);
-    try {
-      object.accumulate("foo", Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testToJSONArray() throws JSONException {
-    JSONObject object = new JSONObject();
-    Object value = new Object();
-    object.put("foo", true);
-    object.put("bar", 5.0d);
-    object.put("baz", -0.0d);
-    object.put("quux", value);
-
-    JSONArray names = new JSONArray();
-    names.put("baz");
-    names.put("quux");
-    names.put("foo");
-
-    JSONArray array = object.toJSONArray(names);
-    assertEquals(-0.0d, array.get(0));
-    assertEquals(value, array.get(1));
-    assertEquals(true, array.get(2));
-
-    object.put("foo", false);
-    assertEquals(true, array.get(2));
-  }
-
-  @Test
-  public void testToJSONArrayMissingNames() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", true);
-    object.put("bar", 5.0d);
-    object.put("baz", JSONObject.NULL);
-
-    JSONArray names = new JSONArray();
-    names.put("bar");
-    names.put("foo");
-    names.put("quux");
-    names.put("baz");
-
-    JSONArray array = object.toJSONArray(names);
-    assertEquals(4, array.length());
-
-    assertEquals(5.0d, array.get(0));
-    assertEquals(true, array.get(1));
-    try {
-      array.get(2);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals(JSONObject.NULL, array.get(3));
-  }
-
-  @Test
-  public void testToJSONArrayNull() throws JSONException {
-    JSONObject object = new JSONObject();
-    assertEquals(null, object.toJSONArray(null));
-    object.put("foo", 5);
-    try {
-      object.toJSONArray(null);
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testToJSONArrayEndsUpEmpty() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    JSONArray array = new JSONArray();
-    array.put("bar");
-    assertEquals(1, object.toJSONArray(array).length());
-  }
-
-  @Test
-  public void testToJSONArrayNonString() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    object.put("null", 10);
-    object.put("false", 15);
-
-    JSONArray names = new JSONArray();
-    names.put(JSONObject.NULL);
-    names.put(false);
-    names.put("foo");
-
-    // array elements are converted to strings to do name lookups on the map!
-    JSONArray array = object.toJSONArray(names);
-    assertEquals(3, array.length());
-    assertEquals(10, array.get(0));
-    assertEquals(15, array.get(1));
-    assertEquals(5, array.get(2));
-  }
-
-  @Test
-  public void testPutUnsupportedNumbers() throws JSONException {
-    JSONObject object = new JSONObject();
-    try {
-      object.put("foo", Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.put("foo", Double.NEGATIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.put("foo", Double.POSITIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testPutUnsupportedNumbersAsObjects() throws JSONException {
-    JSONObject object = new JSONObject();
-    try {
-      object.put("foo", (Double) Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.put("foo", (Double) Double.NEGATIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      object.put("foo", (Double) Double.POSITIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  /**
-   * Although JSONObject is usually defensive about which numbers it accepts, 
it doesn't check
-   * inputs in its constructor.
-   */
-  @Test
-  public void testCreateWithUnsupportedNumbers() throws JSONException {
-    Map<String, Object> contents = new HashMap<String, Object>();
-    contents.put("foo", Double.NaN);
-    contents.put("bar", Double.NEGATIVE_INFINITY);
-    contents.put("baz", Double.POSITIVE_INFINITY);
-
-    JSONObject object = new JSONObject(contents);
-    assertEquals(Double.NaN, object.get("foo"));
-    assertEquals(Double.NEGATIVE_INFINITY, object.get("bar"));
-    assertEquals(Double.POSITIVE_INFINITY, object.get("baz"));
-  }
-
-  @Test
-  public void testToStringWithUnsupportedNumbers() {
-    // when the object contains an unsupported number, toString returns null!
-    JSONObject object = new JSONObject(Collections.singletonMap("foo", 
Double.NaN));
-    assertEquals(null, object.toString());
-  }
-
-  @Test
-  public void testMapConstructorCopiesContents() throws JSONException {
-    Map<String, Object> contents = new HashMap<String, Object>();
-    contents.put("foo", 5);
-    JSONObject object = new JSONObject(contents);
-    contents.put("foo", 10);
-    assertEquals(5, object.get("foo"));
-  }
-
-  @Test
-  public void testMapConstructorWithBogusEntries() {
-    Map<Object, Object> contents = new HashMap<Object, Object>();
-    contents.put(5, 5);
-
-    try {
-      new JSONObject(contents);
-      fail("JSONObject constructor doesn't validate its input!");
-    } catch (Exception ignored) {
-    }
-  }
-
-  @Test
-  public void testTokenerConstructor() throws JSONException {
-    JSONObject object = new JSONObject(new JSONTokener("{\"foo\": false}"));
-    assertEquals(1, object.length());
-    assertEquals(false, object.get("foo"));
-  }
-
-  @Test
-  public void testTokenerConstructorWrongType() throws JSONException {
-    try {
-      new JSONObject(new JSONTokener("[\"foo\", false]"));
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testTokenerConstructorNull() throws JSONException {
-    try {
-      new JSONObject((JSONTokener) null);
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-  }
-
-  @Test
-  public void testTokenerConstructorParseFail() {
-    try {
-      new JSONObject(new JSONTokener("{"));
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testStringConstructor() throws JSONException {
-    JSONObject object = new JSONObject("{\"foo\": false}");
-    assertEquals(1, object.length());
-    assertEquals(false, object.get("foo"));
-  }
-
-  @Test
-  public void testStringConstructorWrongType() throws JSONException {
-    try {
-      new JSONObject("[\"foo\", false]");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testStringConstructorNull() throws JSONException {
-    try {
-      new JSONObject((String) null);
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-  }
-
-  @Test
-  public void testStringConstructorParseFail() {
-    try {
-      new JSONObject("{");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testCopyConstructor() throws JSONException {
-    JSONObject source = new JSONObject();
-    source.put("a", JSONObject.NULL);
-    source.put("b", false);
-    source.put("c", 5);
-
-    JSONObject copy = new JSONObject(source, new String[] {"a", "c"});
-    assertEquals(2, copy.length());
-    assertEquals(JSONObject.NULL, copy.get("a"));
-    assertEquals(5, copy.get("c"));
-    assertEquals(null, copy.opt("b"));
-  }
-
-  @Test
-  public void testCopyConstructorMissingName() throws JSONException {
-    JSONObject source = new JSONObject();
-    source.put("a", JSONObject.NULL);
-    source.put("b", false);
-    source.put("c", 5);
-
-    JSONObject copy = new JSONObject(source, new String[] {"a", "c", "d"});
-    assertEquals(2, copy.length());
-    assertEquals(JSONObject.NULL, copy.get("a"));
-    assertEquals(5, copy.get("c"));
-    assertEquals(0, copy.optInt("b"));
-  }
-
-  @Test
-  public void testAccumulateMutatesInPlace() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    object.accumulate("foo", 6);
-    JSONArray array = object.getJSONArray("foo");
-    assertEquals("[5,6]", array.toString());
-    object.accumulate("foo", 7);
-    assertEquals("[5,6,7]", array.toString());
-  }
-
-  @Test
-  public void testAccumulateExistingArray() throws JSONException {
-    JSONArray array = new JSONArray();
-    JSONObject object = new JSONObject();
-    object.put("foo", array);
-    object.accumulate("foo", 5);
-    assertEquals("[5]", array.toString());
-  }
-
-  @Test
-  public void testAccumulatePutArray() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.accumulate("foo", 5);
-    assertEquals("{\"foo\":5}", object.toString());
-    object.accumulate("foo", new JSONArray());
-    assertEquals("{\"foo\":[5,[]]}", object.toString());
-  }
-
-  @Test
-  public void testAccumulateNull() {
-    JSONObject object = new JSONObject();
-    try {
-      object.accumulate(null, 5);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testEmptyStringKey() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("", 5);
-    assertEquals(5, object.get(""));
-    assertEquals("{\"\":5}", object.toString());
-  }
-
-  @Test
-  public void testNullValue() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", JSONObject.NULL);
-    object.put("bar", null);
-
-    // there are two ways to represent null; each behaves differently!
-    assertTrue(object.has("foo"));
-    assertFalse(object.has("bar"));
-    assertTrue(object.isNull("foo"));
-    assertTrue(object.isNull("bar"));
-  }
-
-  @Test
-  public void testNullValue_equalsAndHashCode() {
-    // noinspection ObjectEqualsNull
-    assertTrue(JSONObject.NULL.equals(null)); // guaranteed by javadoc
-    // not guaranteed by javadoc, but seems like a good idea
-    assertEquals(Objects.hashCode(null), JSONObject.NULL.hashCode());
-  }
-
-  @Test
-  public void testHas() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    assertTrue(object.has("foo"));
-    assertFalse(object.has("bar"));
-    assertFalse(object.has(null));
-  }
-
-  @Test
-  public void testOptNull() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", "bar");
-    assertEquals(null, object.opt(null));
-    assertEquals(false, object.optBoolean(null));
-    assertEquals(Double.NaN, object.optDouble(null), 0);
-    assertEquals(0, object.optInt(null));
-    assertEquals(0L, object.optLong(null));
-    assertEquals(null, object.optJSONArray(null));
-    assertEquals(null, object.optJSONObject(null));
-    assertEquals("", object.optString(null));
-    assertEquals(true, object.optBoolean(null, true));
-    assertEquals(0.0d, object.optDouble(null, 0.0d), 0);
-    assertEquals(1, object.optInt(null, 1));
-    assertEquals(1L, object.optLong(null, 1L));
-    assertEquals("baz", object.optString(null, "baz"));
-  }
-
-  @Test
-  public void testToStringWithIndentFactor() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", new JSONArray(Arrays.asList(5, 6)));
-    object.put("bar", new JSONObject());
-    String foobar = "{\n" + "     \"foo\": [\n" + "          5,\n" + "         
 6\n" + "     ],\n"
-        + "     \"bar\": {}\n" + "}";
-    String barfoo = "{\n" + "     \"bar\": {},\n" + "     \"foo\": [\n" + "    
      5,\n"
-        + "          6\n" + "     ]\n" + "}";
-    String string = object.toString(5);
-    assertTrue(string, foobar.equals(string) || barfoo.equals(string));
-  }
-
-  @Test
-  public void testNames() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    object.put("bar", 6);
-    object.put("baz", 7);
-    JSONArray array = object.names();
-    assertTrue(array.toString().contains("foo"));
-    assertTrue(array.toString().contains("bar"));
-    assertTrue(array.toString().contains("baz"));
-  }
-
-  @Test
-  public void testKeysEmptyObject() {
-    JSONObject object = new JSONObject();
-    assertFalse(object.keys().hasNext());
-    try {
-      object.keys().next();
-      fail();
-    } catch (NoSuchElementException ignored) {
-    }
-  }
-
-  @Test
-  public void testKeys() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    object.put("bar", 6);
-    object.put("foo", 7);
-
-    @SuppressWarnings("unchecked")
-    Iterator<String> keys = object.keys();
-    Set<String> result = new HashSet<String>();
-    assertTrue(keys.hasNext());
-    result.add(keys.next());
-    assertTrue(keys.hasNext());
-    result.add(keys.next());
-    assertFalse(keys.hasNext());
-    assertEquals(new HashSet<String>(Arrays.asList("foo", "bar")), result);
-
-    try {
-      keys.next();
-      fail();
-    } catch (NoSuchElementException ignored) {
-    }
-  }
-
-  @Test
-  public void testMutatingKeysMutatesObject() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    Iterator keys = object.keys();
-    keys.next();
-    keys.remove();
-    assertEquals(0, object.length());
-  }
-
-  @Test
-  public void testQuote() {
-    // covered by JSONStringerTest.testEscaping
-  }
-
-  @Test
-  public void testQuoteNull() throws JSONException {
-    assertEquals("\"\"", JSONObject.quote(null));
-  }
-
-  @Test
-  public void testNumberToString() throws JSONException {
-    assertEquals("5", JSONObject.numberToString(5));
-    assertEquals("-0", JSONObject.numberToString(-0.0d));
-    assertEquals("9223372036854775806", 
JSONObject.numberToString(9223372036854775806L));
-    assertEquals("4.9E-324", JSONObject.numberToString(Double.MIN_VALUE));
-    assertEquals("1.7976931348623157E308", 
JSONObject.numberToString(Double.MAX_VALUE));
-    try {
-      JSONObject.numberToString(Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      JSONObject.numberToString(Double.NEGATIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      JSONObject.numberToString(Double.POSITIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals("0.001", JSONObject.numberToString(new BigDecimal("0.001")));
-    assertEquals("9223372036854775806",
-        JSONObject.numberToString(new BigInteger("9223372036854775806")));
-    try {
-      JSONObject.numberToString(null);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void test_wrap() throws Exception {
-    assertEquals(JSONObject.NULL, JSONObject.wrap(null));
-
-    JSONArray a = new JSONArray();
-    assertEquals(a, JSONObject.wrap(a));
-
-    JSONObject o = new JSONObject();
-    assertEquals(o, JSONObject.wrap(o));
-
-    assertEquals(JSONObject.NULL, JSONObject.wrap(JSONObject.NULL));
-
-    assertTrue(JSONObject.wrap(new byte[0]) instanceof JSONArray);
-    assertTrue(JSONObject.wrap(new ArrayList<String>()) instanceof JSONArray);
-    assertTrue(JSONObject.wrap(new HashMap<String, String>()) instanceof 
JSONObject);
-    assertTrue(JSONObject.wrap(0.0) instanceof Double);
-    assertTrue(JSONObject.wrap("hello") instanceof String);
-  }
-
-  // https://code.google.com/p/android/issues/detail?id=55114
-  @Test
-  public void test_toString_listAsMapValue() throws Exception {
-    ArrayList<Object> list = new ArrayList<Object>();
-    list.add("a");
-    list.add(new ArrayList<String>());
-    Map<String, Object> map = new TreeMap<String, Object>();
-    map.put("x", "l");
-    map.put("y", list);
-    assertEquals("{\"x\":\"l\",\"y\":[\"a\",[]]}", new 
JSONObject(map).toString());
-  }
-
-  @Test
-  public void testAppendExistingInvalidKey() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("foo", 5);
-    try {
-      object.append("foo", 6);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testAppendExistingArray() throws JSONException {
-    JSONArray array = new JSONArray();
-    JSONObject object = new JSONObject();
-    object.put("foo", array);
-    object.append("foo", 5);
-    assertEquals("[5]", array.toString());
-  }
-
-  @Test
-  public void testAppendPutArray() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.append("foo", 5);
-    assertEquals("{\"foo\":[5]}", object.toString());
-    object.append("foo", new JSONArray());
-    assertEquals("{\"foo\":[5,[]]}", object.toString());
-  }
-
-  @Test
-  public void testAppendNull() {
-    JSONObject object = new JSONObject();
-    try {
-      object.append(null, 5);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  // https://code.google.com/p/android/issues/detail?id=103641
-  @Test
-  public void testInvalidUnicodeEscape() {
-    try {
-      new JSONObject("{\"q\":\"\\u\", \"r\":[]}");
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testBeanThings()
-      throws IllegalAccessException, IntrospectionException, 
InvocationTargetException {
-    Foo f = new Foo();
-    assertEquals("{\"a\":1,\"b\":1,\"c\":\"c\",\"d\":[{\"e\":\"echo\"}]}",
-        new JSONObject(f).toString());
-  }
-
-  @Test
-  public void testGetNames() throws Exception {
-    assertArrayEquals(new String[] {"a", "b", "c", "d"},
-        JSONObject.getNames(new JSONObject(new Foo())));
-  }
-
-  private static class Foo {
-    public double getA() {
-      return 1.0;
-    }
-
-    public int getB() {
-      return 1;
-    }
-
-    public String getC() {
-      return "c";
-    }
-
-    public List<Bar> getD() {
-      ArrayList<Bar> r = new ArrayList<Bar>();
-      r.add(new Bar());
-      return r;
-    }
-  }
-
-  private static class Bar {
-    public String getE() {
-      return "echo";
-    }
-  }
-
-  @Test
-  public void testEnumWrapper() throws Exception {
-    Object y = JSONObject.wrap(E.A);
-    assertEquals("A", y);
-    assertTrue(y instanceof String);
-  }
-
-  enum E {
-    A {
-      int key() {
-        return 1;
-      }
-    },
-    B {
-      int key() {
-        return 2;
-      }
-    };
-    int key() {
-      return -1;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/abeaa244/geode-json/src/test/java/org/json/JSONStringerTest.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/JSONStringerTest.java 
b/geode-json/src/test/java/org/json/JSONStringerTest.java
deleted file mode 100755
index b3a8188..0000000
--- a/geode-json/src/test/java/org/json/JSONStringerTest.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software 
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
- * or implied. See the License for the specific language governing permissions 
and limitations under
- * the License.
- */
-
-package org.json;
-
-import org.junit.Test;
-
-import java.util.concurrent.TimeUnit;
-
-import static org.junit.Assert.*;
-
-/**
- * This black box test was written without inspecting the non-free org.json 
sourcecode.
- */
-public class JSONStringerTest {
-
-  @Test
-  public void testJSONFunctionHackTest() {
-    JSONStringer stringer = new JSONStringer();
-    stringer.object();
-    stringer.key("key");
-    stringer.value(new JSONFunctionTestObject("window.test('foo' + \"bar\")"));
-    stringer.endObject();
-    assertEquals("{\"key\":window.test('foo' + \"bar\")}", 
stringer.toString());
-  }
-
-  @Test
-  public void testEmptyStringer() {
-    // why isn't this the empty string?
-    assertNull(new JSONStringer().toString());
-  }
-
-  @Test
-  public void testValueJSONNull() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.value(JSONObject.NULL);
-    stringer.endArray();
-    assertEquals("[null]", stringer.toString());
-  }
-
-  @Test
-  public void testEmptyObject() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.object();
-    stringer.endObject();
-    assertEquals("{}", stringer.toString());
-  }
-
-  @Test
-  public void testEmptyArray() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.endArray();
-    assertEquals("[]", stringer.toString());
-  }
-
-  @Test
-  public void testArray() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.value(false);
-    stringer.value(5.0);
-    stringer.value(5L);
-    stringer.value("five");
-    stringer.value(null);
-    stringer.endArray();
-    assertEquals("[false,5,5,\"five\",null]", stringer.toString());
-  }
-
-  @Test
-  public void testValueObjectMethods() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.value(Boolean.FALSE);
-    stringer.value(Double.valueOf(5.0));
-    stringer.value(Long.valueOf(5L));
-    stringer.endArray();
-    assertEquals("[false,5,5]", stringer.toString());
-  }
-
-  @Test
-  public void testKeyValue() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.object();
-    stringer.key("a").value(false);
-    stringer.key("b").value(5.0);
-    stringer.key("c").value(5L);
-    stringer.key("d").value("five");
-    stringer.key("e").value(null);
-    stringer.endObject();
-    assertEquals("{\"a\":false," + "\"b\":5," + "\"c\":5," + "\"d\":\"five\"," 
+ "\"e\":null}",
-        stringer.toString());
-  }
-
-  /**
-   * Test what happens when extreme values are emitted. Such values are likely 
to be rounded during
-   * parsing.
-   */
-  @Test
-  public void testNumericRepresentations() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.value(Long.MAX_VALUE);
-    stringer.value(Double.MIN_VALUE);
-    stringer.endArray();
-    assertEquals("[9223372036854775807,4.9E-324]", stringer.toString());
-  }
-
-  @Test
-  public void testWeirdNumbers() throws JSONException {
-    try {
-      new JSONStringer().array().value(Double.NaN);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().array().value(Double.NEGATIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().array().value(Double.POSITIVE_INFINITY);
-      fail();
-    } catch (JSONException ignored) {
-    }
-
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.value(-0.0d);
-    stringer.value(0.0d);
-    stringer.endArray();
-    assertEquals("[-0,0]", stringer.toString());
-  }
-
-  @Test
-  public void testMismatchedScopes() {
-    try {
-      new JSONStringer().key("a");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().value("a");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().endObject();
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().endArray();
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().array().endObject();
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().object().endArray();
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().object().key("a").key("a");
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONStringer().object().value(false);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testNullKey() {
-    try {
-      new JSONStringer().object().key(null);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testRepeatedKey() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.object();
-    stringer.key("a").value(true);
-    stringer.key("a").value(false);
-    stringer.endObject();
-    // JSONStringer doesn't attempt to detect duplicates
-    assertEquals("{\"a\":true,\"a\":false}", stringer.toString());
-  }
-
-  @Test
-  public void testEmptyKey() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.object();
-    stringer.key("").value(false);
-    stringer.endObject();
-    assertEquals("{\"\":false}", stringer.toString()); // legit behaviour!
-  }
-
-  @Test
-  public void testEscaping() throws JSONException {
-    assertEscapedAllWays("a", "a");
-    assertEscapedAllWays("a\\\"", "a\"");
-    assertEscapedAllWays("\\\"", "\"");
-    assertEscapedAllWays(":", ":");
-    assertEscapedAllWays(",", ",");
-    assertEscapedAllWays("\\b", "\b");
-    assertEscapedAllWays("\\f", "\f");
-    assertEscapedAllWays("\\n", "\n");
-    assertEscapedAllWays("\\r", "\r");
-    assertEscapedAllWays("\\t", "\t");
-    assertEscapedAllWays(" ", " ");
-    assertEscapedAllWays("\\\\", "\\");
-    assertEscapedAllWays("{", "{");
-    assertEscapedAllWays("}", "}");
-    assertEscapedAllWays("[", "[");
-    assertEscapedAllWays("]", "]");
-    assertEscapedAllWays("\\u0000", "\0");
-    assertEscapedAllWays("\\u0019", "\u0019");
-    assertEscapedAllWays(" ", "\u0020");
-    assertEscapedAllWays("<\\/foo>", "</foo>");
-  }
-
-  private void assertEscapedAllWays(String escaped, String original) throws 
JSONException {
-    assertEquals("{\"" + escaped + "\":false}",
-        new 
JSONStringer().object().key(original).value(false).endObject().toString());
-    assertEquals("{\"a\":\"" + escaped + "\"}",
-        new 
JSONStringer().object().key("a").value(original).endObject().toString());
-    assertEquals("[\"" + escaped + "\"]",
-        new JSONStringer().array().value(original).endArray().toString());
-    assertEquals("\"" + escaped + "\"", JSONObject.quote(original));
-  }
-
-  @Test
-  public void testJSONArrayAsValue() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put(false);
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.value(array);
-    stringer.endArray();
-    assertEquals("[[false]]", stringer.toString());
-  }
-
-  @Test
-  public void testJSONObjectAsValue() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("a", false);
-    JSONStringer stringer = new JSONStringer();
-    stringer.object();
-    stringer.key("b").value(object);
-    stringer.endObject();
-    assertEquals("{\"b\":{\"a\":false}}", stringer.toString());
-  }
-
-  @Test
-  public void testArrayNestingMaxDepthSupports20() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    for (int i = 0; i < 20; i++) {
-      stringer.array();
-    }
-    for (int i = 0; i < 20; i++) {
-      stringer.endArray();
-    }
-    assertEquals("[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]", 
stringer.toString());
-
-    stringer = new JSONStringer();
-    for (int i = 0; i < 20; i++) {
-      stringer.array();
-    }
-  }
-
-  @Test
-  public void testObjectNestingMaxDepthSupports20() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    for (int i = 0; i < 20; i++) {
-      stringer.object();
-      stringer.key("a");
-    }
-    stringer.value(false);
-    for (int i = 0; i < 20; i++) {
-      stringer.endObject();
-    }
-    
assertEquals("{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":"
-        + 
"{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":false"
-        + "}}}}}}}}}}}}}}}}}}}}", stringer.toString());
-
-    stringer = new JSONStringer();
-    for (int i = 0; i < 20; i++) {
-      stringer.object();
-      stringer.key("a");
-    }
-  }
-
-  @Test
-  public void testMixedMaxDepthSupports20() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    for (int i = 0; i < 20; i += 2) {
-      stringer.array();
-      stringer.object();
-      stringer.key("a");
-    }
-    stringer.value(false);
-    for (int i = 0; i < 20; i += 2) {
-      stringer.endObject();
-      stringer.endArray();
-    }
-    assertEquals("[{\"a\":[{\"a\":[{\"a\":[{\"a\":[{\"a\":"
-        + "[{\"a\":[{\"a\":[{\"a\":[{\"a\":[{\"a\":false" + 
"}]}]}]}]}]}]}]}]}]}]",
-        stringer.toString());
-
-    stringer = new JSONStringer();
-    for (int i = 0; i < 20; i += 2) {
-      stringer.array();
-      stringer.object();
-      stringer.key("a");
-    }
-  }
-
-  @Test
-  public void testMaxDepthWithArrayValue() throws JSONException {
-    JSONArray array = new JSONArray();
-    array.put(false);
-
-    JSONStringer stringer = new JSONStringer();
-    for (int i = 0; i < 20; i++) {
-      stringer.array();
-    }
-    stringer.value(array);
-    for (int i = 0; i < 20; i++) {
-      stringer.endArray();
-    }
-    assertEquals("[[[[[[[[[[[[[[[[[[[[[false]]]]]]]]]]]]]]]]]]]]]", 
stringer.toString());
-  }
-
-  @Test
-  public void testMaxDepthWithObjectValue() throws JSONException {
-    JSONObject object = new JSONObject();
-    object.put("a", false);
-    JSONStringer stringer = new JSONStringer();
-    for (int i = 0; i < 20; i++) {
-      stringer.object();
-      stringer.key("b");
-    }
-    stringer.value(object);
-    for (int i = 0; i < 20; i++) {
-      stringer.endObject();
-    }
-    
assertEquals("{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":"
-        + 
"{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":{\"b\":"
-        + "{\"a\":false}}}}}}}}}}}}}}}}}}}}}", stringer.toString());
-  }
-
-  @Test
-  public void testMultipleRoots() throws JSONException {
-    JSONStringer stringer = new JSONStringer();
-    stringer.array();
-    stringer.endArray();
-    try {
-      stringer.object();
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testEnums() {
-    JSONObject x = new JSONObject();
-    x.put("a", TimeUnit.SECONDS);
-    x.put("b", "xyx");
-    JSONStringer s = new JSONStringer();
-    s.array();
-    s.value(x);
-    s.endArray();
-    assertEquals("[{\"a\":\"SECONDS\",\"b\":\"xyx\"}]", s.toString());
-  }
-
-  @Test
-  public void testJsonString() {
-    JSONObject x = new JSONObject();
-    x.put("a", new Goo());
-    JSONStringer s = new JSONStringer();
-    s.array();
-    s.value(x);
-    s.endArray();
-    // note lack of quotes
-    assertEquals("[{\"a\":fffooo}]", s.toString());
-  }
-
-  private static class Goo implements JSONString {
-    @Override
-    public String toJSONString() {
-      return "fffooo";
-    }
-  }
-}

Reply via email to