Author: petemuir
Date: 2010-10-31 11:39:51 -0400 (Sun, 31 Oct 2010)
New Revision: 7071
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Farmer.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java
Log:
CDITCK-186
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2010-10-31
13:23:17 UTC (rev 7070)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2010-10-31
15:39:51 UTC (rev 7071)
@@ -17,11 +17,9 @@
package org.jboss.jsr299.tck.tests.event;
import java.util.ArrayList;
-import java.util.Set;
import javax.enterprise.context.spi.Context;
import javax.enterprise.event.TransactionPhase;
-import javax.enterprise.inject.spi.ObserverMethod;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
@@ -129,9 +127,7 @@
public void testNonStaticObserverMethodInherited()
{
Egg egg = new Egg();
- Set<ObserverMethod<? super Egg>> observers =
getCurrentManager().resolveObserverMethods(egg);
-
- observers.iterator().next().notify(egg);
+ getCurrentManager().fireEvent(egg);
assert typeSetMatches(egg.getClassesVisited(), Farmer.class, LazyFarmer.class);
}
@@ -143,9 +139,7 @@
public void testNonStaticObserverMethodIndirectlyInherited()
{
StockPrice price = new StockPrice();
- Set<ObserverMethod<? super StockPrice>> observers =
getCurrentManager().resolveObserverMethods(price);
-
- observers.iterator().next().notify(price);
+ getCurrentManager().fireEvent(price);
assert typeSetMatches(price.getClassesVisited(), StockWatcher.class,
IntermediateStockWatcher.class, IndirectStockWatcher.class);
}
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Farmer.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Farmer.java 2010-10-31
13:23:17 UTC (rev 7070)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Farmer.java 2010-10-31
15:39:51 UTC (rev 7071)
@@ -20,17 +20,10 @@
class Farmer
{
- private static Class<?> observerClazz;
public void observeEggLaying(@Observes Egg egg)
{
- observerClazz = this.getClass();
egg.recordVisit(this);
}
-
- public static Class<?> getObserverClazz()
- {
- return observerClazz;
- }
}
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java 2010-10-31
13:23:17 UTC (rev 7070)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java 2010-10-31
15:39:51 UTC (rev 7071)
@@ -16,10 +16,6 @@
*/
package org.jboss.jsr299.tck.tests.event.observer.enterprise;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.ObserverMethod;
-
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
@@ -45,9 +41,7 @@
public void testNonStaticObserverMethodInherited() throws Exception
{
Egg egg = new Egg();
- Set<ObserverMethod<? super Egg>> observers =
getCurrentManager().resolveObserverMethods(egg);
-
- observers.iterator().next().notify(egg);
+ getCurrentManager().fireEvent(egg);
assert typeSetMatches(egg.getClassesVisited(), Farmer.class, LazyFarmer.class);
}
@@ -56,9 +50,7 @@
public void testNonStaticObserverMethodIndirectlyInherited() throws Exception
{
StockPrice stockPrice = new StockPrice();
- Set<ObserverMethod<? super StockPrice>> observers =
getCurrentManager().resolveObserverMethods(stockPrice);
-
- observers.iterator().next().notify(stockPrice);
+ getCurrentManager().fireEvent(stockPrice);
assert typeSetMatches(stockPrice.getClassesVisited(), StockWatcher.class,
IndirectStockWatcher.class, IntermediateStockWatcher.class);
}
}
Show replies by date