Search in sources :

Example 1 with ImmutableSortedMap

use of com.google_voltpatches.common.collect.ImmutableSortedMap in project voltdb by VoltDB.

the class TestTheHashinator method checkConfigJSON.

private void checkConfigJSON(ImmutableSortedMap<Integer, Integer> tokens, String JSON) throws JSONException {
    final JSONObject jsonData = new JSONObject(JSON);
    assertEquals(tokens.size(), jsonData.length());
    for (Map.Entry<Integer, Integer> entry : tokens.entrySet()) {
        assertEquals(entry.getValue().intValue(), jsonData.getInt(entry.getKey().toString()));
    }
}
Also used : JSONObject(org.json_voltpatches.JSONObject) HashMap(java.util.HashMap) ImmutableSortedMap(com.google_voltpatches.common.collect.ImmutableSortedMap) Map(java.util.Map) TreeMap(java.util.TreeMap)

Aggregations

ImmutableSortedMap (com.google_voltpatches.common.collect.ImmutableSortedMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 JSONObject (org.json_voltpatches.JSONObject)1