Author: pete.muir(a)jboss.org
Date: 2010-12-30 09:39:31 -0500 (Thu, 30 Dec 2010)
New Revision: 7161
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Egg.java
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/EventPayload.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Farmer.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/FarmerLocal.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IndirectStockWatcher.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IntermediateStockWatcher.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/LazyFarmer.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockPrice.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcher.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcherLocal.java
Log:
CDITCK-202
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Egg.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Egg.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Egg.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -18,4 +18,10 @@
class Egg extends EventPayload
{
+
+ public void recordVisit(FarmerLocal farmer)
+ {
+ recordVisit(farmer.getName());
+ }
+
}
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-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -42,7 +42,9 @@
{
Egg egg = new Egg();
getCurrentManager().fireEvent(egg);
- assert typeSetMatches(egg.getClassesVisited(), Farmer.class, LazyFarmer.class);
+ assert egg.getVisited().size() == 2;
+ assert egg.getVisited().contains(Farmer.class.getSimpleName());
+ assert egg.getVisited().contains(LazyFarmer.class.getSimpleName());
}
@Test(groups = { "events", "inheritance" })
@@ -51,6 +53,9 @@
{
StockPrice stockPrice = new StockPrice();
getCurrentManager().fireEvent(stockPrice);
- assert typeSetMatches(stockPrice.getClassesVisited(), StockWatcher.class,
IndirectStockWatcher.class, IntermediateStockWatcher.class);
+ assert stockPrice.getVisited().size() == 3;
+ assert stockPrice.getVisited().contains(StockWatcher.class.getSimpleName());
+ assert
stockPrice.getVisited().contains(IntermediateStockWatcher.class.getSimpleName());
+ assert
stockPrice.getVisited().contains(IndirectStockWatcher.class.getSimpleName());
}
}
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EventPayload.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EventPayload.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EventPayload.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -19,17 +19,17 @@
import java.util.ArrayList;
import java.util.List;
-class EventPayload
+abstract class EventPayload
{
- private List<Class<?>> classesVisited = new
ArrayList<Class<?>>();
+ private List<String> visited = new ArrayList<String>();
- public List<Class<?>> getClassesVisited()
+ public List<String> getVisited()
{
- return classesVisited;
+ return visited;
}
- public void recordVisit(Object o)
+ public void recordVisit(String name)
{
- classesVisited.add(o.getClass());
+ visited.add(name);
}
}
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Farmer.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Farmer.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/Farmer.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -25,5 +25,10 @@
{
egg.recordVisit(this);
}
+
+ public String getName()
+ {
+ return Farmer.class.getSimpleName();
+ }
}
\ No newline at end of file
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/FarmerLocal.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/FarmerLocal.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/FarmerLocal.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -21,5 +21,9 @@
public @Local interface FarmerLocal
{
+
void observeEggLaying(@Observes Egg egg);
+
+ public String getName();
+
}
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IndirectStockWatcher.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IndirectStockWatcher.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IndirectStockWatcher.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -20,4 +20,11 @@
public @Stateful class IndirectStockWatcher extends IntermediateStockWatcher implements
IndirectStockWatcherLocal,StockWatcherLocal
{
+
+ @Override
+ public String getName()
+ {
+ return IndirectStockWatcher.class.getSimpleName();
+ }
+
}
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IntermediateStockWatcher.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IntermediateStockWatcher.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IntermediateStockWatcher.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -18,4 +18,10 @@
class IntermediateStockWatcher extends StockWatcher
{
+
+ @Override
+ public String getName()
+ {
+ return IntermediateStockWatcher.class.getSimpleName();
+ }
}
\ No newline at end of file
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/LazyFarmer.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/LazyFarmer.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/LazyFarmer.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -20,4 +20,11 @@
public @Stateful class LazyFarmer extends Farmer implements LazyFarmerLocal,FarmerLocal
{
+
+ @Override
+ public String getName()
+ {
+ return LazyFarmer.class.getSimpleName();
+ }
+
}
\ No newline at end of file
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockPrice.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockPrice.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockPrice.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -18,4 +18,10 @@
class StockPrice extends EventPayload
{
+
+ public void recordVisit(StockWatcherLocal stockWatcher)
+ {
+ recordVisit(stockWatcher.getName());
+ }
+
}
\ No newline at end of file
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcher.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcher.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcher.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -25,5 +25,10 @@
{
price.recordVisit(this);
}
+
+ public String getName()
+ {
+ return StockWatcher.class.getSimpleName();
+ }
}
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcherLocal.java
===================================================================
---
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcherLocal.java 2010-12-17
14:06:50 UTC (rev 7160)
+++
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/StockWatcherLocal.java 2010-12-30
14:39:31 UTC (rev 7161)
@@ -22,4 +22,7 @@
public @Local interface StockWatcherLocal
{
void observeStockPrice(@Observes StockPrice price);
+
+ String getName();
+
}
Show replies by date