### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.performance Index: src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java,v retrieving revision 1.33 diff -u -r1.33 FullSourceWorkspaceSearchTests.java --- src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java 24 Apr 2007 11:00:43 -0000 1.33 +++ src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceSearchTests.java 10 May 2007 17:48:12 -0000 @@ -12,6 +12,8 @@ import java.io.PrintStream; import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.List; import junit.framework.Test; @@ -19,6 +21,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.search.*; import org.eclipse.jdt.core.tests.model.AbstractJavaModelTests; import org.eclipse.jdt.internal.core.search.processing.IJob; @@ -161,7 +164,7 @@ } } - protected void search(String patternString, int searchFor, int limitTo, IJavaSearchScope scope, JavaSearchResultCollector resultCollector) throws CoreException { + protected void search(String patternString, int searchFor, int limitTo, IJavaSearchScope scope, SearchRequestor resultCollector) throws CoreException { int matchMode = patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1 ? SearchPattern.R_PATTERN_MATCH : SearchPattern.R_EXACT_MATCH; @@ -660,4 +663,97 @@ commitMeasurements(); assertPerformance(); } + + /** + * Performance tests for search: Package Declarations on workspace scope. + */ + public void testSearchPackageDeclarationsWorkspace() throws CoreException { + tagAsSummary("Search workspace package declarations", false); // do NOT put in fingerprint + + // Wait for indexing end + AbstractJavaModelTests.waitUntilIndexesReady(); + + // Warm up + IJavaSearchScope scope = SearchEngine.createWorkspaceScope(); + String name = "*"; + JavaSearchResultCollector resultCollector = new JavaSearchResultCollector(); + if (true) { + for (int i=0 ; i