IJavaProject p= JUnitSourceSetup.getProject(); IType type= p.findType("junit.framework.TestCase"); IMethod method= type.getMethod("countTestCases", new String[0]); NewSearchUI.activateSearchResultView(); JavaSearchQuery query= new JavaSearchQuery(method, IJavaSearchConstants.REFERENCES, ReferenceScopeFactory.create(method), "workspace scope"); NewSearchUI.runQueryInForeground(null, query); JavaSearchResult result= (JavaSearchResult) query.getSearchResult(); assertEquals(6, result.getMatchCount());
assertEquals(6, SearchTest.countMethodRefs("junit.framework.TestCase", "countTestCases", new String[0]));
	public void testFindOverridden() throws Exception {		IJavaProject p= JUnitSourceSetup.getProject();		IType type= p.findType("junit.framework.TestCase");		IMethod method= type.getMethod("countTestCases", new String[0]);		NewSearchUI.activateSearchResultView();		JavaSearchQuery query= new JavaSearchQuery(method, IJavaSearchConstants.REFERENCES, ReferenceScopeFactory.create(method), "workspace scope");		NewSearchUI.runQueryInForeground(null, query);		JavaSearchResult result= (JavaSearchResult) query.getSearchResult();		assertEquals(6, result.getMatchCount());	}