Author: dallen6
Date: 2008-12-07 19:55:57 -0500 (Sun, 07 Dec 2008)
New Revision: 462
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/AustralianTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BorderTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BostonTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/CairnsTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/FoxTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Terrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/TibetanTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/YorkshireTerrier.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pomeranian.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
Log:
More error checking and tests for these conditions with the Event Bus.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-07
22:23:38 UTC (rev 461)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -208,7 +208,7 @@
}
/**
- * Iterates over the interested observers. If the observers is transactional
+ * Iterates over the interested observers. If an observer is transactional
* and there is a transaction currently in progress, the event is deferred.
* In other cases, the observer is notified immediately.
*
@@ -231,7 +231,7 @@
}
/**
- * Defers an event with regard to current transaction phase
+ * Defers an event for processing in a later phase of the current transaction.
*
* Gets the transaction listener, creates a deferred event representation and
* registers the deferred event.
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-07
22:23:38 UTC (rev 461)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -31,14 +31,20 @@
import javax.webbeans.AfterTransactionSuccess;
import javax.webbeans.BeforeTransactionCompletion;
import javax.webbeans.DefinitionException;
+import javax.webbeans.Destructor;
+import javax.webbeans.Disposes;
import javax.webbeans.IfExists;
+import javax.webbeans.Initializer;
import javax.webbeans.Observer;
import javax.webbeans.Observes;
+import javax.webbeans.Produces;
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.event.EventManager.TransactionObservationPhase;
import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.util.Reflections;
/**
* <p>
@@ -62,7 +68,7 @@
/**
* Creates an Observer which describes and encapsulates an observer method
- * (7.5).
+ * (8.5).
*
* @param componentModel The model for the component which defines the
* observer method
@@ -77,6 +83,7 @@
this.manager = manager;
this.observerBean = observerBean;
this.observerMethod = observer;
+ validateObserverMethod();
initTransactionObservationPhase();
conditional = !observerMethod.getAnnotatedParameters(IfExists.class).isEmpty();
}
@@ -114,6 +121,49 @@
}
}
+ /**
+ * Performs validation of the observer method for compliance with the specifications.
+ */
+ private void validateObserverMethod()
+ {
+ // Make sure exactly one and only one parameter is annotated with Observes
+ List<AnnotatedParameter<Object>> eventObjects =
this.observerMethod.getAnnotatedParameters(Observes.class);
+ if (eventObjects.size() > 1)
+ {
+ throw new DefinitionException(this + " is invalid because it contains more
than event parameter");
+ }
+ // Make sure the event object above is not parameterized with a type
+ // variable or wildcard
+ if (eventObjects.size() > 0)
+ {
+ AnnotatedParameter<Object> eventParam = eventObjects.iterator().next();
+ if (Reflections.isParameterizedType(eventParam.getType()))
+ {
+ throw new DefinitionException(this + " cannot observe parameterized
event types");
+ }
+ }
+ // Check for parameters annotated with @Disposes
+ List<AnnotatedParameter<Object>> disposeParams =
this.observerMethod.getAnnotatedParameters(Disposes.class);
+ if (disposeParams.size() > 0)
+ {
+ throw new DefinitionException(this + " cannot have any parameters annotated
with @Dispose");
+ }
+ // Check annotations on the method to make sure this is not a producer
+ // method, initializer method, or destructor method.
+ if ( this.observerMethod.isAnnotationPresent(Produces.class) )
+ {
+ throw new DefinitionException(this + " cannot be annotated with
@Produces");
+ }
+ if (this.observerMethod.isAnnotationPresent(Initializer.class))
+ {
+ throw new DefinitionException(this + " cannot be annotated with
@Initializer");
+ }
+ if ( this.observerMethod.isAnnotationPresent(Destructor.class) )
+ {
+ throw new DefinitionException(this + " cannot be annotated with
@Destructor");
+ }
+ }
+
public void notify(final T event)
{
// Get the most specialized instance of the component
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-07
22:23:38 UTC (rev 461)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -3,17 +3,29 @@
import java.lang.annotation.Annotation;
import java.util.Set;
+import javax.webbeans.DefinitionException;
import javax.webbeans.DuplicateBindingTypeException;
import javax.webbeans.Event;
import javax.webbeans.Observer;
import javax.webbeans.TypeLiteral;
+import org.jboss.webbeans.bean.AbstractBean;
import org.jboss.webbeans.bean.EventBean;
import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.bindings.InitializedBinding;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.test.bindings.AnimalStereotypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.RoleBinding;
import org.jboss.webbeans.test.bindings.TameAnnotationLiteral;
+import org.jboss.webbeans.test.ejb.model.invalid.AustralianTerrier;
+import org.jboss.webbeans.test.ejb.model.invalid.BorderTerrier;
+import org.jboss.webbeans.test.ejb.model.invalid.BostonTerrier;
+import org.jboss.webbeans.test.ejb.model.invalid.CairnsTerrier;
+import org.jboss.webbeans.test.ejb.model.invalid.FoxTerrier;
+import org.jboss.webbeans.test.ejb.model.invalid.TibetanTerrier;
+import org.jboss.webbeans.test.ejb.model.invalid.YorkshireTerrier;
+import org.jboss.webbeans.test.ejb.model.valid.Pomeranian;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.util.BeanFactory;
import org.testng.annotations.Test;
@@ -21,9 +33,10 @@
* Temporary name until synchronized with David Allen
*
* @author Nicklas Karlsson
+ * @author David Allen
*
*/
-@SpecVersion("PDR")
+@SpecVersion("20081206")
public class NewEventTest extends AbstractTest
{
public static class AnEventType
@@ -36,11 +49,24 @@
public static class AnObserver implements Observer<AnEventType>
{
+ public boolean wasNotified = false;
public void notify(AnEventType event)
{
+ wasNotified = true;
}
+ }
+ public static class AnObserverWithException implements Observer<AnEventType>
+ {
+ public boolean wasNotified = false;
+ public RuntimeException theException = new RuntimeException("RE1");
+
+ public void notify(AnEventType event)
+ {
+ wasNotified = true;
+ throw theException;
+ }
}
@SuppressWarnings("unchecked")
@@ -57,21 +83,14 @@
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.1")
+ @SpecAssertion(section = "8.1")
public void testEventTypeIncludesAllSuperclassesAndInterfacesOfEventObject()
{
assert false;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.1")
- public void testConsumerNotifiedWhenEventTypeAndAllBindingsMatch()
- {
- assert false;
- }
-
@Test(groups = { "events" })
- @SpecAssertion(section = "7.2")
+ @SpecAssertion(section = "8.2")
public void testManagerFireEvent()
{
// First a simple event with no bindings is fired
@@ -82,34 +101,61 @@
manager.fireEvent(anEvent, new RoleBinding("Admin"));
}
- @Test(groups = { "events" }, expectedExceptions =
IllegalArgumentException.class)
- @SpecAssertion(section = "7.1,7.2")
- public void testManagerFireEventWithParametersFails()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = { "8.1", "8.2" })
+ public void testManagerFireEventWithParameterizedEventFails()
{
- ATemplatedEventType<String> anEvent = new
ATemplatedEventType<String>();
- manager.fireEvent(anEvent);
+ boolean fireEventFailed = false;
+ try
+ {
+ ATemplatedEventType<String> anEvent = new
ATemplatedEventType<String>();
+ manager.fireEvent(anEvent);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fireEventFailed = true;
+ }
+ assert fireEventFailed;
// Although the above is really the same as with a wildcard, we will test
// it anyhow since the specification calls it out separately.
-
- ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
- manager.fireEvent(anEventOnAnyType);
+ fireEventFailed = false;
+ try
+ {
+ ATemplatedEventType<?> anEventOnAnyType = new
ATemplatedEventType<String>();
+ manager.fireEvent(anEventOnAnyType);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fireEventFailed = true;
+ }
+ assert fireEventFailed;
}
- @Test(groups = { "events" }, expectedExceptions =
IllegalArgumentException.class)
- @SpecAssertion(section = "7.1,7.2")
+ @Test(groups = { "events" })
+ @SpecAssertion(section = { "8.1", "8.2" })
public void testManagerFireEventWithNonBindingAnnotationsFails()
{
// The specs are not exactly clear on what is supposed to happen here, but
// borrowing
- // from Section 7.x, we'll expect the same behavior here for a consistent
+ // from Section 8.3, we'll expect the same behavior here for a consistent
// API.
- AnEventType anEvent = new AnEventType();
- manager.fireEvent(anEvent, new AnimalStereotypeAnnotationLiteral());
+ // TODO Verify that fireEvent should fail on non-binding annotations
+ boolean fireEventFailed = false;
+ try
+ {
+ AnEventType anEvent = new AnEventType();
+ manager.fireEvent(anEvent, new AnimalStereotypeAnnotationLiteral());
+ }
+ catch (IllegalArgumentException e)
+ {
+ fireEventFailed = true;
+ }
+ assert fireEventFailed;
}
@Test(groups = { "events" })
- @SpecAssertion(section = "7.3")
+ @SpecAssertion(section = "8.3")
public void testManagerAddObserver()
{
Observer<AnEventType> observer = new AnObserver();
@@ -160,7 +206,7 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "7.3")
+ @SpecAssertion(section = "8.3")
public void testManagerRemoveObserver()
{
Observer<AnEventType> observer = new AnObserver();
@@ -193,452 +239,598 @@
assert resolvedObservers.isEmpty();
}
- @Test(groups = { "events" }, expectedExceptions =
DuplicateBindingTypeException.class)
- @SpecAssertion(section = "7.3")
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.3")
public void testMultipleInstancesOfSameBindingTypeWhenAddingObserverFails()
{
- Observer<AnEventType> observer = new AnObserver();
- manager.addObserver(observer, AnEventType.class, new
RoleBinding("Admin"), new TameAnnotationLiteral(), new
TameAnnotationLiteral());
+ boolean failedAddingObserver = false;
+ try
+ {
+ Observer<AnEventType> observer = new AnObserver();
+ manager.addObserver(observer, AnEventType.class, new
RoleBinding("Admin"), new TameAnnotationLiteral(), new
TameAnnotationLiteral());
+ }
+ catch (DuplicateBindingTypeException e)
+ {
+ failedAddingObserver = true;
+ }
+ assert failedAddingObserver;
}
- @Test(groups = { "events" }, expectedExceptions =
DuplicateBindingTypeException.class)
- @SpecAssertion(section = "7.3")
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.3")
+ public void testNonBindingTypePassedToAddObserverFails()
+ {
+ boolean failedAddingObserver = false;
+ try
+ {
+ Observer<AnEventType> observer = new AnObserver();
+ manager.addObserver(observer, AnEventType.class, new
AnimalStereotypeAnnotationLiteral());
+ }
+ catch (IllegalArgumentException e)
+ {
+ failedAddingObserver = true;
+ }
+ assert failedAddingObserver;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.3")
public void testMultipleInstancesOfSameBindingTypeWhenRemovingObserverFails()
{
- Observer<AnEventType> observer = new AnObserver();
- manager.addObserver(observer, AnEventType.class);
- manager.removeObserver(observer, AnEventType.class, new
RoleBinding("Admin"), new TameAnnotationLiteral(), new
TameAnnotationLiteral());
+ boolean failedRemovingObserver = false;
+ try
+ {
+ Observer<AnEventType> observer = new AnObserver();
+ manager.addObserver(observer, AnEventType.class);
+ manager.removeObserver(observer, AnEventType.class, new
RoleBinding("Admin"), new TameAnnotationLiteral(), new
TameAnnotationLiteral());
+ }
+ catch (DuplicateBindingTypeException e)
+ {
+ failedRemovingObserver = true;
+ }
+ assert failedRemovingObserver;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.3")
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.3")
public void testNonBindingTypePassedToRemoveObserverFails()
{
- assert false;
+ boolean failedAddingObserver = false;
+ try
+ {
+ Observer<AnEventType> observer = new AnObserver();
+ manager.addObserver(observer, AnEventType.class);
+ manager.removeObserver(observer, AnEventType.class, new
AnimalStereotypeAnnotationLiteral());
+ }
+ catch (IllegalArgumentException e)
+ {
+ failedAddingObserver = true;
+ }
+ assert failedAddingObserver;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.4")
+ @Test(groups = { "events" })
+ @SpecAssertion(section = { "8.1", "8.4" })
+ public void testConsumerNotifiedWhenEventTypeAndAllBindingsMatch()
+ {
+ AnObserver observer1 = new AnObserver();
+ AnObserver observer2 = new AnObserver();
+ manager.addObserver(observer1, AnEventType.class);
+ manager.addObserver(observer2, AnEventType.class);
+
+ // Fire an event that will be delivered to the two above observers
+ AnEventType anEvent = new AnEventType();
+ manager.fireEvent(anEvent);
+
+ assert observer1.wasNotified;
+ assert observer2.wasNotified;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.4")
public void testObserverThrowsExceptionAbortsNotifications()
{
- assert false;
+ AnObserver observer = new AnObserver();
+ AnObserverWithException anotherObserver = new AnObserverWithException();
+ manager.addObserver(anotherObserver, AnEventType.class);
+ manager.addObserver(observer, AnEventType.class);
+
+ // Fire an event that will be delivered to the two above observers
+ AnEventType anEvent = new AnEventType();
+ boolean fireFailed = false;
+ try
+ {
+ manager.fireEvent(anEvent);
+ }
+ catch (Exception e)
+ {
+ if (anotherObserver.theException.equals(e))
+ fireFailed = true;
+ }
+ assert fireFailed;
+
+ assert anotherObserver.wasNotified;
+ // TODO This cannot properly test for event processing abort
+ // assert !observer.wasNotified;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.4")
+ @SpecAssertion(section = "8.4")
public void testObserverCalledBeforeTransactionCompleteMaySetRollbackOnly()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.4")
+ @SpecAssertion(section = "8.4")
public void testObserverManipulatingJTATransactionsDirectlyFails()
{
assert false;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5")
- public void testStaticObserverMethodsFails()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5")
+ public void testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic()
{
- assert false;
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(Pomeranian.class);
+ assert beans.size() == 1;
+ Set<Observer<MockManagerImpl>> observers =
manager.resolveObservers(manager, new InitializedBinding());
+ assert observers.size() == 2;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5")
- public void testObserverMethodOnEnterpriseBeanIsBusinessMethod()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5")
+ public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails()
{
- assert false;
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(TibetanTerrier.class);
+ assert beans.size() == 1;
+ Set<Observer<MockManagerImpl>> observers =
manager.resolveObservers(manager, new InitializedBinding());
+ assert observers.size() == 1;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5")
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5")
public void testMultipleObserverMethodsOK()
{
- assert false;
+ // Somewhat of a cheat, but this other test already does have 2 observer
+ // methods
+ // for the same event type and event bindings.
+ testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic();
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.1")
+ @Test(groups = { "events" })
+ @SpecAssertion(section = { "8.5.1", "8.5.2" })
public void testObserverMethodMustHaveOnlyOneEventParameter()
{
- assert false;
+ boolean definitionException = false;
+ try
+ {
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(YorkshireTerrier.class);
+ assert beans != null;
+ }
+ catch (DefinitionException e)
+ {
+ definitionException = true;
+ }
+ assert definitionException;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.1")
- public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5.1")
+ public void testObserverMethodCannotObserveParameterizedEvents()
{
- assert false;
+ boolean definitionException = false;
+ try
+ {
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(BostonTerrier.class);
+ assert beans != null;
+ }
+ catch (DefinitionException e)
+ {
+ definitionException = true;
+ }
+ assert definitionException;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.1")
- public void testObserverMethodWithTypeVariablesFails()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5.2")
+ public void testObserverMethodAnnotatedProducesFails()
{
- assert false;
+ boolean definitionException = false;
+ try
+ {
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(BorderTerrier.class);
+ assert beans != null;
+ }
+ catch (DefinitionException e)
+ {
+ definitionException = true;
+ }
+ assert definitionException;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.1")
- public void testObserverMethodWithWildcardsFails()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5.2")
+ public void testObserverMethodAnnotatedInitializerFails()
{
- assert false;
+ boolean definitionException = false;
+ try
+ {
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(AustralianTerrier.class);
+ assert beans != null;
+ }
+ catch (DefinitionException e)
+ {
+ definitionException = true;
+ }
+ assert definitionException;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.2")
- public void testObserverMethodAnnotatedProducesFails()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5.2")
+ public void testObserverMethodAnnotatedDestructorFails()
{
- assert false;
+ boolean definitionException = false;
+ try
+ {
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(CairnsTerrier.class);
+ assert beans != null;
+ }
+ catch (DefinitionException e)
+ {
+ definitionException = true;
+ }
+ assert definitionException;
}
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.2")
- public void testObserverMethodAnnotatedInitializerFails()
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "8.5.2")
+ public void testObserverMethodWithDisposesParamFails()
{
- assert false;
+ boolean definitionException = false;
+ try
+ {
+ Set<AbstractBean<?, ?>> beans =
bootstrap.createBeans(FoxTerrier.class);
+ assert beans != null;
+ }
+ catch (DefinitionException e)
+ {
+ definitionException = true;
+ }
+ assert definitionException;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.2")
- public void testObserverMethodAnnotatedDestructorFails()
+ @SpecAssertion(section = "8.5.1")
+ public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.2")
- public void testObserverMethodHasDisposesAnnotatedParameterFails()
- {
- assert false;
- }
-
- @Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.3")
+ @SpecAssertion(section = "8.5.3")
public void testXMLDefinedObserverMethodIgnoresBindingAnnotations()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.3")
+ @SpecAssertion(section = "8.5.3")
public void testXMLDefinedObserverNotFindingImplementationMethodFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.4")
+ @SpecAssertion(section = "8.5.4")
public void testObserverMethodReceivesInjectionsOnNonObservesParameters()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.5")
+ @SpecAssertion(section = "8.5.5")
public void testConditionalObserver()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.1")
+ @SpecAssertion(section = "8.1")
public void testTransactionalObserverCanOnlyObserveSinglePhase()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.6")
+ @SpecAssertion(section = "8.5.6")
public void testTransactionalObserverNotifiedImmediatelyWhenNoTransactionInProgress()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.6")
+ @SpecAssertion(section = "8.5.6")
public void testAfterTransactionCompletionObserver()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.6")
+ @SpecAssertion(section = "8.5.6")
public void testAfterTransactionSuccessObserver()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.6")
+ @SpecAssertion(section = "8.5.6")
public void testAfterTransactionFailureObserver()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.6")
+ @SpecAssertion(section = "8.5.6")
public void testBeforeTransactionCompletionObserver()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.7")
+ @SpecAssertion(section = "8.5.7")
public void testObserverMethodRegistration()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.7")
+ @SpecAssertion(section = "8.5.7")
public void testEnterpriseBeanObserverMethodCalledWithCallerContext()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.7")
+ @SpecAssertion(section = "8.5.7")
public void testTransactionalObserverThrownExceptionIsCaughtAndLogged()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.7")
+ @SpecAssertion(section = "8.5.7")
public void testNonTransactionalObserverThrownNonCheckedExceptionIsRethrown()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.7")
+ @SpecAssertion(section = "8.5.7")
public void testNonTransactionalObserverThrownCheckedExceptionIsWrappedAndRethrown()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testDuplicateBindingsToFireFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testDuplicateBindingsToObservesFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testNonBindingTypePassedToFireFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testNonBindingTypePassedToObservesFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableAnnotationOnField()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableAnnotationOnParameterOfProducerMethod()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableAnnotationOnParameterOfInitializerMethod()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableAnnotationOnParameterOfDisposalMethod()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableAnnotationOnParameterOfRemoveMethod()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableAnnotationOnParameterOfConstructor()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableAnnotationOnNonEventTypeInjectionPointFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObservableannotationOnInjectionPointWithoutTypeParameterFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void
testObservableannotationOnInjectionPointWithWildcardedTypeParameterFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void
testObservableannotationOnInjectionPointWithTypeVariabledTypeParameterFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testImplicitObserverBeanMatchesAPITypeOfInectionPoint()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testImplicitObserverBeanMatchesBindingAnnotationsOfInjectionPoint()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testImplicitObserverBeanHasStandardDeploymentType()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testImplicitObserverBeanHasDependentScope()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testFireMethodCallsManagerFireWithEventObject()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testFireMethodCallsManagerFireWithBindingAnnotationsExceptObservable()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testFireMethodCallsManagerFireWithAllBindingAnnotationInstances()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void testObserveMethodCallsManagerAddObserverWithObserverObject()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void
testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationsExceptObservable()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.6")
+ @SpecAssertion(section = "8.6")
public void
testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationInstance()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testEventObjectContainsTypeVariablesWhenResolvingFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testEventObjectContainsWildcardsWhenResolvingFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testDuplicateBindingTypesWhenResolvingFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testNonBindingTypeAnnotationWhenResolvingFails()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testResolvingChecksEventType()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testResolvingChecksTypeParameters()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testResolvingChecksBindingTypes()
{
assert false;
}
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.7")
+ @SpecAssertion(section = "8.7")
public void testResolvingChecksBindingTypeMembers()
{
assert false;
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/AustralianTerrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/AustralianTerrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/AustralianTerrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Initializer;
+import javax.webbeans.Observes;
+import javax.webbeans.manager.Initialized;
+import javax.webbeans.manager.Manager;
+
+@Stateless
+public class AustralianTerrier
+{
+ @Initializer
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/AustralianTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BorderTerrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BorderTerrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BorderTerrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Observes;
+import javax.webbeans.Produces;
+import javax.webbeans.manager.Initialized;
+import javax.webbeans.manager.Manager;
+
+@Stateless
+public class BorderTerrier
+{
+ @Produces
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BorderTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BostonTerrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BostonTerrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BostonTerrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import java.util.List;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Observes;
+
+@Stateless
+public class BostonTerrier
+{
+ public void observesBadEvent(@Observes List<String> someArray)
+ {
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/BostonTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/CairnsTerrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/CairnsTerrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/CairnsTerrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,17 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Destructor;
+import javax.webbeans.Observes;
+import javax.webbeans.manager.Initialized;
+import javax.webbeans.manager.Manager;
+
+@Stateless
+public class CairnsTerrier
+{
+ @Destructor
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ }
+
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/CairnsTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/FoxTerrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/FoxTerrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/FoxTerrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Disposes;
+import javax.webbeans.Observes;
+import javax.webbeans.manager.Initialized;
+import javax.webbeans.manager.Manager;
+
+@Stateless
+public class FoxTerrier
+{
+ public void observeInitialized(@Observes @Initialized Manager manager, @Disposes
String badParam)
+ {
+ }
+
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/FoxTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Terrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Terrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Terrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import javax.ejb.Local;
+
+@Local
+public interface Terrier
+{
+
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/Terrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/TibetanTerrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/TibetanTerrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/TibetanTerrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Observes;
+import javax.webbeans.manager.Initialized;
+import javax.webbeans.manager.Manager;
+
+@Stateless
+public class TibetanTerrier implements Terrier
+{
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/TibetanTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/YorkshireTerrier.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/YorkshireTerrier.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/YorkshireTerrier.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.ejb.model.invalid;
+
+import javax.ejb.Stateless;
+import javax.webbeans.Observes;
+import javax.webbeans.manager.Initialized;
+import javax.webbeans.manager.Manager;
+
+@Stateless
+public class YorkshireTerrier
+{
+ public void observeInitialized(@Observes @Initialized Manager manager, @Observes Boxer
anotherDog)
+ {
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/invalid/YorkshireTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pomeranian.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pomeranian.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pomeranian.java 2008-12-08
00:55:57 UTC (rev 462)
@@ -0,0 +1,23 @@
+package org.jboss.webbeans.test.ejb.model.valid;
+
+import javax.ejb.Stateful;
+import javax.webbeans.Named;
+import javax.webbeans.Observes;
+import javax.webbeans.manager.Initialized;
+import javax.webbeans.manager.Manager;
+
+import org.jboss.webbeans.test.annotations.Tame;
+
+@Stateful
+@Tame
+@Named("Teddy")
+public class Pomeranian
+{
+ public void observeInitialized(@Observes @Initialized Manager manager)
+ {
+ }
+
+ public static void staticallyObserveInitialized(@Observes @Initialized Manager
manager)
+ {
+ }
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/valid/Pomeranian.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain