Weld SVN: r4547 - core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-02 12:17:25 -0500 (Mon, 02 Nov 2009)
New Revision: 4547
Added:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedObject.java
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java
Log:
Fix test
Copied: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedObject.java (from rev 4529, core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplictionScopedObject.java)
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedObject.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedObject.java 2009-11-02 17:17:25 UTC (rev 4547)
@@ -0,0 +1,20 @@
+package org.jboss.weld.test.unit.context;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class ApplicationScopedObject
+{
+ private AtomicInteger counter = new AtomicInteger();
+
+ public void increment()
+ {
+ counter.incrementAndGet();
+ }
+ public int getValue()
+ {
+ return counter.get();
+ }
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedObject.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java 2009-11-02 16:19:08 UTC (rev 4546)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/context/ApplicationScopedTest.java 2009-11-02 17:17:25 UTC (rev 4547)
@@ -14,6 +14,7 @@
public void testConcurrentInitilized() throws InterruptedException
{
final CountDownLatch latch = new CountDownLatch(10);
+ final ApplicationScopedObject applictionScopedObject = getCurrentManager().getInstanceByType(ApplicationScopedObject.class);
for (int i = 0; i < 10; i++)
{
new Thread(new Runnable()
@@ -22,7 +23,7 @@
{
try
{
- getCurrentManager().getInstanceByType(ApplictionScopedObject.class).increment();
+ applictionScopedObject.increment();
}
finally
{
@@ -32,7 +33,7 @@
}).start();
}
latch.await();
- int value = getCurrentManager().getInstanceByType(ApplictionScopedObject.class).getValue();
+ int value = applictionScopedObject.getValue();
assert value == 10;
}
16 years, 5 months
Weld SVN: r4546 - api/trunk/cdi/src/main/java/javax/enterprise/inject.
by weld-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2009-11-02 11:19:08 -0500 (Mon, 02 Nov 2009)
New Revision: 4546
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/inject/Model.java
Log:
@Documented
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/Model.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/Model.java 2009-11-02 14:58:40 UTC (rev 4545)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/Model.java 2009-11-02 16:19:08 UTC (rev 4546)
@@ -5,6 +5,7 @@
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;
@@ -22,6 +23,7 @@
@Named
@RequestScoped
+@Documented
@Stereotype
@Target( { TYPE, METHOD, FIELD })
@Retention(RUNTIME)
16 years, 5 months
Weld SVN: r4545 - api/trunk/weld-spi/src/main/java/org/jboss/weld/manager/api.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-02 09:58:40 -0500 (Mon, 02 Nov 2009)
New Revision: 4545
Modified:
api/trunk/weld-spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java
Log:
add getId
Modified: api/trunk/weld-spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java
===================================================================
--- api/trunk/weld-spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java 2009-11-02 14:26:00 UTC (rev 4544)
+++ api/trunk/weld-spi/src/main/java/org/jboss/weld/manager/api/WeldManager.java 2009-11-02 14:58:40 UTC (rev 4545)
@@ -115,5 +115,11 @@
* @return
*/
public <X> InjectionTarget<X> fireProcessInjectionTarget(AnnotatedType<X> type);
+
+ /**
+ * The ID of the manager, identical to the ID provided by the BDA
+ * @return
+ */
+ public String getId();
}
16 years, 5 months
Weld SVN: r4544 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: peteroyle
Date: 2009-11-02 09:26:00 -0500 (Mon, 02 Nov 2009)
New Revision: 4544
Modified:
doc/trunk/reference/en-US/environments.xml
Log:
typo
Modified: doc/trunk/reference/en-US/environments.xml
===================================================================
--- doc/trunk/reference/en-US/environments.xml 2009-11-02 14:24:46 UTC (rev 4543)
+++ doc/trunk/reference/en-US/environments.xml 2009-11-02 14:26:00 UTC (rev 4544)
@@ -276,7 +276,7 @@
bean manager in Java SE, automatically registering all simple beans found on
the classpath. Application developers need not write any bootstrapping code.
The entry point for application code is a simple bean which observes the special <literal>ContainerInitialized</literal>
- event provided by this extension. The command line paramters can be
+ event provided by this extension. The command line parameters can be
injected using either of the following:
</para>
<programlisting role="JAVA"><![CDATA[@Inject @Parameters List<String> params;
16 years, 5 months
Weld SVN: r4543 - doc/trunk/reference/en-US.
by weld-commits@lists.jboss.org
Author: peteroyle
Date: 2009-11-02 09:24:46 -0500 (Mon, 02 Nov 2009)
New Revision: 4543
Modified:
doc/trunk/reference/en-US/environments.xml
Log:
Updated Java SE section, removing Web Beans references, correcting code and improving wording.
Modified: doc/trunk/reference/en-US/environments.xml
===================================================================
--- doc/trunk/reference/en-US/environments.xml 2009-11-02 13:36:30 UTC (rev 4542)
+++ doc/trunk/reference/en-US/environments.xml 2009-11-02 14:24:46 UTC (rev 4543)
@@ -224,16 +224,17 @@
<section>
<title>Java SE</title>
- <para>
- Apart from improved integration of the Enterprise Java stack, Weld also provides a state of the art
- typesafe, stateful dependency injection framework. This is useful in a wide range of application types,
- enterprise or otherwise. To facilitate this, Weld provides a simple means for executing in the Java
- Standard Edition environment independently of any Enterprise Edition features.
+ <para>In addition to improved integration of the Enterprise Java stack,
+ the "Contexts and Dependency Injection for the Java EE platform" specification
+ also defines a state of the art typesafe, stateful dependency injection
+ framework, which can prove useful in a wide range of application types.
+ To help developers take advantage of this, Weld provides a simple means
+ for being executed in the Java Standard Edition environment independently
+ of any Java EE APIs.
</para>
- <para>
- When executing in the SE environment the following features of Weld are available:
- </para>
+ <para>When executing in the SE environment the following features of Weld
+ are available:</para>
<itemizedlist>
<listitem>
@@ -269,36 +270,34 @@
</itemizedlist>
<section id="weld-se">
- <title>CDI SE Module</title>
+ <title>CDI SE Module</title>
- <para>
- To make life easy for developers, Weld provides a special module with a main method which will boot the CDI
- bean manager, automatically registering all JavaBeans found on the classpath. This eliminates the need for
- application developers to write any bootstrapping code. The entry point for a CDI SE applications is a bean
- which observes the special <literal>ContainerInitialized</literal> event provided by the SE module. The
- command line paramters can be injected using either of the following:
+ <para>Weld provides an extension which will boot a CDI
+ bean manager in Java SE, automatically registering all simple beans found on
+ the classpath. Application developers need not write any bootstrapping code.
+ The entry point for application code is a simple bean which observes the special <literal>ContainerInitialized</literal>
+ event provided by this extension. The command line paramters can be
+ injected using either of the following:
</para>
+ <programlisting role="JAVA"><![CDATA[@Inject @Parameters List<String> params;
+@Inject @Parameters String[] paramsArray; // useful for compatability with existing classes]]></programlisting>
- <programlisting role="JAVA"><![CDATA[@Parameters List<String> params;
-@Parameters String[] paramsArray; // useful for compatability with existing classes]]></programlisting>
-
<para>
- Here's an example of a simple CDI SE application:
+ Here's an example of a simple CDI SE application:
</para>
<programlisting role="JAVA"><![CDATA[@ApplicationScoped
-public class HelloWorld {
- @Parameters List<String> parameters;
+public class HelloWorld
+{
+ @Inject @Parameters List<String> parameters;
public void printHello(@Observes ContainerInitialized event) {
System.out.println("Hello " + parameters.get(0));
}
}]]></programlisting>
- <para>
- CDI SE applications are started by running the following main method.
- </para>
-
+ <para>CDI SE applications can be bootstrapped by running the StartMain
+ class like so:</para>
<programlisting role="JAVA"><![CDATA[java org.jboss.weld.environments.se.StartMain <args>]]></programlisting>
<para>
16 years, 5 months
Weld SVN: r4542 - in cdi-tck/trunk/impl/src/main: resources/org/jboss/jsr299/tck/tests/interceptors/definition/custom and 1 other directory.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-11-02 08:36:30 -0500 (Mon, 02 Nov 2009)
New Revision: 4542
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SecureLiteral.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SimpleInterceptorWithoutAnnotations.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/TransactionalLiteral.java
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/InterceptorClass.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/AfterBeanDiscoveryObserver.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorImplementation.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorTest.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/custom/beans.xml
Log:
Tests for section 9.5
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/AfterBeanDiscoveryObserver.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/AfterBeanDiscoveryObserver.java 2009-11-02 13:28:40 UTC (rev 4541)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/AfterBeanDiscoveryObserver.java 2009-11-02 13:36:30 UTC (rev 4542)
@@ -3,12 +3,24 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.Extension;
+import static javax.enterprise.inject.spi.InterceptionType.*;
public class AfterBeanDiscoveryObserver implements Extension
{
+ public static final CustomInterceptorImplementation POST_CONSTRUCT_INTERCEPTOR = new CustomInterceptorImplementation(POST_CONSTRUCT);
+ public static final CustomInterceptorImplementation PRE_DESTROY_INTERCEPTOR = new CustomInterceptorImplementation(PRE_DESTROY);
+ public static final CustomInterceptorImplementation POST_ACTIVATE_INTERCEPTOR = new CustomInterceptorImplementation(POST_ACTIVATE);
+ public static final CustomInterceptorImplementation PRE_PASSIVATE_INTERCEPTOR = new CustomInterceptorImplementation(PRE_PASSIVATE);
+ public static final CustomInterceptorImplementation AROUND_INVOKE_INTERCEPTOR = new CustomInterceptorImplementation(AROUND_INVOKE);
+ public static final CustomInterceptorImplementation AROUND_TIMEOUT_INTERCEPTOR = new CustomInterceptorImplementation(AROUND_TIMEOUT);
+
public void addInterceptors(@Observes AfterBeanDiscovery event) {
- event.addBean(new CustomInterceptorImplementation());
+ event.addBean(POST_CONSTRUCT_INTERCEPTOR);
+ event.addBean(PRE_DESTROY_INTERCEPTOR);
+ event.addBean(POST_ACTIVATE_INTERCEPTOR);
+ event.addBean(PRE_PASSIVATE_INTERCEPTOR);
+ event.addBean(AROUND_INVOKE_INTERCEPTOR);
+ event.addBean(AROUND_TIMEOUT_INTERCEPTOR);
}
-
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorImplementation.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorImplementation.java 2009-11-02 13:28:40 UTC (rev 4541)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorImplementation.java 2009-11-02 13:36:30 UTC (rev 4542)
@@ -14,13 +14,17 @@
import javax.enterprise.util.AnnotationLiteral;
import javax.interceptor.InvocationContext;
-class CustomInterceptorImplementation implements Interceptor<InterceptorClass>
+class CustomInterceptorImplementation implements Interceptor<SimpleInterceptorWithoutAnnotations>
{
private Set<Annotation> interceptorBindingTypes = new HashSet<Annotation>();
+ private InterceptionType type;
+ private boolean getInterceptorBindingsCalled = false;
+ private boolean interceptsCalled = false;
- public CustomInterceptorImplementation()
+ public CustomInterceptorImplementation(InterceptionType type)
{
+ this.type = type;
interceptorBindingTypes.add(new AnnotationLiteral<Secure>()
{
});
@@ -29,11 +33,6 @@
});
}
- public Set<Annotation> getInterceptorBindings()
- {
- return Collections.unmodifiableSet(interceptorBindingTypes);
- }
-
public Set<InjectionPoint> getInjectionPoints()
{
return Collections.emptySet();
@@ -77,7 +76,7 @@
return false;
}
- public Object intercept(InterceptionType type, InterceptorClass instance, InvocationContext ctx)
+ public Object intercept(InterceptionType type, SimpleInterceptorWithoutAnnotations instance, InvocationContext ctx)
{
try {
return instance.intercept(ctx);
@@ -88,21 +87,39 @@
public boolean intercepts(InterceptionType type)
{
- return type.equals(InterceptionType.AROUND_INVOKE);
+ interceptsCalled = true;
+ return this.type.equals(type);
}
+ public Set<Annotation> getInterceptorBindings()
+ {
+ return Collections.unmodifiableSet(interceptorBindingTypes);
+ }
+
public Class<?> getBeanClass()
{
- return InterceptorClass.class;
+ return SimpleInterceptorWithoutAnnotations.class;
}
- public InterceptorClass create(CreationalContext<InterceptorClass> creationalContext)
+ public SimpleInterceptorWithoutAnnotations create(CreationalContext<SimpleInterceptorWithoutAnnotations> creationalContext)
{
- return new InterceptorClass();
+ return new SimpleInterceptorWithoutAnnotations();
}
- public void destroy(InterceptorClass instance, CreationalContext<InterceptorClass> creationalContext)
+ public void destroy(SimpleInterceptorWithoutAnnotations instance, CreationalContext<SimpleInterceptorWithoutAnnotations> creationalContext)
{
creationalContext.release();
}
+
+
+ public boolean isGetInterceptorBindingsCalled()
+ {
+ return getInterceptorBindingsCalled;
+ }
+
+
+ public boolean isInterceptsCalled()
+ {
+ return interceptsCalled;
+ }
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorTest.java 2009-11-02 13:28:40 UTC (rev 4541)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/CustomInterceptorTest.java 2009-11-02 13:36:30 UTC (rev 4542)
@@ -16,8 +16,7 @@
*/
package org.jboss.jsr299.tck.tests.interceptors.definition.custom;
-import javax.enterprise.inject.spi.InterceptionType;
-import javax.enterprise.util.AnnotationLiteral;
+import static javax.enterprise.inject.spi.InterceptionType.*;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
@@ -36,14 +35,62 @@
public class CustomInterceptorTest extends AbstractJSR299Test
{
@Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.5", id = "fa")
+ // WELD-238
+ public void testCustomPostConstructInterceptor()
+ {
+ assert !getCurrentManager().resolveInterceptors(POST_CONSTRUCT, new SecureLiteral(), new TransactionalLiteral()).isEmpty();
+ assert AfterBeanDiscoveryObserver.POST_CONSTRUCT_INTERCEPTOR.isGetInterceptorBindingsCalled();
+ assert AfterBeanDiscoveryObserver.POST_CONSTRUCT_INTERCEPTOR.isInterceptsCalled();
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.5", id = "fb")
+ // WELD-238
+ public void testCustomPreDestroyInterceptor()
+ {
+ assert !getCurrentManager().resolveInterceptors(PRE_DESTROY, new SecureLiteral(), new TransactionalLiteral()).isEmpty();
+ assert AfterBeanDiscoveryObserver.PRE_DESTROY_INTERCEPTOR.isGetInterceptorBindingsCalled();
+ assert AfterBeanDiscoveryObserver.PRE_DESTROY_INTERCEPTOR.isInterceptsCalled();
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.5", id = "fc")
+ // WELD-238
+ public void testCustomPostActivateInterceptor()
+ {
+ assert !getCurrentManager().resolveInterceptors(POST_ACTIVATE, new SecureLiteral(), new TransactionalLiteral()).isEmpty();
+ assert AfterBeanDiscoveryObserver.POST_ACTIVATE_INTERCEPTOR.isGetInterceptorBindingsCalled();
+ assert AfterBeanDiscoveryObserver.POST_ACTIVATE_INTERCEPTOR.isInterceptsCalled();
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.5", id = "fd")
+ // WELD-238
+ public void testCustomPrePassivateInterceptor()
+ {
+ assert !getCurrentManager().resolveInterceptors(PRE_PASSIVATE, new SecureLiteral(), new TransactionalLiteral()).isEmpty();
+ assert AfterBeanDiscoveryObserver.PRE_PASSIVATE_INTERCEPTOR.isGetInterceptorBindingsCalled();
+ assert AfterBeanDiscoveryObserver.PRE_PASSIVATE_INTERCEPTOR.isInterceptsCalled();
+ }
+
+ @Test(groups = "ri-broken")
@SpecAssertion(section = "9.5", id = "fe")
// WELD-238
public void testCustomAroundInvokeInterceptor()
{
- assert !getCurrentManager().resolveInterceptors(InterceptionType.AROUND_INVOKE, new AnnotationLiteral<Secure>()
- {
- }, new AnnotationLiteral<Transactional>()
- {
- }).isEmpty();
+ assert !getCurrentManager().resolveInterceptors(AROUND_INVOKE, new SecureLiteral(), new TransactionalLiteral()).isEmpty();
+ assert AfterBeanDiscoveryObserver.AROUND_INVOKE_INTERCEPTOR.isGetInterceptorBindingsCalled();
+ assert AfterBeanDiscoveryObserver.AROUND_INVOKE_INTERCEPTOR.isInterceptsCalled();
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.5", id = "ff")
+ // WELD-238
+ public void testCustomAroundTimeoutInterceptor()
+ {
+ assert !getCurrentManager().resolveInterceptors(AROUND_TIMEOUT, new SecureLiteral(), new TransactionalLiteral()).isEmpty();
+ assert AfterBeanDiscoveryObserver.AROUND_TIMEOUT_INTERCEPTOR.isGetInterceptorBindingsCalled();
+ assert AfterBeanDiscoveryObserver.AROUND_TIMEOUT_INTERCEPTOR.isInterceptsCalled();
+ }
}
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/InterceptorClass.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/InterceptorClass.java 2009-11-02 13:28:40 UTC (rev 4541)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/InterceptorClass.java 2009-11-02 13:36:30 UTC (rev 4542)
@@ -1,10 +0,0 @@
-package org.jboss.jsr299.tck.tests.interceptors.definition.custom;
-
-import javax.interceptor.InvocationContext;
-
-class InterceptorClass
-{
- public Object intercept(InvocationContext ctx) throws Exception {
- return ctx.proceed();
- }
-}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SecureLiteral.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SecureLiteral.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SecureLiteral.java 2009-11-02 13:36:30 UTC (rev 4542)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.custom;
+
+import javax.enterprise.util.AnnotationLiteral;
+
+class SecureLiteral extends AnnotationLiteral<Secure> implements Secure
+{
+
+}
Copied: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SimpleInterceptorWithoutAnnotations.java (from rev 4539, cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/InterceptorClass.java)
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SimpleInterceptorWithoutAnnotations.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/SimpleInterceptorWithoutAnnotations.java 2009-11-02 13:36:30 UTC (rev 4542)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.custom;
+
+import javax.interceptor.InvocationContext;
+
+class SimpleInterceptorWithoutAnnotations
+{
+ public Object intercept(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/TransactionalLiteral.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/TransactionalLiteral.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/custom/TransactionalLiteral.java 2009-11-02 13:36:30 UTC (rev 4542)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.custom;
+
+import javax.enterprise.util.AnnotationLiteral;
+
+class TransactionalLiteral extends AnnotationLiteral<Transactional> implements Transactional
+{
+
+}
Modified: cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/custom/beans.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/custom/beans.xml 2009-11-02 13:28:40 UTC (rev 4541)
+++ cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/custom/beans.xml 2009-11-02 13:36:30 UTC (rev 4542)
@@ -1,5 +1,5 @@
<beans>
<interceptors>
- <class>org.jboss.jsr299.tck.tests.interceptors.definition.custom.InterceptorClass</class>
+ <class>org.jboss.jsr299.tck.tests.interceptors.definition.custom.SimpleInterceptorWithoutAnnotations</class>
</interceptors>
</beans>
16 years, 5 months
Weld SVN: r4541 - core/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/extensions.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-02 08:28:40 -0500 (Mon, 02 Nov 2009)
New Revision: 4541
Removed:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/extensions/NonBDAExtensionTest.java
Log:
remove bad file
Deleted: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/extensions/NonBDAExtensionTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/extensions/NonBDAExtensionTest.java 2009-11-02 13:03:40 UTC (rev 4540)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/extensions/NonBDAExtensionTest.java 2009-11-02 13:28:40 UTC (rev 4541)
@@ -1,86 +0,0 @@
-package org.jboss.weld.test.unit.deployment.structure.extensions;
-
-import javax.enterprise.inject.spi.Extension;
-
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.weld.bootstrap.spi.Deployment;
-import org.jboss.weld.mock.AbstractMockDeployment;
-import org.jboss.weld.mock.MockBeanDeploymentArchive;
-import org.jboss.weld.mock.MockServletLifecycle;
-import org.jboss.weld.mock.TestContainer;
-import org.jboss.weld.util.serviceProvider.PackageServiceLoaderFactory;
-import org.jboss.weld.util.serviceProvider.ServiceLoaderFactory;
-import org.testng.annotations.Test;
-
-public class NonBDAExtensionTest
-{
-
- @Test(description="WELD-233")
- public void test()
- {
- // Create the BDA in which we will deploy Observer1 and Foo. This is equivalent to a war or ejb jar
- final MockBeanDeploymentArchive bda1 = new MockBeanDeploymentArchive("1", Observer1.class, Foo.class);
-
- // Create the BDA to return from loadBeanDeploymentArchive for Observer2, this is probably a library, though could be another war or ejb jar
- // bda2 is accessible from bda1, but isn't added to it's accessibility graph by default. This similar to an archive which doesn't contain a beans.xml but does contain an extension
- final BeanDeploymentArchive bda2 = new MockBeanDeploymentArchive("2", Observer2.class);
-
- // Create a deployment, that we can use to mirror the structure of one Extension inside a BDA, and one outside
- Deployment deployment = new AbstractMockDeployment(bda1)
- {
-
- public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
- {
- // Return bda2 if it is Observer2. Stick anything else which this test isn't about in bda1
- if (beanClass.equals(Observer2.class))
- {
- // If Observer2 is requested, then we need to add bda2 to the accessibility graph of bda1
- bda1.getBeanDeploymentArchives().add(bda2);
- return bda2;
- }
- else
- {
- return bda1;
- }
- }
-
- };
-
- TestContainer container = new TestContainer(new MockServletLifecycle(deployment, bda1));
- container.getLifecycle().initialize();
-
- // Add custom ServiceLoader so that we can load Extension services from current package, not META-INF/services
- // We do this after startContainer() so we replace the default impl
- deployment.getServices().add(ServiceLoaderFactory.class, new PackageServiceLoaderFactory(NonBDAExtensionTest.class.getPackage(), Extension.class));
-
- // Cause the container to deploy the beans etc.
- container.getLifecycle().beginApplication();
-
- // Get the bean manager for bda1 and bda2
- BeanManagerImpl beanManager1 = container.getBeanManager();
- BeanManagerImpl beanManager2 = container.getLifecycle().getBootstrap().getManager(bda2);
-
- Observer1 observer1 = beanManager1.getInstanceByType(Observer1.class);
- assert observer1.isBeforeBeanDiscoveryCalled();
- assert observer1.isAfterBeanDiscoveryCalled();
- assert observer1.isAfterDeploymentValidationCalled();
- assert observer1.isProcessInjectionTargetCalled();
- assert observer1.isProcessManagedBeanCalled();
- assert observer1.isProcessProducerCalled();
-
- assert beanManager2.getBeans(Observer2.class).size() == 1;
- // Also check that the accessibility graph has been updated
- assert beanManager1.getBeans(Observer2.class).size() == 1;
-
- Observer2 observer2 = beanManager2.getInstanceByType(Observer2.class);
- assert observer2.isBeforeBeanDiscoveryCalled();
- assert observer2.isAfterBeanDiscoveryCalled();
- assert observer2.isAfterDeploymentValidationCalled();
- assert observer2.isProcessInjectionTargetCalled();
- assert observer2.isProcessManagedBeanCalled();
- assert observer2.isProcessProducerCalled();
-
- }
-
-}
16 years, 5 months
Weld SVN: r4540 - examples/trunk/se/hello-world/src/main/java/org/jboss/weld/environment/se/example/simple.
by weld-commits@lists.jboss.org
Author: peteroyle
Date: 2009-11-02 08:03:40 -0500 (Mon, 02 Nov 2009)
New Revision: 4540
Modified:
examples/trunk/se/hello-world/src/main/java/org/jboss/weld/environment/se/example/simple/HelloWorld.java
Log:
cleaned imports
Modified: examples/trunk/se/hello-world/src/main/java/org/jboss/weld/environment/se/example/simple/HelloWorld.java
===================================================================
--- examples/trunk/se/hello-world/src/main/java/org/jboss/weld/environment/se/example/simple/HelloWorld.java 2009-11-02 04:05:54 UTC (rev 4539)
+++ examples/trunk/se/hello-world/src/main/java/org/jboss/weld/environment/se/example/simple/HelloWorld.java 2009-11-02 13:03:40 UTC (rev 4540)
@@ -18,7 +18,6 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
-import javax.inject.Inject;
import org.jboss.weld.environment.se.events.ContainerInitialized;
import javax.inject.Inject;
16 years, 5 months
Weld SVN: r4539 - cdi-tck/trunk/impl/src/main/resources.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-11-01 23:05:54 -0500 (Sun, 01 Nov 2009)
New Revision: 4539
Modified:
cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
assertions for inheritance chapter
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-11-02 03:57:14 UTC (rev 4538)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-11-02 04:05:54 UTC (rev 4539)
@@ -1996,9 +1996,13 @@
<assertion id="k">
<text>A bean X that specializes bean Y will have the same name as Y if Y has a name.</text>
</assertion>
+
+ <assertion id="l">
+ <text>X must have all bean types of Y. If X does not support some bean type of Y, the container automatically detects the problem and treats it as a definition error.</text>
+ </assertion>
<group>
- <text>If X declares a name explicitly, using |@Named|, 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>
+ <text>If Y has a name and X declares a name explicitly, using |@Named|, the container automatically detects the problem and treats it as a definition error.</text>
<assertion id="la">
<text>Test that a specializing producer method with a name throws a deployment exception.</text>
@@ -2012,9 +2016,9 @@
<text>Test that a specializing enterprise bean with a name throws a deployment exception.</text>
</assertion>
</group>
-
- <assertion id="m">
- <text>X must have all the bean types of Y. If X does not support some bean type of Y, 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="n">
+ <text>If an interceptor or decorator is annotated |@Specializes|, non-portable behavior results.</text>
</assertion>
</section>
16 years, 5 months
Weld SVN: r4538 - cdi-tck/trunk/impl/src/main/resources.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-11-01 22:57:14 -0500 (Sun, 01 Nov 2009)
New Revision: 4538
Modified:
cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
assertions for programming model chapter
Modified: cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-11-02 03:09:41 UTC (rev 4537)
+++ cdi-tck/trunk/impl/src/main/resources/tck-audit-cdi.xml 2009-11-02 03:57:14 UTC (rev 4538)
@@ -674,6 +674,10 @@
<assertion id="f">
<text>A top-level Java class is not a managed bean if it is annotated with any of the EJB component-defining annotations</text>
</assertion>
+
+ <assertion id="g">
+ <text>A top-level Java class is not a managed bean if it implements |javax.enterprise.inject.spi.Extension|.</text>
+ </assertion>
<assertion id="n">
<text>A top-level Java class is not a managed bean if it is declared as an EJB bean class in |ejb-jar.xml|</text>
@@ -775,7 +779,7 @@
<section id="3.2" title="Session beans">
<assertion id="aa" testable="false">
- <text>A session bean is a bean that is implemented by a session bean with an EJB 3.x client view. The basic lifecycle and semantics of an EJB session bean are defined by the EJB specification.</text>
+ <text>A session bean is a bean that is implemented by a session bean with an EJB 3.x client view. The basic lifecycle and semantics of EJB session beans are defined by the EJB specification.</text>
<note>This is a reference to the EJB specification</note>
</assertion>
@@ -810,26 +814,25 @@
</assertion>
<assertion id="i">
- <text>If the session bean class is a generic type, it must have scope |@Dependent|. If a session bean with a parameterized bean class 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>
+ <text>If the session bean class is a generic type, it must have scope |@Dependent|. If a session bean with a parameterized bean class declares any scope other than |@Dependent|, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
</section>
<section id="3.2.1" title="EJB remove methods of session beans">
<assertion id="a">
- <text>If a session bean is a stateful session bean, and the scope is |@Dependent|, the application may call any EJB remove method of an instance of the session bean.</text>
+ <text>If a session bean is a stateful session bean, and the scope is |@Dependent|, the application may call any EJB remove method of a contextual instance of the session bean.</text>
</assertion>
<assertion id="b">
- <text>If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method of any instance of the session bean. If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown</text>
+ <text>If a session bean is a stateful session bean, and the scope is not |@Dependent|, the application may not directly call any EJB remove method of any instance of the session bean. If the application directly calls an EJB remove method of any contextual instance of a session bean that is a stateful session bean and declares any scope other than |@Dependent|, an |UnsupportedOperationException| is thrown</text>
</assertion>
<assertion id="da">
- <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then no parameters are passed to the method by the container.</text>
+ <text>If the application directly calls an EJB remove method of a contextual instance of a session bean that is a stateful session bean and has scope |@Dependent| then no parameters are passed to the method by the container.</text>
</assertion>
<assertion id="dba">
- <text>If the application directly calls an EJB remove method of an instance of a session bean that is a stateful session bean and has scope |@Dependent| then the container ignores the instance instead of destroying it when |Contextual.destroy()| is called, as defined in Section 6.5, "Lifecycle of stateful session beans"</text>
+ <text>If the application directly calls an EJB remove method of a contextual instance of a session bean that is a stateful session bean and has scope |@Dependent| then the container ignores the instance instead of destroying it when |Contextual.destroy()| is called, as defined in Section 6.5, "Lifecycle of stateful session beans"</text>
</assertion>
</section>
@@ -887,7 +890,7 @@
</assertion>
<assertion id="da">
- <text>If the bean class of X does not directly extend the bean class of another 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>
+ <text>If the bean class of X does not directly extend the bean class of another session bean, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
</section>
@@ -927,7 +930,7 @@
</assertion>
<assertion id="ha">
- <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>
+ <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.</text>
</assertion>
<assertion id="iaa">
@@ -935,11 +938,11 @@
</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>
+ <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.</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>
+ <text>If a producer method return type is a type variable the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
<assertion id="j">
@@ -995,7 +998,7 @@
</assertion>
<group>
- <text>If a producer method is annotated |@Inject|, has a parameter annotated |@Disposes|, or has a parameter annotated |@Observes|, 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>
+ <text>If a producer method is annotated |@Inject|, has a parameter annotated |@Disposes|, or has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error.</text>
<assertion id="ca">
<text>Test with a producer method annotated |@Inject|.</text>
@@ -1011,43 +1014,41 @@
</group>
<assertion id="fa">
- <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>
+ <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.</text>
</assertion>
<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>
+ <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.</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>
+ <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.</text>
</assertion>
- </section>
- <section id="3.3.3" title="Producer method parameters">
- <assertion id="b">
+ <assertion id="h">
<text>A producer method may have any number of parameters.</text>
</assertion>
- <assertion id="c">
+ <assertion id="i">
<text>All producer method parameters are injection points.</text>
</assertion>
</section>
- <section id="3.3.4" title="Specializing a producer method">
+ <section id="3.3.3" title="Specializing a producer method">
<assertion id="aa">
<text>If a producer method X is annotated |@Specializes|, then it must be non-static and directly override another producer method Y. Then X directly specializes Y, as defined in Section 4.3 "Specialization".</text>
</assertion>
<assertion id="ba">
- <text>If a producer method is static, 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>
+ <text>If a producer method is static, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
<assertion id="ca">
- <text>If a producer method does not directly override another producer method, 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>
+ <text>If a producer method does not directly override another producer method, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
</section>
- <section id="3.3.5" title="Disposer methods">
+ <section id="3.3.4" title="Disposer methods">
<assertion id="aa">
<text>A disposer method must be a non-abstract method of a managed bean class or session bean class.</text>
</assertion>
@@ -1069,7 +1070,7 @@
</assertion>
</section>
- <section id="3.3.6" title="Disposed parameter of a disposer method">
+ <section id="3.3.5" title="Disposed parameter of a disposer method">
<assertion id="a">
<text>Each disposer method must have exactly one disposed parameter, of the same type as the corresponding producer method return type.</text>
</assertion>
@@ -1083,7 +1084,7 @@
</assertion>
</section>
- <section id="3.3.7" title="Declaring a disposer method">
+ <section id="3.3.6" title="Declaring a disposer method">
<assertion id="a">
<text>A disposer method may be declared by annotating a parameter |(a)javax.enterprise.inject.Disposes|. That parameter is the disposed parameter</text>
</assertion>
@@ -1093,33 +1094,35 @@
</assertion>
<assertion id="ba">
- <text>If a method has more than one parameter annotated |@Disposes|, 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>
+ <text>If a method has more than one parameter annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
<assertion id="ca">
- <text>If a disposal method is 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>
+ <text>If a disposal method is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
<assertion id="da">
- <text>If a disposal method is annotated |@Inject|, 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>
+ <text>If a disposal method is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
<assertion id="ea">
- <text>If a disposal method has a parameter annotated |@Observes|, 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>
+ <text>If a disposal method has a parameter annotated |@Observes|, the container automatically detects the problem and treats it as a definition error.</text>
</assertion>
<assertion id="fa">
- <text>If a non-static method of a session bean class has a parameter annotated |@Disposes|, 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>
+ <text>If a non-static method of a session bean class has a parameter annotated |@Disposes|, 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.</text>
</assertion>
- </section>
+
+ <assertion id="g">
+ <text>Interceptors and decorators may not declare disposer methods. If an interceptor or decorator has a method annotated |@Disposes|, the container automatically detects the problem and treats it as a definition error.</text>
+ </assertion>
- <section id="3.3.8" title="Disposer method parameters">
- <assertion id="a">
+ <assertion id="h">
<text>In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify qualifiers. These additional parameters are injection points.</text>
</assertion>
</section>
- <section id="3.3.9" title="Disposer method resolution">
+ <section id="3.3.7" title="Disposer method resolution">
<assertion id="aa">
<text>When searching for disposer methods for a producer method, the container searches for disposer methods which are declared by the same bean class as the producer method, and for which the disposed parameter resolves to the producer method, according to the typesafe resolution algorithm defined in Section 5.3, "Typesafe resolution".</text>
</assertion>
@@ -1133,7 +1136,7 @@
</assertion>
</section>
- <section id="3.3.10" title="Default name for a producer method">
+ <section id="3.3.8" title="Default name for a producer method">
<assertion id="a">
<text>The default name for a producer method is the method name, unless the method follows the JavaBeans property getter naming convention, in which case the default name is the JavaBeans property name</text>
</assertion>
@@ -1224,7 +1227,7 @@
<section id="3.4.2" title="Declaring a producer field">
<assertion id="a">
- <text>A producer field may be declared by annotating a field with the |(a)javax.enterprise.inject.Produces| annotation</text>
+ <text>A producer field may be declared by annotating a field with the |(a)javax.enterprise.inject.Produces| annotation.</text>
</assertion>
<assertion id="b">
@@ -1240,8 +1243,20 @@
</assertion>
<assertion id="f">
- <text>A producer field may specify bindings.</text>
+ <text>A producer field may specify qualifiers.</text>
</assertion>
+
+ <assertion id="g">
+ <text>If a producer field is annotated |@Inject|, the container automatically detects the problem and treats it as a definition error.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a non-static field of a session bean class is annotated |@Produces|, the container automatically detects the problem and treats it as a definition error.</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>Interceptors and decorators may not declare producer fields. If an interceptor or decorator has a field annotated |@Produces|, the container automatically detects the problem and treats it as a definition error.</text>
+ </assertion>
</section>
<section id="3.4.3" title="Default name for a producer field">
@@ -1376,14 +1391,12 @@
<assertion id="ea">
<text>If a bean constructor has a parameter annotated |@Observes|, 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.7.2" title="Bean constructor parameters">
- <assertion id="b">
+ <assertion id="f">
<text>A bean constructor may have any number of parameters.</text>
</assertion>
- <assertion id="c">
+ <assertion id="g">
<text>All parameters of a bean constructor are injection points.</text>
</assertion>
</section>
@@ -1409,13 +1422,6 @@
</assertion>
</group>
- <assertion id="ea">
- <text>Injected fields are initialized by the container before initializer methods are called, and before the |@PostConstruct| callback occurs.</text>
- </assertion>
-
- <assertion id="h">
- <text>If a field is a producer field, it is not an injected field</text>
- </assertion>
</section>
<section id="3.8.1" title="Declaring an injected field">
@@ -1461,10 +1467,6 @@
<text>A bean class may declare multiple (or zero) initializer methods</text>
</assertion>
- <assertion id="ea">
- <text>Initializer methods are called by the container after injected fields are initialized, and before the |@PostConstruct| callback occurs.</text>
- </assertion>
-
<assertion id="h" testable="false">
<text>The application may call initializer methods directly, but then no parameters will be passed to the method by the container</text>
<note>This is a statement of intent</note>
@@ -1492,21 +1494,18 @@
<text>If an initializer method has a parameter annotated |@Observes|, 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.9.2" title="Initializer method parameters">
- <assertion id="aa">
+ <assertion id="e">
<text>An initializer method may have any number of parameters.</text>
</assertion>
- <assertion id="b">
+ <assertion id="f">
<text>All initializer method parameters are injection points.</text>
</assertion>
</section>
<section id="3.10" title="The default qualifier at injection points">
<assertion id="a">
- <text>If an injection point declares no qualifier, the default binding |@Default| is assumed.</text>
+ <text>If an injection point declares no qualifier, the injection point has exactly one qualifier, the default qualifier |@Default|.</text>
</assertion>
</section>
@@ -1520,7 +1519,7 @@
</assertion>
</section>
- <section id="3.12" title="Beans with the @New qualifier">
+ <section id="3.12" title="@New qualified beans">
<assertion id="d">
<text>For each managed bean, a second bean exists which has the same bean class.</text>
</assertion>
@@ -1605,8 +1604,16 @@
<text>This second bean is not an alternative.</text>
</assertion>
+ <assertion id="xc">
+ <text>This second bean is enabled, in the sense of Section 5.1.2, "Enabled and disabled beans", if and only if some other enabled bean has an injection point with the qualifier |(a)New(X.class)| where |X| is the bean class.</text>
+ </assertion>
+
+ <assertion id="xd">
+ <text>This bean is called the |@New| qualified bean for the class |X|.</text>
+ </assertion>
+
<group>
- <text>Note that this second bean exists, is enabled, and is available for injection whenever the bean class is in the application classpath, even if the first bean is disabled, as defined by Section 5.2.2, “Enabled and disabled beans” or is deployed out- side of a bean deployment archive, as defined in Section 12.1, “Bean deployment archives”, and is therefore not discovered during the bean discovery process defined in Chapter 12, Packaging and deployment.</text>
+ <text>Note that this second bean exists, and may be enabled and available for injection even if the first bean is disabled, as defined by Section 5.2.2, “Enabled and disabled beans” or if the bean class is deployed outside of a bean deployment archive, as defined in Section 12.1, “Bean deployment archives”, and is therefore not discovered during the bean discovery process defined in Chapter 12, Packaging and deployment. The container discovers |@New| qualified beans by inspecting injection points of other enabled beans.</text>
<assertion id="ya">
<text>Check that @New on a field injection point outside the BDA, but in the classpath causes a bean with qualifier @New and the given type to be created</text>
</assertion>
16 years, 5 months