Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-11-29 16:11:24 -0500
committerMarkus Keller2015-11-30 20:50:38 -0500
commit64b34b614087b96e6cc92c72143768b98ae32602 (patch)
tree4f4f493fd8161f9a5885f11021cd14a923946e9f /org.eclipse.search.tests
parentf01dd079500e382823d5d1767996cb9ef85233ee (diff)
downloadeclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.tar.gz
eclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.tar.xz
eclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.zip
Bug 478673: added @Override/@Deprecated and removed non-Javadoc boilerplate
Diffstat (limited to 'org.eclipse.search.tests')
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/LineConversionTest.java2
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/LongQuery.java2
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullQuery.java8
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullSearchResult.java24
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/QueryManagerTest.java10
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/TestSearchResult.java2
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/ResourceHelper.java1
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java2
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java2
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java6
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/JUnitSourceSetup.java2
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineAnnotationManagerTest.java2
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineBasedFileSearch.java10
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java1
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/ResultUpdaterTest.java5
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SearchResultPageTest.java1
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SortingTest.java1
17 files changed, 45 insertions, 36 deletions
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LineConversionTest.java b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LineConversionTest.java
index 7066d89bb..21ebb12cf 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LineConversionTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LineConversionTest.java
@@ -41,6 +41,7 @@ public class LineConversionTest extends TestCase {
private static final String LINE_ONE= "This is the first line\n";
private static final String LINE_THREE= "This is the third line";
+ @Override
protected void setUp() throws Exception {
IProject project= ResourcesPlugin.getWorkspace().getRoot().getProject("Test");
project.create(null);
@@ -50,6 +51,7 @@ public class LineConversionTest extends TestCase {
super.setUp();
}
+ @Override
protected void tearDown() throws Exception {
SearchPlugin.getActivePage().closeAllEditors(false);
fFile.getProject().delete(true, true, null);
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LongQuery.java b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LongQuery.java
index 8f7697a3e..c772f96e4 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LongQuery.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/LongQuery.java
@@ -20,10 +20,12 @@ public class LongQuery extends NullQuery {
private boolean fIsRunning= false;
+ @Override
public boolean canRunInBackground() {
return true;
}
+ @Override
public IStatus run(IProgressMonitor monitor) {
fIsRunning= true;
while (!monitor.isCanceled()) {
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullQuery.java b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullQuery.java
index 7cc6ee360..d923c9a5d 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullQuery.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullQuery.java
@@ -18,24 +18,26 @@ import org.eclipse.search.ui.ISearchResult;
public class NullQuery implements ISearchQuery {
+ @Override
public IStatus run(IProgressMonitor monitor) {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.ISearchQuery#getName()
- */
+ @Override
public String getLabel() {
return "Null Query"; //$NON-NLS-1$
}
+ @Override
public boolean canRerun() {
return true;
}
+ @Override
public boolean canRunInBackground() {
return true;
}
+ @Override
public ISearchResult getSearchResult() {
return new NullSearchResult(this);
}
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullSearchResult.java b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullSearchResult.java
index 666a25819..00793f460 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullSearchResult.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullSearchResult.java
@@ -25,39 +25,27 @@ public class NullSearchResult extends FileSearchResult { // inherit from FileSea
super(null);
fNullQuery= query;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.ISearchResult#getText(org.eclipse.search.ui.ISearchResult)
- */
+ @Override
public String getLabel() {
return "Null Query"; //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.ISearchResult#getTooltip(org.eclipse.search.ui.ISearchResult)
- */
+ @Override
public String getTooltip() {
return "Null Query"; //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.ISearchResult#getImageDescriptor(org.eclipse.search.ui.ISearchResult)
- */
+ @Override
public ImageDescriptor getImageDescriptor() {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.ISearchResult#getQuery()
- */
+ @Override
public ISearchQuery getQuery() {
return fNullQuery;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getEditorMatchAdapter()
- */
+ @Override
public IEditorMatchAdapter getEditorMatchAdapter() {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getFileMatchAdapter()
- */
+ @Override
public IFileMatchAdapter getFileMatchAdapter() {
return null;
}
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/QueryManagerTest.java b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/QueryManagerTest.java
index da1a406fe..b846ab5a0 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/QueryManagerTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/QueryManagerTest.java
@@ -45,21 +45,19 @@ public class QueryManagerTest extends TestCase {
final boolean [] wasAdded= { false };
final boolean [] wasRemoved= { false };
IQueryListener l= new IQueryListener() {
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.IQueryListener#queryAdded(org.eclipse.search.ui.ISearchQuery)
- */
+ @Override
public void queryAdded(ISearchQuery query) {
wasAdded[0]= true;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.ui.IQueryListener#queryRemoved(org.eclipse.search.ui.ISearchQuery)
- */
+ @Override
public void queryRemoved(ISearchQuery query) {
wasRemoved[0]= true;
}
+ @Override
public void queryStarting(ISearchQuery query) {
// not interested
}
+ @Override
public void queryFinished(ISearchQuery query) {
// not interested
}
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/TestSearchResult.java b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/TestSearchResult.java
index fe093699b..dcf767326 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/core/tests/TestSearchResult.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/core/tests/TestSearchResult.java
@@ -166,6 +166,7 @@ public class TestSearchResult extends TestCase {
AbstractTextSearchResult result= (AbstractTextSearchResult) query.getSearchResult();
result.addListener(new ISearchResultListener() {
+ @Override
public void searchResultChanged(SearchResultEvent e) {
if (e instanceof MatchEvent) {
MatchEvent evt= (MatchEvent) e;
@@ -208,6 +209,7 @@ public class TestSearchResult extends TestCase {
AbstractTextSearchResult result= (AbstractTextSearchResult) query.getSearchResult();
result.addListener(new ISearchResultListener() {
+ @Override
public void searchResultChanged(SearchResultEvent e) {
if (e instanceof MatchEvent) {
MatchEvent evt= (MatchEvent) e;
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/ResourceHelper.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/ResourceHelper.java
index ba81e9bec..fe28661cc 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/ResourceHelper.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/ResourceHelper.java
@@ -68,6 +68,7 @@ public class ResourceHelper {
public static void delete(final IResource resource) throws CoreException {
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
for (int i= 0; i < MAX_RETRY; i++) {
try {
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 24eef965f..e7e8856a3 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
@@ -65,6 +65,7 @@ public class AnnotationManagerTest extends TestCase {
return new JUnitSourceSetup(test);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
SearchTestPlugin.ensureWelcomePageClosed();
@@ -75,6 +76,7 @@ public class AnnotationManagerTest extends TestCase {
fQuery2= new FileSearchQuery("Test", false, true, scope); //$NON-NLS-1$//$NON-NLS-2$
}
+ @Override
protected void tearDown() throws Exception {
InternalSearchUI.getInstance().removeAllQueries();
fQuery1= null;
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java
index 388756dfc..0a20f6679 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java
@@ -47,10 +47,12 @@ public class FileCharSequenceTests extends TestCase {
return allTests();
}
+ @Override
protected void setUp() throws Exception {
fProject= ResourceHelper.createProject("my-project"); //$NON-NLS-1$
}
+ @Override
protected void tearDown() throws Exception {
ResourceHelper.deleteProject("my-project"); //$NON-NLS-1$
}
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java
index 5f25845f5..097516ace 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java
@@ -77,10 +77,12 @@ public class FileSearchTests extends TestCase {
private static class SerialTestResultCollector extends TestResultCollector {
+ @Override
public boolean canRunInParallel() {
return false;
}
+ @Override
public boolean acceptPatternMatch(TextSearchMatchAccess match) throws CoreException {
fResult.add(new TestResult(match.getFile(), match.getMatchOffset(), match.getMatchLength()));
return true;
@@ -90,10 +92,12 @@ public class FileSearchTests extends TestCase {
private static class ParallelTestResultCollector extends TestResultCollector {
+ @Override
public boolean canRunInParallel() {
return true;
}
+ @Override
public boolean acceptPatternMatch(TextSearchMatchAccess match) throws CoreException {
synchronized(fResult) {
fResult.add(new TestResult(match.getFile(), match.getMatchOffset(), match.getMatchLength()));
@@ -121,10 +125,12 @@ public class FileSearchTests extends TestCase {
return allTests();
}
+ @Override
protected void setUp() throws Exception {
fProject= ResourceHelper.createProject("my-project"); //$NON-NLS-1$
}
+ @Override
protected void tearDown() throws Exception {
ResourceHelper.deleteProject("my-project"); //$NON-NLS-1$
}
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/JUnitSourceSetup.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/JUnitSourceSetup.java
index 8b81c0fc6..8c3066cb4 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/JUnitSourceSetup.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/JUnitSourceSetup.java
@@ -38,6 +38,7 @@ public class JUnitSourceSetup extends TestSetup {
fProjectName= projectName;
}
+ @Override
protected void setUp() throws Exception {
IProject project= ResourcesPlugin.getWorkspace().getRoot().getProject(fProjectName);
if (!project.exists()) { // allow nesting of JUnitSetups
@@ -45,6 +46,7 @@ public class JUnitSourceSetup extends TestSetup {
}
}
+ @Override
protected void tearDown() throws Exception {
if (fProject != null) { // delete only by the setup who created the project
ResourceHelper.deleteProject(fProjectName);
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineAnnotationManagerTest.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineAnnotationManagerTest.java
index 2cbc53ff6..efc1708de 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineAnnotationManagerTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineAnnotationManagerTest.java
@@ -63,6 +63,7 @@ public class LineAnnotationManagerTest extends TestCase {
return new JUnitSourceSetup(test);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
EditorAnnotationManager.debugSetHighlighterType(EditorAnnotationManager.HIGHLIGHTER_ANNOTATION);
@@ -73,6 +74,7 @@ public class LineAnnotationManagerTest extends TestCase {
fLineQuery= new LineBasedFileSearch(scope, false, true, "Test");
}
+ @Override
protected void tearDown() throws Exception {
InternalSearchUI.getInstance().removeAllQueries();
fLineQuery= null;
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineBasedFileSearch.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineBasedFileSearch.java
index 251c7f11b..a8d969940 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineBasedFileSearch.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineBasedFileSearch.java
@@ -54,13 +54,12 @@ public class LineBasedFileSearch extends FileSearchQuery {
fLastDocument= null;
}
+ @Override
public boolean canRunInParallel() {
return true;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.core.text.FileSearchRequestor#acceptPatternMatch(org.eclipse.search.core.text.FileSearchMatchRequestor)
- */
+ @Override
public boolean acceptPatternMatch(TextSearchMatchAccess matchRequestor) throws CoreException {
IFile file= matchRequestor.getFile();
try {
@@ -94,9 +93,7 @@ public class LineBasedFileSearch extends FileSearchQuery {
return fLastDocument;
}
- /* (non-Javadoc)
- * @see org.eclipse.search.core.text.FileSearchRequestor#endReporting()
- */
+ @Override
public void endReporting() {
if (fLastFile != null) {
try {
@@ -116,6 +113,7 @@ public class LineBasedFileSearch extends FileSearchQuery {
}
+ @Override
public IStatus run(IProgressMonitor monitor) {
AbstractTextSearchResult textResult= (AbstractTextSearchResult) getSearchResult();
textResult.removeAll();
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java
index 274f57f81..7846c1c94 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java
@@ -56,6 +56,7 @@ public class PositionTrackerTest extends TestCase {
return new JUnitSourceSetup(test);
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/ResultUpdaterTest.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/ResultUpdaterTest.java
index 98abb34d9..f2520164d 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/ResultUpdaterTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/ResultUpdaterTest.java
@@ -49,6 +49,7 @@ public class ResultUpdaterTest extends TestCase {
return allTests();
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
// create a own project to make modifications
@@ -60,9 +61,7 @@ public class ResultUpdaterTest extends TestCase {
fQuery1= new FileSearchQuery("Test", false, true, scope);
}
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
+ @Override
protected void tearDown() throws Exception {
ResourceHelper.deleteProject(PROJECT_TO_MODIFY);
}
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SearchResultPageTest.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SearchResultPageTest.java
index 274ad176c..c023d1c14 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SearchResultPageTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SearchResultPageTest.java
@@ -57,6 +57,7 @@ public class SearchResultPageTest extends TestCase {
return allTests();
}
+ @Override
protected void setUp() throws Exception {
super.setUp();
SearchTestPlugin.ensureWelcomePageClosed();
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SortingTest.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SortingTest.java
index 1753cf200..7595720a6 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SortingTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SortingTest.java
@@ -43,6 +43,7 @@ public class SortingTest extends TestCase {
return allTests();
}
+ @Override
protected void setUp() throws Exception {
super.setUp();

Back to the top