[webbeans-commits] Webbeans SVN: r3299 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: policy and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-28 02:40:34 -0400 (Tue, 28 Jul 2009)
New Revision: 3299
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
Log:
Matched tests with assertions
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-28 03:00:00 UTC (rev 3298)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-28 06:40:34 UTC (rev 3299)
@@ -88,6 +88,7 @@
@SpecAssertion(section = "2.3.4", id = "b"),
@SpecAssertion(section = "5.3", id = "lc"),
@SpecAssertion(section = "2.3.3", id = "d"),
+ @SpecAssertion(section = "5.3", id = "la"),
@SpecAssertion(section = "5.3.6", id = "a"),
@SpecAssertion(section = "5.3.6", id = "d") })
public void testAllBindingTypesSpecifiedForResolutionMustAppearOnBean()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-07-28 03:00:00 UTC (rev 3298)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java 2009-07-28 06:40:34 UTC (rev 3299)
@@ -40,7 +40,8 @@
@Test(groups = {"policy", "ri-broken"})
@SpecAssertions( {
@SpecAssertion(section = "5.2", id = "b"),
- @SpecAssertion(section = "5.2", id = "c") })
+ @SpecAssertion(section = "5.2", id = "c"),
+ @SpecAssertion(section = "5.2", id = "ea") })
// WBRI-306
public void testPolicyAvailability() throws Exception
{
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3298 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/dependent/ejb and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-27 23:00:00 -0400 (Mon, 27 Jul 2009)
New Revision: 3298
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Bream.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Passivating context tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-07-28 00:01:53 UTC (rev 3297)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -133,13 +133,20 @@
Context context = getCurrentManager().getContext(Dependent.class);
assert context.get(foxBean, null) == null;
}
+
+ @Test(groups = { "contexts" })
+ @SpecAssertion(section = "6.2", id = "ab")
+ public void testContextScopeType()
+ {
+ assert getCurrentManager().getContext(Dependent.class).getScopeType().equals(Dependent.class);
+ }
@Test(groups = { "contexts" })
@SpecAssertions({
@SpecAssertion(section = "6.2", id = "ha"),
@SpecAssertion(section = "6.4", id = "g")
})
- public void testContextIsInactive()
+ public void testContextIsActive()
{
assert getCurrentManager().getContext(Dependent.class).isActive();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-07-28 00:01:53 UTC (rev 3297)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -37,7 +37,7 @@
{
@Test(groups = { "contexts", "ejb3", "integration"})
- @SpecAssertion(section = "6.4.2", id = "aaaa")
+ @SpecAssertion(section = "6.4.2", id = "aaab")
public void testDestroyingEjbDestroysDependents() throws Exception
{
assert getBeans(HouseLocal.class).size() == 1;
@@ -53,7 +53,7 @@
}
@Test(groups = { "contexts", "ejb3", "integration"})
- @SpecAssertion(section = "6.4.2", id = "aaaa")
+ @SpecAssertion(section = "6.4.2", id = "aaab")
public void testDestroyingEjbDestroysDependentSimples() throws Exception
{
assert getBeans(FarmLocal.class).size() == 1;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.interceptor.Interceptors;
+
+@SuppressWarnings("serial")
+@SessionScoped
+(a)Interceptors(KokkolaInterceptor.class)
+public class Kokkola implements Serializable
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.interceptor.Interceptors;
+
+@SuppressWarnings("serial")
+@SessionScoped
+(a)Interceptors(KokkolaInterceptor2.class)
+public class Kokkola2 implements Serializable
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+public class KokkolaInterceptor implements Serializable
+{
+ @AroundInvoke
+ public Object intercept(InvocationContext context)
+ {
+ // do nothing
+ return null;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+public class KokkolaInterceptor2
+{
+ @AroundInvoke
+ public Object intercept(InvocationContext context)
+ {
+ // do nothing
+ return null;
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-28 00:01:53 UTC (rev 3297)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -6,6 +6,8 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
@@ -13,6 +15,7 @@
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
@@ -33,12 +36,28 @@
@Test(groups = { "contexts", "passivation", "review" })
@SpecAssertion(section = "6.6.1", id = "ba")
- public void testSimpleWebBeanWithSerializableImplementationClassOK()
+ public void testManagedBeanWithSerializableImplementationClassOK()
{
Set<Bean<Jyvaskyla>> beans = getBeans(Jyvaskyla.class);
assert !beans.isEmpty();
}
+ @Test(groups = { "contexts", "passivation"})
+ @SpecAssertion(section = "6.6.1", id = "bb")
+ public void testManagedBeanWithSerializableInterceptorClassOK()
+ {
+ Set<Bean<Kokkola>> beans = getBeans(Kokkola.class);
+ assert !beans.isEmpty();
+ }
+
+ @Test(groups = { "contexts", "passivation", "ri-broken"})
+ @SpecAssertion(section = "6.6.1", id = "bb")
+ public void testManagedBeanWithNonSerializableInterceptorClassNotOK()
+ {
+ Set<Bean<Kokkola2>> beans = getBeans(Kokkola2.class);
+ assert beans.isEmpty();
+ }
+
@Test @SpecAssertion(section="6.6.2", id = "c")
public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Bream.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Bream.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Bream.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+
+@SessionScoped
+class Bream implements Serializable
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-28 00:01:53 UTC (rev 3297)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-28 03:00:00 UTC (rev 3298)
@@ -14,6 +14,8 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.impl.MockCreationalContext;
+import org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle.Important;
+import org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle.KleinStadt;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
@@ -48,6 +50,34 @@
}
@Test
+ @SpecAssertions( {
+ @SpecAssertion(section = "6.6.2", id = "b")
+ })
+ public void testSerializeRequestScoped() throws Exception
+ {
+ Cod codInstance = getInstanceByType(Cod.class);
+
+ byte[] bytes = serialize(codInstance);
+ Object object = deserialize(bytes);
+ codInstance = (Cod) object;
+ assert getCurrentConfiguration().getBeans().isProxy(codInstance);
+ }
+
+ @Test
+ @SpecAssertions( {
+ @SpecAssertion(section = "6.6.2", id = "b")
+ })
+ public void testSerializeSessionScoped() throws Exception
+ {
+ Bream instance = getInstanceByType(Bream.class);
+
+ byte[] bytes = serialize(instance);
+ Object object = deserialize(bytes);
+ instance = (Bream) object;
+ assert getCurrentConfiguration().getBeans().isProxy(instance);
+ }
+
+ @Test
@SpecAssertion(section = "3.1.4.2", id = "b")
public void testBindingTypeAnnotatedConstructor()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-28 00:01:53 UTC (rev 3297)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-28 03:00:00 UTC (rev 3298)
@@ -2587,15 +2587,15 @@
<section id="6.4.2" title="Dependent object destruction">
<assertion id="aaaa">
- <text>The container must ensure that all dependent objects of a non-contextual instance of a bean or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
+ <text>The container must ensure that all dependent objects of a non-contextual instance of a bean ~or other Java EE component~ class are destroyed when the instance is destroyed by the container.</text>
</assertion>
<assertion id="aaab">
- <text>The container must ensure that all dependent objects of a non-contextual instance of a bean or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
+ <text>The container must ensure that all dependent objects of a non-contextual instance of a ~bean~ or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
</assertion>
<assertion id="bbb">
- <text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of an observer method of any container lifecycle event, as defined in Section 11.5, "Container lifecycle events", is destroyed after all observers of the |BeforeShutdown| event complete.</text>
+ <text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of an observer method of any container lifecycle event, as defined in Section 11.5, "Container lifecycle events", are destroyed after all observers of the |BeforeShutdown| event complete.</text>
</assertion>
<assertion id="ccc">
@@ -2729,12 +2729,13 @@
<text>An implementation of |Contextual| that is not a bean is passivation capable if it implements both |PassivationCapable| and |Serializable|.</text>
</assertion>
- <assertion id="g">
- <text>The |getId()| method must return a value that uniquely identifies the instance of |Bean| or |Contextual|.</text>
+ <assertion id="g" testable="false">
+ <text>The |PassivationCapable.getId()| method must return a value that uniquely identifies the instance of |Bean| or |Contextual|.</text>
+ <note>This is a requirement of the implementation</note>
</assertion>
<assertion id="h" testable="false">
- <text>The |getId()| ~method must return a value that uniquely identifies the instance of |Bean| or |Contextual|. It~ is recommended that the string contain the package name of the class that implements |Bean| or |Contextual|.</text>
+ <text>The |PassivationCapable.getId()| ~method must return a value that uniquely identifies the instance of |Bean| or |Contextual|. It~ is recommended that the string contain the package name of the class that implements |Bean| or |Contextual|.</text>
<note>Recommendation only</note>
</assertion>
</section>
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3297 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-27 20:01:53 -0400 (Mon, 27 Jul 2009)
New Revision: 3297
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
Log:
fix assertion
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-07-27 23:51:48 UTC (rev 3296)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-07-28 00:01:53 UTC (rev 3297)
@@ -43,7 +43,7 @@
Set<ObserverMethod<?, Temperature>> temperatureObservers = getCurrentManager().resolveObserverMethods(new Temperature(0d));
assert temperatureObservers.size() > 1;
ObserverMethod<?, Temperature> temperatureObserver = temperatureObservers.iterator().next();
- assert temperatureObserver.getBean() == getUniqueBean(AirConditioner.class);
+ assert temperatureObserver.getBean().getBeanClass().equals(AirConditioner.class);
assert temperatureObserver.getObservedType().equals(Temperature.class);
Method method = AirConditioner.class.getMethod("temperatureChanged", Temperature.class);
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3296 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event: fires and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-27 19:51:48 -0400 (Mon, 27 Jul 2009)
New Revision: 3296
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ConditionalEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/EventPayload.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockPrice.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockWatcher.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/RecluseSpider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Spun.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Web.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/AirConditioner.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BatteryEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BullTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DisabledObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DiskSpaceEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Ghost.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/MultiBindingEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/NotEnabled.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Pomeranian.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/PriviledgedObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/RoleBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Secret.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SimpleEventType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SystemMonitor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/TameAnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Temperature.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Thermostat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/EJBEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/PomeranianInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/Spitz.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotypeAnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BananaSpider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ConditionalEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisabledStringObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DogWhisperer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DoggiePoints.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EJBEvent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LazyFarmer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/MagicString.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/NotABindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType1.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType2.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Pomeranian.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/PomeranianInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Praise.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/RecluseSpider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SimpleEventType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spitz.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spun.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TamingCommand.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TeaCupPomeranian.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Web.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/
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/fires/FireEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DisobedientDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogTrainer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/LargeDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Pomeranian.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/PomeranianInterface.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/ShowDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/SmallDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Trainer.java
Log:
continue to reorganize event tests
move many tests from EventTest into more function-specific packages
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotype.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotype.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import static java.lang.annotation.ElementType.FIELD;
-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.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.stereotype.Stereotype;
-
-@Stereotype()
-@Target( { TYPE, METHOD, FIELD })
-@Retention(RUNTIME)
-@RequestScoped
-@interface AnimalStereotype
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotypeAnnotationLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotypeAnnotationLiteral.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/AnimalStereotypeAnnotationLiteral.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-class AnimalStereotypeAnnotationLiteral extends AnnotationLiteral<AnimalStereotype> implements AnimalStereotype
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BananaSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BananaSpider.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BananaSpider.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.BeanManager;
-
-/**
- * Simple bean with observer method and another injectable parameter.
- */
-class BananaSpider
-{
- public void observeStringEvent(@Observes String event, BeanManager beanManager, @Spun Web web)
- {
- assert event != null;
- assert !beanManager.resolveObserverMethods(event).isEmpty();
- if ("validate injected parameters".equals(event))
- {
- assert beanManager != null;
- assert web != null;
- }
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,18 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.SOURCE;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-@Target( { FIELD, PARAMETER })
-@Retention(SOURCE)
-@BindingType
-@interface BindingTypeNotRuntime
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ConditionalEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ConditionalEvent.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ConditionalEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class ConditionalEvent
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisabledStringObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisabledStringObserver.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DisabledStringObserver.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.event.Observes;
-
-class DisabledStringObserver
-{
- public void disabledObserver(@Observes String event)
- {
- if ("fail if disable observer invoked".equals(event))
- {
- assert false : "This observer should not be invoked since it resides on a bean which is disabled";
- }
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DogWhisperer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DogWhisperer.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DogWhisperer.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Any;
-
-class DogWhisperer
-{
- @Any @Tame @Role("Admin") Event<TamingCommand> tamingEvent;
-
- @Any Event<Praise> praiseEvent;
-
- public void issueTamingCommand()
- {
- tamingEvent.fire(new TamingCommand());
- }
-
- public void givePraise()
- {
- praiseEvent.fire(new Praise());
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DoggiePoints.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DoggiePoints.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/DoggiePoints.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,38 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Any;
-
-@RequestScoped class DoggiePoints
-{
- private int numPraiseReceived;
-
- private int numTamed;
-
- public void praiseReceived(@Observes @Any Praise praise)
- {
- numPraiseReceived++;
- }
-
- public void tamed(@Observes @Tame @Role("Admin") TamingCommand tamed)
- {
- numTamed++;
- }
-
- public int getNumPraiseReceived()
- {
- return numPraiseReceived;
- }
-
- public int getNumTamed()
- {
- return numTamed;
- }
-
- public void reset()
- {
- numPraiseReceived = 0;
- numTamed = 0;
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EJBEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EJBEvent.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EJBEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class EJBEvent
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,15 +1,12 @@
package org.jboss.jsr299.tck.tests.event;
-import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Set;
-import javax.enterprise.event.Notify;
import javax.enterprise.event.TransactionPhase;
import javax.enterprise.inject.spi.ObserverMethod;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
@@ -28,90 +25,8 @@
@SpecVersion("20090625")
public class EventTest extends AbstractJSR299Test
{
- private static final String RESOLVE_OBSERVERS_METHOD_NAME = "resolveObserverMethods";
-
- // --------- Below this line are tests that need to be evaluated to determine if they need to be moved
-
@Test(groups = { "events" })
- @SpecAssertions({
- @SpecAssertion(section = "11.3.11", id = "a"),
- @SpecAssertion(section = "11.3.11", id = "b")
- })
- public void testBeanManagerResolveObserversSignature() throws Exception
- {
- assert getCurrentManager().getClass().getDeclaredMethod(RESOLVE_OBSERVERS_METHOD_NAME, Object.class, Annotation[].class) != null;
- }
-
- @Test(groups = { "events" })
- @SpecAssertions({
- @SpecAssertion(section = "10.5", id = "aa"),
- @SpecAssertion(section = "10.4.2", id = "a"),
- @SpecAssertion(section = "12.3", id = "oa")
- })
- public void testObserverMethodAutomaticallyRegistered()
- {
- assert !getCurrentManager().resolveObserverMethods(new String()).isEmpty();
- }
-
- @Test(groups = { "events", "broken" })
- @SpecAssertion(section = "12.3", id = "oa")
- public void testObserverMethodNotAutomaticallyRegisteredForDisabledBeans()
- {
- Set<ObserverMethod<?, String>> observers = getCurrentManager().resolveObserverMethods(new String());
- assert observers.size() == 2;
- for (ObserverMethod<?, String> observer : observers)
- {
- // an assertion error will be raised if an inappropriate observer is called
- observer.notify("fail if disable observer invoked");
- }
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "10.4", id = "e")
- public void testMultipleObserverMethodsForSameEventPermissible()
- {
- assert getCurrentManager().resolveObserverMethods(new String()).size() > 1;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "10.4", id = "f")
- public void testMultipleObserverMethodsOnBeanPermissible()
- {
- // Resolve the observers for types 1 and 2
- assert getCurrentManager().resolveObserverMethods(new ObservedType1()).size() == 1;
-
- assert getCurrentManager().resolveObserverMethods(new ObservedType2()).size() == 1;
- }
-
- @Test(groups = { "events", "ejb" })
- @SpecAssertion(section = "10.4", id = "d")
- public void testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic()
- {
- assert getCurrentManager().resolveObserverMethods(new EJBEvent()).size() == 2;
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "10.4.1", id = "b")
- public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
- {
- // Resolve registered observers with an event containing no binding types
- assert getCurrentManager().resolveObserverMethods(new SimpleEventType()).size() == 2;
- }
-
- @Test(groups = { "events" })
@SpecAssertions( {
- @SpecAssertion(section = "10.4.2", id = "c"),
- @SpecAssertion(section = "10.2.2", id = "a"),
- @SpecAssertion(section = "10.2.3", id = "a")
- })
- public void testObserverMethodMayHaveMultipleBindingTypes()
- {
- // If we can resolve the observer with the two binding types, then it worked
- assert getCurrentManager().resolveObserverMethods(new MultiBindingEvent(), new RoleBinding("Admin"), new TameAnnotationLiteral()).size() == 2;
- }
-
- @Test(groups = { "events" })
- @SpecAssertions( {
@SpecAssertion(section = "10.4.3", id = "a"),
@SpecAssertion(section = "5.6.8", id = "c"),
@SpecAssertion(section = "2.3.5", id = "ca"),
@@ -123,37 +38,6 @@
}
@Test(groups = { "events" })
- @SpecAssertions( {
- @SpecAssertion(section = "10.4.4", id = "a"),
- @SpecAssertion(section = "5.6.8", id = "ba")
- } )
- public void testConditionalObserver()
- {
- RecluseSpider.reset();
- getCurrentManager().fireEvent(new ConditionalEvent());
- // Should not be notified since bean is not instantiated yet
- assert !RecluseSpider.isNotified();
-
- // Now instantiate the bean and fire another event
- RecluseSpider bean = getInstanceByType(RecluseSpider.class);
- assert bean != null;
- // Must invoke a method to really create the instance
- assert !bean.isInstanceNotified();
- getCurrentManager().fireEvent(new ConditionalEvent());
- assert RecluseSpider.isNotified() && bean.isInstanceNotified();
-
- RecluseSpider.reset();
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "10.5", id = "aa")
- public void testObserverMethodRegistration()
- {
- // Resolve registered observers with an event containing no binding types
- assert getCurrentManager().resolveObserverMethods(new SimpleEventType()).size() == 2;
- }
-
- @Test(groups = { "events" })
@SpecAssertions({
@SpecAssertion(section = "10.5", id = "review"), // was b
@SpecAssertion(section = "10.5", id = "review") // was h
@@ -204,17 +88,6 @@
assert Shop.deliveryObservedBy.equals(FarmShop.class.getName());
}
- @Test(groups = { "events" })
- @SpecAssertion(section = "5.6.8", id = "ba")
- public void testObserverMethodInvokedOnReturnedInstanceFromContext()
- {
- RecluseSpider spider = getInstanceByType(RecluseSpider.class);
- spider.setWeb(new Web());
- getCurrentManager().fireEvent(new ConditionalEvent());
- assert spider.isInstanceNotified();
- assert spider.getWeb().getRings() == 1;
- }
-
@Test(groups = { "events", "broken" })
@SpecAssertion(section = "10.5", id = "ca")
public void testAsynchronousObserverThrowsExceptionIsLogged() throws InterruptedException
@@ -305,50 +178,6 @@
}
@Test(groups = { "events" })
- @SpecAssertion(section = "11.1.3", id = "b")
- public void testGetBeanOnObserverMethod()
- {
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
- assert observers.size() == 1;
- ObserverMethod<?, StockPrice> observerMethod = observers.iterator().next();
- assert observerMethod.getBean().getBeanClass().equals(StockWatcher.class);
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "11.1.3", id = "c")
- public void testGetObservedTypeOnObserverMethod()
- {
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
- assert observers.size() == 1;
- ObserverMethod<?, ?> observerMethod = observers.iterator().next();
- assert observerMethod.getObservedType().equals(StockPrice.class);
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "11.1.3", id = "c")
- public void testGetObservedBindingsOnObserverMethod()
- {
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
- assert observers.size() == 1;
- ObserverMethod<?, ?> observerMethod = observers.iterator().next();
- assert observerMethod.getObservedBindings().size() == 1;
- assert observerMethod.getObservedBindings().contains(new CurrentLiteral());
- }
-
- @Test(groups = { "events" })
- @SpecAssertion(section = "11.1.3", id = "d")
- public void testGetNotifyOnObserverMethod()
- {
- Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
- assert observers.size() == 1;
- assert observers.iterator().next().getNotify().equals(Notify.ALWAYS);
-
- Set<ObserverMethod<?, ConditionalEvent>> conditionalObservers = getCurrentManager().resolveObserverMethods(new ConditionalEvent());
- assert !conditionalObservers.isEmpty();
- assert conditionalObservers.iterator().next().getNotify().equals(Notify.IF_EXISTS);
- }
-
- @Test(groups = { "events" })
@SpecAssertion(section = "11.1.3", id = "e")
public void testGetTransactionPhaseOnObserverMethod()
{
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LazyFarmer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LazyFarmer.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/LazyFarmer.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,7 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-
-class LazyFarmer extends Farmer
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/MagicString.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/MagicString.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/MagicString.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,54 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class MagicString
-{
- private static boolean equalsUsed = false;
- private final String value;
-
- public MagicString(String value)
- {
- this.value = value;
- }
-
- public int compareTo(String anotherString)
- {
- return value.compareTo(anotherString);
- }
-
- public int compareToIgnoreCase(String str)
- {
- return value.compareToIgnoreCase(str);
- }
-
- @Override
- public boolean equals(Object anObject)
- {
- return value.equals(anObject);
- }
-
- @Override
- public int hashCode()
- {
- return value.hashCode();
- }
-
- public boolean isEmpty()
- {
- return value == null || value.length() == 0;
- }
-
- public int length()
- {
- return value.length();
- }
-
- public boolean matches(String regex)
- {
- return value.matches(regex);
- }
-
- public static boolean isEqualsUsed()
- {
- return equalsUsed;
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/NotABindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/NotABindingType.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/NotABindingType.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,15 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-@Target( { FIELD, PARAMETER })
-@Retention(RUNTIME)
-@interface NotABindingType
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType1.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType1.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType1.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class ObservedType1
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType2.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/ObservedType2.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class ObservedType2
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Pomeranian.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Pomeranian.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Pomeranian.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,23 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Named;
-
-@Named("Teddy")
-class Pomeranian
-{
- public static Thread notificationThread;
-
- public void observeSimpleEvent(@Observes SimpleEventType someEvent)
- {
- notificationThread = Thread.currentThread();
- }
-
- public void observerTameSimpleEvent(@Observes @Tame SimpleEventType someEvent)
- {
- }
-
- public static void staticallyObserveEvent(@Observes SimpleEventType someEvent)
- {
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/PomeranianInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/PomeranianInterface.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/PomeranianInterface.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,10 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.ejb.Local;
-import javax.enterprise.event.Observes;
-
-@Local
-public interface PomeranianInterface
-{
- public void observeSimpleEvent(@Observes EJBEvent someEvent);
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Praise.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Praise.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Praise.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,5 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class Praise
-{
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/RecluseSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/RecluseSpider.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/RecluseSpider.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,52 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.event.Notify;
-import javax.enterprise.event.Observes;
-
-/**
- * Simple web bean that conditionally listens to events.
- *
- */
-@RequestScoped
-class RecluseSpider
-{
- private static boolean notified = false;
- private boolean instanceNotified = false;
- private Web web;
-
- public void observe(@Observes(notifyObserver = Notify.IF_EXISTS) ConditionalEvent someEvent)
- {
- notified = true;
- instanceNotified = true;
- if (web != null)
- {
- web.addRing();
- }
- }
-
- public boolean isInstanceNotified()
- {
- return instanceNotified;
- }
-
- public static boolean isNotified()
- {
- return notified;
- }
-
- public static void reset()
- {
- notified = false;
- }
-
- public void setWeb(Web web)
- {
- this.web = web;
- }
-
- public Web getWeb()
- {
- return this.web;
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SimpleEventType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SimpleEventType.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SimpleEventType.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class SimpleEventType
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spitz.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spitz.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spitz.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,20 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.ejb.Stateful;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Named;
-
-public
-@Stateful
-@Tame
-@Named("Teddy")
-class Spitz implements PomeranianInterface
-{
- public void observeSimpleEvent(@Observes EJBEvent someEvent)
- {
- }
-
- public static void staticallyObserveEvent(@Observes EJBEvent someEvent)
- {
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spun.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spun.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Spun.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-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.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface Spun
-{
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Any;
-
-class SweeWaxbill
-{
- private @Any @Role("Admin") Event<String> simpleEvent;
-
- public void methodThatReselectsAndFiresEvent()
- {
- simpleEvent.select(new RoleBinding("Admin")).fire("string event");
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TamingCommand.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TamingCommand.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TamingCommand.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,5 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-class TamingCommand
-{
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TeaCupPomeranian.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TeaCupPomeranian.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TeaCupPomeranian.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,30 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Named;
-
-@Tame
-@Named("Teddy")
-class TeaCupPomeranian
-{
- public static class OversizedException extends RuntimeException
- {
- private static final long serialVersionUID = 1L;
-
- }
-
- public static class TooSmallException extends Exception
- {
- private static final long serialVersionUID = 1L;
- }
-
- public void observeSimpleEvent(@Observes ObservedType1 someEvent)
- {
- throw new OversizedException();
- }
-
- public void observeAnotherSimpleEvent(@Observes ObservedType2 someEvent) throws TooSmallException
- {
- throw new TooSmallException();
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Web.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Web.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Web.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.event;
-
-@Spun class Web
-{
- private int rings = 0;
-
- public void addRing()
- {
- this.rings++;
- }
-
- public void setRings(int rings)
- {
- this.rings = rings;
- }
-
- public int getRings()
- {
- return this.rings;
- }
-}
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-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -36,7 +36,7 @@
@Test(groups = { "events" })
@SpecAssertions({
- // These two assertions combine to create a testable assertion
+ // these two assertions combine to create a logical, testable assertion
@SpecAssertion(section = "11.3.10", id = "a"),
@SpecAssertion(section = "11.3.10", id = "b")
})
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/AnotherObserver.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.event.observer;
+import javax.enterprise.event.Notify;
import javax.enterprise.event.Observes;
class AnotherObserver
@@ -10,4 +11,8 @@
{
wasNotified = true;
}
+
+ void conditionalObserve(@Observes(notifyObserver = Notify.IF_EXISTS) ConditionalEvent e)
+ {
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ConditionalEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ConditionalEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ConditionalEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+class ConditionalEvent
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/EventPayload.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/EventPayload.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/EventPayload.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+class EventPayload
+{
+ private List<Class<?>> classesVisited = new ArrayList<Class<?>>();
+
+ public List<Class<?>> getClassesVisited()
+ {
+ return classesVisited;
+ }
+
+ public void recordVisit(Object o)
+ {
+ classesVisited.add(o.getClass());
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-07-27 23:12:35 UTC (rev 3295)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,11 +1,16 @@
package org.jboss.jsr299.tck.tests.event.observer;
import java.lang.annotation.Annotation;
+import java.util.Set;
+import javax.enterprise.event.Notify;
+import javax.enterprise.inject.spi.ObserverMethod;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -43,5 +48,48 @@
assert AnObserver.wasNotified;
assert !AnotherObserver.wasNotified;
}
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "b")
+ public void testGetBeanOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ ObserverMethod<?, StockPrice> observerMethod = observers.iterator().next();
+ assert observerMethod.getBean().getBeanClass().equals(StockWatcher.class);
+ }
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "c")
+ public void testGetObservedTypeOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ ObserverMethod<?, ?> observerMethod = observers.iterator().next();
+ assert observerMethod.getObservedType().equals(StockPrice.class);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "c")
+ public void testGetObservedBindingsOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ ObserverMethod<?, ?> observerMethod = observers.iterator().next();
+ assert observerMethod.getObservedBindings().size() == 1;
+ assert observerMethod.getObservedBindings().contains(new CurrentLiteral());
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "11.1.3", id = "d")
+ public void testGetNotifyOnObserverMethod()
+ {
+ Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
+ assert observers.size() == 1;
+ assert observers.iterator().next().getNotify().equals(Notify.ALWAYS);
+
+ Set<ObserverMethod<?, ConditionalEvent>> conditionalObservers = getCurrentManager().resolveObserverMethods(new ConditionalEvent());
+ assert !conditionalObservers.isEmpty();
+ assert conditionalObservers.iterator().next().getNotify().equals(Notify.IF_EXISTS);
+ }
+
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockPrice.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockPrice.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockPrice.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+class StockPrice extends EventPayload
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockWatcher.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockWatcher.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/StockWatcher.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.event.observer;
+
+import javax.enterprise.event.Observes;
+
+class StockWatcher
+{
+ private static Class<?> observerClazz;
+
+ public void observeStockPrice(@Observes StockPrice price)
+ {
+ observerClazz = this.getClass();
+ price.recordVisit(this);
+ }
+
+ public static Class<?> getObserverClazz()
+ {
+ return observerClazz;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event.observer.conditional;
+
+class ConditionalEvent
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalObserverTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/ConditionalObserverTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,67 @@
+package org.jboss.jsr299.tck.tests.event.observer.conditional;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.enterprise.event.Notify;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+@SpecVersion("20090625")
+public class ConditionalObserverTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events", "broken" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "5.6.8", id = "ba"),
+ @SpecAssertion(section = "10.4.4", id = "a")
+ } )
+ public void testConditionalObserver()
+ {
+ RecluseSpider.reset();
+ getCurrentManager().fireEvent(new ConditionalEvent());
+ // Should not be notified since bean is not instantiated yet
+ assert !RecluseSpider.isNotified();
+
+ // Now instantiate the bean and fire another event
+ RecluseSpider bean = getInstanceByType(RecluseSpider.class);
+ assert bean != null;
+ // Must invoke a method to really create the instance
+ assert !bean.isInstanceNotified();
+ getCurrentManager().fireEvent(new ConditionalEvent());
+ assert RecluseSpider.isNotified() && bean.isInstanceNotified();
+
+ RecluseSpider.reset();
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "5.6.8", id = "ba")
+ public void testObserverMethodInvokedOnReturnedInstanceFromContext()
+ {
+ RecluseSpider spider = getInstanceByType(RecluseSpider.class);
+ spider.setWeb(new Web());
+ getCurrentManager().fireEvent(new ConditionalEvent());
+ assert spider.isInstanceNotified();
+ assert spider.getWeb().getRings() == 1;
+ }
+
+ @Test
+ @SpecAssertion(section = "10.4.4", id = "c")
+ public void testNotifyEnumerationContainsNotifyValues()
+ {
+ assert Notify.values().length == 2;
+ List<String> notifyValueNames = new ArrayList<String>();
+ for (Notify value : Notify.values())
+ {
+ notifyValueNames.add(value.name());
+ }
+
+ assert notifyValueNames.contains("IF_EXISTS");
+ assert notifyValueNames.contains("ALWAYS");
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/RecluseSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/RecluseSpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/RecluseSpider.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,52 @@
+package org.jboss.jsr299.tck.tests.event.observer.conditional;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Notify;
+import javax.enterprise.event.Observes;
+
+/**
+ * Simple web bean that conditionally listens to events.
+ *
+ */
+@RequestScoped
+class RecluseSpider
+{
+ private static boolean notified = false;
+ private boolean instanceNotified = false;
+ private Web web;
+
+ public void observe(@Observes(notifyObserver = Notify.IF_EXISTS) ConditionalEvent someEvent)
+ {
+ notified = true;
+ instanceNotified = true;
+ if (web != null)
+ {
+ web.addRing();
+ }
+ }
+
+ public boolean isInstanceNotified()
+ {
+ return instanceNotified;
+ }
+
+ public static boolean isNotified()
+ {
+ return notified;
+ }
+
+ public static void reset()
+ {
+ notified = false;
+ }
+
+ public void setWeb(Web web)
+ {
+ this.web = web;
+ }
+
+ public Web getWeb()
+ {
+ return this.web;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Spun.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Spun.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Spun.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.event.observer.conditional;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+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.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Spun
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Web.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Web.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/conditional/Web.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.event.observer.conditional;
+
+@Spun class Web
+{
+ private int rings = 0;
+
+ public void addRing()
+ {
+ this.rings++;
+ }
+
+ public void setRings(int rings)
+ {
+ this.rings = rings;
+ }
+
+ public int getRings()
+ {
+ return this.rings;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/AirConditioner.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/AirConditioner.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/AirConditioner.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+public class AirConditioner
+{
+ private Temperature target;
+
+ private boolean on = false;
+
+ public void setTargetTemperature(Temperature target)
+ {
+ this.target = target;
+ }
+
+ public void temperatureChanged(@Observes Temperature temperature)
+ {
+ if (on && temperature.getDegrees() <= target.getDegrees())
+ {
+ on = false;
+ }
+ else if (!on && temperature.getDegrees() > target.getDegrees())
+ {
+ on = true;
+ }
+ }
+
+ public boolean isOn()
+ {
+ return on;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BatteryEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BatteryEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BatteryEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+class BatteryEvent
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BullTerrier.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BullTerrier.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/BullTerrier.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,35 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+class BullTerrier
+{
+ private static boolean multiBindingEventObserved = false;
+ private static boolean singleBindingEventObserved = false;
+
+ public void observesMultiBindingEvent(@Observes @Role("Admin") @Tame MultiBindingEvent someEvent)
+ {
+ multiBindingEventObserved = true;
+ }
+
+ public void observesSingleBindingEvent(@Observes @Tame MultiBindingEvent someEvent)
+ {
+ singleBindingEventObserved = true;
+ }
+
+ public static boolean isMultiBindingEventObserved()
+ {
+ return multiBindingEventObserved;
+ }
+
+ public static boolean isSingleBindingEventObserved()
+ {
+ return singleBindingEventObserved;
+ }
+
+ public static void reset()
+ {
+ multiBindingEventObserved = false;
+ singleBindingEventObserved = false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DisabledObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DisabledObserver.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DisabledObserver.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+@NotEnabled class DisabledObserver
+{
+ public void observeSecret(@Observes @Secret String secretString)
+ {
+ if ("fail if disabled observer invoked".equals(secretString))
+ {
+ assert false : "This observer should not be invoked since it resides on a bean with a policy that is not enabled.";
+ }
+ }
+
+ public void observeGhost(@Observes Ghost ghost)
+ {
+ assert false : "This observer should not be invoked since it resides on a bean with a policy that is not enabled.";
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DiskSpaceEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DiskSpaceEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/DiskSpaceEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+class DiskSpaceEvent
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Ghost.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Ghost.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Ghost.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+class Ghost
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+public class Heater
+{
+ private Temperature target;
+
+ private boolean on = false;
+
+ public void setTargetTemperature(Temperature target)
+ {
+ this.target = target;
+ }
+
+ public void temperatureChanged(@Observes Temperature temperature)
+ {
+ if (on && temperature.getDegrees() > target.getDegrees())
+ {
+ on = false;
+ }
+ else if (!on && temperature.getDegrees() <= target.getDegrees())
+ {
+ on = true;
+ }
+ }
+
+ public boolean isOn()
+ {
+ return on;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/MultiBindingEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/MultiBindingEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/MultiBindingEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+class MultiBindingEvent
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/NotEnabled.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/NotEnabled.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/NotEnabled.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,35 @@
+/*
+ * 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.resolve;
+
+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.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.Policy;
+import javax.enterprise.inject.stereotype.Stereotype;
+
+@Stereotype
+@Policy
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@interface NotEnabled
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Pomeranian.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Pomeranian.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Pomeranian.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Named;
+
+@Named("Teddy")
+class Pomeranian
+{
+ public static Thread notificationThread;
+
+ public void observeSimpleEvent(@Observes SimpleEventType someEvent)
+ {
+ notificationThread = Thread.currentThread();
+ }
+
+ public void observerTameSimpleEvent(@Observes @Tame SimpleEventType someEvent)
+ {
+ }
+
+ public static void staticallyObserveEvent(@Observes SimpleEventType someEvent)
+ {
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/PriviledgedObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/PriviledgedObserver.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/PriviledgedObserver.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+class PriviledgedObserver
+{
+ public void observeSecret(@Observes @Secret String secretString)
+ {
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,121 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.ObserverMethod;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+@SpecVersion("20090625")
+public class ResolveEventObserversTest extends AbstractJSR299Test
+{
+ private static final String BEAN_MANAGER_RESOLVE_OBSERVERS_METHOD_NAME = "resolveObserverMethods";
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.4", id = "e")
+ public void testMultipleObserverMethodsForSameEventPermissible()
+ {
+ assert getCurrentManager().resolveObserverMethods(new Temperature(0)).size() == 2;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.4", id = "f")
+ public void testMultipleObserverMethodsOnBeanPermissible()
+ {
+ assert getCurrentManager().resolveObserverMethods(new BatteryEvent()).size() == 1;
+ assert getCurrentManager().resolveObserverMethods(new DiskSpaceEvent()).size() == 1;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.4.2", id = "a")
+ public void testMethodWithParameterAnnotatedWithObservesRegistersObserverMethod() throws SecurityException, NoSuchMethodException
+ {
+ Set<ObserverMethod<?, Temperature>> temperatureObservers = getCurrentManager().resolveObserverMethods(new Temperature(0d));
+ assert temperatureObservers.size() > 1;
+ ObserverMethod<?, Temperature> temperatureObserver = temperatureObservers.iterator().next();
+ assert temperatureObserver.getBean() == getUniqueBean(AirConditioner.class);
+ assert temperatureObserver.getObservedType().equals(Temperature.class);
+
+ Method method = AirConditioner.class.getMethod("temperatureChanged", Temperature.class);
+ assert method != null;
+ assert method.getParameterTypes().length == 1;
+ assert method.getParameterTypes()[0].equals(Temperature.class);
+ assert method.getParameterAnnotations()[0][0].annotationType().equals(Observes.class);
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.4.1", id = "b")
+ public void testObserverMethodWithoutBindingTypesObservesEventsWithoutBindingTypes()
+ {
+ // Resolve registered observers with an event containing no binding types
+ assert getCurrentManager().resolveObserverMethods(new SimpleEventType()).size() == 2;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "10.4.2", id = "c"),
+ @SpecAssertion(section = "10.2.2", id = "a"),
+ @SpecAssertion(section = "10.2.3", id = "a")
+ })
+ public void testObserverMethodMayHaveMultipleBindingTypes()
+ {
+ // If we can resolve the observer with the two binding types, then it worked
+ assert getCurrentManager().resolveObserverMethods(new MultiBindingEvent(), new RoleBinding("Admin"), new TameAnnotationLiteral()).size() == 2;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "10.5", id = "aa")
+ public void testObserverMethodRegistration()
+ {
+ // Resolve registered observers with an event containing no binding types
+ assert getCurrentManager().resolveObserverMethods(new SimpleEventType()).size() == 2;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertions({
+ // these two assertions combine to create a logical, testable assertion
+ @SpecAssertion(section = "11.3.11", id = "a"),
+ @SpecAssertion(section = "11.3.11", id = "b")
+ })
+ public void testBeanManagerResolveObserversSignature() throws Exception
+ {
+ assert getCurrentManager().getClass().getDeclaredMethod(BEAN_MANAGER_RESOLVE_OBSERVERS_METHOD_NAME, Object.class, Annotation[].class) != null;
+ }
+
+ @Test(groups = { "events" })
+ @SpecAssertion(section = "12.3", id = "oa")
+ public void testObserverMethodAutomaticallyRegistered()
+ {
+ assert !getCurrentManager().resolveObserverMethods(new Ghost()).isEmpty();
+ assert !getCurrentManager().resolveObserverMethods(new String(), new AnnotationLiteral<Secret>() {}).isEmpty();
+ }
+
+ // WBRI-317
+ // when this bug is fixed, also add a test that verifies that if a policy is enabled, the obserer methods on the bean also get registered
+ @Test(groups = { "events", "ri-broken" })
+ @SpecAssertion(section = "12.3", id = "oa")
+ public void testObserverMethodNotAutomaticallyRegisteredForDisabledBeans()
+ {
+ Set<ObserverMethod<?, Ghost>> ghostObservers = getCurrentManager().resolveObserverMethods(new Ghost());
+ assert ghostObservers.size() == 0;
+
+ Set<ObserverMethod<?, String>> stringObservers = getCurrentManager().resolveObserverMethods(new String(), new AnnotationLiteral<Secret>() {});
+ assert stringObservers.size() == 1;
+ for (ObserverMethod<?, String> observer : stringObservers)
+ {
+ // an assertion error will be raised if an inappropriate observer is called
+ observer.notify("fail if disabled observer invoked");
+ }
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Role.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { FIELD, PARAMETER })
+@Retention(RUNTIME)
+@BindingType
+@interface Role
+{
+ String value();
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/RoleBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/RoleBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/RoleBinding.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+
+class RoleBinding extends AnnotationLiteral<Role> implements Role
+{
+ private String value = null;
+
+ public RoleBinding(String value)
+ {
+ this.value = value;
+ }
+
+ public String value()
+ {
+ return value;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Secret.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Secret.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Secret.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+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.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Secret
+{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SimpleEventType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SimpleEventType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SimpleEventType.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+class SimpleEventType
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SystemMonitor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SystemMonitor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/SystemMonitor.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+class SystemMonitor
+{
+ public void lowBattery(@Observes BatteryEvent e)
+ {
+ }
+
+ public void lowDiskSpace(@Observes DiskSpaceEvent e)
+ {
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Tame.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+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.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/TameAnnotationLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/TameAnnotationLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/TameAnnotationLiteral.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class TameAnnotationLiteral extends AnnotationLiteral<Tame> implements Tame
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Temperature.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Temperature.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Temperature.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+class Temperature
+{
+ private double degrees;
+
+ public Temperature(double degrees)
+ {
+ this.degrees = degrees;
+ }
+
+ public double getDegrees()
+ {
+ return degrees;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Thermostat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Thermostat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Thermostat.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+class Thermostat
+{
+ public void notifyTemperatureChanged(Temperature temperature)
+ {
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/EJBEvent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/EJBEvent.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/EJBEvent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve.enterprise;
+
+class EJBEvent
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/PomeranianInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/PomeranianInterface.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/PomeranianInterface.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve.enterprise;
+
+import javax.ejb.Local;
+import javax.enterprise.event.Observes;
+
+@Local
+public interface PomeranianInterface
+{
+ public void observeSimpleEvent(@Observes EJBEvent someEvent);
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve.enterprise;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+@SpecVersion("20090625")
+public class ResolveEnterpriseEventObserverTest extends AbstractJSR299Test
+{
+ @Test(groups = { "events", "ejb" })
+ @SpecAssertion(section = "10.4", id = "d")
+ public void testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic()
+ {
+ assert getCurrentManager().resolveObserverMethods(new EJBEvent()).size() == 2;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/Spitz.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/Spitz.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/enterprise/Spitz.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve.enterprise;
+
+import javax.ejb.Stateful;
+import javax.enterprise.event.Observes;
+
+public
+@Stateful
+class Spitz implements PomeranianInterface
+{
+ public void observeSimpleEvent(@Observes EJBEvent someEvent)
+ {
+ }
+
+ public static void staticallyObserveEvent(@Observes EJBEvent someEvent)
+ {
+ }
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional (from rev 3271, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/Agent.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Agent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
import javax.ejb.Local;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DisobedientDog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/DisobedientDog.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DisobedientDog.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
class DisobedientDog
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/DogAgent.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogAgent.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
import static javax.ejb.TransactionManagementType.BEAN;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogTrainer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/DogTrainer.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/DogTrainer.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
import static javax.ejb.TransactionManagementType.BEAN;
import static javax.enterprise.event.TransactionPhase.BEFORE_COMPLETION;
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/EventTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,188 +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.transactionalObservers;
-
-import java.lang.annotation.Annotation;
-import java.math.BigInteger;
-
-import javax.ejb.EJBException;
-import javax.enterprise.inject.AnnotationLiteral;
-
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.testng.annotations.Test;
-
-/**
- * Integration tests for Web Bean events.
- *
- * @author David Allen
- *
- */
-@Artifact
-(a)Packaging(PackagingType.EAR)
-@IntegrationTest
-@SpecVersion("20090625")
-public class EventTest extends AbstractJSR299Test
-{
-
- private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>()
- {
- };
- private PomeranianInterface dog = null;
-
- @Override
- public void beforeMethod()
- {
- super.beforeMethod();
- dog = (PomeranianInterface) getInstanceByName("Teddy");
- }
-
-// @AfterMethod(alwaysRun = true)
-// public void teardownTest()
-// {
-// try
-// {
-// dog.removeSessionBean();
-// }
-// catch (Exception e)
-// {
-// // Not important since the bean is now gone one way or the other
-// }
-// }
-
- @Test(groups = { "events", "integration" })
- @SpecAssertion(section = "10.4.5", id = "a")
- public void testTransactionalObserverNotifiedImmediatelyWhenNoTransactionInProgress()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getInstanceByType(Agent.class);
- assert dogAgent != null;
- dogAgent.sendOutsideTransaction(BigInteger.TEN);
- assert dog.isCorrectTransactionState();
- // TODO Fix the security contexts
- // assert dog.isCorrectContext();
- }
-
- @Test(groups = { "events", "integration", "broken" })
- @SpecAssertion(section = "10.4.5", id = "c")
- public void testAfterTransactionCompletionObserver() throws InterruptedException
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- assert !getCurrentManager().resolveObserverMethods("event").isEmpty();
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction("event");
- Thread.sleep(100);
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "events", "integration", "broken" })
- @SpecAssertion(section = "10.4.5", id = "d")
- public void testAfterTransactionSuccessObserver() throws InterruptedException
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new Integer(4));
- Thread.sleep(100);
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "events", "integration", "ri-broken" })
- @SpecAssertion(section = "10.4.5", id = "e")
- // WBRI-303
- public void testAfterTransactionFailureObserver() throws InterruptedException
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new Float(4.0));
- Thread.sleep(100);
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "events", "integration", "broken" })
- @SpecAssertions( {
- @SpecAssertion(section = "10.4.5", id = "b"),
- @SpecAssertion(section = "10.4.5", id = "e") })
- public void testBeforeTransactionCompletionObserver()
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new RuntimeException("test event"));
- assert dog.isCorrectTransactionState();
- // TODO Fix the security contexts
- // assert dog.isCorrectContext();
- }
-
- @Test(groups = { "events", "ri-broken" })
- @SpecAssertion(section = "review", id = "review") // the spec now only mentions asynchronous observer methods in passing
- // WBRI-303
- public void testAsynchronousObserverAlsoTransactional() throws InterruptedException
- {
- dog.setCorrectContext(false);
- dog.setCorrectTransactionState(false);
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction('a');
- Thread.sleep(200);
- assert dog.isCorrectTransactionState();
- }
-
- @Test(groups = { "events", "integration" })
- @SpecAssertion(section = "10.5", id = "bd")
- public void testObserverCanSetRollbackOnlyOnTransaction()
- {
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new DisobedientDog());
- }
-
- @Test(groups = { "ri-broken", "events", "integration" }, expectedExceptions = EJBException.class)
- @SpecAssertion(section = "10.5", id = "bd")
- // WBRI-303
- public void testObserverCannotInitiateJtaTransaction()
- {
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new ShowDog());
- }
-
- @Test(groups = { "ri-broken", "events", "integration" }, expectedExceptions = EJBException.class)
- @SpecAssertion(section = "10.5", id = "bd")
- // WBRI-303
- public void testObserverCannotCommitJtaTransaction()
- {
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new LargeDog());
- }
-
- @Test(groups = { "ri-broken", "events", "integration" }, expectedExceptions = EJBException.class)
- @SpecAssertion(section = "10.5", id = "bd")
- // WBRI-303
- public void testObserverCannotRollbackJtaTransaction()
- {
- Agent dogAgent = getInstanceByType(Agent.class);
- dogAgent.sendInTransaction(new SmallDog());
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/LargeDog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/LargeDog.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/LargeDog.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
public class LargeDog
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Pomeranian.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/Pomeranian.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Pomeranian.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
import static javax.ejb.TransactionManagementType.BEAN;
import static javax.enterprise.event.TransactionPhase.AFTER_COMPLETION;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/PomeranianInterface.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/PomeranianInterface.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/PomeranianInterface.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
import java.math.BigInteger;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/ShowDog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/ShowDog.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/ShowDog.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
public class ShowDog
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/SmallDog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/SmallDog.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/SmallDog.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
public class SmallDog
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/Tame.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Tame.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Trainer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/Trainer.java 2009-07-27 16:13:31 UTC (rev 3271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/Trainer.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -1,4 +1,4 @@
-package org.jboss.jsr299.tck.tests.event.transactionalObservers;
+package org.jboss.jsr299.tck.tests.event.observer.transactional;
import javax.ejb.Local;
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java (from rev 3271, 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/observer/transactional/TransactionalObserversTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/transactional/TransactionalObserversTest.java 2009-07-27 23:51:48 UTC (rev 3296)
@@ -0,0 +1,188 @@
+/*
+ * 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.transactional;
+
+import java.lang.annotation.Annotation;
+import java.math.BigInteger;
+
+import javax.ejb.EJBException;
+import javax.enterprise.inject.AnnotationLiteral;
+
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ * Integration tests for Web Bean events.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@IntegrationTest
+@SpecVersion("20090625")
+public class TransactionalObserversTest extends AbstractJSR299Test
+{
+
+ private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>()
+ {
+ };
+ private PomeranianInterface dog = null;
+
+ @Override
+ public void beforeMethod()
+ {
+ super.beforeMethod();
+ dog = (PomeranianInterface) getInstanceByName("Teddy");
+ }
+
+// @AfterMethod(alwaysRun = true)
+// public void teardownTest()
+// {
+// try
+// {
+// dog.removeSessionBean();
+// }
+// catch (Exception e)
+// {
+// // Not important since the bean is now gone one way or the other
+// }
+// }
+
+ @Test(groups = { "events", "integration" })
+ @SpecAssertion(section = "10.4.5", id = "a")
+ public void testTransactionalObserverNotifiedImmediatelyWhenNoTransactionInProgress()
+ {
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getInstanceByType(Agent.class);
+ assert dogAgent != null;
+ dogAgent.sendOutsideTransaction(BigInteger.TEN);
+ assert dog.isCorrectTransactionState();
+ // TODO Fix the security contexts
+ // assert dog.isCorrectContext();
+ }
+
+ @Test(groups = { "events", "integration", "broken" })
+ @SpecAssertion(section = "10.4.5", id = "c")
+ public void testAfterTransactionCompletionObserver() throws InterruptedException
+ {
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ assert !getCurrentManager().resolveObserverMethods("event").isEmpty();
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction("event");
+ Thread.sleep(100);
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "events", "integration", "broken" })
+ @SpecAssertion(section = "10.4.5", id = "d")
+ public void testAfterTransactionSuccessObserver() throws InterruptedException
+ {
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new Integer(4));
+ Thread.sleep(100);
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "events", "integration", "ri-broken" })
+ @SpecAssertion(section = "10.4.5", id = "e")
+ // WBRI-303
+ public void testAfterTransactionFailureObserver() throws InterruptedException
+ {
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new Float(4.0));
+ Thread.sleep(100);
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "events", "integration", "broken" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "10.4.5", id = "b"),
+ @SpecAssertion(section = "10.4.5", id = "e") })
+ public void testBeforeTransactionCompletionObserver()
+ {
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new RuntimeException("test event"));
+ assert dog.isCorrectTransactionState();
+ // TODO Fix the security contexts
+ // assert dog.isCorrectContext();
+ }
+
+ @Test(groups = { "events", "ri-broken" })
+ @SpecAssertion(section = "review", id = "review") // the spec now only mentions asynchronous observer methods in passing
+ // WBRI-303
+ public void testAsynchronousObserverAlsoTransactional() throws InterruptedException
+ {
+ dog.setCorrectContext(false);
+ dog.setCorrectTransactionState(false);
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction('a');
+ Thread.sleep(200);
+ assert dog.isCorrectTransactionState();
+ }
+
+ @Test(groups = { "events", "integration" })
+ @SpecAssertion(section = "10.5", id = "bd")
+ public void testObserverCanSetRollbackOnlyOnTransaction()
+ {
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new DisobedientDog());
+ }
+
+ @Test(groups = { "ri-broken", "events", "integration" }, expectedExceptions = EJBException.class)
+ @SpecAssertion(section = "10.5", id = "bd")
+ // WBRI-303
+ public void testObserverCannotInitiateJtaTransaction()
+ {
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new ShowDog());
+ }
+
+ @Test(groups = { "ri-broken", "events", "integration" }, expectedExceptions = EJBException.class)
+ @SpecAssertion(section = "10.5", id = "bd")
+ // WBRI-303
+ public void testObserverCannotCommitJtaTransaction()
+ {
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new LargeDog());
+ }
+
+ @Test(groups = { "ri-broken", "events", "integration" }, expectedExceptions = EJBException.class)
+ @SpecAssertion(section = "10.5", id = "bd")
+ // WBRI-303
+ public void testObserverCannotRollbackJtaTransaction()
+ {
+ Agent dogAgent = getInstanceByType(Agent.class);
+ dogAgent.sendInTransaction(new SmallDog());
+ }
+}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3295 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-27 19:12:35 -0400 (Mon, 27 Jul 2009)
New Revision: 3295
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Make a start on Scopes and contexts
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java 2009-07-27 23:00:58 UTC (rev 3294)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetFromContextualTest.java 2009-07-27 23:12:35 UTC (rev 3295)
@@ -5,11 +5,11 @@
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -19,8 +19,7 @@
{
@Test(groups = { "contexts" })
@SpecAssertions({
- @SpecAssertion(section = "6.2", id = "o"),
- @SpecAssertion(section = "6.2", id = "na")
+ @SpecAssertion(section = "6.2", id = "o")
})
public void testGetMayNotCreateNewInstanceUnlessCreationalContextGiven()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-27 23:00:58 UTC (rev 3294)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-27 23:12:35 UTC (rev 3295)
@@ -84,9 +84,8 @@
@Test(groups = "beanLifecycle")
@SpecAssertions({
- @SpecAssertion(section = "6.1.1", id = "ca"),
@SpecAssertion(section = "6.1.1", id = "d"),
- @SpecAssertion(section = "6.1.1", id = "e")
+ @SpecAssertion(section = "6.1.1", id = "g")
})
public void testCreateReturnsSameBeanPushed()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 23:00:58 UTC (rev 3294)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 23:12:35 UTC (rev 3295)
@@ -2396,14 +2396,16 @@
<note>A statement about container specific behavior which is not spec defined</note>
</assertion>
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>The container and portable extensions may define implementations of the |Contextual| interface that do not extend |Bean|, but it is not recommended that applications directly implement |Contextual|.</text>
+ <note>Advice only</note>
</assertion>
</section>
<section id="6.1.1" title="The CreationalContext interface">
- <assertion id="ca">
+ <assertion id="ca" testable="false">
<text>The interface |javax.enterprise.context.spi.CreationalContext| provides operations that are used by the |Contextual| implementation during instance creation and destruction.</text>
+ <note>introductory text</note>
</assertion>
<assertion id="d">
@@ -2422,18 +2424,21 @@
<text>If |Contextual.create()| calls |push()|, it must also return the instance passed to |push()|.</text>
</assertion>
- <assertion id="h">
+ <assertion id="h" testable="false">
<text>|Contextual.create()| should use the given |CreationalContext| when obtaining contextual references to inject, as defined in Section 6.5.3, "Contextual reference for a bean", in order to ensure that any dependent objects are associated with the contextual instance that is being created.</text>
+ <note>Advice</note>
</assertion>
- <assertion id="i">
+ <assertion id="i" testable="false">
<text>|Contextual.destroy()| should call |release()| to allow the container to destroy dependent objects of the contextual instance.</text>
+ <note>Advice</note>
</assertion>
</section>
<section id="6.2" title="The Context interface">
- <assertion id="aa">
+ <assertion id="aa" testable="false">
<text>The |javax.enterprise.context.spi.Context| interface provides an operation for obtaining contextual instances with a particular scope of any contextual type.</text>
+ <note>Introductory text</note>
</assertion>
<assertion id="ab">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3294 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-27 19:00:58 -0400 (Mon, 27 Jul 2009)
New Revision: 3294
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/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Match more chapter 3 tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -114,7 +114,8 @@
@SpecAssertions( {
@SpecAssertion(section = "10.4.3", id = "a"),
@SpecAssertion(section = "5.6.8", id = "c"),
- @SpecAssertion(section = "2.3.5", id = "ca")
+ @SpecAssertion(section = "2.3.5", id = "ca"),
+ @SpecAssertion(section = "3.9", id = "a")
})
public void testObserverMethodReceivesInjectionsOnNonObservesParameters()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -83,7 +83,10 @@
* @throws Exception
*/
@Test(groups = { "disposalMethod" })
- @SpecAssertion(section = "3.3.8", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.3.8", id = "a"),
+ @SpecAssertion(section = "3.9", id = "a")
+ })
public void testDisposalMethodParametersGetInjected() throws Exception
{
new RunInDependentContext()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -18,7 +18,7 @@
@Produces
@Deadliest
- public Tarantula producesDeadliestTarantula(@Tame Tarantula tameTarantula, @Current Tarantula tarantula)
+ public Tarantula producesDeadliestTarantula(@Tame Tarantula tameTarantula, Tarantula tarantula)
{
return tameTarantula.getDeathsCaused() >= tarantula.getDeathsCaused() ? tameTarantula : tarantula;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -9,13 +9,13 @@
import javax.enterprise.inject.New;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.AnyLiteral;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
@@ -40,8 +40,9 @@
assert Dependent.class.equals(newEnterpriseBean.getScopeType());
}
- @Test(groups = { "new" })
+ @Test(groups = { "new", "broken" })
@SpecAssertion(section = "3.10", id = "r")
+ // @New has a member value now!
public void testNewBeanIsHasOnlyNewBinding()
{
Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -1,9 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.initializer;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -18,9 +18,9 @@
{
@Test(groups = { "initializerMethod", "ejb3" })
@SpecAssertions({
- @SpecAssertion(section = "3.8", id = "e"),
- @SpecAssertion(section = "3.8", id = "ca")
+ @SpecAssertion(section = "3.8", id = "e")
})
+ // This DOES NOT TEST initializer methods on Java EE component classes PLM
public void testInitializerMethodNotABusinessMethod()
{
AndalusianChicken.nonBusinessMethodCalled = false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -33,7 +33,8 @@
@SpecAssertion(section = "3.8", id = "g"),
@SpecAssertion(section = "3.8.1", id = "a"),
@SpecAssertion(section = "3.8.2", id = "aa"),
- @SpecAssertion(section = "5.6.4", id = "b")
+ @SpecAssertion(section = "5.6.4", id = "b"),
+ @SpecAssertion(section = "3.9", id = "a")
})
public void testMultipleInitializerMethodsAreCalled()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -35,7 +35,8 @@
@SpecAssertion(section = "3.1.4.2", id = "b"),
@SpecAssertion(section = "3.1.4.2", id = "c"),
@SpecAssertion(section = "2.3.5", id = "d"),
- @SpecAssertion(section = "5.6.3", id = "a")
+ @SpecAssertion(section = "5.6.3", id = "a"),
+ @SpecAssertion(section = "3.9")
})
public void testInjectionOfParametersIntoBeanConstructor()
{
@@ -136,7 +137,9 @@
@SpecAssertions({
@SpecAssertion(section = "7.3.1", id = "aa"),
@SpecAssertion(section = "3.7.1", id = "a"),
- @SpecAssertion(section="2.3.4", id="a")
+ @SpecAssertion(section="2.3.4", id="a"),
+ @SpecAssertion(section="3.7", id="aa"),
+ @SpecAssertion(section="3.7", id="ab")
})
public void testCreateInjectsFieldsDeclaredInJava()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -10,13 +10,13 @@
import javax.enterprise.inject.New;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.AnyLiteral;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.jsr299.tck.literals.NewLiteral;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -41,8 +41,9 @@
assert Dependent.class.equals(newSimpleBean.getScopeType());
}
- @Test(groups = { "new" })
+ @Test(groups = { "new", "broken" })
@SpecAssertion(section = "3.10", id = "r")
+ // @New has a member value now!
public void testNewBeanHasOnlyNewBinding()
{
Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-07-27 23:00:58 UTC (rev 3294)
@@ -1,8 +1,8 @@
package org.jboss.jsr299.tck.tests.lookup.injection;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -55,7 +55,9 @@
}
@Test(groups = {"injection", "underInvestigation"})
- @SpecAssertion(section = "3.7", id = "aa")
+ // @SpecAssertion(section = "3.7", id = "aa")
+ @SpecAssertion(section = "review", id = "review")
+ // Looks like this got removed from the spec PLM
public void testInjectingStaticField()
{
assert getBeans(BeanWithStaticBoundField_Broken.class).size() == 1;
@@ -63,7 +65,8 @@
}
@Test(groups = {"injection", "underInvestigation"})
- @SpecAssertion(section = "3.7", id = "ab")
+ // @SpecAssertion(section = "3.7", id = "ab")
+ // Looks like this got removed from the spec PLM
public void testInjectingFinalField()
{
assert getBeans(BeanWithFinalBoundField_Broken.class).size() == 1;
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 22:37:48 UTC (rev 3293)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 23:00:58 UTC (rev 3294)
@@ -1332,8 +1332,9 @@
<text>For each session bean, a second bean exists which has the same bean types.</text>
</assertion>
- <assertion id="l">
+ <assertion id="l" testable="false">
<text>For each session bean, a second bean exists which has the same bean constructor.</text>
+ <note>This is a by product of the English sentence structure, session beans don't have bean constructors</note>
</assertion>
<assertion id="m">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3293 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/conversation/client and 16 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-27 18:37:48 -0400 (Mon, 27 Jul 2009)
New Revision: 3293
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/MethodAnnotatedProducesTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/LongRunningConversationPropagatedByFacesContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.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/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Match in a load of tests and add one
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/ContextTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -7,10 +7,10 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -50,6 +50,7 @@
assert context != null;
context = getCurrentManager().getContext(ApplicationScoped.class);
assert context != null;
- // QUESTION why can't we grab the ConversionScoped context here?
+ // Can't test conversations here, they are only available for a JSF
+ // request. Standalone container only simulates a servlet request
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/LongRunningConversationPropagatedByFacesContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/LongRunningConversationPropagatedByFacesContextTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/LongRunningConversationPropagatedByFacesContextTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -1,6 +1,7 @@
package org.jboss.jsr299.tck.tests.context.conversation.client;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Classes;
@@ -36,7 +37,11 @@
private static final String REDIRECT_STORM_STRENGTH = "15";
@Test(groups = { "contexts" })
- @SpecAssertion(section = "6.7.4", id = "l")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.7.4", id = "l"),
+ @SpecAssertion(section = "2.4.1", id="ba")
+ })
+
public void testConversationPropagated() throws Exception
{
WebClient webClient = new WebClient();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -9,10 +9,10 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -43,7 +43,10 @@
}
@Test
- @SpecAssertion(section = "2.7", id = "c")
+ @SpecAssertions({
+ @SpecAssertion(section = "2.7", id = "c"),
+ @SpecAssertion(section = "2.7.1", id = "b")
+ })
public void testOneStereotypeAllowed()
{
Bean<LongHairedDog> bean = getBeans(LongHairedDog.class).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -9,7 +9,6 @@
import javax.enterprise.inject.spi.ObserverMethod;
import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.AnyLiteral;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
@@ -114,7 +113,8 @@
@Test(groups = { "events" })
@SpecAssertions( {
@SpecAssertion(section = "10.4.3", id = "a"),
- @SpecAssertion(section = "5.6.8", id = "c")
+ @SpecAssertion(section = "5.6.8", id = "c"),
+ @SpecAssertion(section = "2.3.5", id = "ca")
})
public void testObserverMethodReceivesInjectionsOnNonObservesParameters()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -6,10 +6,10 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -29,6 +29,7 @@
@SpecAssertion(section = "3.3.5", id = "e"),
@SpecAssertion(section = "3.3.6", id = "ba"),
@SpecAssertion(section = "3.3.7", id = "a"),
+ @SpecAssertion(section = "3.3.7", id = "b0"),
@SpecAssertion(section = "3.3.9", id = "aa"),
@SpecAssertion(section = "5.6.6", id = "b")
})
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -9,23 +9,25 @@
private static boolean tameSpiderDestroyed = false;
private static boolean deadliestSpiderDestroyed = false;
- @Produces @Tame public Tarantula produceTameTarantula()
+ @Produces
+ @Tame
+ public Tarantula produceTameTarantula()
{
return new DefangedTarantula(0);
}
-
- @Produces @Deadliest public Tarantula producesDeadliestTarantula(@Tame Tarantula tameTarantula,
- @Current Tarantula tarantula)
- {
- return tameTarantula.getDeathsCaused() >= tarantula.getDeathsCaused() ?
- tameTarantula : tarantula;
+
+ @Produces
+ @Deadliest
+ public Tarantula producesDeadliestTarantula(@Tame Tarantula tameTarantula, @Current Tarantula tarantula)
+ {
+ return tameTarantula.getDeathsCaused() >= tarantula.getDeathsCaused() ? tameTarantula : tarantula;
}
-
+
public void destroyTameSpider(@Disposes @Tame Tarantula spider)
{
SpiderProducer.tameSpiderDestroyed = true;
}
-
+
public static void destroyDeadliestSpider(@Disposes @Deadliest Tarantula spider, @Current Tarantula anotherSpider)
{
assert spider != anotherSpider;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -7,10 +7,10 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
@@ -93,7 +93,10 @@
}
@Test(groups = "enterpriseBeans")
- @SpecAssertion(section = "3.2.3", id = "ba")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.2.3", id = "ba"),
+ @SpecAssertion(section = "3.2", id = "e")
+ })
public void testBeanWithScopeAnnotation()
{
Bean<LionLocal> lionBean = getBeans(LionLocal.class).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -11,10 +11,10 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -42,7 +42,6 @@
@Test(groups = {"enterpriseBeans", "clientProxy", "lifecycle", "integration" })
@SpecAssertions( {
- @SpecAssertion(section = "3.2.5", id = "a"),
@SpecAssertion(section = "7.3.2", id = "aa"),
@SpecAssertion(section = "7.3.2", id = "bb"),
@SpecAssertion(section = "7.3.3", id = "b")
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java (from rev 3291, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/MethodAnnotatedProducesTest.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.implementation.initializer.broken.methodAnnotatedProduces;
+
+
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+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;
+
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+@SpecVersion("20090625")
+public class InitializerMethodAnnotatedProducesTest extends AbstractJSR299Test
+{
+
+ @Test(groups = "initializerMethod")
+ @SpecAssertions( { @SpecAssertion(section = "3.8.1", id = "ba"),
+ @SpecAssertion(section = "3.3.2", id = "ca") })
+ public void testInitializerMethodAnnotatedProduces()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/InitializerMethodAnnotatedProducesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/MethodAnnotatedProducesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/MethodAnnotatedProducesTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/MethodAnnotatedProducesTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -1,27 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.initializer.broken.methodAnnotatedProduces;
-
-
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.test.audit.annotations.SpecVersion;
-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;
-
-@Artifact
-(a)ExpectedDeploymentException(DefinitionError.class)
-@SpecVersion("20090625")
-public class MethodAnnotatedProducesTest extends AbstractJSR299Test
-{
-
- @Test(groups = "initializerMethod")
- @SpecAssertions( { @SpecAssertion(section = "3.8.1", id = "ba"),
- @SpecAssertion(section = "3.3.2", id = "ca") })
- public void testInitializerMethodAnnotatedProduces()
- {
- assert false;
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -7,11 +7,11 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -96,7 +96,7 @@
}
@Test(groups = { "producerField" })
- @SpecAssertion(section = "3.4.1", id = "b")
+ @SpecAssertion(section = "3.4.1", id = "ba")
public void testApiTypeForPrimitiveReturn()
{
Set<Bean<?>> beans = getCurrentManager().getBeans("SpiderSize");
@@ -109,7 +109,7 @@
@Test(groups = { "producerField" })
@SpecAssertions({
- @SpecAssertion(section = "3.4.1", id = "b"),
+ @SpecAssertion(section = "3.4.1", id = "bb"),
@SpecAssertion(section = "2.2.1", id = "i")
})
public void testApiTypeForArrayTypeReturn()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -17,8 +17,10 @@
{
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.3", id = "ia")
+// @SpecAssertion(section = "3.3", id = "ia")
+ @SpecAssertion(section = "review", id = "review")
})
+ // I think we can remove this test, it looks very out of date to me and I think 3.3 iaa/ib specifically allow this PLM
public void testParameterizedReturnTypeWithTypeParameter() throws Exception
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -17,7 +17,7 @@
{
@Test
@SpecAssertions({
- @SpecAssertion(section = "3.3", id = "ia"),
+ @SpecAssertion(section = "3.3", id = "ib"),
@SpecAssertion(section = "2.2.1", id="la")
})
public void testParameterizedType()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -18,7 +18,7 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.4", id = "ha"),
+ @SpecAssertion(section = "3.3", id = "ha"),
@SpecAssertion(section="2.2.1", id="lb")
})
public void testParameterizedReturnTypeWithWildcard() throws Exception
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -115,7 +115,7 @@
}
@Test(groups = "producerMethod")
- @SpecAssertion(section = "3.3.1", id = "b")
+ @SpecAssertion(section = "3.3.1", id = "ba")
public void testApiTypeForPrimitiveReturn() throws Exception
{
assert getBeans(Integer.class).size() == 1;
@@ -127,7 +127,7 @@
@Test(groups = "producerMethod")
@SpecAssertions({
- @SpecAssertion(section = "3.3.1", id = "b"),
+ @SpecAssertion(section = "3.3.1", id = "bb"),
@SpecAssertion(section = "2.2.1", id = "i")
})
public void testApiTypeForArrayTypeReturn() throws Exception
@@ -229,7 +229,11 @@
}
@Test
- @SpecAssertion(section = "2.3.5", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "2.3.5", id = "a"),
+ @SpecAssertion(section = "3.3.3", id = "c"),
+ @SpecAssertion(section = "3.3.3", id = "b")
+ })
public void testBindingTypesAppliedToProducerMethodParameters()
{
Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -7,10 +7,10 @@
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -44,8 +44,6 @@
@Test(groups = { "producerMethod" })
@SpecAssertions({
- @SpecAssertion(section = "3.3.3", id = "b"),
- @SpecAssertion(section = "3.3.3", id = "c"),
@SpecAssertion(section = "7.3.4", id = "ea")
})
public void testProducerMethodInvokedOnCreate()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -1,12 +1,15 @@
package org.jboss.jsr299.tck.tests.implementation.simple.resource.persistenceContext;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.spi.Bean;
+import javax.persistence.EntityManager;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -54,4 +57,19 @@
assert managedBean.getPersistenceUnit() != null : "Persistence unit was not injected into bean";
assert managedBean.getPersistenceUnit().isOpen() : "Persistence unit not open injected into bean";
}
+
+ @Test(groups = { "beanLifecycle", "commonAnnotations", "integration" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "3.5.2", id = "a"),
+ @SpecAssertion(section = "3.5.1", id = "hh")
+ })
+ public void testBeanTypesAndBindingTypesOfPersistenceContext()
+ {
+ Bean<EntityManager> managedBeanBean = getBeans(EntityManager.class, new AnnotationLiteral<Default>() {}).iterator().next();
+ assert managedBeanBean.getTypes().size() == 2;
+ assert managedBeanBean.getTypes().contains(Object.class);
+ assert managedBeanBean.getTypes().contains(EntityManager.class);
+ assert managedBeanBean.getBindings().size() == 2;
+ assert annotationSetMatches(managedBeanBean.getBindings(), Any.class, Default.class);
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -28,7 +28,7 @@
@Test
@SpecAssertions({
@SpecAssertion(section = "4.3.1", id = "j"),
- @SpecAssertion(section = "3.3.4", id = "aa")
+ @SpecAssertion(section = "3.2.4", id = "aa")
})
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-07-27 22:37:48 UTC (rev 3293)
@@ -5,10 +5,10 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.Any;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -24,7 +24,8 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "5.6.6", id = "c")
+ @SpecAssertion(section = "5.6.6", id = "c"),
+ @SpecAssertion(section = "3.3.4", id = "aa")
})
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 21:21:44 UTC (rev 3292)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 22:37:48 UTC (rev 3293)
@@ -679,10 +679,12 @@
<assertion id="e">
<text>A stateful session bean may have any scope.</text>
+ <note>No way of testing the real intent of this statement, so we check that a SFSB may be scoped</note>
</assertion>
- <assertion id="f">
+ <assertion id="f" testable="false">
<text>When a contextual instance of a session bean is obtained via the dependency injection service, the behavior of |SessionContext.getInvokedBusinessInterface()| is specific to the container implementation. Portable applications should not rely upon the value returned by this method.</text>
+ <note>This is describing non-portable behavior</note>
</assertion>
<assertion id="g">
@@ -814,9 +816,13 @@
<text>If a producer method return type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- <assertion id="ia">
- <text>If the producer method return type is a parameterized type with a type variable, it must have scope |@Dependent|. If a producer method with a parameterized return type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <assertion id="iaa">
+ <text>If the producer method return type is a parameterized type with a type variable, it must have scope |@Dependent|.</text>
</assertion>
+
+ <assertion id="iab">
+ <text>If a producer method with a parameterized return type with a type variable declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
<assertion id="ib">
<text>If a producer method return type is a type variable the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
@@ -836,9 +842,13 @@
<text>If the return type of a producer method is an interface, the set of bean types contains the return type, all interfaces it extends directly or indirectly and |java.lang.Object|</text>
</assertion>
- <assertion id="b">
- <text>If a return type of a producer method is primitive or is a Java array type, the set of bean types contains exactly two types: the method return type and |java.lang.Object|.</text>
+ <assertion id="ba">
+ <text>If a return type of a producer method is primitive ~or is a Java array type~, the set of bean types contains exactly two types: the method return type and |java.lang.Object|.</text>
</assertion>
+
+ <assertion id="bb">
+ <text>If a return type of a producer method is ~primitive or is~ a Java array type, the set of bean types contains exactly two types: the method return type and |java.lang.Object|.</text>
+ </assertion>
<assertion id="c">
<text>If the return type of a producer method is a class, the set of bean types contains the return type, every superclass and all interfaces it implements directly or indirectly.</text>
@@ -882,9 +892,13 @@
<text>If a non-static method of a session bean class is annotated |@Produces|, and the method is not a business method of the session bean, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- <assertion id="g">
- <text>Interceptors and decorators may not declare producer methods. If an interceptor or decorator has a method annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <assertion id="ga">
+ <text>Interceptors ~and decorators~ may not declare producer methods. If an interceptor ~or decorator~ has a method annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
+
+ <assertion id="gb">
+ <text>~Interceptors and~ decorators may not declare producer methods. If an ~interceptor or~ decorator has a method annotated |@Produces|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
</section>
<section id="3.3.3" title="Producer method parameters">
@@ -1031,8 +1045,12 @@
</assertion>
<assertion id="fa">
- <text>If the producer field type is a parameterized type, it must specify an actual type parameter or type variable for each type parameter</text>
+ <text>If the producer field type is a parameterized type, it must specify an _actual type parameter_ or type variable for each type parameter</text>
</assertion>
+
+ <assertion id="fb">
+ <text>If the producer field type is a parameterized type, it must specify an actual type parameter or _type variable_ for each type parameter</text>
+ </assertion>
<assertion id="ga">
<text>If a producer field type contains a wildcard type parameter the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
@@ -1061,9 +1079,13 @@
<text>The bean types of a producer field depend upon the field type. If the field type is an interface, the set of bean types contains the field type, all interfaces it extends directly or indirectly and java.lang.Object</text>
</assertion>
- <assertion id="b">
- <text>The bean types of a producer field depend upon the field type. If a field type is primitive or is a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object</text>
+ <assertion id="ba">
+ <text>The bean types of a producer field depend upon the field type. If a field type is primitive ~or is a Java array type,~ the set of bean types contains exactly two types: the field type and java.lang.Object</text>
</assertion>
+
+ <assertion id="bb">
+ <text>The bean types of a producer field depend upon the field type. If a field type is ~primitive or is~ a Java array type, the set of bean types contains exactly two types: the field type and java.lang.Object</text>
+ </assertion>
<assertion id="c">
<text>The bean types of a producer field depend upon the field type. If the field type is a class, the set of bean types contains the field type, every superclass and all interfaces it implements directly or indirectly</text>
@@ -1099,18 +1121,21 @@
</section>
<section id="3.5" title="Resources">
- <assertion id="ka">
+ <assertion id="ka" testable="false">
<text>The container is not required to support resources with scope other than |@Dependent|.</text>
+ <note>Statement about non-portable behavior</note>
</assertion>
- <assertion id="l">
+ <assertion id="l" testable="false">
<text>A resource may not declare a bean EL name</text>
+ <note>Doesn't mention the consequences of this</note>
</assertion>
</section>
<section id="3.5.1" title="Declaring a resource">
- <assertion id="aa">
+ <assertion id="aa" testable="false">
<text>A resource may be declared by specifying a Java EE component environment injection annotation as part of a producer field declaration.</text>
+ <note>Introductory text for the folloiwing assertions</note>
</assertion>
<assertion id="bb">
@@ -1133,8 +1158,9 @@
<text>For a web service, |@WebServiceRef| must be specified.</text>
</assertion>
- <assertion id="gg">
+ <assertion id="gg" testable="false">
<text>The injection annotation specifies the metadata needed to obtain the resources, entity manager, entity manager factory, remote EJB instance or web service reference from the component environment.</text>
+ <note>This is defined in other specs</note>
</assertion>
<assertion id="hh">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3292 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/producer/method/broken/parameterizedTypeWithTypeParameter and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-27 17:21:44 -0400 (Mon, 27 Jul 2009)
New Revision: 3292
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java
Log:
assign some tests to chapter 2
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -1,9 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.initializer;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
@@ -17,7 +17,8 @@
@Test(groups = { "initializerMethod" })
@SpecAssertions({
- @SpecAssertion(section = "3.8.2", id = "b")
+ @SpecAssertion(section = "3.8.2", id = "b"),
+ @SpecAssertion(section = "2.3.5", id = "b")
})
public void testBindingTypeOnInitializerParameter()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -1,10 +1,11 @@
package org.jboss.jsr299.tck.tests.implementation.producer.method.broken.parameterizedTypeWithTypeParameter;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -15,7 +16,9 @@
public class ParameterizedTypeWithTypeParameterTest extends AbstractJSR299Test
{
@Test(groups = "producerMethod")
- @SpecAssertion(section = "3.3", id = "ia")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.3", id = "ia")
+ })
public void testParameterizedReturnTypeWithTypeParameter() throws Exception
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -1,10 +1,11 @@
package org.jboss.jsr299.tck.tests.implementation.producer.method.broken.parameterizedTypeWithTypeParameter2;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -15,7 +16,10 @@
public class ParameterizedTypeWithTypeParameterTest extends AbstractJSR299Test
{
@Test
- @SpecAssertion(section = "3.3", id = "ia")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.3", id = "ia"),
+ @SpecAssertion(section = "2.2.1", id="la")
+ })
public void testParameterizedType()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/ParameterizedTypeWithWildcardTest.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -4,6 +4,7 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
@@ -16,7 +17,10 @@
{
@Test(groups = "producerMethod")
- @SpecAssertion(section = "3.4", id = "ha")
+ @SpecAssertions({
+ @SpecAssertion(section = "3.4", id = "ha"),
+ @SpecAssertion(section="2.2.1", id="lb")
+ })
public void testParameterizedReturnTypeWithWildcard() throws Exception
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -9,12 +9,12 @@
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyLiteral;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.literals.AnyLiteral;
-import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -142,7 +142,8 @@
@Test(groups = "producerMethod")
@SpecAssertions({
@SpecAssertion(section = "3.3.2", id = "be"),
- @SpecAssertion(section = "3.3", id = "k")
+ @SpecAssertion(section = "3.3", id = "k"),
+ @SpecAssertion(section="2.3.3", id="b")
})
public void testBindingType() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/RedSnapper.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -7,4 +7,19 @@
class RedSnapper implements Animal
{
+ private boolean touched;
+
+ public void ping()
+ {
+ this.touched = true;
+ }
+
+ /**
+ * @return the touched
+ */
+ public boolean isTouched()
+ {
+ return touched;
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -12,11 +12,11 @@
import javax.enterprise.inject.Specializes;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
@@ -117,22 +117,26 @@
assert fishPond.postConstructCalled = true; // required by Managed Bean specification
}
- @Test(groups = {"beanLifecycle", "broken"})
+ @Test(groups = {"beanLifecycle"})
@SpecAssertions({
@SpecAssertion(section="2", id="g"),
- @SpecAssertion(section="2.2.1", id="b")
+ @SpecAssertion(section="2.2.1", id="b"),
+ @SpecAssertion(section="2.2.1", id="k")
})
- public void testCreateReturnsInstanceOfBean()
+ public void testManagedBean()
{
- // TODO Test needs to use create()!!! PLM
assert getBeans(RedSnapper.class).size() == 1;
assert getInstanceByType(RedSnapper.class) instanceof RedSnapper;
+ RedSnapper redSnapper = getInstanceByType(RedSnapper.class);
+ redSnapper.ping();
+ assert redSnapper.isTouched();
}
@Test(groups = "injection")
@SpecAssertions({
@SpecAssertion(section = "7.3.1", id = "aa"),
- @SpecAssertion(section = "3.7.1", id = "a")
+ @SpecAssertion(section = "3.7.1", id = "a"),
+ @SpecAssertion(section="2.3.4", id="a")
})
public void testCreateInjectsFieldsDeclaredInJava()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java 2009-07-27 20:49:52 UTC (rev 3291)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java 2009-07-27 21:21:44 UTC (rev 3292)
@@ -20,10 +20,10 @@
import javax.enterprise.inject.TypeLiteral;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -33,7 +33,11 @@
{
@Test(groups = { "resolution", "ri-broken" })
- @SpecAssertion(section = "5.3.3", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.3.3", id = "a"),
+ @SpecAssertion(section = "2.2.1", id = "f"),
+ @SpecAssertion(section = "2.2.1", id = "g")
+ })
// WBRI-311
public void testAssignabilityToRawType()
{
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3291 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/event/bindingTypes and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-27 16:49:52 -0400 (Mon, 27 Jul 2009)
New Revision: 3291
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Volume.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.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/StockWatcher.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Marked tests related to non-runtime retention bindings ri-broken; added new test for just the @Any binding on observers
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.java 2009-07-27 20:22:12 UTC (rev 3290)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/BindingTypeNotRuntime.java 2009-07-27 20:49:52 UTC (rev 3291)
@@ -2,12 +2,15 @@
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.enterprise.inject.BindingType;
@Target( { FIELD, PARAMETER })
+@Retention(SOURCE)
@BindingType
@interface BindingTypeNotRuntime
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 20:22:12 UTC (rev 3290)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-27 20:49:52 UTC (rev 3291)
@@ -330,9 +330,8 @@
Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
assert observers.size() == 1;
ObserverMethod<?, ?> observerMethod = observers.iterator().next();
- assert observerMethod.getObservedBindings().size() == 2;
+ assert observerMethod.getObservedBindings().size() == 1;
assert observerMethod.getObservedBindings().contains(new CurrentLiteral());
- assert observerMethod.getObservedBindings().contains(new AnyLiteral());
}
@Test(groups = { "events" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/StockWatcher.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/StockWatcher.java 2009-07-27 20:22:12 UTC (rev 3290)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/StockWatcher.java 2009-07-27 20:49:52 UTC (rev 3291)
@@ -1,10 +1,12 @@
package org.jboss.jsr299.tck.tests.event;
import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
class StockWatcher
{
private static Class<?> observerClazz;
+ private static boolean anyVolumeObserved = false;
public void observeStockPrice(@Observes StockPrice price)
{
@@ -12,8 +14,23 @@
price.recordVisit(this);
}
+ public void observeAllVolume(@Observes @Any Volume volume)
+ {
+ anyVolumeObserved = true;
+ }
+
public static Class<?> getObserverClazz()
{
return observerClazz;
}
+
+ public static boolean isAnyVolumeObserved()
+ {
+ return anyVolumeObserved;
+ }
+
+ public static void setAnyVolumeObserved(boolean anyStockPriceObserved)
+ {
+ StockWatcher.anyVolumeObserved = anyStockPriceObserved;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Volume.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Volume.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Volume.java 2009-07-27 20:49:52 UTC (rev 3291)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.event;
+
+class Volume
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Volume.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java 2009-07-27 20:22:12 UTC (rev 3290)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/EventBindingTypesTest.java 2009-07-27 20:49:52 UTC (rev 3291)
@@ -56,7 +56,7 @@
assert observer.getNumTimesNonRuntimeBindingTypeObserved() == 2;
}
- @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class } )
+ @Test(groups = { "events", "ri-broken" }, expectedExceptions = { IllegalArgumentException.class } )
@SpecAssertion(section = "10.1", id = "f")
public void testFireEventWithNonRuntimeBindingTypeFails()
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 20:22:12 UTC (rev 3290)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 20:49:52 UTC (rev 3291)
@@ -3951,8 +3951,9 @@
<text>When an event is fired by the application, the container must determine the observers for that event according to the observer resolution defined by Section 10.2, "Observer resolution", then then for each observer method, either invoke the observer method immediately or register the observer method for later invocation during the transaction completion phase, using a JTA |Synchronization|.</text>
</assertion>
- <assertion id="b">
+ <assertion id="b" testable="false">
<text>The order in which observers are called in not defined, and so portable applications should not rely upon the order in which observers are called.</text>
+ <note>Behavior is not defined.</note>
</assertion>
<assertion id="bb">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r3290 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/passivating/broken10 and 11 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-27 16:22:12 -0400 (Mon, 27 Jul 2009)
New Revision: 3290
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/EJBRequestContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/TooManyScopesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/exceptionInAfterBeanValidationObserver/AfterDeploymentValidationObserverExecutionFailureTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/SpecializingAndSpecializedBeanHaveNameTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Fix assertions in inheritence, version tests
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/InactiveContextTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -1,25 +0,0 @@
-package org.jboss.jsr299.tck.tests.context;
-
-import javax.enterprise.context.ContextNotActiveException;
-import javax.enterprise.context.RequestScoped;
-
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-@Artifact
-@SpecVersion("20090519")
-public class InactiveContextTest extends AbstractJSR299Test
-{
-
- @Test(expectedExceptions = { ContextNotActiveException.class }, groups = { "manager" })
- @SpecAssertion(section = "6.2", id = "m")
- public void testGetContextWithNoActiveContextsFails()
- {
- getCurrentConfiguration().getContexts().setInactive(getCurrentConfiguration().getContexts().getRequestContext());
- getCurrentManager().getContext(RequestScoped.class);
- }
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken10/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -1,9 +1,9 @@
package org.jboss.jsr299.tck.tests.context.passivating.broken10;
+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.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DeploymentError;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -13,7 +13,7 @@
@Artifact
@Packaging(PackagingType.EAR)
@ExpectedDeploymentException(DeploymentError.class)
-@SpecVersion("unknown")
+@SpecVersion("20090625")
public class UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken2/NonSerializableTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -1,10 +1,10 @@
package org.jboss.jsr299.tck.tests.context.passivating.broken2;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@@ -17,7 +17,7 @@
*/
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
-@SpecVersion("PRD2")
+@SpecVersion("20090625")
public class NonSerializableTest extends AbstractJSR299Test
{
@Test(groups = { "contexts", "passivation" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/EJBRequestContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/EJBRequestContextTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/EJBRequestContextTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -1,8 +1,8 @@
package org.jboss.jsr299.tck.tests.context.request.ejb;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -17,7 +17,7 @@
@Artifact
@IntegrationTest
@Packaging(PackagingType.EAR)
-@SpecVersion("20090519")
+@SpecVersion("20090625")
public class EJBRequestContextTest extends AbstractJSR299Test
{
/**
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -5,9 +5,9 @@
import javax.enterprise.inject.Any;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -27,7 +27,7 @@
public class EnterpriseBindingDefinitionTest extends AbstractJSR299Test
{
@Test
- @SpecAssertion(section = "4.1", id = "ad")
+ @SpecAssertion(section = "4.1", id = "an")
public void testBindingDeclaredInheritedIsInherited() throws Exception
{
Set<? extends Annotation> bindings = getBeans(BorderCollieLocal.class, new HairyBinding(false)).iterator().next().getBindings();
@@ -35,7 +35,7 @@
}
@Test
- @SpecAssertion(section = "4.1", id = "aj")
+ @SpecAssertion(section = "4.1", id = "ar")
public void testBindingDeclaredInheritedIsIndirectlyInherited()
{
Set<? extends Annotation> bindings = getBeans(EnglishBorderCollieLocal.class, new HairyBinding(false)).iterator().next().getBindings();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/TooManyScopesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/TooManyScopesTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/TooManyScopesTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -1,17 +1,17 @@
package org.jboss.jsr299.tck.tests.definition.scope.broken.tooManyScopes;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
-@SpecVersion("20090519")
+@SpecVersion("20090625")
public class TooManyScopesTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -2,9 +2,9 @@
import javax.enterprise.context.RequestScoped;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
@@ -12,17 +12,17 @@
@Artifact
@Packaging(PackagingType.EAR)
-@SpecVersion("20090519")
+@SpecVersion("20090625")
public class EnterpriseScopeDefinitionTest extends AbstractJSR299Test
{
- @Test @SpecAssertion(section="4.1", id = "bb")
+ @Test @SpecAssertion(section="4.1", id = "be")
public void testScopeTypeDeclaredInheritedIsInherited() throws Exception
{
assert getBeans(BorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
- @SpecAssertion(section = "4.1", id = "bd")
+ @SpecAssertion(section = "4.1", id = "bh")
public void testScopeTypeDeclaredInheritedIsIndirectlyInherited()
{
assert getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -3,9 +3,9 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.SessionScoped;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -19,28 +19,28 @@
public class EnterpriseStereotypeDefinitionTest extends AbstractJSR299Test
{
@Test
- @SpecAssertion(section = "4.1", id = "ae")
+ @SpecAssertion(section = "4.1", id = "ao")
public void testStereotypeDeclaredInheritedIsInherited() throws Exception
{
assert getBeans(BorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
- @SpecAssertion(section = "4.1", id = "ak")
+ @SpecAssertion(section = "4.1", id = "as")
public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
{
assert getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
- @SpecAssertion(section = "4.1", id = "hhh")
+ @SpecAssertion(section = "4.1", id = "hhj")
public void testStereotypeScopeIsOverriddenByInheritedScope()
{
assert getBeans(ChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
}
@Test
- @SpecAssertion(section = "4.1", id = "hhi")
+ @SpecAssertion(section = "4.1", id = "hhk")
public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
{
assert getBeans(MexicanChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/exceptionInAfterBeanValidationObserver/AfterDeploymentValidationObserverExecutionFailureTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/exceptionInAfterBeanValidationObserver/AfterDeploymentValidationObserverExecutionFailureTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/exceptionInAfterBeanValidationObserver/AfterDeploymentValidationObserverExecutionFailureTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -17,10 +17,10 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle.broken.exceptionInAfterBeanValidationObserver;
+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.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.DeploymentError;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.testng.annotations.Test;
@@ -34,10 +34,10 @@
*/
@Artifact
@ExpectedDeploymentException(DeploymentError.class)
-@SpecVersion("20090519")
+@SpecVersion("20090625")
public class AfterDeploymentValidationObserverExecutionFailureTest extends AbstractJSR299Test
{
- @Test(groups={"incontainer-ri-broken", "broken"})
+ @Test(groups={"incontainer-ri-broken", "rewrite"})
// TODO Needs Extension stuff adding
// WBRI-312
@SpecAssertion(section = "11.5.3", id = "c")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/bindingTypes/NonRuntimeBindingType.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -3,12 +3,15 @@
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.enterprise.inject.BindingType;
@Target( { FIELD, PARAMETER })
@BindingType
+(a)Retention(RetentionPolicy.CLASS)
@interface NonRuntimeBindingType
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/EnterpriseEventInheritenceTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -4,9 +4,9 @@
import javax.enterprise.inject.spi.ObserverMethod;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
@@ -21,7 +21,7 @@
@Artifact
@Packaging(PackagingType.EAR)
@IntegrationTest
-@SpecVersion("20090519")
+@SpecVersion("20090625")
public class EnterpriseEventInheritenceTest extends AbstractJSR299Test
{
@Test(groups = { "events", "inheritance" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/SpecializingAndSpecializedBeanHaveNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/SpecializingAndSpecializedBeanHaveNameTest.java 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/SpecializingAndSpecializedBeanHaveNameTest.java 2009-07-27 20:22:12 UTC (rev 3290)
@@ -1,17 +1,17 @@
package org.jboss.jsr299.tck.tests.inheritance.specialization.producer.method.broken.specializingAndSpecializedBeanHaveName;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
-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;
@Artifact
@ExpectedDeploymentException(DefinitionError.class)
-@SpecVersion("20090519")
+@SpecVersion("20090625")
public class SpecializingAndSpecializedBeanHaveNameTest extends AbstractJSR299Test
{
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 19:59:32 UTC (rev 3289)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-27 20:22:12 UTC (rev 3290)
@@ -1399,7 +1399,39 @@
<assertion id="ak">
<text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
</assertion>
+
+ <assertion id="al">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+ <assertion id="am">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="an">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ao">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ap">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="aq">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="ar">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _binding type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
+ <assertion id="as">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _stereotype_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares an annotation of type Z.</text>
+ </assertion>
+
<assertion id="ba">
<text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
</assertion>
@@ -1415,7 +1447,23 @@
<assertion id="bd">
<text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
</assertion>
+
+ <assertion id="be">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
+ </assertion>
+ <assertion id="bf">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and Y does not declare a scope type.</text>
+ </assertion>
+
+ <assertion id="bg">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
+ <assertion id="bh">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, if X is annotated with a _scope type_ Z then Y inherits the annotation if and only if Z declares the |@Inherited| meta-annotation and neither Y nor any intermediate class that is a subclass of X and a superclass of Y declares a scope type.</text>
+ </assertion>
+
<assertion id="hhh">
<text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
</assertion>
@@ -1423,6 +1471,14 @@
<assertion id="hhi">
<text>For class X which is extended _indirectly_ by the bean class of a _managed_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
</assertion>
+
+ <assertion id="hhj">
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
+ </assertion>
+
+ <assertion id="hhk">
+ <text>For class X which is extended _indirectly_ by the bean class of a _session_ bean Y, a scope type explicitly declared by X and inherited by Y from X takes precedence over default scopes of stereotypes declared or inherited by Y.</text>
+ </assertion>
<assertion id="i" testable="false">
<text>For annotations defined by the bean specification, all built-in _scope types_ are declared |@Inherited|</text>
@@ -1453,7 +1509,7 @@
</assertion>
<assertion id="ab">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares an injected field x then Y inherits x.</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares an injected field x then Y inherits x.</text>
</assertion>
<assertion id="ac">
@@ -1469,7 +1525,7 @@
</assertion>
<assertion id="bab">
- <text>For class X which is extended _directly_ by the bean class of a _managed_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
+ <text>For class X which is extended _directly_ by the bean class of a _session_ bean Y, if X declares a _|@PostConstruct|_ method x() then Y inherits x() if and only if Y does not override the method x()</text>
</assertion>
<assertion id="bac">
15 years, 6 months