@@ -488,6 +488,59 @@ public void testLinkNavigationTrueForLinksWithMultiSpaceBeforeSignature() throws
488488 project .getProject ().delete (force , new NullProgressMonitor ());
489489 }
490490 }
491+
492+ public void testLinkNavigationTrueForLinksWithTimeStamps1 () throws Exception {
493+ String projectName = "StackTest" ;
494+ IJavaProject project = createProject (projectName , "testfiles/AmbiguityTest/" , JavaProjectHelper .JAVA_SE_1_8_EE_NAME , false );
495+ waitForBuild ();
496+ waitForJobs ();
497+ consoleDocumentWithText ("250420 12:59:13.999 (SampleGenerics.java:25) Hello" );
498+ IHyperlink [] hyperlinks = fConsole .getHyperlinks ();
499+ assertEquals ("Wrong hyperlinks, listing all links: " + allLinks (), 1 , hyperlinks .length );
500+ String expectedText = "System.out.print(\" EXPECTED_GENERICS\" );" ;
501+ try {
502+ for (IHyperlink hyperlink : hyperlinks ) {
503+ closeAllEditors ();
504+ hyperlink .linkActivated ();
505+ IEditorPart editor = waitForEditorOpen ();
506+ String [] selectedText = new String [1 ];
507+ sync (() -> selectedText [0 ] = getSelectedText (editor ));
508+ selectedText [0 ] = selectedText [0 ].trim ();
509+ assertEquals ("Wrong text selected after hyperlink navigation" , expectedText , selectedText [0 ]);
510+
511+ }
512+ } finally {
513+ closeAllEditors ();
514+ boolean force = true ;
515+ project .getProject ().delete (force , new NullProgressMonitor ());
516+ }
517+ }
518+ public void testLinkNavigationTrueForLinksWithTimeStamps2 () throws Exception {
519+ String projectName = "StackTest" ;
520+ IJavaProject project = createProject (projectName , "testfiles/AmbiguityTest/" , JavaProjectHelper .JAVA_SE_1_8_EE_NAME , false );
521+ waitForBuild ();
522+ waitForJobs ();
523+ consoleDocumentWithText ("2025-04-20 12.01.23 (SampleGenerics.java:25) Hello" );
524+ IHyperlink [] hyperlinks = fConsole .getHyperlinks ();
525+ assertEquals ("Wrong hyperlinks, listing all links: " + allLinks (), 1 , hyperlinks .length );
526+ String expectedText = "System.out.print(\" EXPECTED_GENERICS\" );" ;
527+ try {
528+ for (IHyperlink hyperlink : hyperlinks ) {
529+ closeAllEditors ();
530+ hyperlink .linkActivated ();
531+ IEditorPart editor = waitForEditorOpen ();
532+ String [] selectedText = new String [1 ];
533+ sync (() -> selectedText [0 ] = getSelectedText (editor ));
534+ selectedText [0 ] = selectedText [0 ].trim ();
535+ assertEquals ("Wrong text selected after hyperlink navigation" , expectedText , selectedText [0 ]);
536+
537+ }
538+ } finally {
539+ closeAllEditors ();
540+ boolean force = true ;
541+ project .getProject ().delete (force , new NullProgressMonitor ());
542+ }
543+ }
491544 private void waitForJobs () throws Exception {
492545 TestUtil .waitForJobs (getName (), 250 , 10_000 );
493546 }
0 commit comments