Author: shane.bryzak(a)jboss.com
Date: 2009-08-24 00:03:17 -0400 (Mon, 24 Aug 2009)
New Revision: 3587
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Foo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
Log:
test for 11.5.5.e
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-08-24
03:01:55 UTC (rev 3586)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-08-24
04:03:17 UTC (rev 3587)
@@ -60,6 +60,13 @@
assert billing.getCharge() == 5.00d;
}
+ @Test(groups = { "events"}, expectedExceptions = {
IllegalArgumentException.class })
+ @SpecAssertion(section = "11.3.10", id = "c")
+ public void testTypeVariableEventTypeFails() throws Exception
+ {
+ getCurrentManager().fireEvent(new Foo<String>());
+ }
+
@Test(groups = { "events" }, expectedExceptions = {
IllegalArgumentException.class })
@SpecAssertion(section = "11.3.10", id = "d")
public void testDuplicateBindingsToFireEventFails() throws Exception
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Foo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Foo.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/Foo.java 2009-08-24
04:03:17 UTC (rev 3587)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event.fires;
+
+class Foo<T>
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/Dog.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/Dog.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/Dog.java 2009-08-24
04:03:17 UTC (rev 3587)
@@ -0,0 +1,6 @@
+package
org.jboss.jsr299.tck.tests.extensions.annotated.broken.processAnnotatedObserverThrowsException;
+
+class Dog
+{
+
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeEventThrowsExceptionTest.java 2009-08-24
04:03:17 UTC (rev 3587)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, 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.extensions.annotated.broken.processAnnotatedObserverThrowsException;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.testng.annotations.Test;
+
+/**
+ * Tests that an exception thrown by a ProcessAnnotatedType event observer
+ * is treated as a deployment error
+ *
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+@Resources({
+ @Resource(source="javax.enterprise.inject.spi.Extension",
destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
+})
+@IntegrationTest
+@SpecVersion(spec="cdi", version="1.0.20090625")
+public class ProcessAnnotatedTypeEventThrowsExceptionTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "11.5.5", id = "e")
+ public void testProcessAnnotatedTypeEventsSent()
+ {
+ assert false;
+ }
+}
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/broken/processAnnotatedObserverThrowsException/ProcessAnnotatedTypeObserver.java 2009-08-24
04:03:17 UTC (rev 3587)
@@ -0,0 +1,13 @@
+package
org.jboss.jsr299.tck.tests.extensions.annotated.broken.processAnnotatedObserverThrowsException;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+
+public class ProcessAnnotatedTypeObserver implements Extension
+{
+ public void observeAnnotatedType1(@Observes ProcessAnnotatedType<Dog> event)
+ {
+ throw new RuntimeException();
+ }
+}