Author: dazarov
Date: 2011-08-24 14:08:04 -0400 (Wed, 24 Aug 2011)
New Revision: 34237
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/search.jsp
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/search/MySearchableBean.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java
Log:
https://issues.jboss.org/browse/JBIDE-9473
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/search.jsp
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/search.jsp
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/search.jsp 2011-08-24
18:08:04 UTC (rev 34237)
@@ -0,0 +1,16 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+ <head>
+ <title>JSF Test Page</title>
+ </head>
+ <body>
+ <f:view>
+ <h1>
+ <h:outputText value="#{mySearchableBean.sFoo2()}"/>
+ <h:outputText value="#{sFoo}"/>
+ <h:outputText value="#{sFoo1}"/>
+ </h1>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/search.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/search/MySearchableBean.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/search/MySearchableBean.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/search/MySearchableBean.java 2011-08-24
18:08:04 UTC (rev 34237)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.search;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+@Named
+public class MySearchableBean {
+
+ @Produces @Named public String sFoo;
+
+ @Produces @Named public String sFoo1() {
+ return "";
+ }
+
+ public String sFoo2() {
+ return "";
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/search/MySearchableBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-08-24
18:03:00 UTC (rev 34236)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2011-08-24
18:08:04 UTC (rev 34237)
@@ -41,4 +41,47 @@
new ELReferencesQueryParticipant(),
matches);
}
+
+ public void testELReferencesQueryParticipantForType2() throws CoreException{
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure("/tck/WebContent/search.jsp",
"mySearchableBean"));
+
+ QueryParticipantTestUtils.testSearchParticipant(tckProject,
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/search/MySearchableBean.java",
+ QueryParticipantTestUtils.TYPE_SEARCH,
+ "MySearchableBean",
+ "",
+ new ELReferencesQueryParticipant(),
+ matches);
+ }
+
+ public void testELReferencesQueryParticipantForMethod2() throws CoreException{
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure("/tck/WebContent/search.jsp",
"sFoo1"));
+
+ QueryParticipantTestUtils.testSearchParticipant(tckProject,
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/search/MySearchableBean.java",
+ QueryParticipantTestUtils.METHOD_SEARCH,
+ "sFoo1",
+ "",
+ new ELReferencesQueryParticipant(),
+ matches);
+ }
+
+ public void testELReferencesQueryParticipantForField() throws CoreException{
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure("/tck/WebContent/search.jsp",
"sFoo"));
+
+ QueryParticipantTestUtils.testSearchParticipant(tckProject,
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/search/MySearchableBean.java",
+ QueryParticipantTestUtils.FIELD_SEARCH,
+ "sFoo",
+ "",
+ new ELReferencesQueryParticipant(),
+ matches);
+ }
+
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java 2011-08-24
18:03:00 UTC (rev 34236)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java 2011-08-24
18:08:04 UTC (rev 34237)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
@@ -51,7 +52,7 @@
return;
ElementQuerySpecification qs = (ElementQuerySpecification)querySpecification;
- if(qs.getElement() instanceof IMethod || qs.getElement() instanceof IType){
+ if(qs.getElement() instanceof IField || qs.getElement() instanceof IMethod ||
qs.getElement() instanceof IType){
IFile file = (IFile)qs.getElement().getResource();
if(file == null)
return;