break; // nothing more to read
String jsonString = new String(jsonBytes);
String [] jsonStrings = jsonString.split("\n");
assertEquals(jsonStrings.length, numEventsRead);
ObjectMapper mapper = new ObjectMapper();
for(int i=0; i<jsonStrings.length; i++) {
// verify what was written
String evtStr = jsonStrings[i];
if (evtStr.equals(prevEvent)) {
// It may so happen that we receive the same event twice, especially when the
// offered buffer is small. This check gets around the issue.
continue;
}
prevEvent = evtStr;
Map<String, Object> jsonMap = mapper.readValue(evtStr,
new TypeReference<Map<String, Object>>(){});
//assertEquals(jsonMap.size(), 10);
Integer srcId = (Integer)jsonMap.get("srcId");
if(!DbusEventUtils.isControlSrcId(srcId)) { // not a control message
numNonControlEventsRead++;