@Test
public void testReadWriteTraceRecordWithMarker() throws Exception {
TraceRecord tr = tr("some.Class", "someMethod", "()V", 1, 0, TraceRecord.TRACE_BEGIN, 100);
TraceMarker tm = new TraceMarker(tr, sid("TRACE"), 100L);
tm.setFlags(TraceMarker.OVERFLOW_FLAG);
tr.setMarker(tm);
writer.write(tr);
FressianReader reader = reader();
Object obj = reader.readObject();
Set<Integer> ids = new HashSet<Integer>();
while (obj instanceof Symbol) {
Symbol s = (Symbol) obj;
assertThat(s.getId()).isEqualTo(sid(s.getName()));
obj = reader.readObject();
ids.add(s.getId());
}
TraceRecord tr2 = (TraceRecord) obj;
assertThat(tr2.getFlags()).isEqualTo(TraceRecord.TRACE_BEGIN);
TraceMarker tm2 = tr2.getMarker();
assertThat(tm2).isNotNull();
assertThat(tm2.getFlags()).isEqualTo(TraceMarker.OVERFLOW_FLAG);
assertThat(tm2.getClock()).isEqualTo(100L);
assertThat(tm2.getTraceId()).isEqualTo(sid("TRACE"));
assertThat(ids.size()).isEqualTo(symbols.size());
}