geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [1/2] geode git commit: GEODE-2142: removing tests so run precheckin
Date Sat, 18 Feb 2017 00:56:21 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2142 71f2af706 -> fc1624cce


http://git-wip-us.apache.org/repos/asf/geode/blob/fc1624cc/geode-json/src/test/java/org/json/JSONTokenerTest.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/JSONTokenerTest.java b/geode-json/src/test/java/org/json/JSONTokenerTest.java
deleted file mode 100755
index f68b3ce..0000000
--- a/geode-json/src/test/java/org/json/JSONTokenerTest.java
+++ /dev/null
@@ -1,616 +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 junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-
-/**
- * This black box test was written without inspecting the non-free org.json sourcecode.
- */
-public class JSONTokenerTest extends TestCase {
-
-  public void testNulls() throws JSONException {
-    // JSONTokener accepts null, only to fail later on almost all APIs!
-    new JSONTokener((String) null).back();
-
-    try {
-      new JSONTokener((String) null).more();
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).next();
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).next(3);
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).next('A');
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).nextClean();
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).nextString('"');
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).nextTo('A');
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).nextTo("ABC");
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).nextValue();
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).skipPast("ABC");
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    try {
-      new JSONTokener((String) null).skipTo('A');
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-
-    // noinspection ThrowableResultOfMethodCallIgnored
-    assertEquals("foo! at character 0 of null",
-        new JSONTokener((String) null).syntaxError("foo!").getMessage());
-
-    assertEquals(" at character 0 of null", new JSONTokener((String) null).toString());
-  }
-
-  public void testEmptyString() throws JSONException {
-    JSONTokener backTokener = new JSONTokener("");
-    backTokener.back();
-    assertEquals(" at character 0 of ", backTokener.toString());
-    assertFalse(new JSONTokener("").more());
-    assertEquals('\0', new JSONTokener("").next());
-    try {
-      new JSONTokener("").next(3);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONTokener("").next('A');
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals('\0', new JSONTokener("").nextClean());
-    try {
-      new JSONTokener("").nextString('"');
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals("", new JSONTokener("").nextTo('A'));
-    assertEquals("", new JSONTokener("").nextTo("ABC"));
-    try {
-      new JSONTokener("").nextValue();
-      fail();
-    } catch (JSONException ignored) {
-    }
-    new JSONTokener("").skipPast("ABC");
-    assertEquals('\0', new JSONTokener("").skipTo('A'));
-    // noinspection ThrowableResultOfMethodCallIgnored
-    assertEquals("foo! at character 0 of ", new JSONTokener("").syntaxError("foo!").getMessage());
-    assertEquals(" at character 0 of ", new JSONTokener("").toString());
-  }
-
-  public void testCharacterNavigation() throws JSONException {
-    JSONTokener abcdeTokener = new JSONTokener("ABCDE");
-    assertEquals('A', abcdeTokener.next());
-    assertEquals('B', abcdeTokener.next('B'));
-    assertEquals("CD", abcdeTokener.next(2));
-    try {
-      abcdeTokener.next(2);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals('E', abcdeTokener.nextClean());
-    assertEquals('\0', abcdeTokener.next());
-    assertFalse(abcdeTokener.more());
-    abcdeTokener.back();
-    assertTrue(abcdeTokener.more());
-    assertEquals('E', abcdeTokener.next());
-  }
-
-  public void testBackNextAndMore() throws JSONException {
-    JSONTokener abcTokener = new JSONTokener("ABC");
-    assertTrue(abcTokener.more());
-    abcTokener.next();
-    abcTokener.next();
-    assertTrue(abcTokener.more());
-    abcTokener.next();
-    assertFalse(abcTokener.more());
-    abcTokener.back();
-    assertTrue(abcTokener.more());
-    abcTokener.next();
-    assertFalse(abcTokener.more());
-    abcTokener.back();
-    abcTokener.back();
-    abcTokener.back();
-    abcTokener.back(); // you can back up before the beginning of a String!
-    assertEquals('A', abcTokener.next());
-  }
-
-  public void testNextMatching() throws JSONException {
-    JSONTokener abcdTokener = new JSONTokener("ABCD");
-    assertEquals('A', abcdTokener.next('A'));
-    try {
-      abcdTokener.next('C'); // although it failed, this op consumes a character of input
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals('C', abcdTokener.next('C'));
-    assertEquals('D', abcdTokener.next('D'));
-    try {
-      abcdTokener.next('E');
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  public void testNextN() throws JSONException {
-    JSONTokener abcdeTokener = new JSONTokener("ABCDEF");
-    assertEquals("", abcdeTokener.next(0));
-    try {
-      abcdeTokener.next(7);
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals("ABC", abcdeTokener.next(3));
-    try {
-      abcdeTokener.next(4);
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  public void testNextNWithAllRemaining() throws JSONException {
-    JSONTokener tokener = new JSONTokener("ABCDEF");
-    tokener.next(3);
-    try {
-      tokener.next(3);
-    } catch (JSONException e) {
-      AssertionFailedError error = new AssertionFailedError("off-by-one error?");
-      error.initCause(e);
-      throw error;
-    }
-  }
-
-  public void testNext0() throws JSONException {
-    JSONTokener tokener = new JSONTokener("ABCDEF");
-    tokener.next(5);
-    tokener.next();
-    try {
-      tokener.next(0);
-    } catch (JSONException e) {
-      Error error = new AssertionFailedError("Returning an empty string should be valid");
-      error.initCause(e);
-      throw error;
-    }
-  }
-
-  public void testNextCleanComments() throws JSONException {
-    JSONTokener tokener =
-        new JSONTokener("  A  /*XX*/B/*XX//XX\n//XX\nXX*/C//X//X//X\nD/*X*///X\n");
-    assertEquals('A', tokener.nextClean());
-    assertEquals('B', tokener.nextClean());
-    assertEquals('C', tokener.nextClean());
-    assertEquals('D', tokener.nextClean());
-    assertEquals('\0', tokener.nextClean());
-  }
-
-  public void testNextCleanNestedCStyleComments() throws JSONException {
-    JSONTokener tokener = new JSONTokener("A /* B /* C */ D */ E");
-    assertEquals('A', tokener.nextClean());
-    assertEquals('D', tokener.nextClean());
-    assertEquals('*', tokener.nextClean());
-    assertEquals('/', tokener.nextClean());
-    assertEquals('E', tokener.nextClean());
-  }
-
-  /**
-   * Some applications rely on parsing '#' to lead an end-of-line comment. http://b/2571423
-   */
-  public void testNextCleanHashComments() throws JSONException {
-    JSONTokener tokener = new JSONTokener("A # B */ /* C */ \nD #");
-    assertEquals('A', tokener.nextClean());
-    assertEquals('D', tokener.nextClean());
-    assertEquals('\0', tokener.nextClean());
-  }
-
-  public void testNextCleanCommentsTrailingSingleSlash() throws JSONException {
-    JSONTokener tokener = new JSONTokener(" / S /");
-    assertEquals('/', tokener.nextClean());
-    assertEquals('S', tokener.nextClean());
-    assertEquals('/', tokener.nextClean());
-    assertEquals("nextClean doesn't consume a trailing slash", '\0', tokener.nextClean());
-  }
-
-  public void testNextCleanTrailingOpenComment() throws JSONException {
-    try {
-      new JSONTokener("  /* ").nextClean();
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals('\0', new JSONTokener("  // ").nextClean());
-  }
-
-  public void testNextCleanNewlineDelimiters() throws JSONException {
-    assertEquals('B', new JSONTokener("  // \r\n  B ").nextClean());
-    assertEquals('B', new JSONTokener("  // \n  B ").nextClean());
-    assertEquals('B', new JSONTokener("  // \r  B ").nextClean());
-  }
-
-  public void testNextCleanSkippedWhitespace() throws JSONException {
-    assertEquals("character tabulation", 'A', new JSONTokener("\tA").nextClean());
-    assertEquals("line feed", 'A', new JSONTokener("\nA").nextClean());
-    assertEquals("carriage return", 'A', new JSONTokener("\rA").nextClean());
-    assertEquals("space", 'A', new JSONTokener(" A").nextClean());
-  }
-
-  /**
-   * Tests which characters tokener treats as ignorable whitespace. See Kevin Bourrillion's
-   * <a href="https://spreadsheets.google.com/pub?key=pd8dAQyHbdewRsnE5x5GzKQ">list
of whitespace
-   * characters</a>.
-   */
-  public void testNextCleanRetainedWhitespace() throws JSONException {
-    assertNotClean("null", '\u0000');
-    assertNotClean("next line", '\u0085');
-    assertNotClean("non-breaking space", '\u00a0');
-    assertNotClean("ogham space mark", '\u1680');
-    assertNotClean("mongolian vowel separator", '\u180e');
-    assertNotClean("en quad", '\u2000');
-    assertNotClean("em quad", '\u2001');
-    assertNotClean("en space", '\u2002');
-    assertNotClean("em space", '\u2003');
-    assertNotClean("three-per-em space", '\u2004');
-    assertNotClean("four-per-em space", '\u2005');
-    assertNotClean("six-per-em space", '\u2006');
-    assertNotClean("figure space", '\u2007');
-    assertNotClean("punctuation space", '\u2008');
-    assertNotClean("thin space", '\u2009');
-    assertNotClean("hair space", '\u200a');
-    assertNotClean("zero-width space", '\u200b');
-    assertNotClean("left-to-right mark", '\u200e');
-    assertNotClean("right-to-left mark", '\u200f');
-    assertNotClean("line separator", '\u2028');
-    assertNotClean("paragraph separator", '\u2029');
-    assertNotClean("narrow non-breaking space", '\u202f');
-    assertNotClean("medium mathematical space", '\u205f');
-    assertNotClean("ideographic space", '\u3000');
-    assertNotClean("line tabulation", '\u000b');
-    assertNotClean("form feed", '\u000c');
-    assertNotClean("information separator 4", '\u001c');
-    assertNotClean("information separator 3", '\u001d');
-    assertNotClean("information separator 2", '\u001e');
-    assertNotClean("information separator 1", '\u001f');
-  }
-
-  private void assertNotClean(String name, char c) throws JSONException {
-    assertEquals("The character " + name + " is not whitespace according to the JSON spec.",
c,
-        new JSONTokener(new String(new char[] {c, 'A'})).nextClean());
-  }
-
-  public void testNextString() throws JSONException {
-    assertEquals("", new JSONTokener("'").nextString('\''));
-    assertEquals("", new JSONTokener("\"").nextString('\"'));
-    assertEquals("ABC", new JSONTokener("ABC'DEF").nextString('\''));
-    assertEquals("ABC", new JSONTokener("ABC'''DEF").nextString('\''));
-
-    // nextString permits slash-escaping of arbitrary characters!
-    assertEquals("ABC", new JSONTokener("A\\B\\C'DEF").nextString('\''));
-
-    JSONTokener tokener = new JSONTokener(" 'abc' 'def' \"ghi\"");
-    tokener.next();
-    assertEquals('\'', tokener.next());
-    assertEquals("abc", tokener.nextString('\''));
-    tokener.next();
-    assertEquals('\'', tokener.next());
-    assertEquals("def", tokener.nextString('\''));
-    tokener.next();
-    assertEquals('"', tokener.next());
-    assertEquals("ghi", tokener.nextString('\"'));
-    assertFalse(tokener.more());
-  }
-
-  public void testNextStringNoDelimiter() throws JSONException {
-    try {
-      new JSONTokener("").nextString('\'');
-      fail();
-    } catch (JSONException ignored) {
-    }
-
-    JSONTokener tokener = new JSONTokener(" 'abc");
-    tokener.next();
-    tokener.next();
-    try {
-      tokener.next('\'');
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  public void testNextStringEscapedQuote() throws JSONException {
-    try {
-      new JSONTokener("abc\\").nextString('"');
-      fail();
-    } catch (JSONException ignored) {
-    }
-
-    // we're mixing Java escaping like \" and JavaScript escaping like \\\"
-    // which makes these tests extra tricky to read!
-    assertEquals("abc\"def", new JSONTokener("abc\\\"def\"ghi").nextString('"'));
-    assertEquals("abc\\def", new JSONTokener("abc\\\\def\"ghi").nextString('"'));
-    assertEquals("abc/def", new JSONTokener("abc\\/def\"ghi").nextString('"'));
-    assertEquals("abc\bdef", new JSONTokener("abc\\bdef\"ghi").nextString('"'));
-    assertEquals("abc\fdef", new JSONTokener("abc\\fdef\"ghi").nextString('"'));
-    assertEquals("abc\ndef", new JSONTokener("abc\\ndef\"ghi").nextString('"'));
-    assertEquals("abc\rdef", new JSONTokener("abc\\rdef\"ghi").nextString('"'));
-    assertEquals("abc\tdef", new JSONTokener("abc\\tdef\"ghi").nextString('"'));
-  }
-
-  public void testNextStringUnicodeEscaped() throws JSONException {
-    // we're mixing Java escaping like \\ and JavaScript escaping like \\u
-    assertEquals("abc def", new JSONTokener("abc\\u0020def\"ghi").nextString('"'));
-    assertEquals("abcU0020def", new JSONTokener("abc\\U0020def\"ghi").nextString('"'));
-
-    // JSON requires 4 hex characters after a unicode escape
-    try {
-      new JSONTokener("abc\\u002\"").nextString('"');
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONTokener("abc\\u").nextString('"');
-      fail();
-    } catch (JSONException ignored) {
-    }
-    try {
-      new JSONTokener("abc\\u    \"").nextString('"');
-      fail();
-    } catch (JSONException ignored) {
-    }
-    assertEquals("abc\"def", new JSONTokener("abc\\u0022def\"ghi").nextString('"'));
-    try {
-      new JSONTokener("abc\\u000G\"").nextString('"');
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  public void testNextStringNonQuote() throws JSONException {
-    assertEquals("AB", new JSONTokener("ABC").nextString('C'));
-    assertEquals("ABCD", new JSONTokener("AB\\CDC").nextString('C'));
-    assertEquals("AB\nC", new JSONTokener("AB\\nCn").nextString('n'));
-  }
-
-  public void testNextTo() throws JSONException {
-    assertEquals("ABC", new JSONTokener("ABCDEFG").nextTo("DHI"));
-    assertEquals("ABCDEF", new JSONTokener("ABCDEF").nextTo(""));
-
-    JSONTokener tokener = new JSONTokener("ABC\rDEF\nGHI\r\nJKL");
-    assertEquals("ABC", tokener.nextTo("M"));
-    assertEquals('\r', tokener.next());
-    assertEquals("DEF", tokener.nextTo("M"));
-    assertEquals('\n', tokener.next());
-    assertEquals("GHI", tokener.nextTo("M"));
-    assertEquals('\r', tokener.next());
-    assertEquals('\n', tokener.next());
-    assertEquals("JKL", tokener.nextTo("M"));
-
-    tokener = new JSONTokener("ABCDEFGHI");
-    assertEquals("ABC", tokener.nextTo("DEF"));
-    assertEquals("", tokener.nextTo("DEF"));
-    assertEquals('D', tokener.next());
-    assertEquals("", tokener.nextTo("DEF"));
-    assertEquals('E', tokener.next());
-    assertEquals("", tokener.nextTo("DEF"));
-    assertEquals('F', tokener.next());
-    assertEquals("GHI", tokener.nextTo("DEF"));
-    assertEquals("", tokener.nextTo("DEF"));
-
-    tokener = new JSONTokener(" \t \fABC \t DEF");
-    assertEquals("ABC", tokener.nextTo("DEF"));
-    assertEquals('D', tokener.next());
-
-    tokener = new JSONTokener(" \t \fABC \n DEF");
-    assertEquals("ABC", tokener.nextTo("\n"));
-    assertEquals("", tokener.nextTo("\n"));
-
-    tokener = new JSONTokener("");
-    try {
-      tokener.nextTo(null);
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-  }
-
-  public void testNextToTrimming() {
-    assertEquals("ABC", new JSONTokener("\t ABC \tDEF").nextTo("DE"));
-    assertEquals("ABC", new JSONTokener("\t ABC \tDEF").nextTo('D'));
-  }
-
-  public void testNextToTrailing() {
-    assertEquals("ABC DEF", new JSONTokener("\t ABC DEF \t").nextTo("G"));
-    assertEquals("ABC DEF", new JSONTokener("\t ABC DEF \t").nextTo('G'));
-  }
-
-  public void testNextToDoesntStopOnNull() {
-    String message = "nextTo() shouldn't stop after \\0 characters";
-    JSONTokener tokener = new JSONTokener(" \0\t \fABC \n DEF");
-    assertEquals(message, "ABC", tokener.nextTo("D"));
-    assertEquals(message, '\n', tokener.next());
-    assertEquals(message, "", tokener.nextTo("D"));
-  }
-
-  public void testNextToConsumesNull() {
-    String message = "nextTo shouldn't consume \\0.";
-    JSONTokener tokener = new JSONTokener("ABC\0DEF");
-    assertEquals(message, "ABC", tokener.nextTo("\0"));
-    assertEquals(message, '\0', tokener.next());
-    assertEquals(message, "DEF", tokener.nextTo("\0"));
-  }
-
-  public void testSkipPast() {
-    JSONTokener tokener = new JSONTokener("ABCDEF");
-    tokener.skipPast("ABC");
-    assertEquals('D', tokener.next());
-    tokener.skipPast("EF");
-    assertEquals('\0', tokener.next());
-
-    tokener = new JSONTokener("ABCDEF");
-    tokener.skipPast("ABCDEF");
-    assertEquals('\0', tokener.next());
-
-    tokener = new JSONTokener("ABCDEF");
-    tokener.skipPast("G");
-    assertEquals('\0', tokener.next());
-
-    tokener = new JSONTokener("ABC\0ABC");
-    tokener.skipPast("ABC");
-    assertEquals('\0', tokener.next());
-    assertEquals('A', tokener.next());
-
-    tokener = new JSONTokener("\0ABC");
-    tokener.skipPast("ABC");
-    assertEquals('\0', tokener.next());
-
-    tokener = new JSONTokener("ABC\nDEF");
-    tokener.skipPast("DEF");
-    assertEquals('\0', tokener.next());
-
-    tokener = new JSONTokener("ABC");
-    tokener.skipPast("ABCDEF");
-    assertEquals('\0', tokener.next());
-
-    tokener = new JSONTokener("ABCDABCDABCD");
-    tokener.skipPast("ABC");
-    assertEquals('D', tokener.next());
-    tokener.skipPast("ABC");
-    assertEquals('D', tokener.next());
-    tokener.skipPast("ABC");
-    assertEquals('D', tokener.next());
-
-    tokener = new JSONTokener("");
-    try {
-      tokener.skipPast(null);
-      fail();
-    } catch (NullPointerException ignored) {
-    }
-  }
-
-  public void testSkipTo() {
-    JSONTokener tokener = new JSONTokener("ABCDEF");
-    tokener.skipTo('A');
-    assertEquals('A', tokener.next());
-    tokener.skipTo('D');
-    assertEquals('D', tokener.next());
-    tokener.skipTo('G');
-    assertEquals('E', tokener.next());
-    tokener.skipTo('A');
-    assertEquals('F', tokener.next());
-
-    tokener = new JSONTokener("ABC\nDEF");
-    tokener.skipTo('F');
-    assertEquals('F', tokener.next());
-
-    tokener = new JSONTokener("ABCfDEF");
-    tokener.skipTo('F');
-    assertEquals('F', tokener.next());
-
-    tokener = new JSONTokener("ABC/* DEF */");
-    tokener.skipTo('D');
-    assertEquals('D', tokener.next());
-  }
-
-  public void testSkipToStopsOnNull() {
-    JSONTokener tokener = new JSONTokener("ABC\0DEF");
-    tokener.skipTo('F');
-    assertEquals("skipTo shouldn't stop when it sees '\\0'", 'F', tokener.next());
-  }
-
-  public void testBomIgnoredAsFirstCharacterOfDocument() throws JSONException {
-    JSONTokener tokener = new JSONTokener("\ufeff[]");
-    JSONArray array = (JSONArray) tokener.nextValue();
-    assertEquals(0, array.length());
-  }
-
-  public void testBomTreatedAsCharacterInRestOfDocument() throws JSONException {
-    JSONTokener tokener = new JSONTokener("[\ufeff]");
-    JSONArray array = (JSONArray) tokener.nextValue();
-    assertEquals(1, array.length());
-  }
-
-  public void testDehexchar() {
-    assertEquals(0, JSONTokener.dehexchar('0'));
-    assertEquals(1, JSONTokener.dehexchar('1'));
-    assertEquals(2, JSONTokener.dehexchar('2'));
-    assertEquals(3, JSONTokener.dehexchar('3'));
-    assertEquals(4, JSONTokener.dehexchar('4'));
-    assertEquals(5, JSONTokener.dehexchar('5'));
-    assertEquals(6, JSONTokener.dehexchar('6'));
-    assertEquals(7, JSONTokener.dehexchar('7'));
-    assertEquals(8, JSONTokener.dehexchar('8'));
-    assertEquals(9, JSONTokener.dehexchar('9'));
-    assertEquals(10, JSONTokener.dehexchar('A'));
-    assertEquals(11, JSONTokener.dehexchar('B'));
-    assertEquals(12, JSONTokener.dehexchar('C'));
-    assertEquals(13, JSONTokener.dehexchar('D'));
-    assertEquals(14, JSONTokener.dehexchar('E'));
-    assertEquals(15, JSONTokener.dehexchar('F'));
-    assertEquals(10, JSONTokener.dehexchar('a'));
-    assertEquals(11, JSONTokener.dehexchar('b'));
-    assertEquals(12, JSONTokener.dehexchar('c'));
-    assertEquals(13, JSONTokener.dehexchar('d'));
-    assertEquals(14, JSONTokener.dehexchar('e'));
-    assertEquals(15, JSONTokener.dehexchar('f'));
-
-    for (int c = 0; c <= 0xFFFF; c++) {
-      if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
(c >= 'a' && c <= 'f')) {
-        continue;
-      }
-      assertEquals("dehexchar " + c, -1, JSONTokener.dehexchar((char) c));
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/fc1624cc/geode-json/src/test/java/org/json/ParsingTest.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/ParsingTest.java b/geode-json/src/test/java/org/json/ParsingTest.java
deleted file mode 100755
index a49aba7..0000000
--- a/geode-json/src/test/java/org/json/ParsingTest.java
+++ /dev/null
@@ -1,291 +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.*;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-public class ParsingTest {
-
-  @Test
-  public void testParsingNoObjects() {
-    try {
-      new JSONTokener("").nextValue();
-      fail();
-    } catch (JSONException ignored) {
-    }
-  }
-
-  @Test
-  public void testParsingLiterals() throws JSONException {
-    assertParsed(Boolean.TRUE, "true");
-    assertParsed(Boolean.FALSE, "false");
-    assertParsed(JSONObject.NULL, "null");
-    assertParsed(JSONObject.NULL, "NULL");
-    assertParsed(Boolean.FALSE, "False");
-    assertParsed(Boolean.TRUE, "truE");
-  }
-
-  @Test
-  public void testParsingQuotedStrings() throws JSONException {
-    assertParsed("abc", "\"abc\"");
-    assertParsed("123", "\"123\"");
-    assertParsed("foo\nbar", "\"foo\\nbar\"");
-    assertParsed("foo bar", "\"foo\\u0020bar\"");
-    assertParsed("\"{}[]/\\:,=;#", "\"\\\"{}[]/\\\\:,=;#\"");
-  }
-
-  @Test
-  public void testParsingSingleQuotedStrings() throws JSONException {
-    assertParsed("abc", "'abc'");
-    assertParsed("123", "'123'");
-    assertParsed("foo\nbar", "'foo\\nbar'");
-    assertParsed("foo bar", "'foo\\u0020bar'");
-    assertParsed("\"{}[]/\\:,=;#", "'\\\"{}[]/\\\\:,=;#'");
-  }
-
-  @Test
-  public void testParsingUnquotedStrings() throws JSONException {
-    assertParsed("abc", "abc");
-    assertParsed("123abc", "123abc");
-    assertParsed("123e0x", "123e0x");
-    assertParsed("123e", "123e");
-    assertParsed("123ee21", "123ee21");
-    assertParsed("0xFFFFFFFFFFFFFFFFF", "0xFFFFFFFFFFFFFFFFF");
-  }
-
-  /**
-   * Unfortunately the original implementation attempts to figure out what Java number type
best
-   * suits an input value.
-   */
-  @Test
-  public void testParsingNumbersThatAreBestRepresentedAsLongs() throws JSONException {
-    assertParsed(9223372036854775807L, "9223372036854775807");
-    assertParsed(9223372036854775806L, "9223372036854775806");
-    assertParsed(-9223372036854775808L, "-9223372036854775808");
-    assertParsed(-9223372036854775807L, "-9223372036854775807");
-  }
-
-  @Test
-  public void testParsingNumbersThatAreBestRepresentedAsIntegers() throws JSONException {
-    assertParsed(0, "0");
-    assertParsed(5, "5");
-    assertParsed(-2147483648, "-2147483648");
-    assertParsed(2147483647, "2147483647");
-  }
-
-  @Test
-  public void testParsingNegativeZero() throws JSONException {
-    assertParsed(0, "-0");
-  }
-
-  @Test
-  public void testParsingIntegersWithAdditionalPrecisionYieldDoubles() throws JSONException
{
-    assertParsed(1d, "1.00");
-    assertParsed(1d, "1.0");
-    assertParsed(0d, "0.0");
-    assertParsed(-0d, "-0.0");
-  }
-
-  @Test
-  public void testParsingNumbersThatAreBestRepresentedAsDoubles() throws JSONException {
-    assertParsed(9.223372036854776E18, "9223372036854775808");
-    assertParsed(-9.223372036854776E18, "-9223372036854775809");
-    assertParsed(1.7976931348623157E308, "1.7976931348623157e308");
-    assertParsed(2.2250738585072014E-308, "2.2250738585072014E-308");
-    assertParsed(4.9E-324, "4.9E-324");
-    assertParsed(4.9E-324, "4.9e-324");
-  }
-
-  @Test
-  public void testParsingOctalNumbers() throws JSONException {
-    assertParsed(5, "05");
-    assertParsed(8, "010");
-    assertParsed(1046, "02026");
-  }
-
-  @Test
-  public void testParsingHexNumbers() throws JSONException {
-    assertParsed(5, "0x5");
-    assertParsed(16, "0x10");
-    assertParsed(8230, "0x2026");
-    assertParsed(180150010, "0xABCDEFA");
-    assertParsed(2077093803, "0x7BCDEFAB");
-  }
-
-  @Test
-  public void testParsingLargeHexValues() throws JSONException {
-    assertParsed(Integer.MAX_VALUE, "0x7FFFFFFF");
-    String message = "Hex values are parsed as Strings if their signed "
-        + "value is greater than Integer.MAX_VALUE.";
-    assertParsed(message, 0x80000000L, "0x80000000");
-  }
-
-  @Test
-  public void test64BitHexValues() throws JSONException {
-    // note that this is different from the same test in the original Android
-    // this is due to the fact that Long.parseLong doesn't correctly handle
-    // the value -1 expressed as unsigned hex if you use the normal JDK. Presumably
-    // the Android equivalent program does this better.
-    assertParsed("Large hex longs shouldn't yield ints or strings", 0xFFFFFFFFFFFFFFFL,
-        "0xFFFFFFFFFFFFFFF");
-  }
-
-  @Test
-  public void testParsingWithCommentsAndWhitespace() throws JSONException {
-    assertParsed("baz", "  // foo bar \n baz");
-    assertParsed("baz", "  // foo bar \r baz");
-    assertParsed("baz", "  // foo bar \r\n baz");
-    assertParsed("baz", "  # foo bar \n baz");
-    assertParsed("baz", "  # foo bar \r baz");
-    assertParsed("baz", "  # foo bar \r\n baz");
-    assertParsed(5, "  /* foo bar \n baz */ 5");
-    assertParsed(5, "  /* foo bar \n baz */ 5 // quux");
-    assertParsed(5, "  5   ");
-    assertParsed(5, "  5  \r\n\t ");
-    assertParsed(5, "\r\n\t   5 ");
-  }
-
-  @Test
-  public void testParsingArrays() throws JSONException {
-    assertParsed(array(), "[]");
-    assertParsed(array(5, 6, true), "[5,6,true]");
-    assertParsed(array(5, 6, array()), "[5,6,[]]");
-    assertParsed(array(5, 6, 7), "[5;6;7]");
-    assertParsed(array(5, 6, 7), "[5  , 6 \t; \r\n 7\n]");
-    assertParsed(array(5, 6, 7, null), "[5,6,7,]");
-    assertParsed(array(null, null), "[,]");
-    assertParsed(array(5, null, null, null, 5), "[5,,,,5]");
-    assertParsed(array(null, 5), "[,5]");
-    assertParsed(array(null, null, null), "[,,]");
-    assertParsed(array(null, null, null, 5), "[,,,5]");
-  }
-
-  @Test
-  public void testParsingObjects() throws JSONException {
-    assertParsed(object("foo", 5), "{\"foo\": 5}");
-    assertParsed(object("foo", 5), "{foo: 5}");
-    assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\": 5, \"bar\": \"baz\"}");
-    assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\": 5; \"bar\": \"baz\"}");
-    assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\"= 5; \"bar\"= \"baz\"}");
-    assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\"=> 5; \"bar\"=> \"baz\"}");
-    assertParsed(object("foo", object(), "bar", array()), "{\"foo\"=> {}; \"bar\"=>
[]}");
-    assertParsed(object("foo", object("foo", array(5, 6))), "{\"foo\": {\"foo\": [5, 6]}}");
-    assertParsed(object("foo", object("foo", array(5, 6))), "{\"foo\":\n\t{\t \"foo\":[5,\r6]}}");
-  }
-
-  @Test
-  public void testSyntaxProblemUnterminatedObject() {
-    assertParseFail("{");
-    assertParseFail("{\"foo\"");
-    assertParseFail("{\"foo\":");
-    assertParseFail("{\"foo\":bar");
-    assertParseFail("{\"foo\":bar,");
-    assertParseFail("{\"foo\":bar,\"baz\"");
-    assertParseFail("{\"foo\":bar,\"baz\":");
-    assertParseFail("{\"foo\":bar,\"baz\":true");
-    assertParseFail("{\"foo\":bar,\"baz\":true,");
-  }
-
-  @Test
-  public void testSyntaxProblemEmptyString() {
-    assertParseFail("");
-  }
-
-  @Test
-  public void testSyntaxProblemUnterminatedArray() {
-    assertParseFail("[");
-    assertParseFail("[,");
-    assertParseFail("[,,");
-    assertParseFail("[true");
-    assertParseFail("[true,");
-    assertParseFail("[true,,");
-  }
-
-  @Test
-  public void testSyntaxProblemMalformedObject() {
-    assertParseFail("{:}");
-    assertParseFail("{\"key\":}");
-    assertParseFail("{:true}");
-    assertParseFail("{\"key\":true:}");
-    assertParseFail("{null:true}");
-    assertParseFail("{true:true}");
-    assertParseFail("{0xFF:true}");
-  }
-
-  private void assertParseFail(String malformedJson) {
-    try {
-      new JSONTokener(malformedJson).nextValue();
-      fail("Successfully parsed: \"" + malformedJson + "\"");
-    } catch (JSONException ignored) {
-    } catch (StackOverflowError e) {
-      fail("Stack overflowed on input: \"" + malformedJson + "\"");
-    }
-  }
-
-  private JSONArray array(Object... elements) {
-    return new JSONArray(Arrays.asList(elements));
-  }
-
-  private JSONObject object(Object... keyValuePairs) throws JSONException {
-    JSONObject result = new JSONObject();
-    for (int i = 0; i < keyValuePairs.length; i += 2) {
-      result.put((String) keyValuePairs[i], keyValuePairs[i + 1]);
-    }
-    return result;
-  }
-
-  private void assertParsed(String message, Object expected, String json) throws JSONException
{
-    Object actual = new JSONTokener(json).nextValue();
-    actual = canonicalize(actual);
-    expected = canonicalize(expected);
-    assertEquals("For input \"" + json + "\" " + message, expected, actual);
-  }
-
-  private void assertParsed(Object expected, String json) throws JSONException {
-    assertParsed("", expected, json);
-  }
-
-  /**
-   * Since they don't implement equals or hashCode properly, this recursively replaces JSONObjects
-   * with an equivalent HashMap, and JSONArrays with the equivalent ArrayList.
-   */
-  private Object canonicalize(Object input) throws JSONException {
-    if (input instanceof JSONArray) {
-      JSONArray array = (JSONArray) input;
-      List<Object> result = new ArrayList<Object>();
-      for (int i = 0; i < array.length(); i++) {
-        result.add(canonicalize(array.opt(i)));
-      }
-      return result;
-    } else if (input instanceof JSONObject) {
-      JSONObject object = (JSONObject) input;
-      Map<String, Object> result = new HashMap<String, Object>();
-      for (Iterator<?> i = object.keys(); i.hasNext();) {
-        String key = (String) i.next();
-        result.put(key, canonicalize(object.get(key)));
-      }
-      return result;
-    } else if (input == null || input.equals(JSONObject.NULL)) {
-      return JSONObject.NULL;
-    } else {
-      return input;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/fc1624cc/geode-json/src/test/java/org/json/SelfUseTest.java
----------------------------------------------------------------------
diff --git a/geode-json/src/test/java/org/json/SelfUseTest.java b/geode-json/src/test/java/org/json/SelfUseTest.java
deleted file mode 100755
index 78ee678..0000000
--- a/geode-json/src/test/java/org/json/SelfUseTest.java
+++ /dev/null
@@ -1,273 +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 static org.junit.Assert.assertEquals;
-
-/**
- * These tests checks self use calls. For the most part we doesn't attempt to cover self-use,
except
- * in those cases where our clean room implementation does it.
- * <p>
- * <p>
- * This black box test was written without inspecting the non-free org.json sourcecode.
- */
-public class SelfUseTest {
-
-  private int objectPutCalls = 0;
-  private int objectGetCalls = 0;
-  private int objectOptCalls = 0;
-  private int objectOptTypeCalls = 0;
-  private int arrayPutCalls = 0;
-  private int arrayGetCalls = 0;
-  private int arrayOptCalls = 0;
-  private int arrayOptTypeCalls = 0;
-  private int tokenerNextCalls = 0;
-  private int tokenerNextValueCalls = 0;
-
-  private final JSONObject object = new JSONObject() {
-    @Override
-    public JSONObject put(String name, Object value) throws JSONException {
-      objectPutCalls++;
-      return super.put(name, value);
-    }
-
-    @Override
-    public Object get(String name) throws JSONException {
-      objectGetCalls++;
-      return super.get(name);
-    }
-
-    @Override
-    public Object opt(String name) {
-      objectOptCalls++;
-      return super.opt(name);
-    }
-
-    @Override
-    public boolean optBoolean(String key, boolean defaultValue) {
-      objectOptTypeCalls++;
-      return super.optBoolean(key, defaultValue);
-    }
-
-    @Override
-    public double optDouble(String key, double defaultValue) {
-      objectOptTypeCalls++;
-      return super.optDouble(key, defaultValue);
-    }
-
-    @Override
-    public int optInt(String key, int defaultValue) {
-      objectOptTypeCalls++;
-      return super.optInt(key, defaultValue);
-    }
-
-    @Override
-    public long optLong(String key, long defaultValue) {
-      objectOptTypeCalls++;
-      return super.optLong(key, defaultValue);
-    }
-
-    @Override
-    public String optString(String key, String defaultValue) {
-      objectOptTypeCalls++;
-      return super.optString(key, defaultValue);
-    }
-  };
-
-  private final JSONArray array = new JSONArray() {
-    @Override
-    public JSONArray put(int index, Object value) throws JSONException {
-      arrayPutCalls++;
-      return super.put(index, value);
-    }
-
-    @Override
-    public Object get(int index) throws JSONException {
-      arrayGetCalls++;
-      return super.get(index);
-    }
-
-    @Override
-    public Object opt(int index) {
-      arrayOptCalls++;
-      return super.opt(index);
-    }
-
-    @Override
-    public boolean optBoolean(int index, boolean fallback) {
-      arrayOptTypeCalls++;
-      return super.optBoolean(index, fallback);
-    }
-
-    @Override
-    public double optDouble(int index, double fallback) {
-      arrayOptTypeCalls++;
-      return super.optDouble(index, fallback);
-    }
-
-    @Override
-    public long optLong(int index, long fallback) {
-      arrayOptTypeCalls++;
-      return super.optLong(index, fallback);
-    }
-
-    @Override
-    public String optString(int index, String fallback) {
-      arrayOptTypeCalls++;
-      return super.optString(index, fallback);
-    }
-
-    @Override
-    public int optInt(int index, int fallback) {
-      arrayOptTypeCalls++;
-      return super.optInt(index, fallback);
-    }
-  };
-
-  private final JSONTokener tokener = new JSONTokener("{\"foo\": [true]}") {
-    @Override
-    public char next() {
-      tokenerNextCalls++;
-      return super.next();
-    }
-
-    @Override
-    public Object nextValue() throws JSONException {
-      tokenerNextValueCalls++;
-      return super.nextValue();
-    }
-  };
-
-
-  @Test
-  public void testObjectPut() throws JSONException {
-    object.putOpt("foo", "bar");
-    assertEquals(1, objectPutCalls);
-  }
-
-  @Test
-  public void testObjectAccumulate() throws JSONException {
-    object.accumulate("foo", "bar");
-    assertEquals(1, objectPutCalls);
-  }
-
-  @Test
-  public void testObjectGetBoolean() throws JSONException {
-    object.put("foo", "true");
-    object.getBoolean("foo");
-    assertEquals(1, objectGetCalls);
-  }
-
-  @Test
-  public void testObjectOptType() throws JSONException {
-    object.optBoolean("foo");
-    assertEquals(1, objectOptCalls);
-    assertEquals(1, objectOptTypeCalls);
-    object.optDouble("foo");
-    assertEquals(2, objectOptCalls);
-    assertEquals(2, objectOptTypeCalls);
-    object.optInt("foo");
-    assertEquals(3, objectOptCalls);
-    assertEquals(3, objectOptTypeCalls);
-    object.optLong("foo");
-    assertEquals(4, objectOptCalls);
-    assertEquals(4, objectOptTypeCalls);
-    object.optString("foo");
-    assertEquals(5, objectOptCalls);
-    assertEquals(5, objectOptTypeCalls);
-  }
-
-  @Test
-  public void testToJSONArray() throws JSONException {
-    object.put("foo", 5);
-    object.put("bar", 10);
-    array.put("foo");
-    array.put("baz");
-    array.put("bar");
-    object.toJSONArray(array);
-    assertEquals(3, arrayOptCalls);
-    assertEquals(0, arrayOptTypeCalls);
-    assertEquals(3, objectOptCalls);
-    assertEquals(0, objectOptTypeCalls);
-  }
-
-  @Test
-  public void testPutAtIndex() throws JSONException {
-    array.put(10, false);
-    assertEquals(1, arrayPutCalls);
-  }
-
-  @Test
-  public void testIsNull() {
-    array.isNull(5);
-    assertEquals(1, arrayOptCalls);
-  }
-
-  @Test
-  public void testArrayGetType() throws JSONException {
-    array.put(true);
-    array.getBoolean(0);
-    assertEquals(1, arrayGetCalls);
-  }
-
-  @Test
-  public void testArrayOptType() throws JSONException {
-    array.optBoolean(3);
-    assertEquals(1, arrayOptCalls);
-    assertEquals(1, arrayOptTypeCalls);
-    array.optDouble(3);
-    assertEquals(2, arrayOptCalls);
-    assertEquals(2, arrayOptTypeCalls);
-    array.optInt(3);
-    assertEquals(3, arrayOptCalls);
-    assertEquals(3, arrayOptTypeCalls);
-    array.optLong(3);
-    assertEquals(4, arrayOptCalls);
-    assertEquals(4, arrayOptTypeCalls);
-    array.optString(3);
-    assertEquals(5, arrayOptCalls);
-    assertEquals(5, arrayOptTypeCalls);
-  }
-
-  @Test
-  public void testToJSONObject() throws JSONException {
-    array.put("foo");
-    array.put("baz");
-    array.put("bar");
-    JSONArray values = new JSONArray();
-    values.put(5.5d);
-    values.put(11d);
-    values.put(30);
-    values.toJSONObject(array);
-    assertEquals(3, arrayOptCalls);
-    assertEquals(0, arrayOptTypeCalls);
-  }
-
-  @Test
-  public void testNextExpecting() throws JSONException {
-    tokener.next('{');
-    assertEquals(1, tokenerNextCalls);
-    tokener.next('\"');
-    assertEquals(2, tokenerNextCalls);
-  }
-
-  @Test
-  public void testNextValue() throws JSONException {
-    tokener.nextValue();
-    assertEquals(4, tokenerNextValueCalls);
-  }
-}


Mime
View raw message