Bug 60415 Should remove Search extension page
I20040428 We should remove the search extension page and should make sure that participants can't damage a search. If a participant generates an exception the participant should be disabled for the rest of the Eclipse sessions. This is consistent with Platform/UI and refactoring.
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/SearchTest.java
TestSuite suite= new TestSuite("Java Search Tests"); 
		
		suite.addTest(WorkspaceReferenceTest.allTests());
		suite.addTest(TreeContentProviderTest.allTests());
		return suite;
	}
	static int countMethodRefs(String TypeName, String methodName, String[] parameterTypes) throws JavaModelException {
		JavaSearchQuery query= runMethodRefQuery(TypeName, methodName, parameterTypes);
		JavaSearchResult result= (JavaSearchResult) query.getSearchResult();
		return result.getMatchCount();
	}
	static JavaSearchQuery runMethodRefQuery(String TypeName, String methodName, String[] parameterTypes) throws JavaModelException {
		IMethod method= getMethod(TypeName, methodName, parameterTypes);
		NewSearchUI.activateSearchResultView();
		JavaSearchQuery query= new JavaSearchQuery(new ElementQuerySpecification(method, IJavaSearchConstants.REFERENCES, ReferenceScopeFactory.createWorkspaceScope(true), "workspace scope"));
		NewSearchUI.runQueryInForeground(null, query);
		return query;
	}
	static IMethod getMethod(String TypeName, String methodName, String[] parameterTypes) throws JavaModelException {
		IType type= getType(TypeName);
		IMethod method= type.getMethod(methodName, parameterTypes);
		return method;
	}
	static IType getType(String TypeName) throws JavaModelException {
		IJavaProject p= JUnitSourceSetup.getProject();
		IType type= p.findType(TypeName);
		return type;
	}
}