Package com.voyagegames.core.json

Examples of com.voyagegames.core.json.JsonObject


    mParser = new JsonParser(log);
  }

  @Test
  public void testParseString_success() {
    final JsonObject obj = mParser.parse(VALID_STRING);

    assertTrue(log.logs.size() == 0);
    assertTrue(obj != null);
    assertTrue(obj.values.size() == 9);
    assertTrue(obj.values.containsKey("firstName"));
View Full Code Here


    assertTrue(obj.values.containsKey("a decimal"));
  }

  @Test
  public void testParseString_successWithArray() {
    final JsonObject obj = mParser.parse(VALID_ARRAY_STRING);

    assertTrue(log.logs.size() == 0);
    assertTrue(obj != null);
    assertTrue(obj.values.size() == 1);
   
View Full Code Here

  }

  @Test
  public void testParseJsonString_success() {
    final JsonString str = new JsonString(VALID_SUB_STRING, 0, VALID_SUB_STRING.length());
    final JsonObject obj = mParser.parse(str);
   
    assertTrue(log.logs.size() == 0);
    assertTrue(obj != null);
    assertTrue(obj.values.size() == 4);
    assertTrue(obj.values.containsKey("streetAddress"));
View Full Code Here

    assertTrue(obj.values.containsKey("postalCode"));
  }

  @Test
  public void testParseString_malformed() {
    final JsonObject obj = mParser.parse(MALFORMED_STRING);

    assertTrue(log.logs.size() > 0);
    assertTrue(obj == null);
  }
View Full Code Here

    assertTrue(mValue.arrayValue() == values);
  }

  @Test
  public void testObjectValue() {
    final JsonObject obj = new JsonObject();
   
    assertTrue(mValue.type() == JsonValueType.NOT_SET);
   
    mValue.setObject(obj);
   
View Full Code Here

    }
  }

  @Test
  public void testMapQuestDirectionsJson() {
    final JsonObject obj = mParser.parse(TEST_VALUE);

    assertTrue(obj != null);
   
    try {
      final MapQuestSearchJson mqdj = new MapQuestSearchJson(obj);
     
      assertTrue(mqdj.info != null);
      assertTrue(mqdj.route != null);
    } catch (final Exception e) {
      log.log(TAG, e.toString(), e);
      log.log(TAG, obj.debug());
      fail("Unexpected exception");
    }
  }
View Full Code Here

    }
  }

  @Test
  public void testMapQuestReverseJson() {
    final JsonObject obj = mParser.parse(TEST_VALUE);

    assertTrue(obj != null);
   
    try {
      final MapQuestReverseJson mqrj = new MapQuestReverseJson(obj);
     
      assertTrue(mqrj.info != null);
      assertTrue(mqrj.options != null);
      assertTrue(mqrj.results != null);
    } catch (final Exception e) {
      log.log(TAG, e.toString(), e);
      log.log(TAG, obj.debug());
      fail("Unexpected exception");
    }
  }
View Full Code Here

TOP

Related Classes of com.voyagegames.core.json.JsonObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.