@Test
public void testSampleType() throws Exception {
ProfileCollector collector = getCollector(serverNode);
ProfileConsumer cons1 = collector.getConsumer("c1");
ProfileSample s1 =
cons1.createSample("samples1", ProfileDataType.TASK,
ProfileLevel.MAX);
assertTrue(s1 instanceof TaskProfileSample);
assertFalse(s1 instanceof AggregateProfileSample);
ProfileSample s2 =
cons1.createSample("samples2", ProfileDataType.AGGREGATE,
ProfileLevel.MAX);
assertFalse(s2 instanceof TaskProfileSample);
assertTrue(s2 instanceof AggregateProfileSample);
ProfileSample s3 =
cons1.createSample("samples3", ProfileDataType.TASK_AND_AGGREGATE,
ProfileLevel.MAX);
assertTrue(s3 instanceof TaskProfileSample);
assertTrue(s3 instanceof AggregateProfileSample);
}