Package org.json.simple

Examples of org.json.simple.JSONObject.containsKey()


        String branchRev2 = mk.branch(rev2);
        String json = mk.getNodes("/child1", branchRev2, 0, 0, -1, null);
        JSONParser parser = new JSONParser();
        JSONObject obj = (JSONObject) parser.parse(json);
        assertFalse(obj.containsKey("foo"));
    }

    @Test
    public void movesInBranch() throws Exception {
        String branchRev = mk.branch(null);
View Full Code Here


        mk.merge(branchRev, null);

        String json = mk.getNodes("/a", null, 0, 0, -1, null);
        JSONParser parser = new JSONParser();
        JSONObject obj = (JSONObject) parser.parse(json);
        assertTrue(obj.containsKey("foo"));
    }

    @Test
    public void branchIsolation1() throws Exception {
        String filter = "{\"properties\":[\"*\",\":hash\",\":id\"]}";
 
View Full Code Here

        String branchRev2 = mk.branch(rev2);
        String json = mk.getNodes("/child1", branchRev2, 0, 0, -1, null);
        JSONParser parser = new JSONParser();
        JSONObject obj = (JSONObject) parser.parse(json);
        assertFalse(obj.containsKey("foo"));
    }

    @Test
    public void movesInBranch() throws Exception {
        String branchRev = mk.branch(null);
View Full Code Here

        mk.merge(branchRev, null);

        String json = mk.getNodes("/a", null, 0, 0, -1, null);
        JSONParser parser = new JSONParser();
        JSONObject obj = (JSONObject) parser.parse(json);
        assertTrue(obj.containsKey("foo"));
    }

    @Test
    public void branchIsolation1() throws Exception {
        String filter = "{\"properties\":[\"*\",\":hash\",\":id\"]}";
 
View Full Code Here

   
    for (String updateKey : updateKeys) {
      JSONObject counters = (JSONObject) result.get("counters");

      updateKey = updateKey.substring(updateKey.indexOf("_") + 1, updateKey.length());
      if (!counters.containsKey(updateKey)) {
        counters.put(updateKey, new JSONObject());
      }
     
      for (Object[] update : updates) {
        Long _slot = (Long) update[0];
View Full Code Here

        String branchRev2 = mk.branch(rev2);
        String json = mk.getNodes("/child1", branchRev2, 0, 0, -1, null);
        JSONParser parser = new JSONParser();
        JSONObject obj = (JSONObject) parser.parse(json);
        assertFalse(obj.containsKey("foo"));
    }

    @Test
    public void movesInBranch() throws Exception {
        String branchRev = mk.branch(null);
View Full Code Here

        mk.merge(branchRev, null);

        String json = mk.getNodes("/a", null, 0, 0, -1, null);
        JSONParser parser = new JSONParser();
        JSONObject obj = (JSONObject) parser.parse(json);
        assertTrue(obj.containsKey("foo"));
    }
}
View Full Code Here

    if (events == null || events.size() == 0) {
      SummaryEmail summaryEmail = new SummaryEmail();

      List<Chapter> chapters = chapterManager.getActiveChapters();
      for (Chapter chapter : chapters) {
        if (eventsGrouped.containsKey(chapter.getId().toString())) {
          chapter.setNumEvents(((Long) eventsGrouped.get(chapter.getId().toString())).intValue());
        } else {
          chapter.setNumEvents(0);
        }
View Full Code Here

      statsDao.updateField(JdoStatsDao.Field.CHAPTERS_SORTED_BY_NUM_EVENTS,
          chapters);
    } else {
      for (Event event : events) {
        long eventCount = 0;
        if (eventsGrouped.containsKey(event.getChapterId().toString())) {
          eventCount = (Long) eventsGrouped.get(event.getChapterId().toString());
        }
        eventsGrouped.put(""+event.getChapterId(), ++eventCount);
      }
View Full Code Here

    if (events == null || events.size() == 0) {
      Map<String, Long> countryCounts = new HashMap<String, Long>();

      List<Chapter> chapters = chapterManager.getActiveChapters();
      for (Chapter chapter : chapters) {
        if (eventsGrouped.containsKey(chapter.getId().toString())) {
          long count = 0;
          if (countryCounts.containsKey(chapter.getCountry())) {
            count = countryCounts.get(chapter.getCountry());
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.