[webbeans-commits] Webbeans SVN: r3063 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Jul 16 00:32:54 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-07-16 00:32:53 -0400 (Thu, 16 Jul 2009)
New Revision: 3063
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
Log:
matched assertions for event tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-16 04:32:21 UTC (rev 3062)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-16 04:32:53 UTC (rev 3063)
@@ -22,7 +22,7 @@
* @author Nicklas Karlsson
* @author David Allen
*
- * Spec version: Public Release Draft 2
+ * Spec version: 20090625
*/
@Artifact
@BeansXml("beans.xml")
@@ -80,7 +80,7 @@
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class } )
@SpecAssertions({
@SpecAssertion(section = "10.1", id = "g"),
- @SpecAssertion(section = "11.2.8", id = "e")
+ @SpecAssertion(section = "11.3.10", id = "e")
})
public void testManagerFireEventWithNonBindingAnnotationsFails()
{
@@ -90,7 +90,7 @@
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertions({
@SpecAssertion(section = "10.1", id = "aa"),
- @SpecAssertion(section = "11.2.8", id = "c")
+ @SpecAssertion(section = "11.3.10", id = "c")
})
public void testManagerFireEventWithEventTypeParametersFails()
{
@@ -101,16 +101,16 @@
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertions({
@SpecAssertion(section = "10.1", id = "aa"),
- @SpecAssertion(section = "11.2.8", id = "c")
+ @SpecAssertion(section = "11.3.10", id = "c")
})
- public void testManagerFireEventWithEventTypeWildcardsFails()
+ public void testBeanManagerFireEventWithEventTypeWildcardsFails()
{
ATemplatedEventType<?> anEventOnAnyType = new ATemplatedEventType<String>();
getCurrentManager().fireEvent(anEventOnAnyType);
}
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "11.2.8", id = "d")
+ @SpecAssertion(section = "11.3.10", id = "d")
public void testDuplicateBindingsToFireEventFails() throws Exception
{
getCurrentManager().fireEvent("string event", new TameAnnotationLiteral(), new TameAnnotationLiteral());
@@ -118,20 +118,20 @@
@Test(groups = { "events" })
@SpecAssertions({
- @SpecAssertion(section = "11.2.8", id = "a"),
- @SpecAssertion(section = "11.2.8", id = "b")
+ @SpecAssertion(section = "11.3.10", id = "a"),
+ @SpecAssertion(section = "11.3.10", id = "b")
})
- public void testManagerInterfaceForFireEventMethod() throws Exception
+ public void testBeanManagerInterfaceForFireEventMethod() throws Exception
{
assert BeanManager.class.getDeclaredMethod(FIRE_EVENT_METHOD_NAME, Object.class, Annotation[].class) != null;
}
/**
- * The Manager interface provides a method for firing events:
+ * The BeanManager interface provides a method for firing events:
*/
@Test(groups = { "events" })
- @SpecAssertion(section = "11.2.8", id = "a")
- public void testManagerFireEvent()
+ @SpecAssertion(section = "11.3.10", id = "a")
+ public void testBeanManagerFireEvent()
{
// First a simple event with no bindings is fired
AnEventType anEvent = new AnEventType();
@@ -143,18 +143,18 @@
@Test(groups = { "events" })
@SpecAssertions({
- @SpecAssertion(section = "11.2.9", id = "a"),
- @SpecAssertion(section = "11.2.9", id = "b")
+ @SpecAssertion(section = "11.3.11", id = "a"),
+ @SpecAssertion(section = "11.3.11", id = "b")
})
- public void testManagerResolveObserversSignature() throws Exception
+ public void testBeanManagerResolveObserversSignature() throws Exception
{
assert getCurrentManager().getClass().getDeclaredMethod(RESOLVE_OBSERVERS_METHOD_NAME, Object.class, Annotation[].class) != null;
}
@Test(groups = { "events" })
@SpecAssertions({
- @SpecAssertion(section = "10.5", id = "a"),
- @SpecAssertion(section = "10.5.2", id = "a"),
+ @SpecAssertion(section = "10.5", id = "aa"),
+ @SpecAssertion(section = "10.4.2", id = "a"),
@SpecAssertion(section = "12.3", id = "o")
})
public void testObserverMethodAutomaticallyRegistered()
@@ -163,7 +163,7 @@
}
@Test(groups = { "events", "ri-broken" })
- @SpecAssertion(section = "12.3", id = "o")
+ @SpecAssertion(section = "12.3", id = "oa")
public void testObserverMethodNotAutomaticallyRegisteredForDisabledBeans()
{
Set<ObserverMethod<?, String>> observers = getCurrentManager().resolveObserverMethods(new String());
@@ -176,14 +176,14 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "10.5", id = "e")
+ @SpecAssertion(section = "10.4", id = "e")
public void testMultipleObserverMethodsForSameEventPermissible()
{
assert getCurrentManager().resolveObserverMethods(new String()).size() > 1;
}
@Test(groups = { "events" })
- @SpecAssertion(section = "10.5", id = "f")
+ @SpecAssertion(section = "10.4", id = "f")
public void testMultipleObserverMethodsOnBeanPermissible()
{
// Resolve the observers for types 1 and 2
@@ -193,14 +193,14 @@
}
@Test(groups = { "events", "ejb" })
- @SpecAssertion(section = "10.5", id = "d")
+ @SpecAssertion(section = "10.4", id = "d")
public void testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic()
{
assert getCurrentManager().resolveObserverMethods(new EJBEvent()).size() == 2;
}
@Test(groups = { "events" })
- @SpecAssertion(section = "10.5.1", id = "b")
+ @SpecAssertion(section = "10.4.1", id = "b")
public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
{
// Resolve registered observers with an event containing no binding types
@@ -209,9 +209,9 @@
@Test(groups = { "events" })
@SpecAssertions( {
- @SpecAssertion(section = "10.5.2", id = "c"),
- @SpecAssertion(section = "10.2.1", id = "a"),
- @SpecAssertion(section = "10.2.2", id = "a")
+ @SpecAssertion(section = "10.4.2", id = "c"),
+ @SpecAssertion(section = "10.2.2", id = "a"),
+ @SpecAssertion(section = "10.2.3", id = "a")
})
public void testObserverMethodMayHaveMultipleBindingTypes()
{
@@ -221,8 +221,8 @@
@Test(groups = { "events" })
@SpecAssertions( {
- @SpecAssertion(section = "10.5.3", id = "a"),
- @SpecAssertion(section = "5.4.8", id = "c")
+ @SpecAssertion(section = "10.4.3", id = "a"),
+ @SpecAssertion(section = "5.6.8", id = "c")
})
public void testObserverMethodReceivesInjectionsOnNonObservesParameters()
{
@@ -231,8 +231,8 @@
@Test(groups = { "events" })
@SpecAssertions( {
- @SpecAssertion(section = "10.5.4", id = "a"),
- @SpecAssertion(section = "5.4.8", id = "b")
+ @SpecAssertion(section = "10.4.4", id = "a"),
+ @SpecAssertion(section = "5.6.8", id = "b")
} )
public void testConditionalObserver() throws Exception
{
@@ -261,7 +261,7 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "10.6.1", id = "aa")
+ @SpecAssertion(section = "10.5", id = "aa")
public void testObserverMethodRegistration()
{
// Resolve registered observers with an event containing no binding types
@@ -270,8 +270,8 @@
@Test(groups = { "events" })
@SpecAssertions({
- @SpecAssertion(section = "10.6.1", id = "b"),
- @SpecAssertion(section = "10.6.1", id = "h")
+ @SpecAssertion(section = "10.5", id = "review"), // was b
+ @SpecAssertion(section = "10.5", id = "review") // was h
})
public void testObserverMethodCalledImmediately() throws Exception
{
@@ -295,8 +295,8 @@
*/
@Test(groups = { "events" })
@SpecAssertions({
- @SpecAssertion(section = "10.5", id = "c"),
- @SpecAssertion(section = "5.4.8", id = "k")
+ @SpecAssertion(section = "10.4", id = "c"),
+ @SpecAssertion(section = "5.6.8", id = "a")
})
public void testStaticObserverMethodInvoked() throws Exception
{
@@ -317,7 +317,7 @@
@Test(groups = { "events" })
@SpecAssertions({
@SpecAssertion(section = "4.3.2", id = "a"),
- @SpecAssertion(section = "5.4.8", id = "b")
+ @SpecAssertion(section = "5.6.8", id = "ba")
})
public void testObserverCalledOnMostSpecializedInstance()
{
@@ -327,7 +327,7 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "5.4.8", id = "b")
+ @SpecAssertion(section = "5.6.8", id = "ba")
public void testObserverMethodInvokedOnReturnedInstanceFromContext()
{
RecluseSpider spider = getInstanceByType(RecluseSpider.class);
@@ -338,7 +338,7 @@
}
@Test(groups = { "events", "stub" })
- @SpecAssertion(section = "10.6.1", id = "p")
+ @SpecAssertion(section = "10.5", id = "ca")
public void testAsynchronousObserverThrowsExceptionIsLogged() throws Exception
{
new RunInDependentContext()
@@ -356,14 +356,14 @@
}
@Test(groups = { "events", "stub" })
- @SpecAssertion(section = "10.6.2", id = "a")
+ @SpecAssertion(section = "10.5.1", id = "review") // I think this has been removed from the spec
public void testAsynchronousObserverMethodContexts()
{
assert false;
}
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "11.2.8", id = "d")
+ @SpecAssertion(section = "11.3.10", id = "d")
public void testDuplicateBindingsToFireFails() throws Exception
{
new RunInDependentContext()
@@ -378,12 +378,9 @@
}.run();
}
- // FIXME the assertion is being verified indirectly by verifying outcome
- // to verify directly, would need to mock BeanManager (very hard) or
- // intercept the call to BeanManager#fireEvent() (equally hard)
@Test(groups = { "events" })
- @SpecAssertion(section = "10.4.1", id = "ed")
- public void testFireMethodCallsManagerFireWithEventObject()
+ @SpecAssertion(section = "10.3.1", id = "eda")
+ public void testEventFireFiresEvent()
{
BullTerrier.reset();
getInstanceByType(DogWhisperer.class).issueTamingCommand();
@@ -393,21 +390,21 @@
}
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "11.2.7", id = "a")
+ @SpecAssertion(section = "11.2.7", id = "review") // removed from spec?
public void testObserverMethodCallsManagerAddObserverWithObserverObject()
{
assert false;
}
@Test(groups = { "events", "underInvestigation" })
- @SpecAssertion(section = "10.4.1", id = "ee")
+ @SpecAssertion(section = "10.4.1", id = "review") // removed from spec?
public void testObserverMethodCallsManagerAddObserverWithAllBindingAnnotationsExceptFires()
{
assert false;
}
@Test(groups = { "events" }, expectedExceptions = IllegalArgumentException.class)
- @SpecAssertion(section = "11.2.9", id = "c")
+ @SpecAssertion(section = "11.3.11", id = "c")
public void testEventObjectContainsTypeVariablesWhenResolvingFails()
{
eventObjectContainsTypeVariables(new ArrayList<String>());
@@ -434,8 +431,8 @@
@Test(groups = { "events" })
@SpecAssertions( {
- @SpecAssertion(section = "10.2.2", id = "b"),
- @SpecAssertion(section = "10.2.2", id = "c")
+ @SpecAssertion(section = "10.2.3", id = "b"),
+ @SpecAssertion(section = "10.2.3", id = "c")
} )
public void testObserverMethodNotifiedWhenBindingsMatch()
{
@@ -445,56 +442,56 @@
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "a") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testEventTypeMappedToJmsTopic()
{
assert false;
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "b") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testEventMappingIsObserverMethodDeclaredByInterface()
{
assert false;
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "c") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testEventParameterSpecifiesMappedEventTypeAndBindings()
{
assert false;
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "d") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testMessageDestinationInjectedIsMappedTopic()
{
assert false;
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "e") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testEventMappingMemberOfAnyInterface()
{
assert false;
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "f") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testObserversOfJmsTopicMustBeAsynchronous()
{
assert false;
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "g") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testObserversNotifiedOfEventFromJmsTopic()
{
assert false;
}
@Test(groups = { "events", "stub" })
- @SpecAssertions( { @SpecAssertion(section = "10.7", id = "g") })
+ @SpecAssertions( { @SpecAssertion(section = "10.7", id = "review") }) // removed from spec?
public void testEventsDistributedToProcessesWithSameTypeAndJmsTopic()
{
assert false;
More information about the weld-commits
mailing list