[webbeans-commits] Webbeans SVN: r3317 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Tue Jul 28 13:50:13 EDT 2009
Author: dan.j.allen
Date: 2009-07-28 13:50:13 -0400 (Tue, 28 Jul 2009)
New Revision: 3317
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
Log:
fix intermittent failure
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java 2009-07-28 17:50:13 UTC (rev 3317)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+class Cloud
+{
+ public void allocateNewDisk(@Observes DiskSpaceEvent event)
+ {
+ }
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java 2009-07-28 16:27:30 UTC (rev 3316)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java 2009-07-28 17:50:13 UTC (rev 3317)
@@ -1,32 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.observer.resolve;
-
-import javax.enterprise.event.Observes;
-
-public class Heater
-{
- private Temperature target;
-
- private boolean on = false;
-
- public void setTargetTemperature(Temperature target)
- {
- this.target = target;
- }
-
- public void temperatureChanged(@Observes Temperature temperature)
- {
- if (on && temperature.getDegrees() > target.getDegrees())
- {
- on = false;
- }
- else if (!on && temperature.getDegrees() <= target.getDegrees())
- {
- on = true;
- }
- }
-
- public boolean isOn()
- {
- return on;
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-07-28 16:27:30 UTC (rev 3316)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-07-28 17:50:13 UTC (rev 3317)
@@ -25,7 +25,7 @@
@SpecAssertion(section = "10.4", id = "e")
public void testMultipleObserverMethodsForSameEventPermissible()
{
- assert getCurrentManager().resolveObserverMethods(new Temperature(0)).size() == 2;
+ assert getCurrentManager().resolveObserverMethods(new DiskSpaceEvent()).size() == 2;
}
@Test(groups = { "events" })
@@ -33,7 +33,7 @@
public void testMultipleObserverMethodsOnBeanPermissible()
{
assert getCurrentManager().resolveObserverMethods(new BatteryEvent()).size() == 1;
- assert getCurrentManager().resolveObserverMethods(new DiskSpaceEvent()).size() == 1;
+ assert getCurrentManager().resolveObserverMethods(new DiskSpaceEvent()).size() == 2;
}
@Test(groups = { "events" })
@@ -41,9 +41,9 @@
public void testMethodWithParameterAnnotatedWithObservesRegistersObserverMethod() throws SecurityException, NoSuchMethodException
{
Set<ObserverMethod<?, Temperature>> temperatureObservers = getCurrentManager().resolveObserverMethods(new Temperature(0d));
- assert temperatureObservers.size() > 1;
+ assert temperatureObservers.size() == 1;
ObserverMethod<?, Temperature> temperatureObserver = temperatureObservers.iterator().next();
- assert temperatureObserver.getBean().getBeanClass().equals(AirConditioner.class);
+ assert temperatureObserver.getBean() == getUniqueBean(AirConditioner.class);
assert temperatureObserver.getObservedType().equals(Temperature.class);
Method method = AirConditioner.class.getMethod("temperatureChanged", Temperature.class);
More information about the weld-commits
mailing list