[webbeans-commits] Webbeans SVN: r1557 - in tck/trunk/impl/src/main: resources and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Tue Feb 17 01:37:35 EST 2009
Author: shane.bryzak at jboss.com
Date: 2009-02-17 01:37:35 -0500 (Tue, 17 Feb 2009)
New Revision: 1557
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/event/EventTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
mapped event tests to assertions
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/event/EventTest.java 2009-02-17 03:52:40 UTC (rev 1556)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/unit/event/EventTest.java 2009-02-17 06:37:35 UTC (rev 1557)
@@ -132,15 +132,9 @@
getCurrentManager().fireEvent(anEvent, new RoleBinding("Admin"));
}
- /**
- * An event object is an instance of a concrete Java class with no type
- * variables or wildcards.
- *
- * If the type of the event object passed to fireEvent() contains type
- * variables or wildcards, an IllegalArgumentException is thrown
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "unknown"), @SpecAssertion(section = "7.2", id = "unknown") })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "a"),
+ @SpecAssertion(section = "7.2", id = "b") })
public void testManagerFireEventWithEventTypeParametersFails()
{
deployBeans();
@@ -148,15 +142,9 @@
getCurrentManager().fireEvent(anEvent);
}
- /**
- * An event object is an instance of a concrete Java class with no type
- * variables or wildcards.
- *
- * If the type of the event object passed to fireEvent() contains type
- * variables or wildcards, an IllegalArgumentException is thrown
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "unknown"), @SpecAssertion(section = "7.2", id = "unknown") })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "a"),
+ @SpecAssertion(section = "7.2", id = "b") })
public void testManagerFireEventWithEventTypeWildcardsFails()
{
// Although the above test is really the same as with a wildcard, we will
@@ -167,18 +155,10 @@
getCurrentManager().fireEvent(anEventOnAnyType);
}
- /**
- * An event binding type is just an ordinary binding type as specified in
- * Section 2.3.2, "Defining new binding types" with the exception that it may
- * be declared @Target({FIELD, PARAMETER}). More formally, an event binding
- * type is a Java annotation defined as @Target({FIELD, PARAMETER}) or
- *
- * @Target({METHOD, FIELD, PARAMETER, TYPE}) and @Retention(RUNTIME). All
- * event binding types must specify the
- * javax.inject.BindingType meta-annotation.
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "unknown"), @SpecAssertion(section = "7.2", id = "unknown") })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "c"),
+ @SpecAssertion(section = "7.1", id = "d"),
+ @SpecAssertion(section = "7.2", id = "b") })
public void testManagerFireEventWithNonBindingAnnotationsFails()
{
// The specs are not exactly clear on what is supposed to happen here,
@@ -190,12 +170,8 @@
getCurrentManager().fireEvent(anEvent, new AnimalStereotypeAnnotationLiteral());
}
- /**
- * An observer instance may be registered with the container by calling
- * Manager.addObserver():
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.3", id = "unknown")
+ @SpecAssertion(section = "7.3", id = "b")
public void testManagerAddObserver()
{
deployBeans();
@@ -243,12 +219,8 @@
assert foundObserver;
}
- /**
- * An observer instance may be deregistered by calling
- * Manager.removeObserver():
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.3", id = "unknown")
+ @SpecAssertion(section = "7.3", id = "e")
public void testManagerRemoveObserver()
{
deployBeans();
@@ -282,12 +254,8 @@
assert resolvedObservers.isEmpty();
}
- /**
- * If two instances of the same binding type are passed to addObserver() or
- * removeObserver(), a DuplicateBinding- TypeException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
- @SpecAssertion(section = "7.3", id = "unknown")
+ @SpecAssertion(section = "7.3", id = "g")
public void testMultipleInstancesOfSameBindingTypeWhenAddingObserverFails()
{
deployBeans();
@@ -295,12 +263,8 @@
getCurrentManager().addObserver(observer, AnEventType.class, new RoleBinding("Admin"), new TameAnnotationLiteral(), new TameAnnotationLiteral());
}
- /**
- * If an instance of an annotation that is not a binding type is passed to
- * addObserver() or removeObserver(), an IllegalArgumentException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.3", id = "unknown")
+ @SpecAssertion(section = "7.3", id = "h")
public void testNonBindingTypePassedToAddObserverFails()
{
deployBeans();
@@ -308,12 +272,8 @@
getCurrentManager().addObserver(observer, AnEventType.class, new AnimalStereotypeAnnotationLiteral());
}
- /**
- * If two instances of the same binding type are passed to addObserver() or
- * removeObserver(), a DuplicateBinding- TypeException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
- @SpecAssertion(section = "7.3", id = "unknown")
+ @SpecAssertion(section = "7.3", id = "g")
public void testMultipleInstancesOfSameBindingTypeWhenRemovingObserverFails()
{
deployBeans();
@@ -322,12 +282,8 @@
getCurrentManager().removeObserver(observer, AnEventType.class, new RoleBinding("Admin"), new TameAnnotationLiteral(), new TameAnnotationLiteral());
}
- /**
- * If an instance of an annotation that is not a binding type is passed to
- * addObserver() or removeObserver(), an IllegalArgumentException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.3", id = "unknown")
+ @SpecAssertion(section = "7.3", id = "h")
public void testNonBindingTypePassedToRemoveObserverFails()
{
deployBeans();
@@ -336,13 +292,9 @@
getCurrentManager().removeObserver(observer, AnEventType.class, new AnimalStereotypeAnnotationLiteral());
}
- /**
- * An event consumer will be notified of an event if the observed event type
- * it specifies is one of the event types of the event, and if all the
- * observed event bindings it specifies are event bindings of the event.
- */
@Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.1", id = "unknown"), @SpecAssertion(section = "7.4", id = "unknown") })
+ @SpecAssertions( { @SpecAssertion(section = "7.1", id = "e"),
+ @SpecAssertion(section = "7.4", id = "b") })
public void testConsumerNotifiedWhenEventTypeAndAllBindingsMatch()
{
deployBeans();
@@ -359,13 +311,8 @@
assert observer2.wasNotified;
}
- /**
- * Observers may throw exceptions. If an observer throws an exception, the
- * exception aborts processing of the event. No oth- er observers of that
- * event will be called. The fireEvent() method rethrows the exception.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.4", id = "unknown")
+ @SpecAssertion(section = "7.4", id = "c")
public void testObserverThrowsExceptionAbortsNotifications()
{
deployBeans();
@@ -392,12 +339,8 @@
assert observer.wasNotified ^ anotherObserver.wasNotified;
}
- /**
- * There may be arbitrarily many observer methods with the same event
- * parameter type and bindings.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5", id = "unknown")
+ @SpecAssertion(section = "7.5", id = "e")
public void testMultipleObserverMethodsOK()
{
// This bean has a couple observer methods
@@ -413,12 +356,8 @@
assert resolvedIntegerObservers.size() == 1;
}
- /**
- * If the bean is a session bean, the observer method must be a business
- * method of the EJB or a static method of the bean class.
- */
@Test(groups = { "events" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "7.5", id = "unknown")
+ @SpecAssertion(section = "7.5", id = "d")
public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails()
{
deployBeans(TibetanTerrier.class);
@@ -428,14 +367,9 @@
Set<Observer<String>> observers = getCurrentManager().resolveObservers("An event");
}
- /**
- * Each observer method must have exactly one event parameter, of the same
- * type as the event type it observes. When searching for observer methods
- * for an event, the container considers the type and bindings of the event
- * parameter.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertions( { @SpecAssertion(section = "7.5.1", id = "unknown"), @SpecAssertion(section = "7.5.2", id = "unknown") })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.1", id = "a"),
+ @SpecAssertion(section = "7.5.2", id = "b") })
public void testObserverMethodMustHaveOnlyOneEventParameter()
{
deployBeans(YorkshireTerrier_Broken.class);
@@ -444,12 +378,8 @@
assert beans != null;
}
- /**
- * If the type of the event parameter contains type variables or wildcards, a
- * DefinitionException is thrown by the container at deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.5.1", id = "unknown")
+ @SpecAssertion(section = "7.5.1", id = "c")
public void testObserverMethodCannotObserveParameterizedEvents()
{
deployBeans(BostonTerrier.class);
@@ -457,12 +387,8 @@
assert beans != null;
}
- /**
- * If the event parameter does not explicitly declare any binding, the
- * observer method observes events with no binding.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.1", id = "unknown")
+ @SpecAssertion(section = "7.5.1", id = "b")
public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
{
// This observer has no binding types specified
@@ -475,13 +401,8 @@
assert resolvedObservers.size() == 2;
}
- /**
- * If an observer method is annotated @Produces, or @Initializer or has a
- * parameter annotated @Disposes, a Defini- tionException is thrown by the
- * container at deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.5.2", id = "unknown")
+ @SpecAssertion(section = "7.5.2", id = "c")
public void testObserverMethodAnnotatedProducesFails()
{
deployBeans(BorderTerrier.class);
@@ -489,13 +410,8 @@
assert beans != null;
}
- /**
- * If an observer method is annotated @Produces, or @Initializer or has a
- * parameter annotated @Disposes, a Defini- tionException is thrown by the
- * container at deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.5.2", id = "unknown")
+ @SpecAssertion(section = "7.5.2", id = "d")
public void testObserverMethodAnnotatedInitializerFails()
{
deployBeans(AustralianTerrier.class);
@@ -503,13 +419,8 @@
assert beans != null;
}
- /**
- * If an observer method is annotated @Produces, or @Initializer or has a
- * parameter annotated @Disposes, a Defini- tionException is thrown by the
- * container at deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.5.2", id = "unknown")
+ @SpecAssertion(section = "7.5.2", id = "e")
public void testObserverMethodWithDisposesParamFails()
{
deployBeans(FoxTerrier.class);
@@ -517,11 +428,8 @@
assert beans != null;
}
- /**
- * The event parameter may declare bindings:
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.2", id = "unknown")
+ @SpecAssertion(section = "7.5.2", id = "g")
public void testObserverMethodMayHaveMultipleBindingTypes()
{
deployBeans(BullTerrier.class);
@@ -534,24 +442,15 @@
}
- /**
- * When an observer method is declared in XML, the container ignores binding
- * annotations applied to the Java method para- meters.
- */
@Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertion(section = "7.5.3", id = "unknown")
+ @SpecAssertion(section = "7.5.3", id = "b")
public void testXMLDefinedObserverMethodIgnoresBindingAnnotations()
{
assert false;
}
- /**
- * If the bean class of a bean declared in XML does not have a method with
- * parameters that match those declared in XML, a DefinitionException is
- * thrown by the container at deployment time.
- */
@Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertion(section = "7.5.3", id = "unknown")
+ @SpecAssertion(section = "7.5.3", id = "c")
public void testXMLDefinedObserverNotFindingImplementationMethodFails()
{
assert false;
@@ -569,7 +468,8 @@
* Manager.getInstanceToInject() to each of the other parameters.
*/
@Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.4", id = "unknown"), @SpecAssertion(section = "7.5.8", id = "unknown") })
+ @SpecAssertions( { @SpecAssertion(section = "7.5.4", id = "a"),
+ @SpecAssertion(section = "7.5.8", id = "unknown") })
public void testObserverMethodReceivesInjectionsOnNonObservesParameters()
{
deployBeans(BananaSpider.class);
@@ -577,13 +477,8 @@
assert beans != null;
}
- /**
- * Conditional observer methods are observer methods which are notified of an
- * event only if an instance of the bean that defines the observer method
- * already exists in the current context.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.5", id = "unknown")
+ @SpecAssertion(section = "7.5.5", id = "a")
public void testConditionalObserver()
{
RecluseSpider.notified = false;
@@ -610,93 +505,50 @@
}
}
- /**
- * A transactional observer method may not specify more than one of the four
- * types. If a transactional observer method specifies more than one of the
- * four types, a DefinitionException is thrown by the container at deployment
- * time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.5.6", id = "unknown")
+ @SpecAssertion(section = "7.5.6", id = "k")
public void testTransactionalObserverCanOnlyObserveSinglePhase()
{
deployBeans(TooManyPhases_Broken.class);
}
- /**
- * Asynchronous observer methods are observer methods which receive event
- * notifications asynchronously.
- *
- * An asynchronous observer method may be declared by annotating the event
- * parameter of the observer method javax.event.Asynchronously or in XML by a
- * child <Asynchronously> element of the <Observes> element.
- */
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.7", id = "unknown")
+ @SpecAssertion(section = "7.5.7", id = "a")
public void testAsynchronousObserverIsAsynchronous()
{
assert false;
}
- /**
- * An asynchronous observer method may be declared by annotating the event
- * parameter of the observer method javax.event.Asynchronously or in XML by a
- * child <Asynchronously> element of the <Observes> element.
- */
@Test(groups = { "stub", "events", "webbeansxml" })
- @SpecAssertion(section = "7.5.7", id = "unknown")
+ @SpecAssertion(section = "7.5.7", id = "a")
public void testAsynchronousObserverDeclaredByXML()
{
assert false;
}
- /**
- * An asynchronous observer method may also be a transactional observer
- * method.
- */
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.7", id = "unknown")
+ @SpecAssertion(section = "7.5.7", id = "b")
public void testAsynchronousObserverAlsoTransactional()
{
assert false;
}
- /**
- * An asynchronous observer method may also be a transactional observer
- * method. However, it may not be a before completion observer method or a
- * conditional observer method. If an asynchronous observer method is
- * specified as a before completion or conditional observer method, a
- * DefinitionException is thrown by the container at deployment time.
- */
@Test(groups = { "stub", "events" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "7.5.7", id = "unknown")
+ @SpecAssertion(section = "7.5.7", id = "c")
public void testAsynchronousObserverAsBeforeCompletionObserverFails()
{
assert false;
}
- /**
- * An asynchronous observer method may also be a transactional observer
- * method. However, it may not be a before completion observer method or a
- * conditional observer method. If an asynchronous observer method is
- * specified as a before completion or conditional observer method, a
- * DefinitionException is thrown by the container at deployment time.
- */
@Test(groups = { "stub", "events" }, expectedExceptions = DefinitionException.class)
- @SpecAssertion(section = "7.5.7", id = "unknown")
+ @SpecAssertion(section = "7.5.7", id = "c")
public void testAsynchronousObserverAsConditionalObserverFails()
{
assert false;
}
- /**
- * For every observer method of an enabled bean, the container is responsible
- * for providing and registering an appropriate implementation of the
- * Observer interface, that delegates event notifications to the observer
- * method.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "a")
public void testObserverMethodRegistration()
{
// This bean has two observer methods, one static and one non-static
@@ -709,33 +561,23 @@
assert resolvedObservers.size() == 2;
}
- /**
- * Otherwise, if the observer method is an asynchronous observer method, the
- * container calls the observer method asynchronously.
- */
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "e")
public void testAsynchronousObserverMethodCalledAsynchronously()
{
assert false;
}
- /**
- * Otherwise, the container calls the observer immediately.
- */
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "f")
public void testObserverMethodCalledImmediately()
{
assert false;
}
- /**
- * If the observer method is static, the container must invoke the method.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "i")
public void testStaticObserverMethodInvoked()
{
deployBeans(StaticObserver.class);
@@ -746,43 +588,52 @@
/**
* Otherwise, if the observer method is non-static, the container must:
*
- * • obtain the Bean object for the most specialized bean that specializes
+ * obtain the Bean object for the most specialized bean that specializes
* the bean which declares the observer method, and then
*
- * • obtain the context object by calling Manager.getContext(), passing the
+ * obtain the context object by calling Manager.getContext(), passing the
* bean scope, then
*
- * • obtain an instance of the bean by calling Context.get(), passing the
+ * obtain an instance of the bean by calling Context.get(), passing the
* Bean instance representing the bean, together with a CreationalContext
* unless this observer method is a conditional observer method, and then
*
- * • if the get() method returned a non-null value, invoke the observer
+ * if the get() method returned a non-null value, invoke the observer
* method on the returned instance
*/
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "j")
public void testObserverMethodInvocationProcess()
{
assert false;
}
-
+
/**
- * If the observer is a transactional or asynchronous observer method, any
- * exception is caught and logged by the container.
+ * Otherwise, if the observer method is non-static, the container must:
+ *
+ * • obtain the Bean object for the most specialized bean that specializes
+ * the bean which declares the observer method, and then
+ *
*/
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "7.5.8", id = "j")
+ public void testObserverCalledOnMostSpecializedInstance()
+ {
+ Shop.deliveryObservedBy = null;
+ deployBeans(FarmShop.class, Shop.class);
+ getCurrentManager().fireEvent(new Delivery());
+ assert Shop.deliveryObservedBy.equals(FarmShop.class.getName());
+ }
+
@Test(groups = { "stub", "events" }, expectedExceptions = { TeaCupPomeranian.OversizedException.class })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "p")
public void testAsynchronousObserverThrowsNonCheckedExceptionIsRethrown()
{
assert false;
}
- /**
- * Otherwise, the exception is rethrown by the notify() method of the
- * observer object.
- */
@Test(groups = { "events" }, expectedExceptions = { TeaCupPomeranian.OversizedException.class })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "q")
public void testNonTransactionalObserverThrowsNonCheckedExceptionIsRethrown()
{
deployBeans(TeaCupPomeranian.class);
@@ -791,12 +642,8 @@
getCurrentManager().fireEvent("Another event");
}
- /**
- * If the exception is a checked exception, it is wrapped and rethrown as an
- * (unchecked) ObserverException.
- */
@Test(groups = { "events" }, expectedExceptions = { ObserverException.class })
- @SpecAssertion(section = "7.5.8", id = "unknown")
+ @SpecAssertion(section = "7.5.8", id = "r")
public void testNonTransactionalObserverThrowsCheckedExceptionIsWrappedAndRethrown()
{
deployBeans(TeaCupPomeranian.class);
@@ -805,42 +652,15 @@
getCurrentManager().fireEvent(new Integer(1));
}
- /**
- * Otherwise, if the observer method is non-static, the container must:
- *
- * • obtain the Bean object for the most specialized bean that specializes
- * the bean which declares the observer method, and then
- *
- */
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5.8", id = "unknown")
- public void testObserverCalledOnMostSpecializedInstance()
- {
- Shop.deliveryObservedBy = null;
- deployBeans(FarmShop.class, Shop.class);
- getCurrentManager().fireEvent(new Delivery());
- assert Shop.deliveryObservedBy.equals(FarmShop.class.getName());
- }
-
- /**
- * If the observer method is an asynchronous observer method, it is called
- * with no active transaction, no client security context and with a new
- * request context that is destroyed when the observer method returns. The
- * application context is also active.
- */
@Test(groups = { "stub", "events" })
- @SpecAssertion(section = "7.5.9", id = "unknown")
+ @SpecAssertion(section = "7.5.9", id = "a")
public void testAsynchronousObserverMethodContexts()
{
assert false;
}
- /**
- * If two instances of the same binding type are passed to fire() or
- * observes(), a DuplicateBindingTypeException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "g")
public void testDuplicateBindingsToFireFails()
{
deployBeans(SweeWaxbill_Broken.class);
@@ -856,12 +676,8 @@
}
}
- /**
- * If two instances of the same binding type are passed to fire() or
- * observes(), a DuplicateBindingTypeException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "g")
public void testDuplicateBindingsToObservesFails()
{
deployBeans(SweeWaxbill_Broken.class);
@@ -877,12 +693,8 @@
}
}
- /**
- * If an instance of an annotation that is not a binding type is passed to
- * fire() or observes(), an IllegalArgumentException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "h")
public void testNonBindingTypePassedToFireFails()
{
deployBeans(OwlFinch_Broken.class);
@@ -898,12 +710,8 @@
}
}
- /**
- * If an instance of an annotation that is not a binding type is passed to
- * fire() or observes(), an IllegalArgumentException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "h")
public void testNonBindingTypePassedToObservesFails()
{
deployBeans(OwlFinch_Broken.class);
@@ -919,12 +727,8 @@
}
}
- /**
- * The @Fires annotation or <Fires> element may be applied to any injection
- * point of type Event, where an actual type parameter is specified.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "i")
public void testFiresAnnotationOnEventTypes()
{
deployBeans(BlueFacedParrotFinch.class);
@@ -986,14 +790,8 @@
}
}
- /**
- * If the type of the injection point is not of type Event, if no actual type
- * parameter is specified, or if the type parameter contains a type variable
- * or wildcard, a DefinitionException is thrown by the container at
- * deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "j")
public void testFiresAnnotationOnNonEventTypeInjectionPointFails()
{
deployBeans(CommonWaxbill_Broken.class);
@@ -1009,14 +807,8 @@
}
}
- /**
- * If the type of the injection point is not of type Event, if no actual type
- * parameter is specified, or if the type parameter contains a type variable
- * or wildcard, a DefinitionException is thrown by the container at
- * deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "k")
public void testFiresAnnotationOnInjectionPointWithoutTypeParameterFails()
{
deployBeans(BlackRumpedWaxbill_Broken.class);
@@ -1032,14 +824,8 @@
}
}
- /**
- * If the type of the injection point is not of type Event, if no actual type
- * parameter is specified, or if the type parameter contains a type variable
- * or wildcard, a DefinitionException is thrown by the container at
- * deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "m")
public void testFiresAnnotationOnInjectionPointWithWildcardedTypeParameterFails()
{
deployBeans(GoldbreastWaxbill_Broken.class);
@@ -1055,14 +841,8 @@
}
}
- /**
- * If the type of the injection point is not of type Event, if no actual type
- * parameter is specified, or if the type parameter con- tains a type
- * variable or wildcard, a DefinitionException is thrown by the container at
- * deployment time.
- */
@Test(groups = { "events" }, expectedExceptions = { DefinitionException.class })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "l")
public void testFiresAnnotationOnInjectionPointWithTypeVariabledTypeParameterFails()
{
deployBeans(JavaSparrow_Broken.class);
@@ -1078,14 +858,8 @@
}
}
- /**
- * Whenever the @Fires annotation appears at an injection point, an implicit
- * bean exists with:
- *
- * • exactly the bean type and bindings that appear at the injection point,
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "n")
public void testImplicitEventBeanMatchesAPITypeOfInectionPoint()
{
deployBeans(BlueFacedParrotFinch.class);
@@ -1105,14 +879,8 @@
}
}
- /**
- * Whenever the @Fires annotation appears at an injection point, an implicit
- * bean exists with:
- *
- * • exactly the bean type and bindings that appear at the injection point,
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "n")
public void testImplicitEventBeanMatchesBindingAnnotationsOfInjectionPoint()
{
deployBeans(OrangeCheekedWaxbill.class);
@@ -1132,11 +900,8 @@
}
}
- /**
- * deployment type @Standard,
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "o")
public void testImplicitEventBeanHasStandardDeploymentType()
{
deployBeans(BlueFacedParrotFinch.class);
@@ -1158,12 +923,8 @@
}
}
- /**
- * the @Dependent scope,
- * @throws Exception
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "p")
public void testImplicitEventBeanHasDependentScope() throws Exception
{
deployBeans(BlueFacedParrotFinch.class);
@@ -1184,12 +945,8 @@
}.run();
}
- /**
- * no bean name, and
- * @throws Exception
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "q")
public void testImplicitEventBeanHasNoName() throws Exception
{
deployBeans(BlueFacedParrotFinch.class);
@@ -1210,12 +967,8 @@
}.run();
}
- /**
- * an implementation provided automatically by the container.
- * @throws Exception
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "r")
public void testImplicitEventBeanProvidedByContainer() throws Exception
{
deployBeans(BlueFacedParrotFinch.class);
@@ -1234,92 +987,52 @@
}.run();
}
- /**
- * The fire() method of the provided implementation of Event must call
- * Manager.fireEvent(), passing the following parameters:
- *
- * • the event object passed to Event.fire()
- */
// TODO The manager related tests require intercepting all calls
// to it to verify that the correct calls are made.
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "s")
public void testFireMethodCallsManagerFireWithEventObject()
{
assert false;
}
- /**
- * The fire() method of the provided implementation of Event must call
- * Manager.fireEvent(), passing the following parameters:
- *
- * • all bindings declared at the injection point, except @Fires
- */
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "s")
public void testFireMethodCallsManagerFireWithBindingAnnotationsExceptFires()
{
assert false;
}
- /**
- * The fire() method of the provided implementation of Event must call
- * Manager.fireEvent(), passing the following parameters:
- *
- * • all bindings passed to Event.fire()
- */
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "s")
public void testFireMethodCallsManagerFireWithAllBindingAnnotationInstances()
{
assert false;
}
- /**
- * The observe() method of the provided implementation of Event must call
- * Manager.addObserver(), passing the following parameters:
- *
- * • the observer object passed to Event.observe()
- */
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "u")
public void testObserveMethodCallsManagerAddObserverWithObserverObject()
{
assert false;
}
- /**
- * The observe() method of the provided implementation of Event must call
- * Manager.addObserver(), passing the following parameters:
- *
- * • all bindings declared at the injection point, except @Fires
- */
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "u")
public void testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationsExceptFires()
{
assert false;
}
- /**
- * The observe() method of the provided implementation of Event must call
- * Manager.addObserver(), passing the following parameters:
- *
- * • all bindings passed to Event.observe()
- */
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "7.6", id = "unknown")
+ @SpecAssertion(section = "7.6", id = "u")
public void testObserveMethodCallsManagerAddObserverWithAllBindingAnnotationInstance()
{
assert false;
}
- /**
- * If the type of the event object passed to resolveObservers() contains type
- * variables or wildcards, an IllegalArgumentException is thrown.
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "b")
public void testEventObjectContainsTypeVariablesWhenResolvingFails()
{
eventObjectContainsTypeVariables(new ArrayList<String>());
@@ -1332,12 +1045,8 @@
Set<?> resolvedObservers = getCurrentManager().resolveObservers(eventToFire);
}
- /**
- * If the type of the event object passed to resolveObservers() contains type
- * variables or wildcards, an IllegalArgumentException is thrown.
- */
@Test(groups = { "broken", "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "c")
public void testEventObjectContainsWildcardsWhenResolvingFails()
{
eventObjectContainsWildcards(new ArrayList<String>());
@@ -1352,12 +1061,8 @@
Set<?> resolvedObservers = getCurrentManager().resolveObservers(eventToFire);
}
- /**
- * If two instances of the same binding type are passed to
- * resolveObservers(), a DuplicateBindingTypeException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "d")
public void testDuplicateBindingTypesWhenResolvingFails()
{
deployBeans();
@@ -1367,12 +1072,8 @@
Set<Observer<AnEventType>> resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), new BindingTypeABinding(), new BindingTypeABinding());
}
- /**
- * If an instance of an annotation that is not a binding type is passed to
- * resolveObservers(), an IllegalArgumentException is thrown.
- */
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "e")
public void testNonBindingTypeAnnotationWhenResolvingFails()
{
deployBeans();
@@ -1384,12 +1085,8 @@
assert !resolvedObservers.isEmpty();
}
- /**
- * the event object must be assignable to the observed event type, taking
- * type parameters into consideration, and
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "f")
public void testResolvingChecksEventType()
{
deployBeans();
@@ -1401,12 +1098,8 @@
assert emptyObserverSet.isEmpty();
}
- /**
- * the event object must be assignable to the observed event type, taking
- * type parameters into consideration, and
- */
@Test(groups = { "broken", "events" })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "f")
public void testResolvingChecksTypeParameters()
{
deployBeans();
@@ -1422,13 +1115,8 @@
assert resolvedObservers.size() == 1;
}
- /**
- * for each observed event binding, (a) an instance of the binding type must
- * have been passed to fireEvent() and (b) any member values of the binding
- * type must match the member values of the instance passed to fireEvent().
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "g")
public void testResolvingChecksBindingTypes()
{
deployBeans();
@@ -1440,13 +1128,8 @@
assert resolvedObservers.size() == 1;
}
- /**
- * for each observed event binding, (a) an instance of the binding type must
- * have been passed to fireEvent() and (b) any member values of the binding
- * type must match the member values of the instance passed to fireEvent().
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "unknown")
+ @SpecAssertion(section = "7.7", id = "g")
public void testResolvingChecksBindingTypeMembers()
{
deployBeans();
@@ -1464,7 +1147,7 @@
* inherited by the second bean.
*/
@Test(groups = { "events", "inheritance" })
- @SpecAssertion(section = "4.", id = "unknown")
+ @SpecAssertion(section = "4", id = "a")
public void testNonStaticObserverMethodNotInherited()
{
deployBeans(LazyFarmer.class);
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-17 03:52:40 UTC (rev 1556)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-02-17 06:37:35 UTC (rev 1557)
@@ -1725,7 +1725,9 @@
</section>
<section id="4" title="Inheritance, specialization and realization">
-
+ <assertion id="a">
+ <text>By default, Java implementation reuse is assumed</text>
+ </assertion>
</section>
<section id="4.1" title="Inheritance of type-level metadata">
@@ -2340,15 +2342,15 @@
</assertion>
<assertion id="k">
- <text>Placeholder</text>
+ <text>Placeholder for path 2</text>
</assertion>
<assertion id="l">
- <text>Placeholder</text>
+ <text>Placeholder for path 3</text>
</assertion>
<assertion id="m">
- <text>Placeholder</text>
+ <text>Placeholder for path 4 etc</text>
</assertion>
<assertion id="p">
@@ -2356,10 +2358,14 @@
</assertion>
<assertion id="q">
- <text>If the observer isn't a transactional or asynchronous observer method, the exception is rethrown by the notify() method of the observer object. If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) ObserverException</text>
+ <text>If the observer isn't a transactional or asynchronous observer method, the exception is rethrown by the notify() method of the observer object</text>
</assertion>
<assertion id="r">
+ <text>If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) ObserverException</text>
+ </assertion>
+
+ <assertion id="s">
<text>The observer object is registered by calling Manager.addObserver(), passing the event parameter type as the observed event type, and the bindings of the event parameter as the observed event bindings</text>
</assertion>
</section>
More information about the weld-commits
mailing list