@Test public void testProcess() { UnixProcessIOtParser parser = new UnixProcessIOtParser(); parser.process("rchar: 1661777"); assertFalse(parser.done()); parser.process("wchar: 7431"); assertFalse(parser.done()); parser.process("syscr: 1240"); assertFalse(parser.done()); parser.process("syscw: 123"); assertFalse(parser.done()); parser.process("read_bytes: 7335936"); assertFalse(parser.done()); parser.process("write_bytes: 12288"); assertTrue(parser.done()); assertEquals(7335936 + 12288, parser.getValue(), 0.0); parser.process("cancelled_write_bytes: 0"); assertTrue(parser.done()); assertEquals(7335936 + 12288, parser.getValue(), 0.0); parser.process("write_bytes: 12288"); assertTrue(parser.done()); assertEquals(7335936 + 12288, parser.getValue(), 0.0); }
void process(String line) { if (!readBytesDone && parseValue(line, READ_BYTES_PART)) { readBytesDone = true; return; } if (!writeBytesDone && parseValue(line, WRITE_BYTES_PART)) { writeBytesDone = true; } }
UnixProcessIOtParser { void process(String line) { if (!readBytesDone && parseValue(line, READ_BYTES_PART)) { readBytesDone = true; return; } if (!writeBytesDone && parseValue(line, WRITE_BYTES_PART)) { writeBytesDone = true; } } }
UnixProcessIOtParser { void process(String line) { if (!readBytesDone && parseValue(line, READ_BYTES_PART)) { readBytesDone = true; return; } if (!writeBytesDone && parseValue(line, WRITE_BYTES_PART)) { writeBytesDone = true; } }  }
UnixProcessIOtParser { void process(String line) { if (!readBytesDone && parseValue(line, READ_BYTES_PART)) { readBytesDone = true; return; } if (!writeBytesDone && parseValue(line, WRITE_BYTES_PART)) { writeBytesDone = true; } }   }
UnixProcessIOtParser { void process(String line) { if (!readBytesDone && parseValue(line, READ_BYTES_PART)) { readBytesDone = true; return; } if (!writeBytesDone && parseValue(line, WRITE_BYTES_PART)) { writeBytesDone = true; } }    }