use of org.eclipse.tracecompass.segmentstore.core.ISegment in project tracecompass by tracecompass.
the class AbstractStatsAnalysisTest method testPerTypeStats.
/**
* Test per-type statistics
*
* @throws TmfAnalysisException
* should not happen
*/
@Test
public void testPerTypeStats() throws TmfAnalysisException {
TmfXmlTraceStub trace = new TmfXmlTraceStubNs();
StubSegmentStatisticsAnalysis fixture = getValidSegmentStats(trace);
Map<@NonNull String, IStatistics<@NonNull ISegment>> perTypeStats = fixture.getStatsPerType();
assertNotNull(perTypeStats);
// no need to test the content much as it is tested in the other test.
assertEquals(2, perTypeStats.size());
assertEquals(ImmutableSet.<String>of("odd", "even"), perTypeStats.keySet());
IStatistics<@NonNull ISegment> segmentStoreStatistics = perTypeStats.get("even");
assertNotNull(segmentStoreStatistics);
// starts with 0 so size + 1
assertEquals(StubSegmentStatisticsAnalysis.SIZE / 2 + 1, segmentStoreStatistics.getNbElements());
trace.dispose();
fixture.dispose();
}
Aggregations