コード例 #1
0
 private void checkGah(JsonNode diff) {
   JsonNode name_wrapper = diff.get("name");
   ArrayNode name_timestamp = (ArrayNode) name_wrapper.get("shmem_timestamp");
   int[] temp = {2, 2, 0, 0};
   assertEquals(VectorTimestamp.CompareWithSerializedTS(temp, name_timestamp), Comparison.EQ);
   JsonNode second = name_wrapper.get("value");
   JsonNode second_wrapper = second.get("second");
   ArrayNode second_timestamp = (ArrayNode) second_wrapper.get("shmem_timestamp");
   assertEquals(VectorTimestamp.CompareWithSerializedTS(temp, second_timestamp), Comparison.EQ);
   JsonNode gah = second_wrapper.get("value");
   JsonNode gah_wrapper = gah.get("gah");
   ArrayNode gah_timestamp = (ArrayNode) gah_wrapper.get("shmem_timestamp");
   assertEquals(VectorTimestamp.CompareWithSerializedTS(temp, gah_timestamp), Comparison.EQ);
   String blah_string = gah_wrapper.get("value").getTextValue();
   assertEquals(blah_string.equals("blah"), true);
 }
コード例 #2
0
 private void checkWatson(JsonNode diff) {
   JsonNode name_wrapper = diff.get("name");
   JsonNode cs_wrapper = name_wrapper.get("value").get("CS");
   ArrayNode cs_timestamp = (ArrayNode) cs_wrapper.get("shmem_timestamp");
   int[] temp = {2, 0, 0, 0};
   assertEquals(VectorTimestamp.CompareWithSerializedTS(temp, cs_timestamp), Comparison.EQ);
   assertEquals(cs_wrapper.get("value").getTextValue().equals("Watson"), true);
 }
コード例 #3
0
 private void checkYale(JsonNode diff) {
   JsonNode name_wrapper = diff.get("name");
   JsonNode yale_wrapper = name_wrapper.get("value").get("Yale");
   ArrayNode yale_timestamp = (ArrayNode) yale_wrapper.get("shmem_timestamp");
   int[] temp = {1, 0, 0, 0};
   assertEquals(VectorTimestamp.CompareWithSerializedTS(temp, yale_timestamp), Comparison.EQ);
   String yale_value = yale_wrapper.get("value").getTextValue();
   assertEquals(yale_value.equals("University"), true);
 }