[webbeans-commits] Webbeans SVN: r1228 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/event and 2 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sat Jan 24 15:53:15 EST 2009
Author: dallen6
Date: 2009-01-24 15:53:14 -0500 (Sat, 24 Jan 2009)
New Revision: 1228
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDiscovery.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/EnterpriseBeanDeclarationTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Greyhound_Broken.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Labrador.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Leopard.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java
Log:
Fixed a few more tests and added Singleton as EJB type.
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDiscovery.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDiscovery.java 2009-01-24 18:47:01 UTC (rev 1227)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDiscovery.java 2009-01-24 20:53:14 UTC (rev 1228)
@@ -6,6 +6,7 @@
import java.util.Set;
import javax.ejb.MessageDriven;
+import javax.ejb.Singleton;
import javax.ejb.Stateful;
import javax.ejb.Stateless;
@@ -37,7 +38,7 @@
Set<Class<?>> ejbs = new HashSet<Class<?>>();
for (Class<?> clazz : webBeanClasses)
{
- if (clazz.isAnnotationPresent(Stateless.class) || clazz.isAnnotationPresent(Stateful.class) || clazz.isAnnotationPresent(MessageDriven.class))
+ if (clazz.isAnnotationPresent(Stateless.class) || clazz.isAnnotationPresent(Stateful.class) || clazz.isAnnotationPresent(MessageDriven.class) || clazz.isAnnotationPresent(Singleton.class))
{
ejbs.add(clazz);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/event/EventTest.java 2009-01-24 18:47:01 UTC (rev 1227)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/event/EventTest.java 2009-01-24 20:53:14 UTC (rev 1228)
@@ -30,8 +30,7 @@
@SpecVersion("20081206")
public class EventTest extends AbstractTest
{
-
-
+
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
@@ -40,7 +39,7 @@
deploymentTypes.add(AnotherDeploymentType.class);
return deploymentTypes;
}
-
+
public static class AnEventType
{
}
@@ -272,11 +271,11 @@
assert observer2.wasNotified;
}
- @Test(groups = { "events", "broken" })
+ @Test(groups = { "events" })
@SpecAssertion(section = "8.4")
public void testObserverThrowsExceptionAbortsNotifications()
{
- AnObserver observer = new AnObserver();
+ AnObserverWithException observer = new AnObserverWithException();
AnObserverWithException anotherObserver = new AnObserverWithException();
manager.addObserver(anotherObserver, AnEventType.class);
manager.addObserver(observer, AnEventType.class);
@@ -290,14 +289,13 @@
}
catch (Exception e)
{
- if (anotherObserver.theException.equals(e))
+ if (e.equals(observer.theException) || e.equals(anotherObserver.theException))
fireFailed = true;
}
assert fireFailed;
-
- assert anotherObserver.wasNotified;
- // TODO This cannot properly test for event processing abort
- // assert !observer.wasNotified;
+ // Only one of the observers can be notified if processing
+ // is aborted
+ assert observer.wasNotified ^ anotherObserver.wasNotified;
}
@Test(groups = { "events" })
@@ -312,7 +310,7 @@
// Resolve the observers for String and Integer
Set<Observer<String>> resolvedStringObservers = manager.resolveObservers("A new event");
assert resolvedStringObservers.size() == 1;
-
+
Set<Observer<Integer>> resolvedIntegerObservers = manager.resolveObservers(new Integer(42));
assert resolvedIntegerObservers.size() == 1;
}
@@ -920,7 +918,7 @@
{
assert false;
}
-
+
@Test
@SpecAssertion(section = "4.2")
public void testNonStaticObserverMethodNotInherited()
@@ -928,8 +926,9 @@
deployBeans(LazyFarmer.class);
assert manager.resolveObservers(new Egg()).isEmpty();
}
-
- @Test @SpecAssertion(section="8.5.8")
+
+ @Test
+ @SpecAssertion(section = "8.5.8")
public void testObserverCalledOnMostSpecializedInstance()
{
Shop.deliveryObservedBy = null;
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/EnterpriseBeanDeclarationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/EnterpriseBeanDeclarationTest.java 2009-01-24 18:47:01 UTC (rev 1227)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/EnterpriseBeanDeclarationTest.java 2009-01-24 20:53:14 UTC (rev 1228)
@@ -10,11 +10,9 @@
/**
* Sections
*
- * 3.3. Enterprise Web Beans
- * 3.3.1. Which EJBs are enterprise Web Beans?
- * 3.3.2. API types of an enterprise Web Bean
- * 3.3.3. Declaring an enterprise Web Bean using annotations
- * 3.3.4. Declaring an enterprise Web Bean using XML
+ * 3.3. Enterprise Web Beans 3.3.1. Which EJBs are enterprise Web Beans? 3.3.2.
+ * API types of an enterprise Web Bean 3.3.3. Declaring an enterprise Web Bean
+ * using annotations 3.3.4. Declaring an enterprise Web Bean using XML
*
* @author Nicklas Karlsson
*/
@@ -94,12 +92,11 @@
* illegal scope, a DefinitionException is thrown by the Web Bean manager at
* initialization time
*/
- @Test(groups = { "enterpriseBeans" ,"broken"})
+ @Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3")
public void testSingletonWithDependentScopeOK()
{
deployBeans(Labrador.class);
- assert false;
}
/**
@@ -108,7 +105,7 @@
* illegal scope, a DefinitionException is thrown by the Web Bean manager at
* initialization time
*/
- @Test(groups = { "enterpriseBeans" , "broken"}, expectedExceptions = DefinitionException.class)
+ @Test(groups = { "enterpriseBeans" }, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithRequestScopeFails()
{
@@ -314,7 +311,7 @@
* Bean declared in XML is a message-driven bean, a DefinitionException is
* thrown by the Web Bean manager at initialization time.
*/
- @Test(expectedExceptions = DefinitionException.class, groups = {"enterpriseBeans", "broken"})
+ @Test(expectedExceptions = DefinitionException.class, groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3")
public void testMessageDrivenBeansNotOK()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Greyhound_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Greyhound_Broken.java 2009-01-24 18:47:01 UTC (rev 1227)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Greyhound_Broken.java 2009-01-24 20:53:14 UTC (rev 1228)
@@ -1,8 +1,9 @@
package org.jboss.webbeans.tck.unit.implementation.enterprise;
+import javax.ejb.Singleton;
import javax.webbeans.RequestScoped;
-//@Singleton
+ at Singleton
@RequestScoped
class Greyhound_Broken
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Labrador.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Labrador.java 2009-01-24 18:47:01 UTC (rev 1227)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Labrador.java 2009-01-24 20:53:14 UTC (rev 1228)
@@ -1,8 +1,9 @@
package org.jboss.webbeans.tck.unit.implementation.enterprise;
+import javax.ejb.Singleton;
import javax.webbeans.Dependent;
-//@Singleton
+ at Singleton
@Dependent
class Labrador
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Leopard.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Leopard.java 2009-01-24 18:47:01 UTC (rev 1227)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/enterprise/Leopard.java 2009-01-24 20:53:14 UTC (rev 1228)
@@ -1,10 +1,11 @@
package org.jboss.webbeans.tck.unit.implementation.enterprise;
+import javax.ejb.MessageDriven;
import javax.webbeans.Production;
@Production
-//@MessageDriven
-class Leopard /*implements javax.jms.MessageListener*/
+ at MessageDriven
+class Leopard /*implements MessageListener*/
{
public void onMessage(/*Message message*/)
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java 2009-01-24 18:47:01 UTC (rev 1227)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/implementation/producer/field/ProducerFieldLifecycleTest.java 2009-01-24 20:53:14 UTC (rev 1228)
@@ -18,7 +18,7 @@
* • If the producer method is static, the container must access the field
* value.
*/
- @Test(groups = { "producerField", "broken" })
+ @Test(groups = { "producerField" })
@SpecAssertion(section = "5.6")
public void testProducerStaticFieldBean()
{
@@ -56,7 +56,7 @@
*
* @throws Exception
*/
- @Test(groups = { "producerField", "broken" })
+ @Test(groups = { "producerField" })
@SpecAssertion(section = "6.8")
public void testProducerFieldBeanCreate() throws Exception
{
More information about the weld-commits
mailing list