Author: pete.muir(a)jboss.org
Date: 2009-07-25 14:20:24 -0400 (Sat, 25 Jul 2009)
New Revision: 3222
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/Behavior.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/BostonTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithParametertizedTypeTest.java
Removed:
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/wildcardAndTypeVariable/GenericBostonTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithTypeVariableEventTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithWildcardedEventTypeTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/WildBostonTerrier.java
Log:
Fix the tests (hopefully, not sure about use of generics). RI is broken
Copied:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable
(from rev 3215,
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType)
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/Behavior.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/Behavior.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/Behavior.java 2009-07-25
18:20:24 UTC (rev 3222)
@@ -0,0 +1,26 @@
+/*
+ * 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.wildcardAndTypeVariable;
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Behavior
+{
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/Behavior.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/BostonTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/BostonTerrier.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/BostonTerrier.java 2009-07-25
18:20:24 UTC (rev 3222)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.event.observer.wildcardAndTypeVariable;
+
+import javax.enterprise.event.Observes;
+
+class BostonTerrier
+{
+
+ public static boolean observed;
+
+ public <T extends Behavior> void observesEventWithTypeParameter(@Observes T
behavior)
+ {
+ observed = true;
+ }
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/BostonTerrier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/GenericBostonTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/GenericBostonTerrier.java 2009-07-25
13:16:47 UTC (rev 3215)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/GenericBostonTerrier.java 2009-07-25
18:20:24 UTC (rev 3222)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.observer.wildcardAndGenericType;
-
-import java.util.List;
-
-import javax.enterprise.event.Observes;
-
-class GenericBostonTerrier
-{
- public <T> void observesEventWithTypeParameter(@Observes List<T>
someArray)
- {
- }
-}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithParametertizedTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithParametertizedTypeTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithParametertizedTypeTest.java 2009-07-25
18:20:24 UTC (rev 3222)
@@ -0,0 +1,62 @@
+/*
+ * 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.wildcardAndTypeVariable;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+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 a type variable
+ *
+ * Spec version: 20090625
+ *
+ * @author David Allen
+ */
+@Artifact
+public class ObserverMethodWithParametertizedTypeTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events", "ri-broken"})
+ @SpecAssertion(section = "10.4.1", id = "cb")
+ public void testObserverMethodCanObserveTypeVariable()
+ {
+ BostonTerrier.observed = false;
+ Behavior event = new Behavior() {};
+ getCurrentManager().fireEvent(event);
+ assert BostonTerrier.observed;
+ }
+
+ @Test(groups = { "events", "ri-broken" })
+ @SpecAssertion(section = "10.4.1", id = "ca")
+ public void testObserverMethodCanObserveWildcardType()
+ {
+ WildBostonTerrier.observed = false;
+ // TODO Not sure if this should match a wildcard event, I think it should as ? is
an upper bound of all types PLM
+ List<?> event = new ArrayList<Object>();
+ getCurrentManager().fireEvent(event);
+ assert WildBostonTerrier.observed;
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithParametertizedTypeTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithTypeVariableEventTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithTypeVariableEventTypeTest.java 2009-07-25
13:16:47 UTC (rev 3215)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithTypeVariableEventTypeTest.java 2009-07-25
18:20:24 UTC (rev 3222)
@@ -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.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: 20090625
- *
- * @author David Allen
- */
-@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
-public class ObserverMethodWithTypeVariableEventTypeTest extends AbstractJSR299Test
-{
- @Test(groups = { "events", "ri-broken" })
- @SpecAssertion(section = "10.4.1", id = "cb")
- public void testObserverMethodCanObserveParameterizedEvents()
- {
- assert false;
- }
-
-}
Deleted:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithWildcardedEventTypeTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/ObserverMethodWithWildcardedEventTypeTest.java 2009-07-25
13:16:47 UTC (rev 3215)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/ObserverMethodWithWildcardedEventTypeTest.java 2009-07-25
18:20:24 UTC (rev 3222)
@@ -1,42 +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.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: 20090625
- *
- * @author David Allen
- */
-@Artifact
-public class ObserverMethodWithWildcardedEventTypeTest extends AbstractJSR299Test
-{
- @Test(groups = { "events", "ri-broken" })
- @SpecAssertion(section = "10.4.1", id = "ca")
- public void testObserverMethodCanObserveParameterizedEvents()
- {
- assert false;
- }
-
-}
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/WildBostonTerrier.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndGenericType/WildBostonTerrier.java 2009-07-25
13:16:47 UTC (rev 3215)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/wildcardAndTypeVariable/WildBostonTerrier.java 2009-07-25
18:20:24 UTC (rev 3222)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.observer.wildcardAndGenericType;
+package org.jboss.jsr299.tck.tests.event.observer.wildcardAndTypeVariable;
import java.util.List;
@@ -6,7 +6,11 @@
class WildBostonTerrier
{
+
+ public static boolean observed;
+
public void observesEventTypeWithWildcard(@Observes List<?> someArray)
{
+ observed = true;
}
}