From 0bc4762118f3af9ea3adb76f00a1ada4457d2b54 Mon Sep 17 00:00:00 2001 From: Dani Megert Date: Wed, 1 Oct 2008 10:46:28 +0000 Subject: Added debug info to track down bug 249273: Test failures in I20080930-0921 --- .../search/tests/filesearch/AnnotationManagerTest.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java index 37fccca737b..25579e59610 100644 --- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java +++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java @@ -91,23 +91,30 @@ public class AnnotationManagerTest extends TestCase { AbstractTextSearchResult result= (AbstractTextSearchResult) fQuery1.getSearchResult(); Object[] files= result.getElements(); try { + System.out.println("AnnotationManagerTest.testAddAnnotation> file count: = " + files.length); for (int i= 0; i < files.length; i++) { - IFile file= (IFile) files[0]; + IFile file= (IFile)files[i]; + System.out.println("AnnotationManagerTest.testAddAnnotation> file: = " + file.getFullPath()); ITextEditor editor= (ITextEditor)IDE.openEditor(SearchPlugin.getActivePage(), file, true); IAnnotationModel annotationModel= editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput()); annotationModel.getAnnotationIterator(); HashSet positions= new HashSet(); for (Iterator iter= annotationModel.getAnnotationIterator(); iter.hasNext();) { Annotation annotation= (Annotation) iter.next(); + System.out.println(" annotation: = " + annotation.getType()); if (annotation.getType().equals(fAnnotationTypeLookup.getAnnotationType(NewSearchUI.SEARCH_MARKER, IMarker.SEVERITY_INFO))) { - positions.add(annotationModel.getPosition(annotation)); + Position position= annotationModel.getPosition(annotation); + positions.add(position); + System.out.println(" found: " + position); } } Match[] matches= result.getMatches(file); + System.out.println(" match count:" + matches.length); for (int j= 0; j < matches.length; j++) { Position position= new Position(matches[j].getOffset(), matches[j].getLength()); - assertTrue("position not found at: "+j, positions.remove(position)); //$NON-NLS-1$ + System.out.println(" position[" + j + "] = " + position); + assertTrue("position not found at: " + j, positions.remove(position)); //$NON-NLS-1$ } assertEquals(0, positions.size()); -- cgit v1.2.3