@@ -77,7 +77,7 @@ public class FlameChartDataProviderTest extends CallStackTestBase2 {
7777 private static final String CALLSTACKIEVENTS_FILE = "testfiles/traces/callstackIevents.xml" ;
7878
7979 public FlameChartDataProviderTest () {
80- super ( CALLSTACKIEVENTS_FILE );
80+ super (CALLSTACKIEVENTS_FILE );
8181 }
8282
8383 private FlameChartDataProvider getDataProvider () {
@@ -485,6 +485,7 @@ public void testFetchAnnotations() {
485485 assertNotNull (model );
486486 assertTrue (model .getAnnotations ().containsKey (InstrumentedCallStackAnalysis .ANNOTATIONS ));
487487 }
488+
488489 /**
489490 * Test fetchAnnotations with null filter returns completed with null model
490491 */
@@ -507,25 +508,23 @@ public void testFetchAnnotationsOutputElementStyle() {
507508 FlameChartDataProvider dataProvider = getDataProvider ();
508509
509510 // Get tree to find entry IDs
510- TmfModelResponse <@ NonNull TmfTreeModel <@ NonNull FlameChartEntryModel >> treeResponse =
511- dataProvider .fetchTree (FetchParametersUtils .timeQueryToMap (new TimeQueryFilter (0 , Long .MAX_VALUE , 2 )), null );
511+ TmfModelResponse <@ NonNull TmfTreeModel <@ NonNull FlameChartEntryModel >> treeResponse = dataProvider .fetchTree (FetchParametersUtils .timeQueryToMap (new TimeQueryFilter (0 , Long .MAX_VALUE , 2 )), null );
512512 TmfTreeModel <@ NonNull FlameChartEntryModel > model = treeResponse .getModel ();
513513
514514 if (model != null ) {
515515 List <FlameChartEntryModel > entries = model .getEntries ();
516516
517517 // Find a function entry that should have annotations
518518 FlameChartEntryModel functionEntry = entries .stream ()
519- .filter (e -> e .getEntryType () == EntryType .FUNCTION )
520- .findFirst ()
521- .orElse (null );
519+ .filter (e -> e .getEntryType () == EntryType .FUNCTION )
520+ .findFirst ()
521+ .orElse (null );
522522 assertNotNull (functionEntry );
523523
524- // 15 and 18 are timestamps with instant events
524+ // Test both instant and nestable events ( timestamps 15, 16, 20)
525525 Map <String , Object > fetchParams = FetchParametersUtils .selectionTimeQueryToMap (
526- new SelectionTimeQueryFilter (15 , 18 , 2 , Collections .singleton (functionEntry .getId ())));
526+ new SelectionTimeQueryFilter (15 , 20 , 3 , Collections .singleton (functionEntry .getId ())));
527527
528- // Fetch annotations
529528 TmfModelResponse <AnnotationModel > response = dataProvider .fetchAnnotations (fetchParams , MONITOR );
530529
531530 assertEquals (ITmfResponse .Status .COMPLETED , response .getStatus ());
@@ -535,15 +534,18 @@ public void testFetchAnnotationsOutputElementStyle() {
535534 assertNotNull (annotations );
536535 assertFalse (annotations .isEmpty ());
537536
538- // Verify OutputElementStyle properties
539- Annotation annotation = annotations .iterator ().next ();
540- OutputElementStyle style = annotation .getStyle ();
541- assertNotNull (style );
537+ // Verify OutputElementStyle properties for all annotations (instant
538+ // and nestable)
539+ for (Annotation annotation : annotations ) {
540+ OutputElementStyle style = annotation .getStyle ();
541+ assertNotNull (style );
542+
543+ Map <String , Object > styleMap = style .getStyleValues ();
544+ assertEquals ("#7D3D31" , styleMap .get (StyleProperties .COLOR ));
545+ assertEquals (0.33f , styleMap .get (StyleProperties .HEIGHT ));
546+ assertEquals (SymbolType .DIAMOND , styleMap .get (StyleProperties .SYMBOL_TYPE ));
547+ }
542548
543- Map <String , Object > styleMap = style .getStyleValues ();
544- assertEquals ("#7D3D31" , styleMap .get (StyleProperties .COLOR ));
545- assertEquals (0.33f , styleMap .get (StyleProperties .HEIGHT ));
546- assertEquals (SymbolType .DIAMOND , styleMap .get (StyleProperties .SYMBOL_TYPE ));
547549 }
548550
549551 }
@@ -556,7 +558,7 @@ public void testAnnotationModelStructure() {
556558 FlameChartDataProvider dataProvider = getDataProvider ();
557559
558560 Map <String , Object > parameters = FetchParametersUtils .selectionTimeQueryToMap (
559- new SelectionTimeQueryFilter (0 , Long .MAX_VALUE , 2 ,Collections .emptySet ()));
561+ new SelectionTimeQueryFilter (0 , Long .MAX_VALUE , 2 , Collections .emptySet ()));
560562 TmfModelResponse <AnnotationModel > response = dataProvider .fetchAnnotations (parameters , MONITOR );
561563 assertEquals (ITmfResponse .Status .COMPLETED , response .getStatus ());
562564
@@ -568,27 +570,25 @@ public void testAnnotationModelStructure() {
568570 assertNotNull (model .getAnnotations ().get (InstrumentedCallStackAnalysis .ANNOTATIONS ));
569571 }
570572
571- /**
572- * Test annotation model structure and properties
573- */
574- @ SuppressWarnings ("null" )
575- @ Test
573+ /**
574+ * Test annotation model structure and properties
575+ */
576+ @ SuppressWarnings ("null" )
577+ @ Test
576578 public void testFetchValidAnnotations () {
577579 FlameChartDataProvider dataProvider = getDataProvider ();
578- TmfModelResponse <@ NonNull TmfTreeModel <@ NonNull FlameChartEntryModel >> treeResponse =
579- dataProvider .fetchTree (FetchParametersUtils .timeQueryToMap (new TimeQueryFilter (1 , Long .MAX_VALUE , 2 )), MONITOR );
580- assertEquals (ITmfResponse .Status .COMPLETED , treeResponse .getStatus ());
581-
582- TmfTreeModel <@ NonNull FlameChartEntryModel > m = treeResponse .getModel ();
583- // Get entry IDs from the same tree response
584- if (m != null ) {
585- Set <Long > allEntryIds = m .getEntries ().stream ()
586- .map (FlameChartEntryModel ::getId )
587- .collect (Collectors .toSet ());
580+ TmfModelResponse <@ NonNull TmfTreeModel <@ NonNull FlameChartEntryModel >> treeResponse = dataProvider .fetchTree (FetchParametersUtils .timeQueryToMap (new TimeQueryFilter (1 , Long .MAX_VALUE , 2 )), MONITOR );
581+ assertEquals (ITmfResponse .Status .COMPLETED , treeResponse .getStatus ());
588582
583+ TmfTreeModel <@ NonNull FlameChartEntryModel > m = treeResponse .getModel ();
584+ // Get entry IDs from the same tree response
585+ if (m != null ) {
586+ Set <Long > allEntryIds = m .getEntries ().stream ()
587+ .map (FlameChartEntryModel ::getId )
588+ .collect (Collectors .toSet ());
589589
590590 Map <String , Object > parameters = FetchParametersUtils .selectionTimeQueryToMap (
591- new SelectionTimeQueryFilter (1 , Long .MAX_VALUE , 2 , allEntryIds ));
591+ new SelectionTimeQueryFilter (1 , Long .MAX_VALUE , 2 , allEntryIds ));
592592
593593 TmfModelResponse <AnnotationModel > response = dataProvider .fetchAnnotations (parameters , MONITOR );
594594
@@ -599,8 +599,8 @@ public void testFetchValidAnnotations() {
599599 assertNotNull (model );
600600
601601 Map <String , Collection <Annotation >> annotations = model .getAnnotations ();
602- assertNotNull (annotations );
603- }
602+ assertNotNull (annotations );
603+ }
604604 }
605605
606606 private static void verifyArrows (List <ITimeGraphArrow > arrows , List <ITimeGraphArrow > expectedArrows ) {
0 commit comments