Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java')
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java28
1 files changed, 13 insertions, 15 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 10e85ffca82..24eef965fad 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,10 +13,6 @@ package org.eclipse.search.tests.filesearch;
import java.util.HashSet;
import java.util.Iterator;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
@@ -25,8 +21,6 @@ import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.ide.IDE;
-
import org.eclipse.ui.texteditor.AnnotationTypeLookup;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -45,6 +39,10 @@ import org.eclipse.search.ui.text.Match;
import org.eclipse.search2.internal.ui.InternalSearchUI;
import org.eclipse.search2.internal.ui.text.EditorAnnotationManager;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
public class AnnotationManagerTest extends TestCase {
private FileSearchQuery fQuery1;
private FileSearchQuery fQuery2;
@@ -94,7 +92,7 @@ public class AnnotationManagerTest extends TestCase {
try {
for (int i= 0; i < files.length; i++) {
IFile file= (IFile)files[i];
- ITextEditor editor= (ITextEditor)IDE.openEditor(SearchPlugin.getActivePage(), file, true);
+ ITextEditor editor= (ITextEditor)SearchTestPlugin.openTextEditor(SearchPlugin.getActivePage(), file);
IAnnotationModel annotationModel= editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
annotationModel.getAnnotationIterator();
HashSet positions= new HashSet();
@@ -122,7 +120,7 @@ public class AnnotationManagerTest extends TestCase {
NewSearchUI.runQueryInForeground(null, fQuery1);
FileSearchResult result= (FileSearchResult) fQuery1.getSearchResult();
IFile file= (IFile) result.getElements()[0];
- IDE.openEditor(SearchTestPlugin.getDefault().getWorkbench().getWorkbenchWindows()[0].getPages()[0], file, true);
+ SearchTestPlugin.openTextEditor(SearchTestPlugin.getDefault().getWorkbench().getWorkbenchWindows()[0].getPages()[0], file);
result.addMatch(new FileMatch(file));
}
@@ -134,8 +132,8 @@ public class AnnotationManagerTest extends TestCase {
try {
for (int i= 0; i < files.length; i++) {
- IFile file= (IFile) files[0];
- ITextEditor editor= (ITextEditor) IDE.openEditor(SearchPlugin.getActivePage(), file, true);
+ IFile file= (IFile)files[i];
+ ITextEditor editor= (ITextEditor)SearchTestPlugin.openTextEditor(SearchPlugin.getActivePage(), file);
IAnnotationModel annotationModel= editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
int annotationCount= 0;
for (Iterator annotations= annotationModel.getAnnotationIterator(); annotations.hasNext();) {
@@ -159,8 +157,8 @@ public class AnnotationManagerTest extends TestCase {
NewSearchUI.runQueryInForeground(null, fQuery2);
try {
for (int i= 0; i < files.length; i++) {
- IFile file= (IFile) files[0];
- ITextEditor editor= (ITextEditor) IDE.openEditor(SearchPlugin.getActivePage(), file, true);
+ IFile file= (IFile)files[i];
+ ITextEditor editor= (ITextEditor)SearchTestPlugin.openTextEditor(SearchPlugin.getActivePage(), file);
IAnnotationModel annotationModel= editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
int annotationCount= 0;
IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput());
@@ -187,8 +185,8 @@ public class AnnotationManagerTest extends TestCase {
SearchTestPlugin.getDefault().getSearchView().showSearchResult(result);
try {
for (int i= 0; i < files.length; i++) {
- IFile file= (IFile) files[0];
- ITextEditor editor= (ITextEditor) IDE.openEditor(SearchPlugin.getActivePage(), file, true);
+ IFile file= (IFile)files[i];
+ ITextEditor editor= (ITextEditor)SearchTestPlugin.openTextEditor(SearchPlugin.getActivePage(), file);
IAnnotationModel annotationModel= editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
int annotationCount= 0;
IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput());

Back to the top