Author: scabanovich
Date: 2012-05-15 19:18:53 -0400 (Tue, 15 May 2012)
New Revision: 41033
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java
Log:
JBIDE-11867
https://issues.jboss.org/browse/JBIDE-11867
Test is added.
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java 2012-05-15
20:22:31 UTC (rev 41032)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/event/fires/DogWhisperer.java 2012-05-15
23:18:53 UTC (rev 41033)
@@ -25,6 +25,9 @@
@Inject @Tame @Role("Master")
TamingCommand tamingCommand;
+ @Inject
+ Event<TamingCommand> generalEvent;
+
@Inject @Any @Tame @Role("Master")
Event<TamingCommand> tamingEvent;
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java 2012-05-15
20:22:31 UTC (rev 41032)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java 2012-05-15
23:18:53 UTC (rev 41033)
@@ -35,6 +35,28 @@
assertTrue(observers.isEmpty());
}
+ /**
+ * Event injection point has no qualifiers.
+ */
+ public void testObserverMethodResolution0() {
+ IInjectionPointField generalEvent =
getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java",
"generalEvent");
+ assertNotNull(generalEvent);
+
+ Set<IObserverMethod> observers =
generalEvent.getCDIProject().resolveObserverMethods(generalEvent);
+ IObserverMethod tamedObserver = null;
+ IObserverMethod recognizedFriendObserver = null;
+ for (IObserverMethod m: observers) {
+ IMethod jm = m.getMethod();
+ if("tamed".equals(jm.getElementName())) {
+ tamedObserver = m;
+ } else if("recognizedFriend".equals(jm.getElementName())) {
+ recognizedFriendObserver = m;
+ }
+ }
+ assertNull(tamedObserver);
+ assertNull(recognizedFriendObserver);
+ }
+
public void testObserverMethodResolution() {
IInjectionPointField tamingEvent =
getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java",
"tamingEvent");
assertNotNull(tamingEvent);