Author: dan.j.allen
Date: 2009-06-24 18:43:38 -0400 (Wed, 24 Jun 2009)
New Revision: 2886
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/GenericBostonTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithTypeVariableEventTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithWildcardedEventTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/WildBostonTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AnotherEnabledDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/RegisterObserversUsingImplicitEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/registerUsingEvent/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/registerUsingEvent/beans.xml
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/FiresOnEventWithTypeVariableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/FiresOnEventWithWildcardTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/FiresOnEventWithoutTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer1/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3a/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer9/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/BostonTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodAndWildcardedEventTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AnotherDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/ImplicitEventBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/ChecksTypeParametersWhenResolvingTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/register/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/registerUsingEvent/fires1/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java
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/broken/event1/FiresOnNonEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/JavaSparrow_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/GoldbreastWaxbill_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/BlackRumpedWaxbill_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/ObserverMethodAnnotatedDisposesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/ObserverMethodAnnotatedInitialzerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/ObserverMethodAnnotatedProducesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/Terrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TooManyPhases_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TransactionalObserverMethodOnlyOnePhaseTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/Boxer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/ObserverMethodWithTwoEventParametersTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/YorkshireTerrier_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AuroraFinch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/BirdCage.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/BlueFacedParrotFinch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/FinchKeeper.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OneEyed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OneEyedLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OrangeCheekedWaxbill.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/StarFinch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeA.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotypeAnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AbstractEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AllEventTypesObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AllEventTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/ComplexEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/GeneralEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/AnotherFooObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/ChecksEventTypeWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/Foo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/FooObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/UnusedEventType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
continue bringing event tests in compliance with 20090519 spec
add two assertions from 20090610 spec that can be tested now (mark as such)
cleanups
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/RequestContextTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,7 +9,7 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -26,7 +26,6 @@
* @author David Allen
*
* Spec version: 20090519
- *
*/
@Artifact
public class RequestContextTest extends AbstractJSR299Test
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -6,6 +6,8 @@
import javax.event.Notify;
import javax.event.Observes;
+import org.jboss.jsr299.tck.impl.OldSPIBridge;
+
class TcasDisplay
{
@Current
@@ -27,7 +29,7 @@
public void drawNearMiss(@Observes(notifyObserver = Notify.ASYNCHRONOUSLY) NearMiss
event)
{
-
event.setBean(org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleRequestBean.class));
+ event.setBean(OldSPIBridge.getInstanceByType(beanManager,
SimpleRequestBean.class));
}
public static boolean isRequestScopeActive()
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-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -167,7 +167,10 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "11.2.8", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2.8", id = "a"),
+ @SpecAssertion(section = "11.2.8", id = "b")
+ })
public void testManagerInterfaceForFireEventMethod() throws Exception
{
assert BeanManager.class.getDeclaredMethod(FIRE_EVENT_METHOD_NAME, Object.class,
Annotation[].class) != null;
@@ -203,7 +206,10 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "11.2.9", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2.9", id = "a"),
+ @SpecAssertion(section = "11.2.9", id = "b")
+ })
public void testManagerResolveObserversSignature() throws Exception
{
assert
getCurrentManager().getClass().getDeclaredMethod(RESOLVE_OBSERVERS_METHOD_NAME,
Object.class, Annotation[].class) != null;
@@ -326,7 +332,8 @@
@Test(groups = { "events" })
@SpecAssertions({
@SpecAssertion(section = "10.6.1", id = "c"),
- @SpecAssertion(section = "10.6.1", id = "g")
+ @SpecAssertion(section = "10.6.1", id = "g"),
+ @SpecAssertion(section = "10.5.6", id = "a")
})
public void testAsynchronousObserverIsAsynchronous() throws Exception
{
@@ -628,8 +635,8 @@
assert false;
}
- @Test(groups = { "events" },
expectedExceptions=IllegalArgumentException.class)
- @SpecAssertion(section = "7.7", id = "b")
+ @Test(groups = { "events" }, expectedExceptions =
IllegalArgumentException.class)
+ @SpecAssertion(section = "11.2.9", id = "c")
public void testEventObjectContainsTypeVariablesWhenResolvingFails()
{
eventObjectContainsTypeVariables(new ArrayList<String>());
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -26,9 +26,11 @@
import org.testng.annotations.Test;
/**
- * Tests the use of @Any on an injection point that is
- * not an Event type.
+ * Tests that @Any can only be used to inject a selectable type,
+ * such as Event<T> or Instance<T>.
*
+ * FIXME this should be moved to the bean resolution section
+ *
* @author David Allen
*/
@Artifact
@@ -36,7 +38,6 @@
public class FiresOnNonEventTest extends AbstractJSR299Test
{
@Test(groups = { "events", "broken" })
- // Erm, not right anymore :-) PLM
@SpecAssertion(section = "7.6", id = "j")
public void testFiresAnnotationOnNonEventTypeInjectionPointFails() throws Exception
{
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4)
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/FiresOnEventWithTypeVariableTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/EventInjectionWithUndefinedTypeVariableTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.event.broken.inject.withTypeVariable;
+
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ * Tests an Event templated with an undefined type variable and annotated
+ * with {@link @Any} fails.
+ *
+ * @author David Allen
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class EventInjectionWithUndefinedTypeVariableTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events", "ri-broken" })
+ // TODO need spec assertion (see 10.3.1)
+ // I'm confused whether or not this should fail
+ public void testAnyAnnotationOnEventInjectionPointWithUndefinedTypeVariableFails()
+ {
+ assert false;
+ }
+}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/FiresOnEventWithTypeVariableTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/FiresOnEventWithTypeVariableTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/FiresOnEventWithTypeVariableTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.jsr299.tck.tests.event.broken.event4;
-
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DefinitionError;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
-import org.testng.annotations.Test;
-
-/**
- * Tests an Event templated with a type variable and annotated
- * with @Any fails.
- *
- * @author David Allen
- *
- */
-@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
-public class FiresOnEventWithTypeVariableTest extends AbstractJSR299Test
-{
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "l")
- public void testFiresAnnotationOnInjectionPointWithTypeVariabledTypeParameterFails()
- {
- assert false;
- }
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/JavaSparrow_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event4/JavaSparrow_Broken.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withTypeVariable/JavaSparrow_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,15 +1,13 @@
-package org.jboss.jsr299.tck.tests.event.broken.event4;
+package org.jboss.jsr299.tck.tests.event.broken.inject.withTypeVariable;
-import javax.enterprise.inject.Produces;
-import javax.event.Event;
import javax.enterprise.inject.Any;
+import javax.event.Event;
class JavaSparrow_Broken
{
-
- @Produces
- public <T> void produce(@Any Event<T> event)
+ public <T> Egg produce(@Any Event<T> event)
{
-
+ // event might be fired here in real code
+ return new Egg();
}
}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3)
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/FiresOnEventWithWildcardTypeTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/EventInjectionWithWildcardTypeTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.event.broken.inject.withWildcardType;
+
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ * Tests that an injection point for an Event object with a wildcard
+ * type parameter is treated as a definition error.
+ *
+ * @author David Allen
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class EventInjectionWithWildcardTypeTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events" })
+ // FIXME need spec assertion (see 10.3.1)
+ public void testAnyAnnotationOnEventInjectionPointWithWildcardTypeParameterFails()
+ {
+ assert false;
+ }
+
+}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/FiresOnEventWithWildcardTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/FiresOnEventWithWildcardTypeTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/FiresOnEventWithWildcardTypeTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.jsr299.tck.tests.event.broken.event3;
-
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DefinitionError;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
-import org.testng.annotations.Test;
-
-/**
- * Tests an injection point for an Event object with a wildcard
- * type parameter.
- *
- * @author David Allen
- *
- */
-@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
-public class FiresOnEventWithWildcardTypeTest extends AbstractJSR299Test
-{
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.6", id = "m")
- public void testFiresAnnotationOnInjectionPointWithWildcardedTypeParameterFails()
- {
- assert false;
- }
-
-
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/GoldbreastWaxbill_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event3/GoldbreastWaxbill_Broken.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withWildcardType/GoldbreastWaxbill_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,15 +1,10 @@
-package org.jboss.jsr299.tck.tests.event.broken.event3;
+package org.jboss.jsr299.tck.tests.event.broken.inject.withWildcardType;
-import javax.event.Event;
import javax.enterprise.inject.Any;
+import javax.event.Event;
class GoldbreastWaxbill_Broken
{
- @Any
- private Event<?> simpleEvent;
-
- public void eliminateWarning()
- {
- assert simpleEvent != null;
- }
+ @SuppressWarnings("unused")
+ private @Any Event<?> simpleEvent;
}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2)
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/BlackRumpedWaxbill_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/BlackRumpedWaxbill_Broken.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/BlackRumpedWaxbill_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,16 +1,10 @@
-package org.jboss.jsr299.tck.tests.event.broken.event2;
+package org.jboss.jsr299.tck.tests.event.broken.inject.withoutType;
-import javax.event.Event;
import javax.enterprise.inject.Any;
+import javax.event.Event;
class BlackRumpedWaxbill_Broken
{
- @SuppressWarnings("unchecked")
- @Any
- private Event simpleEvent;
-
- public void eliminateWarning()
- {
- assert simpleEvent != null;
- }
+ @SuppressWarnings({"unchecked", "unused"})
+ private @Any Event simpleEvent;
}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/EventInjectionWithoutTypeTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.broken.inject.withoutType;
+
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ * Tests if the Event object on an injection point annotated
+ * {@link @Any} has a type parameter for the actual type of event.
+ *
+ * @author David Allen
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class EventInjectionWithoutTypeTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events" })
+ // FIXME need spec assertion (see 10.4.1)
+ public void testAnyAnnotationOnEventInjectionPointWithoutTypeParameterFails()
+ {
+ assert false;
+ }
+
+}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/FiresOnEventWithoutTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/inject/withoutType/FiresOnEventWithoutTypeTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.jsr299.tck.tests.event.broken.event2;
-
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DefinitionError;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
-import org.testng.annotations.Test;
-
-/**
- * Tests if the Event object on an injection point annotated
- * @Any has a type parameter for the actual type of event.
- *
- * @author David Allen
- *
- */
-@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
-public class FiresOnEventWithoutTypeTest extends AbstractJSR299Test
-{
- @Test(groups = { "events", "broken" })
- @SpecAssertion(section = "7.6", id = "k")
- // TODO I don't think this matches any more
- public void testFiresAnnotationOnInjectionPointWithoutTypeParameterFails()
- {
- assert false;
- }
-
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6)
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/FoxTerrier.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer6;
-
-import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.event.Observes;
-
-class FoxTerrier
-{
- /* (non-Javadoc)
- * @see
org.jboss.jsr299.tck.unit.event.broken.observer6.Terrier#observeInitialized(javax.inject.manager.Manager,
java.lang.String)
- */
- public void observeInitialized(@Observes BeforeBeanDiscovery event, @Disposes String
badParam)
- {
- }
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/FoxTerrier.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.event.broken.observer.isDisposer;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.event.Observes;
+
+class FoxTerrier_Broken
+{
+ /* (non-Javadoc)
+ * @see
org.jboss.jsr299.tck.unit.event.broken.observer6.Terrier#observeInitialized(javax.inject.manager.Manager,
java.lang.String)
+ */
+ public void observeInitialized(@Observes BeforeBeanDiscovery event, @Disposes String
badParam)
+ {
+ }
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/ObserverMethodAnnotatedDisposesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/ObserverMethodAnnotatedDisposesTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/ObserverMethodAnnotatedDisposesTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,13 +9,13 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.jsr299.tck.tests.event.broken.observer6;
+package org.jboss.jsr299.tck.tests.event.broken.observer.isDisposer;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -29,15 +29,16 @@
* Tests an observer method that is also a disposes method
* for something else.
*
+ * Spec version: 20090519
+ *
* @author David Allen
- *
*/
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
public class ObserverMethodAnnotatedDisposesTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.2", id = "e")
+ @SpecAssertion(section = "10.5.2", id = "f")
public void testObserverMethodWithDisposesParamFails()
{
assert false;
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5)
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/AustralianTerrier.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer5;
-
-import javax.enterprise.inject.Initializer;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.event.Observes;
-
-class AustralianTerrier
-{
- /* (non-Javadoc)
- * @see
org.jboss.jsr299.tck.unit.event.broken.observer5.Terrier#observeInitialized(javax.inject.manager.Manager)
- */
- @Initializer
- public void observeInitialized(@Observes BeforeBeanDiscovery discovery)
- {
- }
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/AustralianTerrier.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.event.broken.observer.isInitializer;
+
+import javax.enterprise.inject.Initializer;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.event.Observes;
+
+class AustralianTerrier_Broken
+{
+ public @Initializer void observesAfterBeanDiscovery(@Observes AfterBeanDiscovery
discovery)
+ {
+ }
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/ObserverMethodAnnotatedInitialzerTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/ObserverMethodAnnotatedInitialzerTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/ObserverMethodAnnotatedInitialzerTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,13 +9,13 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.jsr299.tck.tests.event.broken.observer5;
+package org.jboss.jsr299.tck.tests.event.broken.observer.isInitializer;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -29,15 +29,16 @@
* Tests an observer method that is also annotated as an
* initializer method.
*
+ * Spec version: 20090519
+ *
* @author David Allen
- *
*/
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
public class ObserverMethodAnnotatedInitialzerTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.2", id = "d")
+ @SpecAssertion(section = "10.5.2", id = "e")
public void testObserverMethodAnnotatedInitializerFails()
{
assert false;
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4)
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/BorderTerrier.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer4;
-
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.event.Observes;
-
-class BorderTerrier
-{
- @Produces
- public String observeInitialized(@Observes BeforeBeanDiscovery event)
- {
- return "product";
- }
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/BorderTerrier.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.event.broken.observer.isProducer;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.event.Observes;
+
+class BorderTerrier_Broken
+{
+ public @Produces String observesAfterBeanDiscovery(@Observes AfterBeanDiscovery
event)
+ {
+ return "product";
+ }
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/ObserverMethodAnnotatedProducesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/ObserverMethodAnnotatedProducesTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/ObserverMethodAnnotatedProducesTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,13 +9,13 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.jsr299.tck.tests.event.broken.observer4;
+package org.jboss.jsr299.tck.tests.event.broken.observer.isProducer;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -28,15 +28,16 @@
/**
* Tests an observer method which is also annotated as a producer method.
*
+ * Spec version: 20090519
+ *
* @author David Allen
- *
*/
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
public class ObserverMethodAnnotatedProducesTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- @SpecAssertion(section = "7.5.2", id = "c")
+ @SpecAssertion(section = "10.5.2", id = "d")
public void testObserverMethodAnnotatedProducesFails()
{
assert false;
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer1)
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer1/EJBObserverMethodNotBusinessMethodTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,15 +9,13 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.jboss.jsr299.tck.tests.event.broken.observer.notBusinessMethod;
-package org.jboss.jsr299.tck.tests.event.broken.observer1;
-
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -29,19 +27,20 @@
import org.testng.annotations.Test;
/**
- * Test an observer method on an EJB that is neither a business method
- * nor a static method of the class.
+ * Test an observer method on an EJB that is neither a business method nor a
+ * static method of the class.
*
+ * Spec version: 20090519
+ *
* @author David Allen
- *
*/
@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
@Packaging(PackagingType.EAR)
+(a)ExpectedDeploymentException(DefinitionError.class)
public class EJBObserverMethodNotBusinessMethodTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5", id = "d"),
@SpecAssertion(section = "7.5.2", id = "f")} )
+ @SpecAssertions( { @SpecAssertion(section = "10.5", id = "d"),
@SpecAssertion(section = "10.5.2", id = "g") })
public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails()
{
assert false;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/Terrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer1/Terrier.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/Terrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,9 +1,9 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer1;
+package org.jboss.jsr299.tck.tests.event.broken.observer.notBusinessMethod;
import javax.ejb.Local;
@Local
-public interface Terrier
+interface Terrier
{
}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer1/TibetanTerrier.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,13 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer1;
-
-import javax.ejb.Stateless;
-import javax.event.Observes;
-
-
-@Stateless
-class TibetanTerrier implements Terrier
-{
- public void observeInitialized(@Observes String someEvent)
- {
- }
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer1/TibetanTerrier.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.event.broken.observer.notBusinessMethod;
+
+import javax.ejb.Stateless;
+import javax.event.Observes;
+
+@Stateless
+class TibetanTerrier_Broken implements Terrier
+{
+ public void observeSomeEvent(@Observes String someEvent)
+ {
+ }
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TooManyPhases_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TooManyPhases_Broken.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TooManyPhases_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,12 +9,11 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.jboss.jsr299.tck.tests.event.broken.observer7;
import javax.event.AfterTransactionFailure;
@@ -26,12 +25,10 @@
* specified.
*
* @author David Allen
- *
*/
public class TooManyPhases_Broken
{
public void observeSomething(@Observes @AfterTransactionSuccess
@AfterTransactionFailure String event)
{
-
}
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TransactionalObserverMethodOnlyOnePhaseTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TransactionalObserverMethodOnlyOnePhaseTest.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer7/TransactionalObserverMethodOnlyOnePhaseTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,7 +9,7 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -43,5 +43,4 @@
assert false;
}
-
}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2)
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/Boxer.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/Boxer.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/Boxer.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,11 +1,5 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer2;
+package org.jboss.jsr299.tck.tests.event.broken.tooManyObserverParameters;
-import javax.ejb.Stateless;
-import javax.enterprise.context.ConversationScoped;
-
-@Stateless
-@ConversationScoped
class Boxer
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/ObserverMethodWithTwoEventParametersTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/ObserverMethodWithTwoEventParametersTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/ObserverMethodWithTwoEventParametersTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,6 +1,5 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer2;
+package org.jboss.jsr299.tck.tests.event.broken.tooManyObserverParameters;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -9,16 +8,18 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
public class ObserverMethodWithTwoEventParametersTest extends AbstractJSR299Test
{
@Test(groups = { "events" })
- @SpecAssertions( { @SpecAssertion(section = "7.5.1", id = "a"),
@SpecAssertion(section = "7.5.2", id = "b") })
+ @SpecAssertions( { @SpecAssertion(section = "10.5.1", id = "a"),
@SpecAssertion(section = "10.5.2", id = "b") })
public void testObserverMethodMustHaveOnlyOneEventParameter()
{
assert false;
}
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/YorkshireTerrier_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/YorkshireTerrier_Broken.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/tooManyObserverParameters/YorkshireTerrier_Broken.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,12 +1,11 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer2;
+package org.jboss.jsr299.tck.tests.event.broken.tooManyObserverParameters;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.event.Observes;
-
class YorkshireTerrier_Broken
{
- public void observeInitialized(@Observes BeforeBeanDiscovery beforeBeanDiscovery,
@Observes Boxer anotherDog)
+ public void observesAfterBeanDiscovery(@Observes AfterBeanDiscovery
beforeBeanDiscovery, @Observes Boxer anotherDog)
{
}
}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3)
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/BostonTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3/BostonTerrier.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/BostonTerrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.broken.observer3;
-
-import java.util.List;
-
-import javax.event.Observes;
-
-class BostonTerrier
-{
- public void observesBadEvent(@Observes List<?> someArray)
- {
- }
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/GenericBostonTerrier.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3a/BostonTerrier.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/GenericBostonTerrier.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/GenericBostonTerrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.event.observer.wildcardAndGenericType;
+
+import java.util.List;
+
+import javax.event.Observes;
+
+class GenericBostonTerrier
+{
+ public <T> void observesEventWithTypeParameter(@Observes List<T>
someArray)
+ {
+ }
+}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodAndWildcardedEventTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3/ObserverMethodAndWildcardedEventTypeTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodAndWildcardedEventTypeTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.jsr299.tck.tests.event.broken.observer3;
-
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DefinitionError;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
-import org.testng.annotations.Test;
-
-/**
- * Tests an observer method defined to observe an event type which
- * is generic and wildcarded.
- *
- * @author David Allen
- *
- */
-@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
-public class ObserverMethodAndWildcardedEventTypeTest extends AbstractJSR299Test
-{
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.5.1", id = "c")
- public void testObserverMethodCannotObserveParameterizedEvents()
- {
- assert false;
- }
-
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithTypeVariableEventTypeTest.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3a/ObserverMethodAndTypeVariableEventTypeTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithTypeVariableEventTypeTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithTypeVariableEventTypeTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.event.observer.wildcardAndGenericType;
+
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ * Tests an observer method defined to observe an event type which
+ * is generic and wildcarded.
+ *
+ * Spec version: 20090610
+ *
+ * @author David Allen
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class ObserverMethodWithTypeVariableEventTypeTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events", "ri-broken" })
+ @SpecAssertion(section = "10.5.1", id = "cb")
+ public void testObserverMethodCanObserveParameterizedEvents()
+ {
+ assert false;
+ }
+
+}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithWildcardedEventTypeTest.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3/ObserverMethodAndWildcardedEventTypeTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithWildcardedEventTypeTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithWildcardedEventTypeTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.observer.wildcardAndGenericType;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Tests an observer method defined to observe an event type which
+ * is generic and wildcarded.
+ *
+ * Spec version: 20090610
+ *
+ * @author David Allen
+ */
+@Artifact
+public class ObserverMethodWithWildcardedEventTypeTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events", "ri-broken" })
+ @SpecAssertion(section = "10.5.1", id = "ca")
+ public void testObserverMethodCanObserveParameterizedEvents()
+ {
+ assert false;
+ }
+
+}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/WildBostonTerrier.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer3/BostonTerrier.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/WildBostonTerrier.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/WildBostonTerrier.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.event.observer.wildcardAndGenericType;
+
+import java.util.List;
+
+import javax.event.Observes;
+
+class WildBostonTerrier
+{
+ public void observesEventTypeWithWildcard(@Observes List<?> someArray)
+ {
+ }
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1)
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AnotherDeploymentType.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/AnotherDeploymentType.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AnotherDeploymentType.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,20 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.deployment.DeploymentType;
-
-@Target( { TYPE, METHOD })
-@Retention(RUNTIME)
-@Documented
-@DeploymentType
-@interface AnotherDeploymentType
-{
-
-}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AnotherEnabledDeploymentType.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/AnotherDeploymentType.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AnotherEnabledDeploymentType.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AnotherEnabledDeploymentType.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.deployment.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface AnotherEnabledDeploymentType
+{
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AuroraFinch.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/AuroraFinch.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/AuroraFinch.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,19 +1,16 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.Initializer;
import javax.event.Event;
-import javax.enterprise.inject.Any;
-import org.jboss.jsr299.tck.tests.event.register.fires1.StarFinch.Mess;
+import org.jboss.jsr299.tck.tests.event.registerUsingEvent.StarFinch.Mess;
-
class AuroraFinch
{
-
private Mess someMess;
- @Initializer
- public AuroraFinch(@Any Event<Mess> eventObject)
+ public @Initializer AuroraFinch(@Any Event<Mess> eventObject)
{
// Create a new mess and fire the event for it
someMess = new Mess("smallMess");
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/BirdCage.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BirdCage.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/BirdCage.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,17 +1,14 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Current;
-import javax.enterprise.inject.Named;
-import org.jboss.jsr299.tck.tests.event.register.fires1.StarFinch.Mess;
+import org.jboss.jsr299.tck.tests.event.registerUsingEvent.StarFinch.Mess;
@RequestScoped
-@Named("BirdCage")
class BirdCage
{
- @Current
- private Mess someMess;
+ private @Current Mess someMess;
public BirdCage()
{
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/BlueFacedParrotFinch.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/BlueFacedParrotFinch.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,25 +1,23 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
-import javax.event.Event;
import javax.enterprise.inject.Any;
+import javax.event.Event;
import javax.event.Observer;
class BlueFacedParrotFinch
{
- @Any
- protected Event<Integer> simpleEvent;
+ protected @Any Event<Integer> simpleEvent;
- @Any @Tame
- protected Event<String> simpleStringEvent;
+ protected @Any @Tame Event<String> simpleStringEvent;
public static boolean simpleStringEventObserved = false;
- public void methodThatFiresEvent()
+ public void methodThatFiresIntegerEvent()
{
simpleEvent.fire(new Integer(42));
}
- public void methodThatRegistersObserver()
+ public void methodThatRegistersIntegerObserver()
{
simpleEvent.observe(new Observer<Integer>()
{
@@ -30,12 +28,12 @@
});
}
- public void methodThatFiresAnotherEvent()
+ public void methodThatFiresStringEvent()
{
- simpleStringEvent.fire("the answer to life", new OneEyedLiteral());
+ simpleStringEvent.fire("string event", new OneEyedLiteral());
}
- public void methodThatRegistersAnotherObserver()
+ public void methodThatRegistersStringObserver()
{
simpleStringEvent.observe(new Observer<String>()
{
@@ -46,4 +44,5 @@
}
});
}
+
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/FinchKeeper.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/FinchKeeper.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/FinchKeeper.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,19 +1,13 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Named;
import javax.event.Observes;
-import org.jboss.jsr299.tck.tests.event.register.fires1.StarFinch.Mess;
+import org.jboss.jsr299.tck.tests.event.registerUsingEvent.StarFinch.Mess;
@RequestScoped
-@Named("FinchKeeper")
class FinchKeeper
{
- public FinchKeeper()
- {
- }
-
private boolean newMessDetected = false;
public void observesMesses(@Observes Mess aNewMess)
@@ -25,4 +19,9 @@
{
return newMessDetected;
}
+
+ public void reset()
+ {
+ newMessDetected = false;
+ }
}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/ImplicitEventBeanTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/ImplicitEventBeanTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,125 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.jsr299.tck.tests.event.register.fires1;
-
-import java.util.Set;
-
-import javax.event.Observer;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.testng.annotations.Test;
-
-/**
- * Tests proper functioning of the implicit event bean injected when @Any is
- * used on an Event<T> type.
- *
- * @author David Allen
- */
-@Artifact
-(a)BeansXml("beans.xml")
-public class ImplicitEventBeanTest extends AbstractJSR299Test
-{
- @Test(groups = { "events" })
- @SpecAssertions( {
- @SpecAssertion(section = "7.6", id = "b"),
- @SpecAssertion(section = "7.6", id = "c"),
- @SpecAssertion(section = "7.6", id = "d"),
- @SpecAssertion(section = "7.6", id = "i"),
- @SpecAssertion(section = "7.6", id = "t"),
- @SpecAssertion(section = "7.6", id = "v")
- })
- public void testFiresAnnotationOnEventTypes() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- BlueFacedParrotFinch bean = getInstanceByType(BlueFacedParrotFinch.class);
- bean.methodThatRegistersObserver();
-
- Set<Observer<Integer>> observers =
getCurrentManager().resolveObservers(new Integer(78));
- assert observers.size() == 1;
- }
-
- }.run();
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- BlueFacedParrotFinch.simpleStringEventObserved = false;
- BlueFacedParrotFinch bean = getInstanceByType(BlueFacedParrotFinch.class);
- bean.methodThatRegistersAnotherObserver();
- bean.methodThatFiresAnotherEvent();
- assert BlueFacedParrotFinch.simpleStringEventObserved;
- }
-
- }.run();
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- StarFinch starFinch = getInstanceByType(StarFinch.class);
- FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
- BirdCage birdCage = getInstanceByType(BirdCage.class);
- assert starFinch != null;
- assert birdCage != null;
- assert birdCage.getSomeMess() != null;
- assert birdKeeper.isNewMessDetected();
- }
-
- }.run();
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- OrangeCheekedWaxbill bird = getInstanceByType(OrangeCheekedWaxbill.class);
- FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
- assert bird != null;
- assert bird.getSomeMess() != null;
- assert birdKeeper.isNewMessDetected();
- }
-
- }.run();
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- AuroraFinch bird = getInstanceByType(AuroraFinch.class);
- FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
- assert bird != null;
- assert birdKeeper.isNewMessDetected();
- }
-
- }.run();
- }
-
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OneEyed.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/OneEyed.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OneEyed.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
@@ -18,5 +18,4 @@
@BindingType
@interface OneEyed
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OneEyedLiteral.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/OneEyedLiteral.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OneEyedLiteral.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,8 +1,7 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
import javax.enterprise.inject.AnnotationLiteral;
-public class OneEyedLiteral extends AnnotationLiteral<OneEyed> implements OneEyed
+class OneEyedLiteral extends AnnotationLiteral<OneEyed> implements OneEyed
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OrangeCheekedWaxbill.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/OrangeCheekedWaxbill.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/OrangeCheekedWaxbill.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,14 +1,13 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.Initializer;
import javax.event.Event;
-import javax.enterprise.inject.Any;
-import org.jboss.jsr299.tck.tests.event.register.fires1.StarFinch.Mess;
+import org.jboss.jsr299.tck.tests.event.registerUsingEvent.StarFinch.Mess;
class OrangeCheekedWaxbill
{
-
private Mess someMess;
private Event<Mess> injectedEvent;
@@ -16,8 +15,7 @@
{
}
- @Initializer
- public void theInitializerMethod(@Any @Tame Event<Mess> eventObject)
+ public @Initializer void theInitializerMethod(@Any @Tame Event<Mess>
eventObject)
{
// Create a new mess and fire the event for it
someMess = new Mess("tameMess");
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/RegisterObserversUsingImplicitEventTest.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/RegisterObserversUsingImplicitEventTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/RegisterObserversUsingImplicitEventTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
+
+import java.util.Set;
+
+import javax.event.Observer;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * Tests proper functioning of the implicit event bean to register
+ * observers and have those observers observe the events fired
+ * from the same event bean or matching the same event type.
+ *
+ * Spec version: 20090519
+ *
+ * @author David Allen
+ * @author Dan Allen
+ */
+@Artifact
+(a)BeansXml("beans.xml")
+public class RegisterObserversUsingImplicitEventTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "10.4", id = "a"),
+ @SpecAssertion(section = "10.4", id = "b"),
+ @SpecAssertion(section = "10.4", id = "c"),
+ @SpecAssertion(section = "10.4", id = "e"),
+ @SpecAssertion(section = "10.4.1", id = "c"),
+ @SpecAssertion(section = "10.4.1", id = "d"),
+ @SpecAssertion(section = "11.2.7", id = "c")
+ })
+ public void testRegisterObserversObserveFiredEvents() throws Exception
+ {
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Integer payload = new Integer(7);
+ Set<Observer<Integer>> observers =
getCurrentManager().resolveObservers(payload);
+ assert observers.size() == 0;
+
+ BlueFacedParrotFinch bean = getInstanceByType(BlueFacedParrotFinch.class);
+ bean.methodThatRegistersIntegerObserver();
+
+ observers = getCurrentManager().resolveObservers(payload);
+ assert observers.size() == 1;
+ getCurrentManager().removeObserver(observers.iterator().next());
+ }
+
+ }.run();
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ BlueFacedParrotFinch.simpleStringEventObserved = false;
+ BlueFacedParrotFinch bean = getInstanceByType(BlueFacedParrotFinch.class);
+ bean.methodThatRegistersStringObserver();
+ bean.methodThatFiresStringEvent();
+ assert BlueFacedParrotFinch.simpleStringEventObserved;
+ }
+
+ }.run();
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ // When BirdCage is intantiated, the Mess produced by StarFinch is injected.
+ // The producer fires an event of type Mess which the BirdKeeper observes.
+ StarFinch starFinch = getInstanceByType(StarFinch.class);
+ FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
+ BirdCage birdCage = getInstanceByType(BirdCage.class);
+ assert starFinch != null;
+ assert birdCage != null;
+ assert birdCage.getSomeMess() != null;
+ assert birdKeeper.isNewMessDetected();
+ birdKeeper.reset();
+ }
+
+ }.run();
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ // The initializer for OrangeCheekedWaxBill instantiates a Mess, assigns
+ // it to a local property named someMess and fires an event using that
object
+ // with the binding type @Tame, which the BirdKeeper observes.
+ OrangeCheekedWaxbill bird = getInstanceByType(OrangeCheekedWaxbill.class);
+ FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
+ assert bird != null;
+ assert bird.getSomeMess() != null;
+ assert birdKeeper.isNewMessDetected();
+ birdKeeper.reset();
+ }
+
+ }.run();
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ // The initializer for AuroraFinch instantiates a Mess, assigns
+ // it to a local property named someMess and fires an event using that
object,
+ // which the BirdKeeper observes.
+ AuroraFinch bird = getInstanceByType(AuroraFinch.class);
+ FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
+ assert bird != null;
+ assert bird.getSomeMess() != null;
+ assert birdKeeper.isNewMessDetected();
+ birdKeeper.reset();
+ }
+
+ }.run();
+ }
+
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/StarFinch.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/StarFinch.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/StarFinch.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,18 +1,15 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
-import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.Produces;
import javax.event.Event;
-import javax.enterprise.inject.Any;
-@Named("StarFinch")
public class StarFinch
{
public static class Mess
{
public Mess(String name)
{
-
}
}
@@ -20,8 +17,7 @@
{
}
- @Produces @AnotherDeploymentType
- public Mess producerOfMesses(@Any Event<Mess> messEvent)
+ public @Produces @AnotherEnabledDeploymentType Mess producerOfMesses(@Any
Event<Mess> messEvent)
{
Mess newMess = new Mess("bigMess");
messEvent.fire(newMess);
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/Tame.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/Tame.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/registerUsingEvent/Tame.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.register.fires1;
+package org.jboss.jsr299.tck.tests.event.registerUsingEvent;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
@@ -18,5 +18,4 @@
@BindingType
@interface Tame
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeA.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeA.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeA.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -18,5 +18,4 @@
@BindingType
@interface BindingTypeA
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -2,4 +2,6 @@
import javax.enterprise.inject.AnnotationLiteral;
-public class BindingTypeABinding extends AnnotationLiteral<BindingTypeA> implements
BindingTypeA {}
\ No newline at end of file
+public class BindingTypeABinding extends AnnotationLiteral<BindingTypeA> implements
BindingTypeA
+{
+}
\ No newline at end of file
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeBBinding.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -2,4 +2,6 @@
import javax.enterprise.inject.AnnotationLiteral;
-public class BindingTypeBBinding extends AnnotationLiteral<BindingTypeB> implements
BindingTypeB {}
\ No newline at end of file
+public class BindingTypeBBinding extends AnnotationLiteral<BindingTypeB> implements
BindingTypeB
+{
+}
\ No newline at end of file
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeCBinding.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -4,16 +4,15 @@
public class BindingTypeCBinding extends AnnotationLiteral<BindingTypeC> implements
BindingTypeC
{
+ private String value;
- private String stringValue;
-
public BindingTypeCBinding(String value)
{
- this.stringValue = value;
+ this.value = value;
}
public String value()
{
- return this.stringValue;
+ return this.value;
}
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -7,6 +7,9 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
public class DuplicateBindingTypesWhenResolvingTest extends AbstractJSR299Test
{
@@ -26,7 +29,7 @@
}
@Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertion(section = "7.7", id = "d")
+ @SpecAssertion(section = "11.2.9", id = "d")
public void testDuplicateBindingTypesWhenResolvingFails()
{
AnObserver observer = new AnObserver();
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -5,6 +5,7 @@
import javax.event.Observer;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -28,7 +29,11 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "g")
+ @SpecAssertions({
+ @SpecAssertion(section = "10.5.1", id = "a"),
+ @SpecAssertion(section = "10.2.1", id = "a"),
+ @SpecAssertion(section = "10.2.1", id = "b")
+ })
public void testResolvingChecksBindingTypeMembers()
{
AnObserver observer = new AnObserver();
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotype.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotype.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotype.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -17,5 +17,4 @@
@RequestScoped
@interface AnimalStereotype
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotypeAnnotationLiteral.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotypeAnnotationLiteral.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/AnimalStereotypeAnnotationLiteral.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -4,5 +4,4 @@
class AnimalStereotypeAnnotationLiteral extends AnnotationLiteral<AnimalStereotype>
implements AnimalStereotype
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,6 +9,9 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
public class NonBindingTypesWhenResolvingTest extends AbstractJSR299Test
{
@@ -28,7 +31,7 @@
}
@Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
- @SpecAssertion(section = "7.7", id = "e")
+ @SpecAssertion(section = "11.2.9", id = "e")
public void testNonBindingTypeAnnotationWhenResolvingFails()
{
AnObserver observer = new AnObserver();
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily
(from rev 2883, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall)
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AbstractEvent.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/AbstractEvent.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AbstractEvent.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,21 +9,19 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.jboss.jsr299.tck.tests.event.resolve.typeFamily;
-package org.jboss.jsr299.tck.tests.event.firesall;
-
-
/**
- * Abstract level of event hierarchy used to test firing
- * a concrete type and observing each of the event types
- * associated with that concrete type.
+ * Abstract level of event hierarchy used to test firing a concrete type and
+ * observing each of the event types associated with that concrete type.
*
* @author David Allen
- *
*/
-abstract class AbstractEvent implements GeneralEvent {}
\ No newline at end of file
+abstract class AbstractEvent implements GeneralEvent
+{
+}
\ No newline at end of file
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AllEventTypesObserver.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/AllEventTypesObserver.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AllEventTypesObserver.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,23 +9,20 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.jboss.jsr299.tck.tests.event.resolve.typeFamily;
-package org.jboss.jsr299.tck.tests.event.firesall;
-
import javax.event.Observes;
-
/**
* This class declares observer methods for every superclass and interface
* contained in the hierarchy for the {@link ComplexEvent} event type.
*
* @author David Allen
- *
*/
class AllEventTypesObserver
{
@@ -33,29 +30,31 @@
private static int generalEventQuantity = 0;
private static int abstractEventQuantity = 0;
private static int complexEventQuantity = 0;
-
+
public void observeObject(@Observes Object event)
{
// Avoid counting implicit container events
if (event instanceof ComplexEvent)
+ {
objectEventQuantity++;
+ }
}
-
+
public void observeGeneralEvent(@Observes GeneralEvent event)
{
generalEventQuantity++;
}
-
+
public void observeAbstractEvent(@Observes AbstractEvent event)
{
abstractEventQuantity++;
}
-
+
public void observeComplexEvent(@Observes ComplexEvent event)
{
complexEventQuantity++;
}
-
+
public int getTotalEventsObserved()
{
return objectEventQuantity + generalEventQuantity + abstractEventQuantity +
complexEventQuantity;
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AllEventTypesTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/AllEventTypesTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/AllEventTypesTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,27 +1,23 @@
-package org.jboss.jsr299.tck.tests.event.firesall;
+package org.jboss.jsr299.tck.tests.event.resolve.typeFamily;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
public class AllEventTypesTest extends AbstractJSR299Test
{
- /**
- * The event types of the event include all superclasses and interfaces of
- * the class of the event object.
- *
- * @throws Exception
- */
@Test(groups = { "events" })
- @SpecAssertion(section = "7.1", id = "c")
+ @SpecAssertion(section = "10.1", id = "c")
public void testEventTypeIncludesAllSuperclassesAndInterfacesOfEventObject() throws
Exception
{
// Fire a single complex type of event with many observers
new RunInDependentContext()
{
-
@Override
protected void execute() throws Exception
{
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/ComplexEvent.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/ComplexEvent.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/ComplexEvent.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,23 +9,19 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.jboss.jsr299.tck.tests.event.resolve.typeFamily;
-package org.jboss.jsr299.tck.tests.event.firesall;
-
-
/**
- * An event type with a class/interface hierarchy complex enough
- * to test observing all event types.
+ * An event type with a class/interface hierarchy complex enough to test
+ * observing all event types.
*
* @author David Allen
- *
*/
public class ComplexEvent extends AbstractEvent implements GeneralEvent
{
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/GeneralEvent.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/GeneralEvent.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeFamily/GeneralEvent.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,19 +9,18 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.jboss.jsr299.tck.tests.event.resolve.typeFamily;
-package org.jboss.jsr299.tck.tests.event.firesall;
-
/**
- * Arbitrary interface to test firing events and observing all
- * event types.
+ * Arbitrary interface to test firing events and observing all event types.
*
* @author David Allen
- *
*/
-interface GeneralEvent {}
+interface GeneralEvent
+{
+}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type)
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/AnotherFooObserver.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/AnotherFooObserver.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/AnotherFooObserver.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,13 +1,11 @@
-package org.jboss.jsr299.tck.tests.event.resolve.type;
+package org.jboss.jsr299.tck.tests.event.resolve.typeWithParameters;
import javax.event.Observes;
public class AnotherFooObserver
{
-
public void observe(@Observes Foo<Integer> foo)
{
foo.setObserved(true);
}
-
}
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java
(from rev 2883,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java)
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/CheckTypeParametersWhenResolvingObserversTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,84 @@
+package org.jboss.jsr299.tck.tests.event.resolve.typeWithParameters;
+
+import java.util.ArrayList;
+
+import javax.event.Observer;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Spec version: 20090519
+ */
+@Artifact
+public class CheckTypeParametersWhenResolvingObserversTest extends AbstractJSR299Test
+{
+ public static class CharacterList extends ArrayList<Character>
+ {
+ private static final long serialVersionUID = 1L;
+ }
+
+ public static class StringList extends ArrayList<String>
+ {
+ private static final long serialVersionUID = 1L;
+ }
+
+ public static class IntegerList extends ArrayList<Integer>
+ {
+ private static final long serialVersionUID = 1L;
+ }
+
+ public static class StringListObserver implements
Observer<ArrayList<String>>
+ {
+ public boolean wasNotified = false;
+
+ public boolean notify(ArrayList<String> event)
+ {
+ wasNotified = true;
+ return false;
+ }
+ }
+
+ public static class IntegerListObserver implements
Observer<ArrayList<Integer>>
+ {
+ public boolean wasNotified = false;
+
+ public boolean notify(ArrayList<Integer> event)
+ {
+ wasNotified = true;
+ return false;
+ }
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions({
+ @SpecAssertion(section = "10.5.1", id = "a"),
+ @SpecAssertion(section = "11.2.9", id = "a")
+ })
+ public void testResolvingChecksTypeParameters()
+ {
+ StringListObserver observer = new StringListObserver();
+ IntegerListObserver anotherObserver = new IntegerListObserver();
+ getCurrentManager().addObserver(observer);
+ getCurrentManager().addObserver(anotherObserver);
+ assert getCurrentManager().resolveObservers(new StringList()).size() == 1;
+ assert getCurrentManager().resolveObservers(new
StringList()).iterator().next().getClass().equals(StringListObserver.class);
+ assert getCurrentManager().resolveObservers(new CharacterList()).size() == 0;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions({
+ @SpecAssertion(section = "10.2", id = "h"),
+ @SpecAssertion(section = "10.5", id = "a")
+ // FIXME also 10.3.1, which does not yet have spec assertions cataloged
+ })
+ public void testResolvingChecksTypeParametersOnObservesMethod()
+ {
+ Foo<String> fooEvent = new Foo<String>() {};
+ getCurrentManager().fireEvent(fooEvent);
+ assert fooEvent.isObserved();
+ }
+}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/ChecksEventTypeWhenResolvingTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/ChecksEventTypeWhenResolvingTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.resolve.type;
+package org.jboss.jsr299.tck.tests.event.resolve.typeWithParameters;
import java.util.Set;
@@ -9,6 +9,9 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+/**
+ * Spec version: 20090519
+ */
@Artifact
public class ChecksEventTypeWhenResolvingTest extends AbstractJSR299Test
{
@@ -28,7 +31,7 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "f")
+ @SpecAssertion(section = "10.5.1", id = "a")
public void testResolvingChecksEventType()
{
Observer<AnEventType> observer = new AnObserver();
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/ChecksTypeParametersWhenResolvingTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/ChecksTypeParametersWhenResolvingTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,70 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.resolve.type;
-
-import java.util.ArrayList;
-
-import javax.event.Observer;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-@Artifact
-public class ChecksTypeParametersWhenResolvingTest extends AbstractJSR299Test
-{
-
- public static class AList extends ArrayList<String>
- {
- private static final long serialVersionUID = 1L;
-
- }
-
- public static class AnotherList extends ArrayList<Integer>
- {
- private static final long serialVersionUID = 1L;
-
- }
-
- public static class AListObserver implements Observer<ArrayList<String>>
- {
- public boolean wasNotified = false;
-
- public boolean notify(ArrayList<String> event)
- {
- wasNotified = true;
- return false;
- }
- }
-
- public static class AnotherListObserver implements
Observer<ArrayList<Integer>>
- {
- public boolean wasNotified = false;
-
- public boolean notify(ArrayList<Integer> event)
- {
- wasNotified = true;
- return false;
- }
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "f")
- public void testResolvingChecksTypeParameters()
- {
- AListObserver observer = new AListObserver();
- AnotherListObserver anotherObserver = new AnotherListObserver();
- getCurrentManager().addObserver(observer);
- getCurrentManager().addObserver(anotherObserver);
- assert getCurrentManager().resolveObservers(new AList()).size() == 1;
- assert getCurrentManager().resolveObservers(new
AList()).iterator().next().getClass().equals(AListObserver.class);
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "7.7", id = "f")
- public void testResolvingChecksTypeParametersOnObservesMethod()
- {
- Foo<String> fooEvent = new Foo<String>() {};
- getCurrentManager().fireEvent(fooEvent);
- assert fooEvent.isObserved();
- }
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/Foo.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/Foo.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/Foo.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,8 +1,7 @@
-package org.jboss.jsr299.tck.tests.event.resolve.type;
+package org.jboss.jsr299.tck.tests.event.resolve.typeWithParameters;
public class Foo<T>
{
-
private boolean observed;
public boolean isObserved()
@@ -15,5 +14,4 @@
assert !this.observed : "Event should only be observed once";
this.observed = observed;
}
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/FooObserver.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/FooObserver.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/FooObserver.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,13 +1,11 @@
-package org.jboss.jsr299.tck.tests.event.resolve.type;
+package org.jboss.jsr299.tck.tests.event.resolve.typeWithParameters;
import javax.event.Observes;
public class FooObserver
{
-
public void observe(@Observes Foo<String> foo)
{
foo.setObserved(true);
}
-
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/UnusedEventType.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/UnusedEventType.java 2009-06-24
12:53:37 UTC (rev 2883)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/typeWithParameters/UnusedEventType.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,9 +1,8 @@
-package org.jboss.jsr299.tck.tests.event.resolve.type;
+package org.jboss.jsr299.tck.tests.event.resolve.typeWithParameters;
class UnusedEventType
{
public UnusedEventType(String name)
{
-
}
}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-06-24
22:43:38 UTC (rev 2886)
@@ -9,7 +9,7 @@
* You may obtain a copy of the License at
*
http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@@ -52,7 +52,7 @@
private PomeranianInterface dog = null;
@Override
- public void beforeMethod()
+ public void beforeMethod()
{
super.beforeMethod();
dog = (PomeranianInterface) getInstanceByName("Teddy");
@@ -85,7 +85,7 @@
// assert dog.isCorrectContext();
}
- @Test(groups = { "events", "integration" })
+ @Test(groups = { "events", "integration", "broken" })
@SpecAssertions( { @SpecAssertion(section = "7.5.6", id = "c"),
@SpecAssertion(section = "7.5.6", id = "i"), @SpecAssertion(section =
"7.5.8", id = "d"), @SpecAssertion(section = "7.5.8", id =
"f") })
public void testAfterTransactionCompletionObserver() throws InterruptedException
{
@@ -98,9 +98,9 @@
assert dog.isCorrectTransactionState();
}
- @Test(groups = { "events", "integration" })
- @SpecAssertions( {
- @SpecAssertion(section = "7.5.6", id = "d"),
+ @Test(groups = { "events", "integration", "broken" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "7.5.6", id = "d"),
@SpecAssertion(section = "7.5.6", id = "j") })
public void testAfterTransactionSuccessObserver() throws InterruptedException
{
@@ -113,8 +113,8 @@
}
@Test(groups = { "events", "integration", "ri-broken"
})
- @SpecAssertions( {
- @SpecAssertion(section = "7.5.6", id = "e"),
+ @SpecAssertions( {
+ @SpecAssertion(section = "7.5.6", id = "e"),
@SpecAssertion(section = "7.5.6", id = "k") })
public void testAfterTransactionFailureObserver() throws InterruptedException
{
@@ -126,10 +126,10 @@
assert dog.isCorrectTransactionState();
}
- @Test(groups = { "events", "integration" })
- @SpecAssertions( {
- @SpecAssertion(section = "7.5.6", id = "b"),
- @SpecAssertion(section = "7.5.6", id = "h"),
+ @Test(groups = { "events", "integration", "broken" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "7.5.6", id = "b"),
+ @SpecAssertion(section = "7.5.6", id = "h"),
@SpecAssertion(section = "7.5.8", id = "e") })
public void testBeforeTransactionCompletionObserver()
{
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml 2009-06-24
20:11:07 UTC (rev 2885)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml 2009-06-24
22:43:38 UTC (rev 2886)
@@ -1,7 +0,0 @@
-<beans>
- <deploy>
- <type>javax.enterprise.inject.deployment.Standard</type>
- <type>javax.enterprise.inject.deployment.Production</type>
- <type>org.jboss.jsr299.tck.tests.event.AnotherDeploymentType</type>
- </deploy>
-</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml (from
rev 2883, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/beans.xml 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,7 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+ <type>org.jboss.jsr299.tck.tests.event.AnotherDeploymentType</type>
+ </deploy>
+</beans>
Copied:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/registerUsingEvent
(from rev 2883,
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/register)
Copied:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/registerUsingEvent/beans.xml
(from rev 2883,
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/register/fires1/beans.xml)
===================================================================
---
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/registerUsingEvent/beans.xml
(rev 0)
+++
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/event/registerUsingEvent/beans.xml 2009-06-24
22:43:38 UTC (rev 2886)
@@ -0,0 +1,7 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+
<type>org.jboss.jsr299.tck.tests.event.registerUsingEvent.AnotherEnabledDeploymentType</type>
+ </deploy>
+</beans>
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-24 20:11:07 UTC (rev 2885)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-24 22:43:38 UTC (rev 2886)
@@ -4004,6 +4004,15 @@
<assertion id="b">
<text>If the event parameter does not explicitly declare any binding, the
observer method observes events with no binding</text>
</assertion>
+
+ <assertion id="ca">
+ <text>The event parameter type may contain a type variable or ~wildcard~.
(added from 20090610 spec)</text>
+ </assertion>
+
+ <assertion id="cb">
+ <text>The event parameter type may contain a ~type variable~ or wildcard.
(added from 20090610 spec)</text>
+ </assertion>
+
</section>
<section id="10.5.2" title="Declaring an observer method">