use of org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope in project webtools.sourceediting by eclipse.
the class JSPSearchTests method testSearchField.
public void testSearchField() {
TestJspSearchRequestor requestor = new TestJspSearchRequestor();
requestor.addCheckMatch("searchTestJSP.jsp", 93, 106);
JSPSearchSupport.getInstance().search("searchForThis", new JSPSearchScope(), FIELD, ALL_OCCURRENCES, SearchPattern.R_EXACT_MATCH, true, requestor, new NullProgressMonitor());
assertTrue("did not find all expected matches: searchForThis", requestor.checkValid());
}
use of org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope in project webtools.sourceediting by eclipse.
the class JSPSearchTests method testSearchProjectClasses.
public void testSearchProjectClasses() {
TestJspSearchRequestor requestor = new TestJspSearchRequestor();
requestor.addCheckMatch("searchTestJSP3.jsp", 148, 157);
requestor.addCheckMatch("searchTestJSP3.jsp", 170, 179);
requestor.addCheckMatch("searchTestJSP3.jsp", 263, 273);
requestor.addCheckMatch("searchTestJSP3.jsp", 299, 309);
requestor.addCheckMatch("searchTestJSP3.jsp", 408, 417);
requestor.addCheckMatch("searchTestJSP3.jsp", 430, 439);
JSPSearchSupport.getInstance().search("Jellybean*", new JSPSearchScope(), TYPE, ALL_OCCURRENCES, SearchPattern.R_PATTERN_MATCH, true, requestor, new NullProgressMonitor());
assertTrue("did not find all expected matches: search*", requestor.checkValid());
}
use of org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope in project webtools.sourceediting by eclipse.
the class JSPSearchTests method testSearchLocalVariable.
public void testSearchLocalVariable() {
IDOMModel xmlModel = null;
try {
IPath jspTestFilePath = new Path("judo/SEARCH/searchTestJSP3.jsp");
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(jspTestFilePath);
xmlModel = (IDOMModel) getStructuredModelForRead(file);
ModelHandlerForJSP.ensureTranslationAdapterFactory(xmlModel);
IDOMDocument doc = xmlModel.getDocument();
JSPTranslationAdapter adapter = (JSPTranslationAdapter) doc.getAdapterFor(IJSPTranslation.class);
JSPTranslation translation = adapter.getJSPTranslation();
IJavaElement element = translation.getElementsFromJspRange(377, 384)[0];
TestJspSearchRequestor requestor = new TestJspSearchRequestor();
requestor.addCheckMatch("searchTestJSP3.jsp", 377, 384);
JSPSearchSupport.getInstance().search(element, new JSPSearchScope(), requestor, new NullProgressMonitor());
assertTrue("did not find all expected matches: search*", requestor.checkValid());
} finally {
if (xmlModel != null)
xmlModel.releaseFromRead();
}
}
Aggregations