@@ -213,6 +213,31 @@ public void testMixedCases() throws Exception {
213213 new String [] { "somewhere1.somewhere2.Some1Class105" , "line: 5" }, matchTexts );
214214 }
215215
216+ public void testStackTraceDetectionWithColors () throws Exception {
217+ String exception = ""
218+ + "Caused by\033 [m: java.lang.NullPointerException: \033 [1;31mCannot invoke \" org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus.addListener(org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener)\" because \" this.eventBus\" is null\033 [m\n "
219+ + " \033 [1mat\033 [m org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.<init> (\033 [1mAbstractRepositoryManager.java:107\033 [m)\n "
220+ + " \033 [1mat\033 [m org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRepositoryManager.<init> (\033 [1mArtifactRepositoryManager.java:41\033 [m)\n "
221+ // ...
222+ + " \033 [1mat\033 [m java.lang.reflect.Method.invoke (\033 [1mMethod.java:568\033 [m)\n "
223+ + " \033 [1mat\033 [m org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (\033 [1mLauncher.java:282\033 [m)\n "
224+ + " \033 [1mat\033 [m org.codehaus.plexus.classworlds.launcher.Launcher.launch (\033 [1mLauncher.java:225\033 [m)\n "
225+ + " \033 [1mat\033 [m org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (\033 [1mLauncher.java:406\033 [m)\n "
226+ + " \033 [1mat\033 [m org.codehaus.plexus.classworlds.launcher.Launcher.main (\033 [1mLauncher.java:347\033 [m)\n " ;
227+ consoleDocumentWithText (exception );
228+
229+ Position [] positions = allLinkPositions ();
230+ int [] offsets = new int [positions .length ];
231+ for (int i = 0 ; i < offsets .length ; i ++) {
232+ offsets [i ] = positions [i ].getOffset ();
233+ }
234+
235+ String [] matchTexts = linkTextsAtPositions (offsets );
236+ String [] expected = { "java.lang.NullPointerException" , "AbstractRepositoryManager.java:107" , "ArtifactRepositoryManager.java:41" ,
237+ "Method.java:568" , "Launcher.java:282" , "Launcher.java:225" , "Launcher.java:406" , "Launcher.java:347" };
238+ assertArrayEquals ("Wrong hyperlinks, listing all links: " + allLinks (), expected , matchTexts );
239+ }
240+
216241 private static String getSelectedText (IEditorPart editor ) {
217242 ITextEditor textEditor = (ITextEditor ) editor ;
218243 ISelectionProvider selectionProvider = textEditor .getSelectionProvider ();
0 commit comments