[webbeans-commits] Webbeans SVN: r2766 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-04 19:59:36 -0400 (Thu, 04 Jun 2009)
New Revision: 2766
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
updated section 7 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-04 23:09:42 UTC (rev 2765)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-04 23:59:36 UTC (rev 2766)
@@ -3079,13 +3079,8 @@
<note>Cannot test as their as what happens is not well defined</note>
</assertion>
</section>
-
-
-
-
-
- <section id="6" title="Bean lifecycle">
+ <section id="7" title="Bean lifecycle">
<assertion id="a">
<text>To create a contextual instance of a session bean, the container creates an EJB local object reference</text>
</assertion>
@@ -3099,7 +3094,7 @@
</assertion>
<assertion id="d">
- <text>To create a contextual instance of a simple bean, the container calls the bean constructor</text>
+ <text>To create a contextual instance of a managed bean, the container calls the bean constructor</text>
</assertion>
<assertion id="e">
@@ -3109,139 +3104,84 @@
<assertion id="f">
<text>To destroy a contextual instance of a producer method bean, the container calls the disposal method, if any</text>
</assertion>
-
- <assertion id="g">
- <text>When the container injects a dependency and there is no existing instance of the bean cached by the context object for the bean scope, the context object automatically creates a new contextual instance of the bean</text>
- </assertion>
-
- <assertion id="h">
- <text>When the container resolves an EL name and there is no existing instance of the bean cached by the context object for the bean scope, the context object automatically creates a new contextual instance of the bean</text>
- </assertion>
-
- <assertion id="i">
- <text>When a context is destroyed, the context object automatically destroys any instances associated with that context</text>
- </assertion>
-
- <assertion id="j">
- <text>To create and destroy contextual instances, the context object calls operations defined by the interface Contextual</text>
- </assertion>
</section>
- <section id="6.1" title="The Contextual interface">
- <assertion id="a" testable="false">
- <text>The interface |javax.context.CreationalContext| provides an operation that allows the |create()| method to register an incompletely initialized contextual instance with the container. A contextual instance is considered incompletely initialized until the |create()| method returns the instance</text>
- <note>Statement of intent</note>
+ <section id="7.1" title="Container invocations and interception">
+ <assertion id="a">
+ <text>Invocations of initializer methods by the container are not business method invocations and are never intercepted.</text>
</assertion>
<assertion id="b">
- <text>If |Contextual.create()| calls |CreationalContext.push()|, it must also return the instance passed to |push()|</text>
+ <text>Invocations of producer, disposal and observer methods by the container are business method invocations and are intercepted by method interceptors and decorators.</text>
</assertion>
- <assertion id="c" testable="false">
- <text>The implementation of |Contextual| is not required to call |CreationalContext.push()|</text>
- <note>No way to test this really</note>
+ <assertion id="c">
+ <text>Invocation of lifecycle callbacks by the container are not business method invocations, but are intercepted by interceptors for lifecycle callbacks.</text>
</assertion>
- </section>
-
- <section id="6.2" title="Creation">
- <assertion id="a">
- <text>The |Contextual.create()| method obtains an instance of the bean</text>
- </assertion>
<assertion id="d">
- <text>The |Contextual.create()| method injects any dependencies</text>
+ <text>Invocations of interceptors and decorator methods during method or lifecycle callback interception are not business method invocations, and therefore no recursive interception occurs.</text>
</assertion>
-
- <assertion id="f">
- <text>The |Contextual.create()| method calls the |@PostConstruct| method, if necessary</text>
- </assertion>
-
- <assertion id="g">
- <text>If any exception occurs while creating an instance, the exception is rethrown by the |create()| method</text>
- </assertion>
-
- <assertion id="h">
- <text>If a checked exception occurs while creating an instance, it is wrapped and rethrown as an (unchecked) |CreationException|</text>
- </assertion>
</section>
- <section id="6.3" title="Destruction">
+ <section id="7.2" title="Lifecycle of managed beans">
<assertion id="a">
- <text>The |Contextual.destroy()| method calls the disposal method, if necessary</text>
+ <text>When the create() method of the Bean object that represents a managed bean is called, the container first calls the bean constructor to obtain an instance of the bean, as defined in Section 5.4.3, "Injection
+using the bean constructor". The container is permitted to return an instance of a container-generated subclass of the bean class, allowing interceptor and decorator bindings.</text>
</assertion>
<assertion id="b">
- <text>The |Contextual.destroy()| method calls the |@PreDestroy method|, if necessary</text>
+ <text>Next, the container performs Java EE component environment injection, as required by the managed bean specification.</text>
</assertion>
<assertion id="c">
- <text>The |Contextual.destroy()| method destroys all dependent objects of the instance, as defined in Section 8.3.2, "Dependent object destruction"</text>
+ <text>Next, the container performs dependency injection, as defined in Section 5.4.4, "Injection of fields and initializer methods".</text>
</assertion>
<assertion id="d">
- <text>If any exception occurs while destroying an instance, the exception is caught by the |destroy()| method</text>
+ <text>Finally, the container calls the |@PostConstruct| method, if any.</text>
</assertion>
- <assertion id="e" testable="false">
- <text>If the application invokes a contextual instance after it has been destroyed, the behavior is undefined</text>
- <note>In otherwords, the behavious is unspecified!</note>
+ <assertion id="e">
+ <text>When the |destroy()| method is called, the container calls the |@PreDestroy| method, if any.</text>
</assertion>
+
+ <assertion id="f">
+ <text>Finally, the container destroys dependent objects, as defined in Section 5.4.5, "Destruction of dependent objects.</text>
+ </assertion>
</section>
- <section id="6.4" title="Lifecycle of simple beans">
-
- <assertion id="b">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the bean constructor is called the container next initializes the values of any attributes annotated |@EJB|</text>
+ <section id="7.3" title="Lifecycle of stateful session beans">
+ <assertion id="aa">
+ <text>When the |create()| method of a |Bean| object that represents a stateful session bean that is called, the container creates and returns a container-specific internal local reference to a new session bean instance. The reference must be passivation capable. This reference is not directly exposed to the application.</text>
</assertion>
- <assertion id="c">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the bean constructor is called the container next initializes the values of any attributes annotated |@PersistenceContext|</text>
+ <assertion id="bb">
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying stateful session bean instance. This object must be passivation capable.</text>
</assertion>
-
- <assertion id="d">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the bean constructor is called the container next initializes the values of any attributes annotated |@Resource|</text>
+
+ <assertion id="bc">
+ <text>When the |destroy()| method is called, and if the underlying EJB was not already removed by direct invocation of a remove method by the application, the container removes the stateful session bean. The |@PreDestroy| callback must be invoked by the container.</text>
</assertion>
-
- <assertion id="e">
- <text>When the |create()| method of the |Bean| object that represents a simple bean is called, after the |@EJB|, |@PersistenceContext| and |@Resource| attributes are initialized the container initializes the values of all injected fields. For each injected field, the container sets the value to the object returned by |Manager.getInstanceToInject()|.</text>
- </assertion>
-
- <assertion id="k">
- <text>When the |destroy()| method of a |Bean| object is called, the container calls the |@PreDestroy| method, if any</text>
- </assertion>
-
- <assertion id="l">
- <text>When the |destroy()| method of a |Bean| object is called, after the container calls the |@PreDestroy| method, it finally destroys dependent objects</text>
- </assertion>
</section>
- <section id="6.5" title="Lifecycle of stateful session beans">
+ <section id="7.4" title="Lifecycle of stateless session and singleton beans">
<assertion id="a">
- <text>When the |create()| method of a |Bean| object that represents a stateful session bean that is called, the container creates and returns a session bean proxy, as defined in Section 3.3.9, "Session bean proxies".</text>
+ <text>When the |create()| method of a Bean object that represents a stateless session or singleton session bean is called, the container
+creates and returns a container-specific internal local reference to the session bean. This reference is not directly exposed to the application.</text>
</assertion>
<assertion id="b">
- <text>When the |destroy()| method of a |Bean| object is called, the container removes the stateful session bean. The |@PreDestroy| callback must be invoked by the container</text>
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying session bean. This object must be passivation capable.</text>
</assertion>
<assertion id="c">
- <text>If the underlying EJB was already removed by direct invocation of a remove method by the application, the container ignores the instance</text>
+ <text>When the |destroy()| method is called, the container simply discards this internal reference.</text>
</assertion>
</section>
- <section id="6.6" title="Lifecycle of stateless session and singleton beans">
+ <section id="7.5" title="Lifecycle of producer methods">
<assertion id="a">
- <text>When the |create()| method of a |Bean| object that represents a stateless session or singleton session bean is called, the container creates and returns a session bean proxy, as defined in Section 3.3.9, "Session bean proxies".</text>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>When the |destroy()| method of a |Bean| object is called, the container simply discards the proxy and all underlying EJB local object references</text>
- <note>Untestable</note>
- </assertion>
- </section>
-
- <section id="6.7" title="Lifecycle of producer methods">
- <assertion id="a">
<text>Any Java object may be returned by a producer method. It is not required that the returned object be an instance of another bean</text>
</assertion>
@@ -3260,30 +3200,10 @@
<note>In other words the behaviour is unspecified</note>
</assertion>
- <assertion id="e">
- <text>When the |create()| method of a |Bean| object that represents a producer method is called, the container must invoke the producer method, passing the object returned by |Manager.getInstanceToInject()| to each parameter</text>
+ <assertion id="ea">
+ <text>When the create() method of a Bean object that represents a producer method is called, the container must invoke the producer method as defined by Section 5.4.6, "Invocation of producer or disposal methods". The return value of the producer method, after method interception completes, is the new contextual instance to be returned by |Bean.create()|.</text>
</assertion>
- <assertion id="f">
- <text>If a producer method is static, the container must invoke the method</text>
- </assertion>
-
- <assertion id="g">
- <text>If a producer method is not static, the container must obtain the |Bean| object for the most specialized bean that specializes the bean which declares the producer method</text>
- </assertion>
-
- <assertion id="h">
- <text>If a producer method is not static, after obtaining the most specialized |Bean| object the container must obtain an instance of the most specialized bean, by calling |Manager.getInstance()|, passing the |Bean| object representing the bean</text>
- </assertion>
-
- <assertion id="i">
- <text>If a producer method is not static, after obtaining an instance of the most specialized bean the container must invoke the producer method upon this instance</text>
- </assertion>
-
- <assertion id="j">
- <text>The return value of the producer method, after method interception completes, is the new contextual instance to be returned by |Bean.create()|</text>
- </assertion>
-
<assertion id="k">
<text>If the producer method returns a null value and the producer method bean has the scope |@Dependent|, the |create()| method returns a null value</text>
</assertion>
@@ -3292,32 +3212,17 @@
<text>If the producer method returns a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|</text>
</assertion>
- <assertion id="m">
- <text>When the |destroy()| method is called, and if there is a disposal method for this producer method, the container must invoke the disposal method, passing the instance given to |destroy()| to the disposed parameter, and the object returned by |Manager.getInstanceToInject()| to each of the other parameters</text>
+ <assertion id="ma">
+ <text>When the destroy() method is called, and if there is a disposal method for this producer method, the container must invoke
+the disposal method as defined by Section 5.4.6, "Invocation of producer or disposal methods", passing the instance given to |destroy()| to the disposed parameter.</text>
</assertion>
-
- <assertion id="n">
- <text>If a disposal method is static, the container must invoke the method</text>
- </assertion>
-
- <assertion id="o">
- <text>If a disposal method is non-static, the container must obtain the |Bean| object for the most specialized bean that specializes the bean which declares the disposal method</text>
- </assertion>
-
- <assertion id="p">
- <text>If a disposal method is non-static, after obtaining the |Bean| object for the most specialized bean, the container must obtain an instance of the most specialized bean, by calling |Manager.getInstance()|, passing the |Bean| object representing the bean</text>
- </assertion>
-
- <assertion id="q">
- <text>If a disposal method is non-static, after obtaining the instance of the most specialized bean the container must invoke the disposal method upon this instance</text>
- </assertion>
-
+
<assertion id="r">
<text>Finally, the container destroys dependent objects</text>
- </assertion>
+ </assertion>
</section>
-
- <section id="6.8" title="Lifecycle of producer fields">
+
+ <section id="7.6" title="Lifecycle of producer fields">
<assertion id="a">
<text>Any Java object may be the value of a producer field</text>
</assertion>
@@ -3346,108 +3251,53 @@
<note>In other words the behaviour is unspecified</note>
</assertion>
- <assertion id="g">
- <text>When the |create()| method of a |Bean| object that represents a producer field is called, the container must access the producer field to obtain the current value of the field</text>
+ <assertion id="ga">
+ <text>When the |create()| method of a |Bean| object that represents a producer field is called, the container must access the producer field as defined by Section 5.4.7, "Access to producer field values" to obtain the current value of the field. The value of the producer field is the new contextual instance to be returned by |Bean.create()|.</text>
</assertion>
-
- <assertion id="h">
- <text>If a producer field is static, the container must access the field value</text>
- </assertion>
-
- <assertion id="i">
- <text>If a producer field is non-static, the container must obtain the |Bean| object for the most specialized bean that specializes the bean which declares the producer field</text>
- </assertion>
-
- <assertion id="j">
- <text>If a producer field is non-static, after obtaining the |Bean| object for the most specialized bean the container must obtain an instance of the most specialized bean, by calling |Manager.getInstance()|, passing the |Bean| object representing the bean</text>
- </assertion>
-
- <assertion id="k">
- <text>If a producer field is non-static, after obtaining an instance of the most specialized bean, the container must access the field value of this instance</text>
- </assertion>
-
- <assertion id="l">
- <text>The value of the producer field is the new contextual instance to be returned by |Bean.create()|</text>
- </assertion>
-
+
<assertion id="m">
<text>If the producer field contains a null value and the producer field bean has the scope |@Dependent|, the create() method returns a null value</text>
</assertion>
<assertion id="n">
<text>If the producer field contains a null value, and the scope of the producer method is not |@Dependent|, the |create()| method throws an |IllegalProductException|</text>
- </assertion>
+ </assertion>
</section>
<section id="6.9" title="Lifecycle of resources">
- <assertion id="a" testable="false">
- <text>An instance of a resource is a proxy object, provided by the container, that implements the declared bean type, delegating the actual implementation of the methods directly to the underlying Java EE resource, entity manager, entity manager factory, EJB remote object or web service referenc</text>
+ <assertion id="l">
+ <text>When the |create()| method of a |Bean| object that represents a resource is called, the container creates and returns a container-
+specific internal reference to the Java EE component environment resource, entity manager, entity manager factory, remote EJB instance or web service reference. This reference is not directly exposed to the application./text>
</assertion>
- <assertion id="b">
- <text>A resource proxy object is a dependent object of the object it is injected into</text>
+ <assertion id="m">
+ <text>Before injecting or returning a contextual instance to the application, the container transforms its internal reference into an object that implements the bean types expected by the application and delegates method invocations to the underlying resource, entity manager, entity manager factory, remote EJB instance or web service reference. This object must be passivation capable.</text>
</assertion>
- <assertion id="c">
- <text>Resource proxy objects are serializable</text>
+ <assertion id="n">
+ <text>When the |destroy()| method is called, the container discards this internal reference.</text>
</assertion>
-
- <assertion id="d">
- <text>When the |create()| method of a |Bean| object that represents a JMS resource is called, the container creates and returns a proxy object that implements the bean type of the resource</text>
- </assertion>
-
- <assertion id="e">
- <text>The methods of this proxy object delegate to the underlying implementation, which is obtained using the metadata provided in the resource declaration</text>
- </assertion>
-
- <assertion id="f">
- <text>A Java EE resource is obtained using the JNDI name or mapped name specified by |<Resource>|</text>
- </assertion>
-
- <assertion id="g">
- <text>A persistence context is obtained using the persistence unit name specified by |<PersistenceContext>|</text>
- </assertion>
-
- <assertion id="h">
- <text>A persistence unit is obtained using the persistence unit name specified by |<PersistenceUnit>|</text>
- </assertion>
-
- <assertion id="i">
- <text>A remote EJB is obtained using the JNDI name, mapped name or EJB link specified by |<EJB>|</text>
- </assertion>
-
- <assertion id="j">
- <text>A web service is obtained using the JNDI name or mapped name specified by |<WebServiceRef>|</text>
- </assertion>
-
- <assertion id="k">
- <text>When the |destroy()| method is called, the container discards the proxy object</text>
- </assertion>
</section>
- <section id="6.10" title="Lifecycle of JMS resources">
+ <section id="7.8" title="Lifecycle of message destinations">
<assertion id="a" testable="false">
- <text>An instance of a JMS resource is a proxy object, provided by the container, that implements all the bean types defined in Section 3.7, "JMS resources", delegating the actual implementation of these methods directly to the underlying JMS objects</text>
+ <text>An instance of a message destination is a proxy object, provided by the container, that implements all the bean types defined in Section 3.7, "JMS resources", delegating the actual implementation of these methods directly to the underlying JMS objects. This proxy must be passivation capable.</text>
</assertion>
<assertion id="b">
- <text>A JMS resource proxy object is a dependent object of the object it is injected into</text>
+ <text>A message destination resource proxy object is a dependent object of the object it is injected into.</text>
</assertion>
- <assertion id="c">
- <text>JMS resource proxy objects are serializable</text>
+ <assertion id="da">
+ <text>When the |create()| method of a |Bean| object that represents a message destination is called, the container creates and returns a proxy object.</text>
</assertion>
- <assertion id="d">
- <text>When the |create()| method of a |Bean| object that represents a JMS resource is called, the container creates and returns a proxy object that implements all the bean types of the JMS resource</text>
- </assertion>
-
<assertion id="e">
- <text>The methods of this proxy object delegate to JMS objects obtained as needed using the metadata provided by the JMS resource declaration and using standard JMS APIs</text>
+ <text>The methods of this proxy object delegate to JMS objects obtained as needed using the metadata provided by the message destination declaration.</text>
</assertion>
<assertion id="f">
- <text>The Destination is obtained using the JNDI name or mapped name specified by |<Resource>|</text>
+ <text>The Destination is obtained using the JNDI name or mapped name specified by |@Resource|.</text>
</assertion>
<assertion id="g">
@@ -3499,43 +3349,11 @@
</assertion>
<assertion id="s">
- <text>The |close()| method of a JMS resource proxy object always throws an |UnsupportedOperationException|</text>
+ <text>The |close()| method of a message destination proxy object always throws an |UnsupportedOperationException|.</text>
</assertion>
</section>
- <section id="6.11" title="Lifecycle of EJBs">
- <assertion id="a">
- <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container must initialize the values of all injected fields . For each injected field, the container sets the value to the object returned by |Manager.getInstanceToInject()|</text>
- </assertion>
-
- <assertion id="c">
- <text>When the EJB container creates a new instance of an EJB, after Java EE injection has been performed and before the |@PostConstruct| callback occurs the container calls all initializer methods. For each initializer method parameter, the container passes the object returned by |Manager.getInstanceToInject()|</text>
- </assertion>
-
- <assertion id="f">
- <text>When the EJB container removes an instance of an EJB, the container destroys all dependent objects, after the |@PreDestroy| callback completes</text>
- </assertion>
- </section>
-
- <section id="6.12" title="Lifecycle of servlets">
- <assertion id="a">
- <text>When the servlet container creates a new instance of a servlet, the container initializes the values of all injected fields. For each injected field, the container sets the value to the object returned by |Manager.getInstanceToInject()|</text>
- </assertion>
-
- <assertion id="b">
- <text>When the servlet container creates a new instance of a servlet, the container calls all initializer methods. For each initializer method parameter, the container passes the object returned by |Manager.getInstanceToInject()|</text>
- </assertion>
-
- <assertion id="c">
- <text>When the servlet container destroys a servlet, the container destroys all dependent objects</text>
- </assertion>
-
- <assertion id="d" testable="false">
- <text>In a Java EE 5 environment, the container is not required to support injected fields or initializer methods of servlets</text>
- </assertion>
- </section>
-
<section id="7" title="Events">
</section>
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2765 - ri/trunk/api/src/main/java/javax/enterprise/inject/spi and 101 other directories.
by webbeans-commits@lists.jboss.org
Author: cpopetz
Date: 2009-06-04 19:09:42 -0400 (Thu, 04 Jun 2009)
New Revision: 2765
Added:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Extension.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/DeployedLiteral.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/InitializedLiteral.java
Modified:
ri/trunk/api/pom.xml
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationBeginTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationEndTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByContainerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java
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/context/passivating/integration/PassivatingContextIntegrationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/unserializableSimpleInjectedIntoPassivatingEnterpriseBean/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.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/context/request/ejb/FMSModelIII.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.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/deployment/DeploymentTypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.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/StereotypeDefinitionTest.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/DeploymentTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail2/ManagerObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail3/ManagerObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail4/ManagerObserver.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/YorkshireTerrier_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/BorderTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/AustralianTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/FoxTerrier.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/AllEventTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/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/enterprise/definition/EnterpriseBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.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/enterprise/newBean/NewEnterpriseBeanICTest.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/enterprise/remove/EnterpriseBeanRemoveMethodTest.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/producer/field/definition/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.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/definition/enterprise/EnterpriseProducerMethodDefinitionTest.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/definition/SimpleBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.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/implementation/simple/resource/ejb/EjbInjectionTest.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/implementation/simple/resource/resource/InjectionOfResourceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.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/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/InstantiationByNameTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
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/enterprise/EnterpriseBeanInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java
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/xml/annotationtypes/AnnotationTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/deployment/DeploymentDeclarationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/JavaEePkgTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/ejb/DeclarationOfEjbTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/persistenceContext/DeclarationOfPersistenceUnitAndContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/resource/DeclarationOfResourceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java
Log:
Update BeanManager to new spec, add bridge for tests that use SPI methods which are no longer available, implement new bootstrap events, partial implementation of new methods of BeanManager in ManagerImpl.
Modified: ri/trunk/api/pom.xml
===================================================================
--- ri/trunk/api/pom.xml 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/api/pom.xml 2009-06-04 23:09:42 UTC (rev 2765)
@@ -13,4 +13,11 @@
<packaging>jar</packaging>
<name>JSR-299 API</name>
<url>http://www.seamframework.org/WebBeans</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </dependency>
+ </dependencies>
</project>
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,41 +1,5 @@
-/*
- * 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 javax.enterprise.inject.spi;
-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;
-
-/**
- * Event binding type for the event that is raised by the manager when
- * it has completed resolving and validation
- *
- * @author Pete Muir
- */
-
-@BindingType
-@Retention(RUNTIME)
-@Target( { FIELD, PARAMETER })
-public @interface AfterBeanDiscovery
-{
+public interface AfterBeanDiscovery {
+ public void addDefinitionError(Throwable t);
}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,12 @@
+package javax.enterprise.inject.spi;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+public interface Annotated {
+ Type getType();
+ public <T extends Annotation> T getAnnotation(Class<T> annotationType);
+ public Set<Annotation> getAnnotations();
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,7 @@
+package javax.enterprise.inject.spi;
+
+import java.util.List;
+
+public interface AnnotatedCallable<X> extends AnnotatedMember<X> {
+ public List<AnnotatedParameter<X>> getParameters();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,7 @@
+package javax.enterprise.inject.spi;
+
+import java.lang.reflect.Constructor;
+
+public interface AnnotatedConstructor<X> extends AnnotatedCallable<X> {
+ public Constructor<X> getJavaMember();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,7 @@
+package javax.enterprise.inject.spi;
+
+import java.lang.reflect.Field;
+
+public interface AnnotatedField<X> extends AnnotatedMember<X> {
+ public Field getJavaMember();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,9 @@
+package javax.enterprise.inject.spi;
+
+import java.lang.reflect.Member;
+
+public interface AnnotatedMember<X> extends Annotated {
+ public Member getJavaMember();
+ public boolean isStatic();
+ public AnnotatedType<X> getDeclaringType();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,7 @@
+package javax.enterprise.inject.spi;
+
+import java.lang.reflect.Method;
+
+public interface AnnotatedMethod<X> extends AnnotatedCallable<X> {
+ public Method getJavaMember();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,6 @@
+package javax.enterprise.inject.spi;
+
+public interface AnnotatedParameter<X> extends Annotated {
+ public int getPosition();
+ public AnnotatedCallable<X> getDeclaringCallable();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,10 @@
+package javax.enterprise.inject.spi;
+
+import java.util.Set;
+
+public interface AnnotatedType<X> extends Annotated {
+ public Class<X> getJavaClass();
+ public Set<AnnotatedConstructor<X>> getConstructors();
+ public Set<AnnotatedMethod<? super X>> getMethods();
+ public Set<AnnotatedField<? super X>> getFields();
+}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -17,20 +17,19 @@
package javax.enterprise.inject.spi;
-import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Set;
+import javax.el.ELResolver;
import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.context.ScopeType;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.event.Observer;
-import javax.inject.DuplicateBindingTypeException;
/**
* The contract between the application and the manager. Also the contract
@@ -45,148 +44,24 @@
public interface BeanManager
{
- /**
- * Allows beans to be matched to injection point by considering bean type,
- * bindings, and deployment precedence.
+ /**
+ * Obtains a contextual reference for a given bean and a given bean type.
*
- * Typesafe resolution usually occurs at container deployment time.
- *
- * @param <T>
- * the type of the beans to be resolved
- * @param type
- * the type of the beans to be resolved
- * @param bindings
- * the bindings used to restrict the matched beans
- * @return the matched beans
- * @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
- * @throws IllegalArgumentException
- * if an annotation which is not a binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
- */
- public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation... bindings);
-
- /**
- * Allows beans to be matched to injection point by considering bean type,
- * bindings, and deployment precedence.
- *
- * Typesafe resolution usually occurs at container deployment time.
- *
- * @param <T>
- * the type of the beans to be resolved
- * @param type
- * the type of the beans to be resolved
- * @param bindings
- * the bindings used to restrict the matched beans
- * @return the matched beans
- * @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
- * @throws IllegalArgumentException
- * if an annotation which is not a binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
- */
- public <T> Set<Bean<T>> getBeans(TypeLiteral<T> type, Annotation... bindings);
-
- /**
- * Obtains an instance of a bean by considering bean type, bindings, and
- * deployment precedence.
- *
- * @param <T>
- * the type of the bean to obtain
- * @param type
- * the type of the bean to obtain
- * @param bindings
- * the bindings used to restrict the matched beans
- * @return an instance of the bean
- * @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
- * @throws IllegalArgumentException
- * if an annotation which is not a binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
- * @throws UnsatisfiedResolutionException
- * if no bean can be resolved for the given type and bindings
- * @throws AmbiguousResolutionException
- * if more than one bean is resolved for the given type and
- * bindings
- */
- public <T> T getInstanceByType(Class<T> type, Annotation... bindings);
-
- /**
- * Obtains an instance of a bean by considering bean type, bindings, and
- * deployment precedence.
- *
- * @param <T>
- * the type of the bean to obtain
- * @param type
- * the type of the bean to obtain
- * @param bindings
- * the bindings used to restrict the matched beans
- * @return an instance of the bean
- * @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
- * @throws IllegalArgumentException
- * if an annotation which is not a binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
- * @throws UnsatisfiedResolutionException
- * if no bean can be resolved for the given type and bindings
- * @throws AmbiguousResolutionException
- * if more than one bean is resolved for the given type and
- * bindings
- */
- public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindings);
-
- /**
- * Allows beans to be matched by considering the bean name and deployment
- * precedence.
- *
- * Used in an environment that doesn't support typing such EL.
- *
- * @param name
- * the name used to restrict the beans matched
- * @return the matched beans
- */
- public Set<Bean<?>> getBeans(String name);
-
- /**
- * Obtains an instance of a bean by considering the bean name and deployment
- * precedence.
- *
- * Used in an environment that doesn't support typing such EL.
- *
- * @param name
- * the name used to restrict the beans matched
- * @return an instance of the bean or null if no beans matched
- * @throws AmbiguousResolutionException
- * if more than one bean matches
- */
- public Object getInstanceByName(String name);
-
- /**
- * Obtains an instance of a bean
- *
- * @param <T>
- * the type of the bean
* @param bean
- * the bean to obtain an instance of
- * @return an instance of the bean
+ * the Bean object representing the bean
+ * @param beanType
+ * a bean type that must be implemented by any proxy that is returned
+ * @return a contextual reference representing the bean
+ * @throws IllegalArgumentException
+ * if the given type is not a bean type of the given bean
*/
- public <T> T getInstance(Bean<T> bean);
+ public Object getReference(Bean<?> bean, Type beanType);
/**
* Obtains an instance of bean for a given injection point.
*
* This method should not be called by an application.
*
- * @param <T>
- * the type of the bean
* @param injectionPoint
* the injection point the instance is needed for
* @param creationalContext
@@ -201,197 +76,133 @@
public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> creationalContext);
/**
- * Fire an event
+ * Returns the set of beans which match the given required type and bindings and are
+ * accessible to the class into which the BeanManager was injected, according to the
+ * rules of typesafe resolution.
*
- * @param event
- * the event object
+ * Typesafe resolution usually occurs at container deployment time.
+ *
+ * @param beanType
+ * the type of the beans to be resolved
* @param bindings
- * the event bindings used to restrict the observers matched
+ * the bindings used to restrict the matched beans. If no bindings are passed to
+ * getBeans(), the default binding @Current is assumed.
+ * @return the matched beans
* @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
+ * if the given type represents a type variable, or
+ * if two instances of the same binding type are given, or
+ * if an instance of an annotation that is not a binding type is given
*/
- public void fireEvent(Object event, Annotation... bindings);
+ public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings);
+
/**
- * Obtain an active context instance for the given scope type.
+ * Returns the set of beans which match the given EL name and are accessible to the
+ * class into which the BeanManager was injected, according to the rules of EL name
+ * resolution.
*
- * @param scopeType
- * the scope to get the context instance for
- * @return the context instance
- * @throws ContextNotActiveException
- * if no active contexts exist for the given scope type
- * @throws IllegalArgumentException
- * if more than one active context exists for the given scope type
+ * @param name
+ * the name used to restrict the beans matched
+ * @return the matched beans
*/
- public Context getContext(Class<? extends Annotation> scopeType);
+ public Set<Bean<?>> getBeans(String name);
/**
- * Associate a custom Context with a scope.
- *
- * This method may be called at any time in the applications lifecycle.
- *
- * @param context
- * the context to register
- * @return the manager the context was registered with
+ * Returns the Bean object representing the most specialized enabled bean registered
+ * with the container that specializes the given bean,
+
+ * @param <X> The type of the bean
+ * @param bean
+ * The Bean representation of the bean.
+ * @return the mest specialized enabled bean
*/
- public BeanManager addContext(Context context);
-
+ public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean);
+
/**
- * Allows a new bean to be registered.
- *
- * This method may be called at any time in the applications lifecycle.
- *
- * @param bean
- * the bean to register
- * @return the manager the bean was registered with
+ * Returns the PassivationCapableBean with the given identifier.
*/
- public BeanManager addBean(Bean<?> bean);
-
+ public Bean<?> getPassivationCapableBean(String id);
+
/**
- * Allows a new interceptor to be registered.
- *
- * This method may be called at any time in the applications lifecycle.
- *
- * @param abstractInterceptor
- * the interceptor to register
- * @return the manager the interceptor was registered with
+ * Allows resolution of an ambiguous dependency programatically, by returning the Bean
+ * with the highest precedence deployment type in a set of beans.
+
+ * @param <X> The type of the bean
+ * @param beans A set of beans of the given type
*/
- public BeanManager addInterceptor(Interceptor abstractInterceptor);
+ public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans);
/**
- * Allows a new decorator to be registered.
+ * Allows a new bean to be registered. This fires a ProcessBean event and then
+ * registers a new bean with the container, thereby making it available for injection
+ * into other beans.
*
* This method may be called at any time in the applications lifecycle.
*
- * @param abstractDecorator
- * the decorator to register
- * @return the manager the decorator was registered with
+ * @param bean
+ * the bean to register
*/
- public BeanManager addDecorator(Decorator abstractDecorator);
+ public void addBean(Bean<?> bean);
+
- /**
- * Allows additional XML based to be provided.
- *
- * This method may be called at any time in the applications lifecycle.
- *
- * @param xmlStream
- * the XML metadata
- * @return the manager the XML metadata was registered with
- */
- public BeanManager parse(InputStream xmlStream);
/**
- * Create a new child activity. A child activity inherits all beans,
- * interceptors, decorators, observers, and contexts defined by its direct
- * and indirect parent activities.
+ * Register an observer with the container, allowing it to begin receiving
+ * event notifications.
*
- * This method should not be called by the application.
+ * The observed event type is the actual type parameter of Observer declared
+ * by the class of the observer object. The observer is notified when an
+ * event object that is assignable to the observed event type is raised
+ * with the observed event bindings.
*
- * @return the child activity
- */
- public BeanManager createActivity();
-
- /**
- * Associate an activity with the current context for a normal scope
- *
- * @param scopeType
- * the scope to associate the activity with
- * @return the activity
- * @throws ContextNotActiveException
- * if the given scope is inactive
- * @throws IllegalArgumentException
- * if the given scope is not a normal scope
- */
- public BeanManager setCurrent(Class<? extends Annotation> scopeType);
-
- /**
- * Register an observer with the container
- *
- * @param <T>
- * the type of the observer
* @param observer
* the observer to register
- * @param eventType
- * the event type the observer observes
* @param bindings
* event bindings to further restrict the events observed
- * @return the manager the observer was registered with
- * @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
* passed
* @throws IllegalArgumentException
- * if an annotation which is not a binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
+ * if an annotation which is not a binding type is passed, or
+ * if two instances of the same binding type are passed, or
+ * if the runtime type of the observer object contains a type variable
*/
- public <T> BeanManager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings);
+ public void addObserver(Observer<?> observer, Annotation... bindings);
+
/**
- * Register an observer with the container
- *
- * @param <T>
- * the type of the observer
- * @param observer
- * the observer to register
- * @param eventType
- * the event type the observer observes
- * @param bindings
- * event bindings to further restrict the events observed
- * @return the manager the observer was registered with
- * @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
- * @throws IllegalArgumentException
- * if an annotation which is not a event binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
+ * An alternative mechanism for registering an observer. The observed event
+ * type and event bindings for registration will be obtained from the
+ * ObserverMethod instance
+ * @param observerMethod
+ * a the method to register for receiving events
*/
- public <T> BeanManager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings);
+ public void addObserver(ObserverMethod<?, ?> observerMethod);
+
/**
* Remove an observer registration
*
- * @param <T>
- * the type of the observer
* @param observer
* the observer to register
- * @param eventType
- * the event type the observer obseres
- * @param bindings
- * event bindings to further restrict the events observed
- * @return the manager the observer was registered with
* @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
- * @throws IllegalArgumentException
- * if an annotation which is not a event binding type is passed
- * @throws DuplicateBindingTypeException
+ * if an annotation which is not a event binding type is passed or
* if two instances of the same binding type are passed
*/
- public <T> BeanManager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings);
+ public void removeObserver(Observer<?> observer);
+
/**
- * Remove an observer registration
+ * Fire an event
*
- * @param <T>
- * the type of the observer
- * @param observer
- * the observer to register
- * @param eventType
- * the event type the observer obseres
+ * @param event
+ * the event object
* @param bindings
- * event bindings to further restrict the events observed
- * @return the manager the observer was registered with
+ * the event bindings used to restrict the observers matched
* @throws IllegalArgumentException
- * if a parameterized type with a type parameter or a wildcard is
- * passed
- * @throws IllegalArgumentException
- * if an annotation which is not a event binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
+ * if the runtime type of the event object contains a type variable or
+ * if two instances of the same binding type are given, or
+ * if an instance of an annotation that is not a binding type is given,
*/
- public <T> BeanManager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings);
+ public void fireEvent(Object event, Annotation... bindings);
/**
* Obtains observers for an event by considering event type and bindings.
@@ -408,12 +219,30 @@
* passed
* @throws IllegalArgumentException
* if an annotation which is not a event binding type is passed
- * @throws DuplicateBindingTypeException
+ * @throws IllegalArgumentException
* if two instances of the same binding type are passed
*/
public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings);
-
+
/**
+ * Obtains an ordered list of enabled decorators for a set of bean types and
+ * a set of bindings
+ *
+ * @param types
+ * the set of bean types of the decorated bean
+ * @param bindings
+ * the bindings declared by the decorated bean
+ * @return the resolved decorators
+ * @throws IllegalArgumentException
+ * if the set of bean types is empty
+ * @throws IllegalArgumentException
+ * if an annotation which is not a binding type is passed
+ * @throws IllegalArgumentException
+ * if two instances of the same binding type are passed
+ */
+ public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindings);
+
+ /**
* Obtains an ordered list of enabled interceptors for a set interceptor
* bindings
*
@@ -427,27 +256,177 @@
* @throws IllegalArgumentException
* if an annotation which is not a interceptor binding type is
* passed
- * @throws DuplicateBindingTypeException
+ * @throws IllegalArgumentException
* if two instances of the same binding type are passed
*/
public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings);
+
+ /**
+ * Validates the dependency
+ * @throws
+ * an InjectionException if there is a deployment problem
+ * (for example, an unsatisfied or unresolvable ambiguous
+ * dependency) associated with the injection point.
+ * @param injectionPoint the injection point to validate
+ */
+ public void validate(InjectionPoint injectionPoint);
+
+ /**
+ * Determine if the given annotationType is a scope type
+ */
+ public boolean isScopeType(Class<? extends Annotation> annotationType);
/**
- * Obtains an ordered list of enabled decorators for a set of bean types and
- * a set of bindings
+ * Determine if the given annotationType is a binding type
+ */
+ public boolean isBindingType(Class<? extends Annotation> annotationType);
+
+
+ /**
+ * Determine if the given annotationType is an interceptor binding type
+ */
+ public boolean isInterceptorBindingType(Class<? extends Annotation> annotationType);
+
+ /**
+ * Determine if the given annotationType is a stereotype
+ */
+ public boolean isStereotype(Class<? extends Annotation> annotationType);
+
+ /**
+ * Return a ScopeType definition type for a given annotation representing a scope type
+ */
+ public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType);
+
+ /**
+ * Obtain the set of interceptor binding types meta-annotatinos for the given binding type
+ * annotation
+ */
+ public Set<Annotation> getInterceptorBindingTypeDefinition(Class<? extends Annotation> bindingType);
+
+
+ /**
+ * Obtain the set of binding types meta-annotations for the given stereotype annotation
+ */
+ public Set<Annotation> getStereotypeDefinition(Class<? extends Annotation> stereotype);
+
+
+ /**
+ * Exposes the list of enabled deployment types, in order of lower to higher precedence,
+ * This method may be used by portable extensions to discover information about the
+ * deployment.
+ */
+ public List<Class<? extends Annotation>> getEnabledDeploymentTypes();
+
+ /**
+ * Associate a custom Context with a scope.
*
- * @param types
- * the set of bean types of the decorated bean
- * @param bindings
- * the bindings declared by the decorated bean
- * @return the resolved decorators
+ * This method may be called at any time in the applications lifecycle.
+ *
+ * @param context
+ * the context to register
+ */
+ public void addContext(Context context);
+
+ /**
+ * Obtain an active context instance for the given scope type.
+ *
+ * @param scopeType
+ * the scope to get the context instance for
+ * @return the context instance
+ * @throws ContextNotActiveException
+ * if no active contexts exist for the given scope type
* @throws IllegalArgumentException
- * if the set of bean types is empty
- * @throws IllegalArgumentException
- * if an annotation which is not a binding type is passed
- * @throws DuplicateBindingTypeException
- * if two instances of the same binding type are passed
+ * if more than one active context exists for the given scope type
*/
- public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindings);
+ public Context getContext(Class<? extends Annotation> scopeType);
+ /**
+ * Returns the ELResolver for integration with the servlet engine and JSF implementation
+ * This resolver will return a contextual instance of a bean if the name for resolution
+ * resolves to exactly one bean
+ */
+ public ELResolver getELResolver();
+
+ /**
+ * Parse and validate the standard metadata defined by JSR-299 for the specified class,
+ * returning an InjectionTarget to allow injection into custom beans or
+ * non-contextual instances by portable extensions
+ *
+ * @param <T>
+ * The type of the class to inspect
+ * @param type
+ * The class to inspect
+ * @returns
+ * a container provided instance of InjectionTarget for the given type
+ * @throws IllegalArgumentException
+ * if there is a definition error associated with any injection point of the type.
+ */
+ public <T> InjectionTarget<T> createInjectionTarget(Class<T> type);
+
+ /**
+ * Returns an InjectionTarget to allow injection into custom beans
+ * or non-contextual instances by portable extensions.
+ *
+ * The container ignores the annotations and types declared by the elements of the
+ * actual Java class and uses the metadata provided via the Annotated interface instead.
+
+ * @param <T>
+ * The type of the AnnotatedType to inspect
+ * @param type
+ * The AnnotatedType to inspect
+ * @returns
+ * a container provided instance of InjectionTarget for the given type
+ * @throws IllegalArgumentException
+ * if there is a definition error associated with any injection point of the type.
+ */
+ public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type);
+
+ /**
+ * Parse and validate the standard metadata defined by JSR-299 for the specified class,
+ * returning a ManagedBean instance representing that class.
+ * @param <T>
+ * The type of the class
+ * @param type
+ * The class for which a managed bean instance should be created
+ */
+ public <T> ManagedBean<T> createManagedBean(Class<T> type);
+
+ /**
+ * Returns a ManagedBean instance representing the metadata described by the specified
+ * type.
+ *
+ * The container ignores the annotations and types declared by the elements of the
+ * actual Java class and uses the metadata provided via the Annotated interface instead.
+ * @param <T>
+ * The type of the underlying bean
+ * @param type
+ * The metadat for construction of the ManagedBean
+ */
+ public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type);
+
+ /**
+ * Create a new child activity. A child activity inherits all beans,
+ * interceptors, decorators, observers, and contexts defined by its direct
+ * and indirect parent activities.
+ *
+ * This method should not be called by the application.
+ *
+ * @return the child activity
+ */
+ public BeanManager createActivity();
+
+ /**
+ * Associate an activity with the current context for a normal scope
+ *
+ * @param scopeType
+ * the scope to associate the activity with
+ * @return the activity
+ * @throws ContextNotActiveException
+ * if the given scope is inactive
+ * @throws IllegalArgumentException
+ * if the given scope is not a normal scope
+ */
+ public BeanManager setCurrent(Class<? extends Annotation> scopeType);
+
+
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,40 +1,10 @@
-/*
- * 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 javax.enterprise.inject.spi;
-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.Annotation;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-/**
- * Event binding type for the event that is raised by the manager when
- * it has completed discovery and bean creation
- *
- * @author Pete Muir
- */
-@BindingType
-@Retention(RUNTIME)
-@Target( { FIELD, PARAMETER })
-public @interface BeforeBeanDiscovery
-{
+public interface BeforeBeanDiscovery {
+ public void addBindingType(Class<? extends Annotation> bindingType);
+ public void addScopeType(Class<? extends Annotation> scopeType, boolean normal, boolean passivating);
+ public void addStereotype(Class<? extends Annotation> stereotype, Annotation... stereotypeDef);
+ public void addInterceptorBindingType(Class<? extends Annotation> bindingType);
}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Extension.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Extension.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Extension.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,3 @@
+package javax.enterprise.inject.spi;
+
+public interface Extension {}
\ No newline at end of file
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,13 @@
+package javax.enterprise.inject.spi;
+
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+
+public interface InjectionTarget<X> {
+ public X produce(CreationalContext<X> ctx);
+ public void inject(X instance, CreationalContext<X> ctx);
+ public void dispose(X instance);
+ public void destroy(X instance);
+ public Set<InjectionPoint> getInjectionPoints();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,11 @@
+package javax.enterprise.inject.spi;
+
+import java.util.Set;
+
+public interface ManagedBean<X> extends Bean<X> {
+ public AnnotatedType<X> getAnnotatedType();
+ public InjectionTarget<X> getInjectionTarget();
+ public Set<ProducerBean<X, ?>> getProducerBeans();
+ public Set<ObserverMethod<X,?>> getObserverMethods();
+ public Bean<X> getBeanClass();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,16 @@
+package javax.enterprise.inject.spi;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.event.Observer;
+
+public interface ObserverMethod<X, T> extends Observer<T> {
+ public AnnotatedMethod<? super X> getAnnotatedMethod();
+ public Bean<X> getBean();
+ public Type getObservedEventType();
+ public Set<Annotation> getObservedEventBindings();
+ public void notify(X instance, T event);
+ public Set<InjectionPoint> getInjectionPoints();
+}
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,9 @@
+package javax.enterprise.inject.spi;
+
+public interface ProducerBean<X, T> extends Bean<T> {
+ public AnnotatedMember<? super X> getAnnotatedProducer();
+ public AnnotatedMethod<? super X> getAnnotatedDisposer();
+ public Bean<X> getBean();
+ public InjectionTarget<T> getInjectionTarget();
+ public Bean<X> getBeanClass();
+}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -25,13 +25,21 @@
import java.lang.reflect.WildcardType;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.NavigableMap;
+import java.util.NavigableSet;
import java.util.Set;
+import java.util.SortedMap;
import java.util.Stack;
+import java.util.TreeMap;
+import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
@@ -40,25 +48,33 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import javax.el.ELResolver;
import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.context.ScopeType;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AmbiguousResolutionException;
import javax.enterprise.inject.BindingType;
+import javax.enterprise.inject.Stereotype;
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.UnproxyableResolutionException;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.deployment.Standard;
+import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.Decorator;
import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
import javax.enterprise.inject.spi.InterceptionType;
import javax.enterprise.inject.spi.Interceptor;
+import javax.enterprise.inject.spi.ManagedBean;
+import javax.enterprise.inject.spi.ObserverMethod;
import javax.event.Observer;
import javax.inject.DeploymentException;
import javax.inject.DuplicateBindingTypeException;
+import javax.interceptor.InterceptorBindingType;
import org.jboss.webbeans.bean.DisposalMethodBean;
import org.jboss.webbeans.bean.EnterpriseBean;
@@ -69,6 +85,7 @@
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.el.Namespace;
+import org.jboss.webbeans.el.WebBeansELResolver;
import org.jboss.webbeans.event.EventManager;
import org.jboss.webbeans.event.EventObserver;
import org.jboss.webbeans.event.ObserverImpl;
@@ -80,7 +97,9 @@
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.manager.api.WebBeansManager;
import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.metadata.StereotypeModel;
import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.ListComparator;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.collections.multi.ConcurrentListHashMultiMap;
@@ -333,11 +352,11 @@
*
* @see javax.enterprise.inject.spi.BeanManager#addBean(javax.inject.manager.Bean)
*/
- public BeanManager addBean(Bean<?> bean)
+ public void addBean(Bean<?> bean)
{
if (beanWithManagers.contains(bean))
{
- return this;
+ return;
}
resolver.clear();
beanWithManagers.add(bean);
@@ -346,7 +365,7 @@
{
childActivity.addBean(bean);
}
- return this;
+ return;
}
/**
@@ -447,36 +466,18 @@
addWebBeansDeploymentTypes();
}
- /**
- * Resolves beans by API type and binding types
- *
- * @param type The API type to match
- * @param bindings The binding types to match
- * @return The set of matching beans
- *
- * @see javax.enterprise.inject.spi.BeanManager#getBeans(java.lang.Class,
- * java.lang.annotation.Annotation[])
- */
- public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation... bindings)
+
+ public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
{
- return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ return (Set<Bean<?>>)(Set)resolveByType(ResolvableAnnotatedClass.of(beanType, bindings), bindings);
}
- /**
- * Resolves beans by API type literal and binding types
- *
- * @param type The API type literal to match
- * @param bindings The binding types to match
- * @return The set of matching beans
- *
- * @see javax.enterprise.inject.spi.BeanManager#getBeans(javax.enterprise.inject.TypeLiteral,
- * java.lang.annotation.Annotation[])
- */
- public <T> Set<Bean<T>> getBeans(TypeLiteral<T> type, Annotation... bindings)
+ public <T> Set<Bean<T>> getBeans(Class<T> beanType, Annotation... bindings)
{
- return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ return resolveByType(ResolvableAnnotatedClass.of(beanType, bindings), bindings);
}
+
public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, InjectionPoint injectionPoint, Annotation... bindings)
{
boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
@@ -607,80 +608,60 @@
*
* @see javax.enterprise.inject.spi.BeanManager#addContext(javax.enterprise.context.spi.Context)
*/
- public BeanManager addContext(Context context)
+ public void addContext(Context context)
{
contexts.put(context.getScopeType(), context);
- return this;
}
- /**
- * Registers a decorator with the manager
- *
- * @param abstractDecorator The decorator to register
- * @return A reference to the manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#addDecorator(org.jboss.webbeans.bean.AbstractDecorator)
- */
- public BeanManager addDecorator(Decorator abstractDecorator)
+
+ public void addObserver(Observer<?> observer, Annotation... bindings)
{
- throw new UnsupportedOperationException("Not yet implemented");
+ addObserver(observer,eventManager.getTypeOfObserver(observer),bindings);
}
/**
- * Registers an interceptor with the manager
- *
- * @param abstractInterceptor The interceptor to register
- * @return A reference to the manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#addInterceptor(org.jboss.webbeans.bean.AbstractInterceptor)
- */
- public BeanManager addInterceptor(Interceptor abstractInterceptor)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <T> BeanManager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
- {
- return addObserverByType(observer, eventType, bindings);
- }
-
- /**
* Shortcut to register an ObserverImpl
*
* @param <T>
* @param observer
- * @return
*/
- public <T> BeanManager addObserver(ObserverImpl<T> observer)
+ public <T> void addObserver(ObserverImpl<T> observer)
{
- return addObserverByType(observer, observer.getEventType(), observer.getBindingsAsArray());
+ addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
}
- public <T> BeanManager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
+ public void addObserver(ObserverMethod<?, ?> observerMethod)
{
- return addObserverByType(observer, eventType.getType(), bindings);
+ addObserver((Observer<?>)observerMethod, observerMethod.getObservedEventType(),
+ new ArrayList<Annotation>(observerMethod.getObservedEventBindings()).toArray(new Annotation[0]));
+
}
-
+
+
/**
* Does the actual observer registration
*
- * @param <T>
* @param observer
* @param eventType
* @param bindings
* @return
*/
- public <T> BeanManager addObserverByType(Observer<T> observer, Type eventType, Annotation... bindings)
+ public void addObserver(Observer<?> observer, Type eventType, Annotation... bindings)
{
checkEventType(eventType);
this.eventManager.addObserver(observer, eventType, bindings);
for (ManagerImpl childActivity : childActivities)
{
- childActivity.addObserverByType(observer, eventType, bindings);
+ childActivity.addObserver(observer, eventType, bindings);
}
- return this;
}
+
+ public void removeObserver(Observer<?> observer)
+ {
+ eventManager.removeObserver(observer);
+ }
+
/**
* Fires an event object with given event object for given bindings
*
@@ -800,7 +781,19 @@
return getContext(bean.getScopeType()).get((Bean<T>)bean, (CreationalContext<T>)creationalContext);
}
}
+
+ /**
+ * XXX this is not correct, as the current implementation of getInstance does not
+ * pay attention to what type the resulting instance needs to implement (non-Javadoc)
+ * @see javax.enterprise.inject.spi.BeanManager#getReference(javax.enterprise.inject.spi.Bean, java.lang.reflect.Type)
+ */
+ public Object getReference(Bean<?> bean, Type beanType)
+ {
+ return getInstance(bean,true);
+ }
+
+
public Object getInstanceToInject(InjectionPoint injectionPoint)
{
return this.getInjectableReference(injectionPoint, null);
@@ -942,41 +935,8 @@
return bean;
}
- /**
- * Removes an observer
- *
- * @param observer The observer to remove
- * @param eventType The event type to match
- * @param bindings the binding types to match
- * @return A reference to the manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#removeObserver(javax.event.Observer,
- * java.lang.Class, java.lang.annotation.Annotation[])
- */
- public <T> BeanManager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
- {
- this.eventManager.removeObserver(observer, eventType, bindings);
- return this;
- }
/**
- * Removes an observer
- *
- * @param observer The observer to remove
- * @param eventType The event type to match
- * @param bindings the binding types to match
- * @return A reference to the manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#removeObserver(javax.event.Observer,
- * javax.enterprise.inject.TypeLiteral, java.lang.annotation.Annotation[])
- */
- public <T> BeanManager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
- {
- this.eventManager.removeObserver(observer, eventType.getRawType(), bindings);
- return this;
- }
-
- /**
* Resolves a set of beans based on their name
*
* @param The name to match
@@ -1214,4 +1174,129 @@
return rootNamespace;
}
+
+ public <T> InjectionTarget<T> createInjectionTarget(Class<T> type)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public <T> ManagedBean<T> createManagedBean(Class<T> type)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+
+
+ public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+
+ public void validate(InjectionPoint injectionPoint)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+
+ public Set<Annotation> getInterceptorBindingTypeDefinition(
+ Class<? extends Annotation> bindingType)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public Bean<?> getPassivationCapableBean(String id)
+ {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType)
+ {
+ return scopeType.getAnnotation(ScopeType.class);
+ }
+
+ public Set<Annotation> getStereotypeDefinition(
+ Class<? extends Annotation> stereotype)
+ {
+ StereotypeModel<? extends Annotation> model =
+ getServices().get(MetaDataCache.class).getStereotype(stereotype);
+ Set<Annotation> results = new HashSet<Annotation>();
+ if (model.getDefaultDeploymentType() != null)
+ results.add(model.getDefaultDeploymentType());
+ if (model.getDefaultScopeType() != null)
+ results.add(model.getDefaultScopeType());
+ if (model.getInterceptorBindings() != null)
+ results.addAll(model.getInterceptorBindings());
+
+ return results;
+ }
+
+ public boolean isBindingType(Class<? extends Annotation> annotationType)
+ {
+ return annotationType.isAnnotationPresent(BindingType.class);
+ }
+
+ public boolean isInterceptorBindingType(
+ Class<? extends Annotation> annotationType)
+ {
+ return annotationType.isAnnotationPresent(InterceptorBindingType.class);
+ }
+
+ public boolean isScopeType(Class<? extends Annotation> annotationType)
+ {
+ return annotationType.isAnnotationPresent(ScopeType.class);
+ }
+
+ public boolean isStereotype(Class<? extends Annotation> annotationType)
+ {
+ return annotationType.isAnnotationPresent(Stereotype.class);
+ }
+
+ public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans)
+ {
+ if (beans.size() == 1)
+ {
+ return beans.iterator().next();
+ }
+ else if (beans.isEmpty())
+ {
+ return null;
+ }
+
+ //make a copy so that the sort is stable with respect to new deployment types addded through the SPI
+ final List<Class<? extends Annotation>> enabledDeploymentTypes = getEnabledDeploymentTypes();
+
+ NavigableSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
+ {
+ public int compare(Bean<? extends X> o1, Bean<? extends X> o2)
+ {
+ int diff = enabledDeploymentTypes.indexOf(o1) - enabledDeploymentTypes.indexOf(o2);
+ if (diff == 0)
+ throw new AmbiguousResolutionException();
+ return diff;
+ }
+ });
+ sortedBeans.addAll(beans);
+ return sortedBeans.last();
+ }
+
+ /**
+ * Return the webbeans el resolver, as part of the BeanManager contract
+ * @see javax.enterprise.inject.spi.BeanManager#getELResolver()
+ */
+ public ELResolver getELResolver()
+ {
+ return new WebBeansELResolver();
+ }
+
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.bootstrap;
+
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.inject.DeploymentException;
+
+public class AfterBeanDiscoveryImpl implements AfterBeanDiscovery
+{
+
+ public void addDefinitionError(Throwable t)
+ {
+ //XXX spec says need to delay abort until all observers
+ //have been notified
+ throw new DeploymentException(t);
+ }
+
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.bootstrap;
+
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
+
+public class AfterDeploymentValidationImpl implements AfterDeploymentValidation
+{
+ public void addDeploymentProblem(Throwable t)
+ {
+ //XXX spec says need to delay abort until all observers
+ //have been notified
+ throw new RuntimeException(t);
+ }
+
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,33 @@
+package org.jboss.webbeans.bootstrap;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+
+public class BeforeBeanDiscoveryImpl implements BeforeBeanDiscovery
+{
+
+ public void addBindingType(Class<? extends Annotation> bindingType)
+ {
+ throw new RuntimeException("Not Yet Implemented");
+
+ }
+
+ public void addInterceptorBindingType(Class<? extends Annotation> bindingType)
+ {
+ throw new RuntimeException("Not Yet Implemented");
+ }
+
+ public void addScopeType(Class<? extends Annotation> scopeType,
+ boolean normal, boolean passivating)
+ {
+ throw new RuntimeException("Not Yet Implemented");
+ }
+
+ public void addStereotype(Class<? extends Annotation> stereotype,
+ Annotation... stereotypeDef)
+ {
+ throw new RuntimeException("Not Yet Implemented");
+ }
+
+}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -50,8 +50,6 @@
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.jsf.JsfApiAbstraction;
-import org.jboss.webbeans.literal.DeployedLiteral;
-import org.jboss.webbeans.literal.InitializedLiteral;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.messaging.spi.JmsServices;
@@ -209,12 +207,15 @@
manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
}
log.debug("Deployment types: " + manager.getEnabledDeploymentTypes());
+ manager.fireEvent(new BeforeBeanDiscoveryImpl());
registerBeans(getServices().get(WebBeanDiscovery.class).discoverWebBeanClasses(), xmlEnvironmentImpl.getClasses(), xmlEnvironmentImpl.getResourceBeans(), ejbDescriptors);
- manager.fireEvent(manager, new InitializedLiteral());
+ manager.fireEvent(new AfterBeanDiscoveryImpl());
log.debug("Web Beans initialized. Validating beans.");
manager.getResolver().resolveInjectionPoints();
new BeanValidator(manager).validate();
- manager.fireEvent(manager, new DeployedLiteral());
+ manager.fireEvent(new AfterDeploymentValidationImpl());
+ manager.getResolver().resolveInjectionPoints();
+
endDeploy(requestBeanStore);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -80,7 +80,7 @@
*/
public void observe(Observer<T> observer, Annotation... bindings)
{
- getManager().addObserverByType(observer, type, mergeInBindings(bindings));
+ getManager().addObserver(observer, type, mergeInBindings(bindings));
}
@Override
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.event;
import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashSet;
@@ -127,11 +128,12 @@
* @param eventType The event type of the observer to remove
* @param bindings The bindings of the observer to remove
*/
- public <T> void removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
+ public void removeObserver(Observer<?> observer)
{
- Collection<EventObserver<?>> observers = manager.getRegisteredObservers().get(eventType);
- EventObserver<T> eventObserver = new EventObserver<T>(observer, eventType, manager, bindings);
- observers.remove(eventObserver);
+ Collection<EventObserver<?>> observers = manager.getRegisteredObservers().get(getTypeOfObserver(observer));
+ for (EventObserver<?> eventObserver : observers)
+ if (eventObserver.getObserver() == observer)
+ observers.remove(eventObserver);
}
@Override
@@ -142,5 +144,22 @@
buffer.append(manager.getRegisteredObservers().toString());
return buffer.toString();
}
+
+ public Type getTypeOfObserver(Observer<?> observer)
+ {
+ for (Type type : observer.getClass().getGenericInterfaces())
+ {
+ if (type instanceof ParameterizedType)
+ {
+ ParameterizedType ptype = (ParameterizedType) type;
+ if (Observer.class.isAssignableFrom((Class)ptype.getRawType()))
+ {
+ return ptype.getActualTypeArguments()[0];
+ }
+ }
+ }
+ throw new RuntimeException("Cannot find observer's event type: " + observer);
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -16,7 +16,6 @@
*/
package org.jboss.webbeans.introspector;
-import javax.enterprise.inject.spi.BeanManager;
/**
@@ -28,13 +27,6 @@
*/
public interface AnnotatedParameter<T> extends AnnotatedItem<T, Object>
{
- /**
- * Gets the actual value of the parameter from the manager
- *
- * @param beanManager The Web Beans manager
- * @return The value
- */
- public T getValue(BeanManager beanManager);
public AnnotatedMember<?, ?> getDeclaringMember();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -16,7 +16,6 @@
*/
package org.jboss.webbeans.introspector;
-import javax.enterprise.inject.spi.BeanManager;
public abstract class ForwardingAnnotatedParameter<T> extends ForwardingAnnotatedItem<T, Object> implements AnnotatedParameter<T>
{
@@ -29,9 +28,5 @@
return delegate().getDeclaringMember();
}
- public T getValue(BeanManager beanManager)
- {
- return delegate().getValue(beanManager);
- }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -20,9 +20,6 @@
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
-import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.spi.BeanManager;
-
import org.jboss.webbeans.introspector.AnnotatedMember;
import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.ForwardingAnnotatedMember;
@@ -105,11 +102,11 @@
*
* @param beanManager The Web Beans manager
* @return The current value
- */
+ *
public T getValue(BeanManager beanManager)
{
- return beanManager.getInstanceByType(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
- }
+ return beanManager.getInstance(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
+ }*/
/**
* Gets the name of the member
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -20,9 +20,6 @@
import java.lang.reflect.Type;
import java.util.Set;
-import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.spi.BeanManager;
-
import org.jboss.webbeans.introspector.AnnotatedMember;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotationStore;
@@ -114,11 +111,11 @@
* @return the value
*
* @see org.jboss.webbeans.introspector.AnnotatedParameter
- */
+ *
public T getValue(BeanManager beanManager)
{
return beanManager.getInstanceByType(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
- }
+ }*/
/**
* Gets the name of the parameter
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -52,7 +52,8 @@
{
String actionUrl = super.getActionURL(context, viewId);
BeanManager beanManager = CurrentManager.rootManager();
- Conversation conversation = beanManager.getInstanceByType(Conversation.class);
+ Conversation conversation = (Conversation) beanManager.getReference(
+ (beanManager.getBeans(Conversation.class).iterator().next()),Conversation.class);
if (conversation.isLongRunning())
{
return new FacesUrlTransformer(actionUrl).appendConversationIdIfNecessary(conversation.getId()).getUrl();
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/DeployedLiteral.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/DeployedLiteral.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/DeployedLiteral.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,30 +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.webbeans.literal;
-
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-
-/**
- * Annotation literal for @Deployed
- *
- * @author Nicklas Karlsson
- */
-public class DeployedLiteral extends AnnotationLiteral<AfterBeanDiscovery> implements AfterBeanDiscovery
-{
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/InitializedLiteral.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/InitializedLiteral.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/literal/InitializedLiteral.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,30 +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.webbeans.literal;
-
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-
-/**
- * Annotation literal for @Initialized
- *
- * @author Pete Muir
- */
-public class InitializedLiteral extends AnnotationLiteral<BeforeBeanDiscovery> implements BeforeBeanDiscovery
-{
-
-}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,15 +1,15 @@
package org.jboss.webbeans.test.unit.bootstrap;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.event.Observes;
+
class InitializedObserver
{
public static boolean observered;
- public void observeInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void observeInitialized(@Observes AfterBeanDiscovery event)
{
observered = true;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,8 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap;
import javax.enterprise.inject.Current;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.event.Observes;
class InitializedObserverWhichUsesApplicationContext
@@ -10,7 +9,7 @@
@Current Cow cow;
- public void observeInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void observeInitialized(@Observes AfterBeanDiscovery event)
{
cow.moo();
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,8 +1,7 @@
package org.jboss.webbeans.test.unit.bootstrap;
import javax.enterprise.inject.Current;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.event.Observes;
class InitializedObserverWhichUsesRequestContext
@@ -12,7 +11,7 @@
@Current Tuna tuna;
- public void observeInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void observeInitialized(@Observes AfterBeanDiscovery event)
{
name = tuna.getName();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -12,11 +12,14 @@
import java.util.Set;
import javax.enterprise.context.spi.Context;
+import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.jsr299.tck.api.JSR299Configuration;
import org.jboss.jsr299.tck.impl.JSR299ConfigurationImpl;
+import org.jboss.jsr299.tck.impl.OldSPIBridge;
public abstract class AbstractJSR299Test extends org.jboss.testharness.AbstractTest
{
@@ -142,6 +145,36 @@
return annotationTypeList.size() == 0;
}
+ @Deprecated
+ public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation... bindings)
+ {
+ return (Set<Bean<T>>)(Set)getCurrentManager().getBeans(type, bindings);
+ }
+
+ @Deprecated
+ public <T> Set<Bean<T>> getBeans(TypeLiteral<T> type, Annotation... bindings)
+ {
+ return (Set<Bean<T>>)(Set)getCurrentManager().getBeans(type.getType(), bindings);
+ }
+
+ @Deprecated
+ public <T> T getInstanceByType(Class<T> beanType, Annotation... bindings)
+ {
+ return OldSPIBridge.getInstanceByType(getCurrentManager(), beanType, bindings);
+ }
+
+ @Deprecated
+ public <T> T getInstanceByType(TypeLiteral<T> beanType, Annotation... bindings)
+ {
+ return OldSPIBridge.getInstanceByType(getCurrentManager(), beanType, bindings);
+ }
+
+ @Deprecated
+ public Object getInstanceByName(String name)
+ {
+ return OldSPIBridge.getInstanceByName(getCurrentManager(), name);
+ }
+
/**
* Create a bean instance. This method abstracts the TCK
* from having to manage the CreationalContext
@@ -167,4 +200,4 @@
{
getCurrentConfiguration().getBeans().destroyAndRemoveBeanInstance(bean, instance);
}
-}
\ No newline at end of file
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/OldSPIBridge.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -0,0 +1,68 @@
+package org.jboss.jsr299.tck.impl;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.TypeLiteral;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+
+public class OldSPIBridge
+{
+
+ /**
+ * This used to be an spi method of BeanManager, but it has been removed.
+ * Replicate it here using the new spi, and deprecate its usage
+ *
+ */
+ @Deprecated
+ public static <T> T getInstanceByType(BeanManager manager, Class<T> beanType, Annotation... bindings)
+ {
+ return (T)manager.getReference(ensureUniqueBean(beanType, manager.getBeans(beanType, bindings)),beanType);
+ }
+
+ @Deprecated
+ public static <T> T getInstanceByType(BeanManager manager, TypeLiteral<T> beanType, Annotation... bindings)
+ {
+
+ return (T) manager.getReference(ensureUniqueBean(beanType.getType(), manager.getBeans(beanType.getType(), bindings)),beanType.getType());
+ }
+
+ public static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans)
+ {
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousResolutionException("More than one bean available");
+ }
+ return beans.iterator().next();
+ }
+
+
+ @Deprecated
+ public static Object getInstanceByName(BeanManager manager, String name)
+ {
+ Set<Bean<?>> beans = manager.getBeans(name);
+ if (beans.size() == 0)
+ {
+ return null;
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousResolutionException("Resolved multiple Web Beans with " + name);
+ }
+ else
+ {
+ Bean<?> bean = beans.iterator().next();
+ return manager.getReference(bean, bean.getTypes().iterator().next());
+ }
+ }
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -174,8 +174,8 @@
})
public void testBeanBelongingToParentActivityBelongsToChildActivity()
{
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
- Bean<?> bean = getCurrentManager().getBeans(Cow.class).iterator().next();
+ assert getBeans(Cow.class).size() == 1;
+ Bean<?> bean = getBeans(Cow.class).iterator().next();
BeanManager childActivity = getCurrentManager().createActivity();
assert childActivity.getBeans(Cow.class).size() == 1;
assert childActivity.getBeans(Cow.class).iterator().next().equals(bean);
@@ -185,8 +185,8 @@
@SpecAssertion(section="11.6", id="c")
public void testBeanBelongingToParentActivityCanBeInjectedIntoChildActivityBean()
{
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
- Bean<?> bean = getCurrentManager().getBeans(Cow.class).iterator().next();
+ assert getBeans(Cow.class).size() == 1;
+ Bean<?> bean = getBeans(Cow.class).iterator().next();
BeanManager childActivity = getCurrentManager().createActivity();
Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
childActivity.addBean(dummyBean);
@@ -240,11 +240,11 @@
@SpecAssertion(section="11.6", id="o")
public void testBeanBelongingToChildActivityCannotBeInjectedIntoParentActivityBean()
{
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).size() == 1;
BeanManager childActivity = getCurrentManager().createActivity();
Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
childActivity.addBean(dummyBean);
- assert getCurrentManager().getBeans(Object.class, new AnnotationLiteral<Tame>() {}).size() == 0;
+ assert getBeans(Object.class, new AnnotationLiteral<Tame>() {}).size() == 0;
}
@Test(expectedExceptions=UnsatisfiedResolutionException.class)
@@ -253,8 +253,8 @@
{
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
- final Bean<Cow> bean = getCurrentManager().getBeans(Cow.class).iterator().next();
+ assert getBeans(Cow.class).size() == 1;
+ final Bean<Cow> bean = getBeans(Cow.class).iterator().next();
BeanManager childActivity = getCurrentManager().createActivity();
final Set<Annotation> bindingTypes = new HashSet<Annotation>();
bindingTypes.add(new AnnotationLiteral<Tame>() {});
@@ -274,7 +274,7 @@
}
});
- getCurrentManager().getInstanceByType(Field.class).get();
+ getInstanceByType(Field.class).get();
}
@Test
@@ -291,7 +291,7 @@
}
};
- childActivity.addObserver(observer, NightTime.class);
+ childActivity.addObserver(observer);
getCurrentManager().fireEvent(new NightTime());
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -144,7 +144,7 @@
{
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).size() == 1;
BeanManager childActivity = getCurrentManager().createActivity();
childActivity.addBean(new Daisy(childActivity));
childActivity.setCurrent(dummyContext.getScopeType());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -83,9 +83,9 @@
}
};
- childActivity.addObserver(observer, NightTime.class);
+ childActivity.addObserver(observer);
childActivity.setCurrent(dummyContext.getScopeType());
- getCurrentManager().getInstanceByType(Dusk.class).ping();
+ getInstanceByType(Dusk.class).ping();
assert observer.isObserved();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -62,10 +62,10 @@
{
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).size() == 1;
BeanManager childActivity = getCurrentManager().createActivity();
childActivity.setCurrent(dummyContext.getScopeType());
- assert getCurrentManager().getInstanceByType(Horse.class).getManager().equals(childActivity);
+ assert getInstanceByType(Horse.class).getManager().equals(childActivity);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -157,11 +157,11 @@
{
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).size() == 1;
BeanManager childActivity = getCurrentManager().createActivity();
childActivity.addBean(new Daisy(childActivity));
childActivity.setCurrent(dummyContext.getScopeType());
- assert getCurrentManager().getInstanceByType(Field.class).get() != null;
+ assert getInstanceByType(Field.class).get() != null;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -65,10 +65,10 @@
{
Context dummyContext = new DummyContext();
getCurrentManager().addContext(dummyContext);
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).size() == 1;
BeanManager childActivity = getCurrentManager().createActivity();
childActivity.setCurrent(dummyContext.getScopeType());
- assert getCurrentManager().getInstanceByType(Donkey.class).getManager().equals(childActivity);
+ assert getInstanceByType(Donkey.class).getManager().equals(childActivity);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -16,7 +16,7 @@
@SpecAssertion(section = "8.1", id = "g")
public void testDestroyedInstanceMustNotBeReturnedByGet()
{
- Bean<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
+ Bean<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
MySessionBean beanInstance = createBeanInstance(mySessionBean);
assert beanInstance != null;
destroyContext(getCurrentManager().getContext(SessionScoped.class));
@@ -24,7 +24,7 @@
beanInstance = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean);
assert beanInstance == null;
- Bean<MyApplicationBean> myApplicationBean = getCurrentManager().getBeans(MyApplicationBean.class).iterator().next();
+ Bean<MyApplicationBean> myApplicationBean = getBeans(MyApplicationBean.class).iterator().next();
MyApplicationBean myApplicationBeanInstance = createBeanInstance(myApplicationBean);
assert myApplicationBeanInstance != null;
destroyContext(getCurrentManager().getContext(ApplicationScoped.class));
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetOnInactiveContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
assert sessionContext.isActive();
setContextInactive(sessionContext);
- Contextual<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
+ Contextual<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
sessionContext.get(mySessionBean);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -18,10 +18,10 @@
@SpecAssertion(section = "8.1", id = "e")
public void testGetMayNotCreateNewInstanceUnlessCreationalContextGiven()
{
- Contextual<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
+ Contextual<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
assert getCurrentManager().getContext(SessionScoped.class).get(mySessionBean) == null;
- Contextual<MyApplicationBean> myApplicationBean = getCurrentManager().getBeans(MyApplicationBean.class).iterator().next();
+ Contextual<MyApplicationBean> myApplicationBean = getBeans(MyApplicationBean.class).iterator().next();
assert getCurrentManager().getContext(ApplicationScoped.class).get(myApplicationBean) == null;
// Now try same operation with a CreationalContext
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/GetWithNoCreationalContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -15,7 +15,7 @@
@SpecAssertion(section = "8.1", id = "b")
public void testGetWithoutCreationalContextReturnsNull()
{
- Contextual<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
+ Contextual<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
assert getCurrentManager().getContext(SessionScoped.class).get(mySessionBean) == null;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -32,7 +32,7 @@
} )
public void testGetReturnsExistingInstance()
{
- Bean<MySessionBean> mySessionBean = getCurrentManager().getBeans(MySessionBean.class).iterator().next();
+ Bean<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
MySessionBean beanInstance = createBeanInstance(mySessionBean);
beanInstance.setId(10);
assert beanInstance != null;
@@ -100,8 +100,8 @@
})
public void testSameNormalScopeBeanInjectedEverywhere()
{
- SimpleBeanA instanceOfA = getCurrentManager().getInstanceByType(SimpleBeanA.class);
- SimpleBeanB instanceOfB = getCurrentManager().getInstanceByType(SimpleBeanB.class);
+ SimpleBeanA instanceOfA = getInstanceByType(SimpleBeanA.class);
+ SimpleBeanB instanceOfB = getInstanceByType(SimpleBeanB.class);
assert instanceOfA.getZ() == instanceOfB.getZ();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/IntrospectApplication.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -23,7 +23,7 @@
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
resp.setContentType("text/text");
- SimpleApplicationBean aBean = jsr299Manager.getInstanceByType(SimpleApplicationBean.class);
+ SimpleApplicationBean aBean = org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleApplicationBean.class);
resp.getWriter().print(aBean.getId());
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -25,8 +25,8 @@
public void testApplicationScopeActiveDuringWebSericeInvocation()
{
//TODO This test might work better with a separate client over HTTP
- FeederService birdFeeder = getCurrentManager().getInstanceByType(FeederService.class);
- Bird bird = getCurrentManager().getInstanceByType(Bird.class);
+ FeederService birdFeeder = getInstanceByType(FeederService.class);
+ Bird bird = getInstanceByType(Bird.class);
bird.eat();
assert birdFeeder.adequateFood();
}
@@ -35,7 +35,7 @@
@SpecAssertion(section = "8.5.3", id = "f")
public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception
{
- FMS flightManagementSystem = getCurrentManager().getInstanceByType(FMS.class);
+ FMS flightManagementSystem = getInstanceByType(FMS.class);
flightManagementSystem.climb();
Thread.sleep(250);
assert flightManagementSystem.isApplicationScopeActive();
@@ -45,7 +45,7 @@
@SpecAssertion(section = "8.5.3", id = "l")
public void testApplicationContextSharedBetweenEJBTimeoutInvokations() throws Exception
{
- FMS flightManagementSystem = getCurrentManager().getInstanceByType(FMS.class);
+ FMS flightManagementSystem = getInstanceByType(FMS.class);
flightManagementSystem.climb();
flightManagementSystem.descend();
Thread.sleep(250);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -52,14 +52,14 @@
applicationScopeActive = true;
if (beanId > 0.0)
{
- if (beanId == beanManager.getInstanceByType(SimpleApplicationBean.class).getId())
+ if (beanId == org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleApplicationBean.class).getId())
{
sameBean = true;
}
}
else
{
- beanId = beanManager.getInstanceByType(SimpleApplicationBean.class).getId();
+ beanId = org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleApplicationBean.class).getId();
}
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -27,7 +27,7 @@
public void drawNearMiss(@Observes @Asynchronously NearMiss event)
{
- event.setBean(beanManager.getInstanceByType(SimpleApplicationBean.class));
+ event.setBean(org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleApplicationBean.class));
}
public static boolean isApplicationScopeActive()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasToFmsLink.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -12,7 +12,7 @@
public void avoidanceAction(@Observes @Asynchronously NearMiss event)
{
- event.setBean(beanManager.getInstanceByType(SimpleApplicationBean.class));
+ event.setBean(org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleApplicationBean.class));
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationBeginTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationBeginTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationBeginTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
@SpecAssertion(section = "8.5.4", id = "f")
public void testConversationBeginMakesConversationLongRunning()
{
- Conversation conversation = getCurrentManager().getInstanceByType(Conversation.class);
+ Conversation conversation = getInstanceByType(Conversation.class);
conversation.begin();
assert conversation.isLongRunning();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -27,28 +27,28 @@
@SpecAssertion(section = "8.5.4", id = "e")
public void testDefaultConversationIsTransient()
{
- assert !getCurrentManager().getInstanceByType(Conversation.class).isLongRunning();
+ assert !getInstanceByType(Conversation.class).isLongRunning();
}
@Test(groups = { "contexts" })
@SpecAssertion(section = "8.5.4", id = "ia")
public void testBeanWithTypeConversation()
{
- assert getCurrentManager().getBeans(Conversation.class).size() == 1;
+ assert getBeans(Conversation.class).size() == 1;
}
@Test(groups = { "contexts" })
@SpecAssertion(section = "8.5.4", id = "ib")
public void testBeanWithRequestScope()
{
- assert getCurrentManager().getBeans(Conversation.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(Conversation.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test(groups = { "contexts" })
@SpecAssertion(section = "8.5.4", id = "ic")
public void testBeanWithDeploymentTypeStandard()
{
- assert getCurrentManager().getBeans(Conversation.class).iterator().next().getDeploymentType().equals(Standard.class);
+ assert getBeans(Conversation.class).iterator().next().getDeploymentType().equals(Standard.class);
}
@Test(groups = { "contexts" })
@@ -56,7 +56,7 @@
public void testBeanWithBindingCurrent()
{
boolean found = false;
- for (Annotation binding : getCurrentManager().getBeans(Conversation.class).iterator().next().getBindings())
+ for (Annotation binding : getBeans(Conversation.class).iterator().next().getBindings())
{
if (binding.annotationType().equals(Current.class))
{
@@ -70,7 +70,7 @@
@SpecAssertion(section = "8.5.4", id = "ie")
public void testBeanWithNameJavaxContextConversation()
{
- assert getCurrentManager().getBeans(Conversation.class).iterator().next().getName().equals("javax.context.conversation");
+ assert getBeans(Conversation.class).iterator().next().getName().equals("javax.context.conversation");
}
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationEndTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationEndTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationEndTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
@SpecAssertion(section = "8.5.4", id = "g")
public void testConversationEndMakesConversationTransient()
{
- Conversation conversation = getCurrentManager().getInstanceByType(Conversation.class);
+ Conversation conversation = getInstanceByType(Conversation.class);
conversation.begin();
assert conversation.isLongRunning();
conversation.end();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
@SpecAssertion(section = "8.5.4", id = "ha")
public void testConversationIdMayBeSetByApplication()
{
- Conversation conversation = getCurrentManager().getInstanceByType(Conversation.class);
+ Conversation conversation = getInstanceByType(Conversation.class);
conversation.begin("foo");
assert conversation.getId().equals("foo");
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByContainerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByContainerTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByContainerTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
@SpecAssertion(section = "8.5.4", id = "f")
public void testConversationBeginMakesConversationLongRunning()
{
- Conversation conversation = getCurrentManager().getInstanceByType(Conversation.class);
+ Conversation conversation = getInstanceByType(Conversation.class);
conversation.begin();
assert conversation.isLongRunning();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationStatusServlet.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -20,7 +20,7 @@
String method = req.getParameter("method");
if ("cid".equals(method))
{
- serializeToResponse(JSR299ConfigurationImpl.get().getManagers().getManager().getInstanceByType(Conversation.class).getId(), resp);
+ serializeToResponse(org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(JSR299ConfigurationImpl.get().getManagers().getManager(),Conversation.class).getId(), resp);
}
else if ("cloudDestroyed".equals(method))
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -9,6 +9,7 @@
import javax.servlet.http.HttpServletResponse;
import org.jboss.jsr299.tck.impl.JSR299ConfigurationImpl;
+import org.jboss.jsr299.tck.impl.OldSPIBridge;
public class ConversationTestPhaseListener implements PhaseListener
{
@@ -47,8 +48,8 @@
if (event.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
{
HttpServletResponse response = (HttpServletResponse) event.getFacesContext().getExternalContext().getResponse();
- response.addHeader(AbstractConversationTest.CID_HEADER_NAME, JSR299ConfigurationImpl.get().getManagers().getManager().getInstanceByType(Conversation.class).getId());
- response.addHeader(Cloud.RAINED_HEADER_NAME, new Boolean(JSR299ConfigurationImpl.get().getManagers().getManager().getInstanceByType(Cloud.class).isRained()).toString());
+ response.addHeader(AbstractConversationTest.CID_HEADER_NAME, OldSPIBridge.getInstanceByType(JSR299ConfigurationImpl.get().getManagers().getManager(),Conversation.class).getId());
+ response.addHeader(Cloud.RAINED_HEADER_NAME, new Boolean(OldSPIBridge.getInstanceByType(JSR299ConfigurationImpl.get().getManagers().getManager(),Cloud.class).isRained()).toString());
response.addHeader(ACTIVE_BEFORE_APPLY_REQUEST_VALUES_HEADER_NAME, new Boolean(activeBeforeApplyRequestValues).toString());
}
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -31,9 +31,9 @@
@SpecAssertion(section = "8.3", id = "a")
public void testInstanceNotSharedBetweenInjectionPoints()
{
- Set<Bean<Fox>> foxBeans = getCurrentManager().getBeans(Fox.class);
+ Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
assert foxBeans.size() == 1;
- Set<Bean<FoxRun>> foxRunBeans = getCurrentManager().getBeans(FoxRun.class);
+ Set<Bean<FoxRun>> foxRunBeans = getBeans(FoxRun.class);
assert foxRunBeans.size() == 1;
Bean<FoxRun> foxRunBean = foxRunBeans.iterator().next();
FoxRun foxRun = createBeanInstance(foxRunBean);
@@ -49,7 +49,7 @@
@Override
protected void execute() throws Exception
{
- Set<Bean<Fox>> foxBeans = getCurrentManager().getBeans(Fox.class);
+ Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
assert foxBeans.size() == 1;
Fox fox1 = getCurrentConfiguration().getEl().evaluateValueExpression("#{fox}", Fox.class);
@@ -63,7 +63,7 @@
@SpecAssertion(section = "8.3", id = "d")
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
- Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
Tarantula tarantula = createBeanInstance(tarantulaBean);
Tarantula tarantula2 = createBeanInstance(tarantulaBean);
assert tarantula != null;
@@ -75,7 +75,7 @@
@SpecAssertion(section = "8.3", id = "d")
public void testInstanceUsedForProducerFieldNotShared() throws Exception
{
- Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).iterator().next();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, TAME_LITERAL).iterator().next();
Tarantula tarantula = createBeanInstance(tarantulaBean);
Tarantula tarantula2 = createBeanInstance(tarantulaBean);
assert tarantula != null;
@@ -93,8 +93,8 @@
@Override
protected void execute() throws Exception
{
- SpiderProducer spiderProducer = getCurrentManager().getInstanceByType(SpiderProducer.class);
- Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ SpiderProducer spiderProducer = getInstanceByType(SpiderProducer.class);
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
@@ -115,7 +115,7 @@
@Override
protected void execute() throws Exception
{
- HorseStable firstStableInstance = getCurrentManager().getInstanceByType(HorseStable.class);
+ HorseStable firstStableInstance = getInstanceByType(HorseStable.class);
getCurrentManager().fireEvent(new HorseInStableEvent());
assert HorseStable.getInstanceThatObservedEvent() != null;
assert HorseStable.getInstanceThatObservedEvent() != firstStableInstance;
@@ -134,7 +134,7 @@
@Override
protected void execute() throws Exception
{
- Set<Bean<Fox>> foxBeans = getCurrentManager().getBeans(Fox.class);
+ Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
assert foxBeans.size() == 1;
Bean<Fox> foxBean = foxBeans.iterator().next();
Context context = getCurrentManager().getContext(Dependent.class);
@@ -155,7 +155,7 @@
@Override
protected void execute() throws Exception
{
- Set<Bean<Fox>> foxBeans = getCurrentManager().getBeans(Fox.class);
+ Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
assert foxBeans.size() == 1;
Bean<Fox> foxBean = foxBeans.iterator().next();
Context context = getCurrentManager().getContext(Dependent.class);
@@ -177,7 +177,7 @@
@SpecAssertion(section = "8.3", id = "g")
public void testContextIsActiveWhenInvokingProducerMethod()
{
- Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
assert SpiderProducer.isDependentContextActive();
@@ -189,7 +189,7 @@
{
// Reset test class
Tarantula.setDependentContextActive(false);
- getCurrentManager().getInstanceByType(Tarantula.class, TAME_LITERAL);
+ getInstanceByType(Tarantula.class,TAME_LITERAL);
assert Tarantula.isDependentContextActive();
}
@@ -200,7 +200,7 @@
})
public void testContextIsActiveWhenInvokingDisposalMethod()
{
- Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
SpiderProducer.setDependentContextActive(false);
@@ -252,7 +252,7 @@
@Override
protected void execute() throws Exception
{
- SensitiveFox fox1 = getCurrentManager().getInstanceByType(SensitiveFox.class);
+ SensitiveFox fox1 = getInstanceByType(SensitiveFox.class);
assert fox1 != null;
assert fox1.isDependentContextActiveDuringCreate();
}
@@ -264,7 +264,7 @@
@SpecAssertion(section = "8.3", id = "j")
public void testContextIsActiveDuringInjection()
{
- Bean<FoxRun> foxRunBean = getCurrentManager().getBeans(FoxRun.class).iterator().next();
+ Bean<FoxRun> foxRunBean = getBeans(FoxRun.class).iterator().next();
FoxRun foxRun = foxRunBean.create(new MockCreationalContext<FoxRun>());
assert foxRun.fox != null;
}
@@ -282,8 +282,8 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getBeans(Farm.class).size() == 1;
- Bean<Farm> farmBean = getCurrentManager().getBeans(Farm.class).iterator().next();
+ assert getBeans(Farm.class).size() == 1;
+ Bean<Farm> farmBean = getBeans(Farm.class).iterator().next();
Farm farm = createBeanInstance(farmBean);
farm.open();
Stable.destroyed = false;
@@ -314,7 +314,7 @@
Fox.setDestroyCount(0);
assert getCurrentManager().getBeans(FoxRun.class).size() == 1;
- Bean<FoxRun> bean = getCurrentManager().getBeans(FoxRun.class).iterator().next();
+ Bean<FoxRun> bean = getBeans(FoxRun.class).iterator().next();
FoxRun instance = createBeanInstance(bean);
assert instance.fox != instance.anotherFox;
destroyAndRemoveBeanInstance(bean, instance);
@@ -357,7 +357,7 @@
{
// Reset the test class
SpiderProducer.setDestroyed(false);
- Tarantula spiderInstance = getCurrentManager().getInstanceByType(Tarantula.class);
+ Tarantula spiderInstance = getInstanceByType(Tarantula.class);
assert spiderInstance != null;
assert SpiderProducer.isDestroyed();
}
@@ -378,7 +378,7 @@
// Reset the test class
OtherSpiderProducer.setDestroyed(false);
- Tarantula spiderInstance = getCurrentManager().getInstanceByType(Tarantula.class, TAME_LITERAL);
+ Tarantula spiderInstance = getInstanceByType(Tarantula.class,TAME_LITERAL);
assert spiderInstance != null;
assert OtherSpiderProducer.isDestroyed();
@@ -397,7 +397,7 @@
@Override
protected void execute() throws Exception
{
- Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
Tarantula tarantula = createBeanInstance(tarantulaBean);
assert tarantula != null;
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -39,7 +39,7 @@
@SpecAssertion(section = "8.3", id = "k")
public void testContextIsActiveDuringEJBDependencyInjection()
{
- Bean<FoxRunLocal> foxRunBean = getCurrentManager().getBeans(FoxRunLocal.class).iterator().next();
+ Bean<FoxRunLocal> foxRunBean = getBeans(FoxRunLocal.class).iterator().next();
FoxRunLocal foxRun = createBeanInstance(foxRunBean);
assert foxRun.getFox() != null;
}
@@ -49,7 +49,7 @@
public void testContextIsActiveDuringEJBPostConstruct()
{
Fox.setDependentContextActiveDuringPostConstruct(false);
- getCurrentManager().getInstanceByType(FoxLocal.class).getName();
+ getInstanceByType(FoxLocal.class).getName();
assert Fox.isDependentContextActiveDuringPostConstruct();
}
@@ -63,8 +63,8 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getBeans(HouseLocal.class).size() == 1;
- Bean<HouseLocal> bean = getCurrentManager().getBeans(HouseLocal.class).iterator().next();
+ assert getBeans(HouseLocal.class).size() == 1;
+ Bean<HouseLocal> bean = getBeans(HouseLocal.class).iterator().next();
HouseLocal instance = createBeanInstance(bean);
Room.destroyed = false;
Table.destroyed = false;
@@ -86,8 +86,8 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getBeans(FarmLocal.class).size() == 1;
- Bean<FarmLocal> farmBean = getCurrentManager().getBeans(FarmLocal.class).iterator().next();
+ assert getBeans(FarmLocal.class).size() == 1;
+ Bean<FarmLocal> farmBean = getBeans(FarmLocal.class).iterator().next();
FarmLocal farm = createBeanInstance(farmBean);
Horse.destroyed = false;
Stable.destroyed = false;
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -38,20 +38,20 @@
@SpecAssertion(section = "8.4", id = "b")
public void testSimpleWebBeanWithSerializableImplementationClassOK()
{
- Set<Bean<Jyvaskyla>> beans = getCurrentManager().getBeans(Jyvaskyla.class);
+ Set<Bean<Jyvaskyla>> beans = getBeans(Jyvaskyla.class);
assert !beans.isEmpty();
}
@Test @SpecAssertion(section="8.4", id = "ca")
public void testInjectionOfDependentSerializableProductIntoNormalBean()
{
- getCurrentManager().getInstanceByType(NumberConsumer.class).ping();
+ getInstanceByType(NumberConsumer.class).ping();
}
@Test @SpecAssertion(section="8.4", id = "cb")
public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
{
- getCurrentManager().getInstanceByType(FooConsumer.class).ping();
+ getInstanceByType(FooConsumer.class).ping();
}
@Test(groups = { "contexts", "passivation" })
@@ -61,12 +61,12 @@
})
public void testSimpleWebBeanDeclaringPassivatingScopeIsSerializedWhenContextIsPassivated() throws IOException, ClassNotFoundException
{
- Kajaani instance = getCurrentManager().getInstanceByType(Kajaani.class);
+ Kajaani instance = getInstanceByType(Kajaani.class);
instance.setTheNumber(100);
Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
setContextInactive(sessionContext);
setContextActive(sessionContext);
- instance = getCurrentManager().getInstanceByType(Kajaani.class);
+ instance = getInstanceByType(Kajaani.class);
assert instance.getTheNumber() == 100;
}
@@ -74,7 +74,7 @@
private <T> boolean testSerialize(Bean<T> bean) throws IOException, ClassNotFoundException
{
getCurrentManager().addBean(bean);
- T instance = getCurrentManager().getInstance(bean);
+ T instance = getCurrentManager().getContext(bean.getScopeType()).get(bean);
byte[] data = serialize(instance);
T resurrected = (T) deserialize(data);
return resurrected.toString().equals(instance.toString());
@@ -88,7 +88,7 @@
@SpecAssertion(section = "8.4", id = "j")
public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
{
- Set<Bean<Vaasa>> vaasaBeans = getCurrentManager().getBeans(Vaasa.class);
+ Set<Bean<Vaasa>> vaasaBeans = getBeans(Vaasa.class);
assert vaasaBeans.size() == 1;
assert testSerialize(vaasaBeans.iterator().next());
}
@@ -97,7 +97,7 @@
@SpecAssertion(section = "8.4", id = "l")
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoTransientFieldOK()
{
- Set<Bean<Joensuu>> beans = getCurrentManager().getBeans(Joensuu.class);
+ Set<Bean<Joensuu>> beans = getBeans(Joensuu.class);
assert !beans.isEmpty();
}
@@ -105,14 +105,14 @@
@SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Nokia_Broken.class).ping();
+ getInstanceByType(Nokia_Broken.class).ping();
}
@Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
{
- Set<Bean<Hyvinkaa>> beans = getCurrentManager().getBeans(Hyvinkaa.class);
+ Set<Bean<Hyvinkaa>> beans = getBeans(Hyvinkaa.class);
assert !beans.isEmpty();
}
@@ -120,77 +120,77 @@
@SpecAssertion(section = "8.4", id = "r")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Loviisa_Broken.class).ping();
+ getInstanceByType(Loviisa_Broken.class).ping();
}
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "s")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Kuopio_Broken.class).ping();
+ getInstanceByType(Kuopio_Broken.class).ping();
}
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "t")
public void testDependentScopedProducerMethodReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Violation2.class).ping();
+ getInstanceByType(Violation2.class).ping();
}
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoNonTransientFieldOfWebBeanWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Uusikaupunki_Broken.class).ping();
+ getInstanceByType(Uusikaupunki_Broken.class).ping();
}
@Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "8.4", id = "q")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoTransientFieldOfWebBeanWithPassivatingScopeOK()
{
- getCurrentManager().getInstanceByType(Salo_Broken.class).ping();
+ getInstanceByType(Salo_Broken.class).ping();
}
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "r")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoConstructorParameterOfWebBeanWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Loviisa_Broken.class).ping();
+ getInstanceByType(Loviisa_Broken.class).ping();
}
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "s")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoInitializerParameterOfWebBeanWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Mikkeli_Broken.class).ping();
+ getInstanceByType(Mikkeli_Broken.class).ping();
}
@Test(groups = { "contexts", "passivation" }, expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "t")
public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoProducerMethodParameterWithPassivatingScopeFails()
{
- getCurrentManager().getInstanceByType(Violation2.class, BIG_LITERAL).ping();
+ getInstanceByType(Violation2.class,BIG_LITERAL).ping();
}
@Test(groups = { "contexts", "passivation", "enterpriseBean", "integration" })
@SpecAssertion(section = "8.4", id = "a")
public void testEJBWebBeanCanDeclarePassivatingScope()
{
- assert getCurrentManager().getBeans(TurkuLocal.class).size() == 1;
+ assert getBeans(TurkuLocal.class).size() == 1;
}
@Test(expectedExceptions = IllegalProductException.class)
@SpecAssertion(section = "8.4", id = "cc")
public void testNonSerializableProducerFieldDeclaredPassivatingThrowsIllegalProductException()
{
- getCurrentManager().getInstanceByType(HelsinkiNonSerializable.class).ping();
+ getInstanceByType(HelsinkiNonSerializable.class).ping();
}
@Test(groups = { "contexts", "passivation" })
@SpecAssertion(section = "8.4", id = "v")
public void testIsSerializableOnBean()
{
- assert !getCurrentManager().getBeans(Sysma.class).iterator().next().isSerializable();
- assert getCurrentManager().getBeans(Hyvinkaa.class).iterator().next().isSerializable();
+ assert !getBeans(Sysma.class).iterator().next().isSerializable();
+ assert getBeans(Hyvinkaa.class).iterator().next().isSerializable();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/integration/PassivatingContextIntegrationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/integration/PassivatingContextIntegrationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/integration/PassivatingContextIntegrationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -31,7 +31,7 @@
{
try
{
- getCurrentManager().getInstanceByType(MaarianHaminaLocal_Broken.class);
+ getInstanceByType(MaarianHaminaLocal_Broken.class);
}
catch (Throwable e)
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/unserializableSimpleInjectedIntoPassivatingEnterpriseBean/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/unserializableSimpleInjectedIntoPassivatingEnterpriseBean/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/unserializableSimpleInjectedIntoPassivatingEnterpriseBean/UnserializableSimpleInjectedIntoPassivatingEnterpriseBeanTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
public void testSimpleDependentWebBeanWithNonSerializableImplementationInjectedIntoStatefulSessionBeanFails()
{
// WBRI-150
- getCurrentManager().getInstanceByType(EspooLocal_Broken.class);
+ getInstanceByType(EspooLocal_Broken.class);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/IntrospectRequestScope.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -23,7 +23,7 @@
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
resp.setContentType("text/text");
- SimpleRequestBean aBean = jsr299Manager.getInstanceByType(SimpleRequestBean.class);
+ SimpleRequestBean aBean = org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleRequestBean.class);
resp.getWriter().print(aBean.getId());
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/EJBRequestContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -29,7 +29,7 @@
@SpecAssertion(section = "8.5.1", id = "i")
public void testRequestScopeActiveDuringCallToEjbTimeoutMethod() throws Exception
{
- FMS flightManagementSystem = getCurrentManager().getInstanceByType(FMS.class);
+ FMS flightManagementSystem = getInstanceByType(FMS.class);
flightManagementSystem.climb();
Thread.sleep(250);
assert flightManagementSystem.isRequestScopeActive();
@@ -43,7 +43,7 @@
@SpecAssertion(section = "8.5.1", id = "l")
public void testRequestScopeDestroyedAfterCallToEjbTimeoutMethod() throws Exception
{
- FMS flightManagementSystem = getCurrentManager().getInstanceByType(FMS.class);
+ FMS flightManagementSystem = getInstanceByType(FMS.class);
flightManagementSystem.climb();
flightManagementSystem.descend();
Thread.sleep(250);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -52,14 +52,14 @@
requestScopeActive = true;
if (beanId > 0.0)
{
- if (beanId == beanManager.getInstanceByType(SimpleRequestBean.class).getId())
+ if (beanId == org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleRequestBean.class).getId())
{
sameBean = true;
}
}
else
{
- beanId = beanManager.getInstanceByType(SimpleRequestBean.class).getId();
+ beanId = org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleRequestBean.class).getId();
}
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/standalone/TcasDisplay.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -27,7 +27,7 @@
public void drawNearMiss(@Observes @Asynchronously NearMiss event)
{
- event.setBean(beanManager.getInstanceByType(SimpleRequestBean.class));
+ event.setBean(org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(beanManager,SimpleRequestBean.class));
}
public static boolean isRequestScopeActive()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -46,7 +46,7 @@
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
resp.setContentType("text/text");
- SimpleSessionBean aBean = jsr299Manager.getInstanceByType(SimpleSessionBean.class);
+ SimpleSessionBean aBean = org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleSessionBean.class);
resp.getWriter().print(aBean.hashCode());
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/InvalidateSession.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -27,7 +27,7 @@
if (req.getParameter("timeout") != null)
{
SimpleSessionBean.setBeanDestroyed(false);
- jsr299Manager.getInstanceByType(SimpleSessionBean.class);
+ org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleSessionBean.class);
req.getSession().setMaxInactiveInterval(Integer.parseInt(req.getParameter("timeout")));
}
else if (req.getParameter("isBeanDestroyed") != null)
@@ -37,7 +37,7 @@
else
{
SimpleSessionBean.setBeanDestroyed(false);
- jsr299Manager.getInstanceByType(SimpleSessionBean.class);
+ org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleSessionBean.class);
req.getSession().invalidate();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -34,16 +34,16 @@
@SpecAssertion(section = "2", id = "a")
public void testBeanTypesNonEmpty()
{
- assert getCurrentManager().getBeans(RedSnapper.class).size() == 1;
- assert getCurrentManager().getBeans(RedSnapper.class).iterator().next().getTypes().size() > 0;
+ assert getBeans(RedSnapper.class).size() == 1;
+ assert getBeans(RedSnapper.class).iterator().next().getTypes().size() > 0;
}
@Test
@SpecAssertion(section = "2", id = "b")
public void testBindingTypesNonEmpty()
{
- assert getCurrentManager().getBeans(RedSnapper.class).size() == 1;
- assert getCurrentManager().getBeans(RedSnapper.class).iterator().next().getBindings().size() > 0;
+ assert getBeans(RedSnapper.class).size() == 1;
+ assert getBeans(RedSnapper.class).iterator().next().getBindings().size() > 0;
}
@Test
@@ -54,8 +54,8 @@
})
public void testHasScopeType()
{
- assert getCurrentManager().getBeans(RedSnapper.class).size() == 1;
- assert getCurrentManager().getBeans(RedSnapper.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(RedSnapper.class).size() == 1;
+ assert getBeans(RedSnapper.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@@ -66,19 +66,19 @@
})
public void testHasDeploymentType()
{
- assert getCurrentManager().getBeans(RedSnapper.class).size() == 1;
- assert getCurrentManager().getBeans(RedSnapper.class).iterator().next().getDeploymentType().equals(Production.class);
+ assert getBeans(RedSnapper.class).size() == 1;
+ assert getBeans(RedSnapper.class).iterator().next().getDeploymentType().equals(Production.class);
}
@Test(groups = "producerMethod")
@SpecAssertion(section = "5.2", id = "b")
public void testIsNullable() throws Exception
{
- assert getCurrentManager().getBeans(int.class).size() == 1;
- Bean<Integer> bean = getCurrentManager().getBeans(int.class).iterator().next();
+ assert getBeans(int.class).size() == 1;
+ Bean<Integer> bean = getBeans(int.class).iterator().next();
assert !bean.isNullable();
- assert getCurrentManager().getBeans(Animal.class, TAME_LITERAL).size() == 1;
- Bean<Animal> animalBean = getCurrentManager().getBeans(Animal.class, TAME_LITERAL).iterator().next();
+ assert getBeans(Animal.class, TAME_LITERAL).size() == 1;
+ Bean<Animal> animalBean = getBeans(Animal.class, TAME_LITERAL).iterator().next();
assert animalBean.isNullable();
}
@@ -94,8 +94,8 @@
})
public void testBeanTypes()
{
- assert getCurrentManager().getBeans(Tarantula.class).size() == 1;
- Bean<Tarantula> bean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ assert getBeans(Tarantula.class).size() == 1;
+ Bean<Tarantula> bean = getBeans(Tarantula.class).iterator().next();
assert bean.getTypes().size() == 6;
assert bean.getTypes().contains(Tarantula.class);
assert bean.getTypes().contains(Spider.class);
@@ -110,9 +110,9 @@
@SuppressWarnings("unused")
public void testBeanClientCanCastBeanInstanceToAnyBeanType()
{
- assert getCurrentManager().getBeans(Tarantula.class).size() == 1;
- Bean<Tarantula> bean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = getCurrentManager().getInstance(bean);
+ assert getBeans(Tarantula.class).size() == 1;
+ Bean<Tarantula> bean = getBeans(Tarantula.class).iterator().next();
+ Tarantula tarantula = getCurrentManager().getContext(bean.getScopeType()).get(bean);
Spider spider = (Spider) tarantula;
Animal animal = (Animal) tarantula;
@@ -125,14 +125,14 @@
@SpecAssertion(section = "2.2", id = "g")
public void testFinalApiType()
{
- assert !getCurrentManager().getBeans(DependentFinalTuna.class).isEmpty();
+ assert !getBeans(DependentFinalTuna.class).isEmpty();
}
@Test
@SpecAssertion(section = "3.2.3", id = "bd")
public void testMultipleStereotypes()
{
- Bean<ComplicatedTuna> tunaBean = getCurrentManager().getBeans(ComplicatedTuna.class).iterator().next();
+ Bean<ComplicatedTuna> tunaBean = getBeans(ComplicatedTuna.class).iterator().next();
assert tunaBean.getScopeType().equals(RequestScoped.class);
assert tunaBean.getName().equals("complicatedTuna");
}
@@ -141,8 +141,8 @@
@SpecAssertion(section = "3.2.3", id = "c")
public void testBeanExtendsAnotherBean()
{
- assert !getCurrentManager().getBeans(Spider.class).isEmpty();
- assert !getCurrentManager().getBeans(Tarantula.class).isEmpty();
+ assert !getBeans(Spider.class).isEmpty();
+ assert !getBeans(Tarantula.class).isEmpty();
}
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -4,8 +4,6 @@
import java.util.Set;
import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -28,7 +26,7 @@
@SpecAssertion(section = "2.3.1", id = "a")
public void testDefaultBindingDeclaredInJava()
{
- Bean<Order> order = getCurrentManager().getBeans(Order.class).iterator().next();
+ Bean<Order> order = getBeans(Order.class).iterator().next();
assert order.getBindings().size() == 2;
assert order.getBindings().contains(new CurrentLiteral());
assert order.getBindings().contains(new AnyBinding());
@@ -38,7 +36,7 @@
@SpecAssertion(section = "2.3.1", id = "b")
public void testDefaultBindingForInjectionPoint()
{
- Bean<Order> order = getCurrentManager().getBeans(Order.class).iterator().next();
+ Bean<Order> order = getBeans(Order.class).iterator().next();
InjectionPoint injectionPoint = order.getInjectionPoints().iterator().next();
assert injectionPoint.getBean().getBindings().contains(new CurrentLiteral());
}
@@ -47,14 +45,14 @@
@SpecAssertion(section = "2.3.2", id = "b")
public void testBindingDeclaresBindingAnnotation()
{
- assert !getCurrentManager().getBeans(Tarantula.class, new TameBinding()).isEmpty();
+ assert !getBeans(Tarantula.class, new TameBinding()).isEmpty();
}
@Test
@SpecAssertion(section = "2.3.3", id = "a")
public void testBindingsDeclaredInJava()
{
- Bean<Cat> cat = getCurrentManager().getBeans(Cat.class, new SynchronousBinding()).iterator().next();
+ Bean<Cat> cat = getBeans(Cat.class, new SynchronousBinding()).iterator().next();
assert cat.getBindings().size() == 2;
assert cat.getBindings().contains(new SynchronousBinding());
}
@@ -66,7 +64,7 @@
})
public void testMultipleBindings()
{
- Bean<?> model = getCurrentManager().getBeans(Cod.class, new ChunkyBinding(true), new WhitefishBinding()).iterator().next();
+ Bean<?> model = getBeans(Cod.class, new ChunkyBinding(true), new WhitefishBinding()).iterator().next();
assert model.getBindings().size() == 3;
}
@@ -74,7 +72,7 @@
@SpecAssertion(section = "2.3.5", id = "a")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- Barn barn = createBeanInstance(getCurrentManager().getBeans(Barn.class).iterator().next());
+ Barn barn = createBeanInstance(getBeans(Barn.class).iterator().next());
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
}
@@ -89,7 +87,7 @@
@Override
protected void execute() throws Exception
{
- Spider spider = getCurrentManager().getInstanceByType(Spider.class, new AnnotationLiteral<Produced>() {});
+ Spider spider = getInstanceByType(Spider.class,new AnnotationLiteral<Produced>() {});
assert spider != null;
assert spider instanceof DefangedTarantula;
}
@@ -103,7 +101,7 @@
@SpecAssertion(section = "4.1", id = "aa")
public void testBindingDeclaredInheritedIsInherited() throws Exception
{
- Set<? extends Annotation> bindings = getCurrentManager().getBeans(BorderCollie.class, new HairyBinding(false)).iterator().next().getBindings();
+ Set<? extends Annotation> bindings = getBeans(BorderCollie.class, new HairyBinding(false)).iterator().next().getBindings();
assert bindings.size() == 2;
assert bindings.contains(new HairyBinding(false));
assert bindings.contains(new AnyBinding());
@@ -113,7 +111,7 @@
@SpecAssertion(section = "4.1", id = "aa")
public void testBindingNotDeclaredInheritedIsNotInherited()
{
- Set<? extends Annotation> bindings = getCurrentManager().getBeans(ShetlandPony.class).iterator().next().getBindings();
+ Set<? extends Annotation> bindings = getBeans(ShetlandPony.class).iterator().next().getBindings();
assert bindings.size() == 2;
assert bindings.contains(new CurrentLiteral());
assert bindings.contains(new AnyBinding());
@@ -123,7 +121,7 @@
@SpecAssertion(section = "4.1", id = "aa")
public void testBindingDeclaredInheritedIsBlockedByIntermediateClass()
{
- Set<? extends Annotation> bindings = getCurrentManager().getBeans(ClippedBorderCollie.class, new HairyBinding(true)).iterator().next().getBindings();
+ Set<? extends Annotation> bindings = getBeans(ClippedBorderCollie.class, new HairyBinding(true)).iterator().next().getBindings();
assert bindings.size() == 2;
Annotation hairyLiteral = new HairyBinding(true);
assert bindings.contains(hairyLiteral);
@@ -134,9 +132,9 @@
@SpecAssertion(section = "4.1", id = "ag")
public void testBindingDeclaredInheritedIsIndirectlyInherited()
{
- Set<? extends Annotation> bindings = getCurrentManager().getBeans(EnglishBorderCollie.class, new HairyBinding(false)).iterator().next().getBindings();
+ Set<? extends Annotation> bindings = getBeans(EnglishBorderCollie.class, new HairyBinding(false)).iterator().next().getBindings();
assert bindings.size() == 2;
assert bindings.contains(new HairyBinding(false));
}
-}
\ No newline at end of file
+}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/enterprise/EnterpriseBindingDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -22,7 +22,7 @@
@SpecAssertion(section = "4.1", id = "ad")
public void testBindingDeclaredInheritedIsInherited() throws Exception
{
- Set<? extends Annotation> bindings = getCurrentManager().getBeans(BorderCollieLocal.class, new HairyBinding(false)).iterator().next().getBindings();
+ Set<? extends Annotation> bindings = getBeans(BorderCollieLocal.class, new HairyBinding(false)).iterator().next().getBindings();
assert annotationSetMatches(bindings, Any.class, Hairy.class);
}
@@ -30,7 +30,7 @@
@SpecAssertion(section = "4.1", id = "aj")
public void testBindingDeclaredInheritedIsIndirectlyInherited()
{
- Set<? extends Annotation> bindings = getCurrentManager().getBeans(EnglishBorderCollieLocal.class, new HairyBinding(false)).iterator().next().getBindings();
+ Set<? extends Annotation> bindings = getBeans(EnglishBorderCollieLocal.class, new HairyBinding(false)).iterator().next().getBindings();
assert annotationSetMatches(bindings, Any.class, Hairy.class);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -30,8 +30,8 @@
@SpecAssertion(section = "2.5.2", id = "a")
public void testDeploymentTypeHasCorrectTarget()
{
- assert getCurrentManager().getBeans(BlackWidow.class).size() == 1;
- Bean<BlackWidow> blackWidowSpiderModel = getCurrentManager().getBeans(BlackWidow.class).iterator().next();
+ assert getBeans(BlackWidow.class).size() == 1;
+ Bean<BlackWidow> blackWidowSpiderModel = getBeans(BlackWidow.class).iterator().next();
Target target = blackWidowSpiderModel.getScopeType().getAnnotation(Target.class);
List<ElementType> elements = Arrays.asList(target.value());
@@ -48,8 +48,8 @@
@SpecAssertion(section = "2.5.2", id = "c")
public void testDeploymentTypeDeclaresDeploymentTypeAnnotation()
{
- assert getCurrentManager().getBeans(BlackWidow.class).size() == 1;
- Bean<BlackWidow> blackWidowSpiderModel = getCurrentManager().getBeans(BlackWidow.class).iterator().next();
+ assert getBeans(BlackWidow.class).size() == 1;
+ Bean<BlackWidow> blackWidowSpiderModel = getBeans(BlackWidow.class).iterator().next();
assert blackWidowSpiderModel.getDeploymentType().getAnnotation(DeploymentType.class) != null;
}
@@ -57,8 +57,8 @@
@SpecAssertion(section = "2.5.3", id = "c")
public void testDeploymentTypeInheritedFromDeclaringBean() throws Exception
{
- assert getCurrentManager().getBeans(BlackWidow.class).size() == 1;
- Bean<BlackWidow> blackWidowSpiderModel = getCurrentManager().getBeans(BlackWidow.class).iterator().next();
+ assert getBeans(BlackWidow.class).size() == 1;
+ Bean<BlackWidow> blackWidowSpiderModel = getBeans(BlackWidow.class).iterator().next();
assert blackWidowSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@@ -66,8 +66,8 @@
@SpecAssertion(section = "2.5.5", id = "a")
public void testDefaultDeploymentType()
{
- assert getCurrentManager().getBeans(Tarantula.class).size() == 1;
- Bean<Tarantula> bean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ assert getBeans(Tarantula.class).size() == 1;
+ Bean<Tarantula> bean = getBeans(Tarantula.class).iterator().next();
assert bean.getDeploymentType().equals(Production.class);
}
@@ -75,8 +75,8 @@
@SpecAssertion(section = "2.5.5", id = "b")
public void testHighestPrecedenceDeploymentTypeFromStereotype()
{
- assert getCurrentManager().getBeans(Rhinoceros.class).size() == 1;
- Bean<?> bean = getCurrentManager().getBeans(Rhinoceros.class).iterator().next();
+ assert getBeans(Rhinoceros.class).size() == 1;
+ Bean<?> bean = getBeans(Rhinoceros.class).iterator().next();
assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -84,7 +84,7 @@
@SpecAssertion(section = "2.5.6", id = "a")
public void testBeanWithDisabledDeploymentTypeNotInstantiated()
{
- getCurrentManager().getInstanceByType(RedSnapper.class);
+ getInstanceByType(RedSnapper.class);
}
@Test(groups = { "deploymentType" })
@@ -94,8 +94,8 @@
})
public void testWebBeanDeploymentTypeOverridesStereotype()
{
- assert getCurrentManager().getBeans(Reindeer.class).size() == 1;
- Bean<Reindeer> bean = getCurrentManager().getBeans(Reindeer.class).iterator().next();
+ assert getBeans(Reindeer.class).size() == 1;
+ Bean<Reindeer> bean = getBeans(Reindeer.class).iterator().next();
assert bean.getDeploymentType().equals(Production.class);
}
@@ -103,8 +103,8 @@
@SpecAssertion(section = "2.5.3", id = "i")
public void testDeploymentTypeMayBeSpecifiedByStereotype()
{
- assert getCurrentManager().getBeans(Goat.class).size() == 1;
- Bean<Goat> bean = getCurrentManager().getBeans(Goat.class).iterator().next();
+ assert getBeans(Goat.class).size() == 1;
+ Bean<Goat> bean = getBeans(Goat.class).iterator().next();
assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -112,48 +112,48 @@
@SpecAssertion(section = "4.1", id = "ca")
public void testDeploymentTypeDeclaredInheritedIsInherited() throws Exception
{
- assert getCurrentManager().getBeans(BorderCollie.class).size() == 1;
- assert getCurrentManager().getBeans(BorderCollie.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(BorderCollie.class).size() == 1;
+ assert getBeans(BorderCollie.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups = { "deploymentType" })
@SpecAssertion(section = "4.1", id = "ca")
public void testDeploymentTypeNotDeclaredInheritedIsNotInherited()
{
- assert getCurrentManager().getBeans(ShetlandPony.class).size() == 1;
- assert getCurrentManager().getBeans(ShetlandPony.class).iterator().next().getDeploymentType().equals(Production.class);
+ assert getBeans(ShetlandPony.class).size() == 1;
+ assert getBeans(ShetlandPony.class).iterator().next().getDeploymentType().equals(Production.class);
}
@Test(groups = { "deploymentType" })
@SpecAssertion(section = "4.1", id = "cc")
public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeNotMarkedInherited()
{
- assert getCurrentManager().getBeans(GoldenRetriever.class).size() == 1;
- assert getCurrentManager().getBeans(GoldenRetriever.class).iterator().next().getDeploymentType().equals(Production.class);
+ assert getBeans(GoldenRetriever.class).size() == 1;
+ assert getBeans(GoldenRetriever.class).iterator().next().getDeploymentType().equals(Production.class);
}
@Test(groups = { "deploymentType" })
@SpecAssertion(section = "4.1", id = "cc")
public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeMarkedInherited()
{
- assert getCurrentManager().getBeans(GoldenLabrador.class).size() == 1;
- assert getCurrentManager().getBeans(GoldenLabrador.class).iterator().next().getDeploymentType().equals(InheritedDeploymentType.class);
+ assert getBeans(GoldenLabrador.class).size() == 1;
+ assert getBeans(GoldenLabrador.class).iterator().next().getDeploymentType().equals(InheritedDeploymentType.class);
}
@Test
@SpecAssertion(section = "4.1", id = "dab")
public void testDeploymentTypeIsOverriddenByInheritedDeploymentType()
{
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
- assert getCurrentManager().getBeans(Cow.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test
@SpecAssertion(section = "4.1", id = "dcb")
public void testDeploymentTypeIsOverriddenByIndirectlyInheritedDeploymentType()
{
- assert getCurrentManager().getBeans(JerseyCow.class).size() == 1;
- assert getCurrentManager().getBeans(JerseyCow.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(JerseyCow.class).size() == 1;
+ assert getBeans(JerseyCow.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -19,31 +19,31 @@
@SpecAssertion(section = "4.1", id = "cb")
public void testDeploymentTypeDeclaredInheritedIsInherited() throws Exception
{
- assert getCurrentManager().getBeans(BorderCollieLocal.class, new WoofBinding()).size() == 1;
- assert getCurrentManager().getBeans(BorderCollieLocal.class, new WoofBinding()).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(BorderCollieLocal.class, new WoofBinding()).size() == 1;
+ assert getBeans(BorderCollieLocal.class, new WoofBinding()).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups = { "deploymentType" })
@SpecAssertion(section = "4.1", id = "cd")
public void testDeploymentTypeDeclaredInheritedIsIndirectlyInherited() throws Exception
{
- assert getCurrentManager().getBeans(EnglishBorderCollieLocal.class).size() == 1;
- assert getCurrentManager().getBeans(EnglishBorderCollieLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(EnglishBorderCollieLocal.class).size() == 1;
+ assert getBeans(EnglishBorderCollieLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test
@SpecAssertion(section = "4.1", id = "dbb")
public void testDeploymentTypeIsOverriddenByInheritedDeploymentType()
{
- assert getCurrentManager().getBeans(CowLocal.class).size() == 1;
- assert getCurrentManager().getBeans(CowLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(CowLocal.class).size() == 1;
+ assert getBeans(CowLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test
@SpecAssertion(section = "4.1", id = "ddb")
public void testDeploymentTypeIsOverriddenByIndirectlyInheritedDeploymentType()
{
- assert getCurrentManager().getBeans(JerseyBullLocal.class).size() == 1;
- assert getCurrentManager().getBeans(JerseyBullLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(JerseyBullLocal.class).size() == 1;
+ assert getBeans(JerseyBullLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/name/NameDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -33,8 +33,8 @@
})
public void testNonDefaultNamed()
{
- assert getCurrentManager().getBeans(Moose.class).size() == 1;
- Bean<Moose> moose =getCurrentManager().getBeans(Moose.class).iterator().next();
+ assert getBeans(Moose.class).size() == 1;
+ Bean<Moose> moose =getBeans(Moose.class).iterator().next();
assert moose.getName().equals("aMoose");
}
@@ -46,8 +46,8 @@
})
public void testDefaultNamed()
{
- assert getCurrentManager().getBeans(Haddock.class).size() == 1;
- Bean<Haddock> haddock = getCurrentManager().getBeans(Haddock.class).iterator().next();
+ assert getBeans(Haddock.class).size() == 1;
+ Bean<Haddock> haddock = getBeans(Haddock.class).iterator().next();
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
@@ -60,8 +60,8 @@
})
public void testSterotypeDefaultsName()
{
- assert getCurrentManager().getBeans(RedSnapper.class).size() == 1;
- Bean<RedSnapper> bean = getCurrentManager().getBeans(RedSnapper.class).iterator().next();
+ assert getBeans(RedSnapper.class).size() == 1;
+ Bean<RedSnapper> bean = getBeans(RedSnapper.class).iterator().next();
assert bean.getName().equals("redSnapper");
}
@@ -72,8 +72,8 @@
})
public void testNotNamedInJava()
{
- assert getCurrentManager().getBeans(SeaBass.class).size() == 1;
- Bean<SeaBass> bean = getCurrentManager().getBeans(SeaBass.class).iterator().next();
+ assert getBeans(SeaBass.class).size() == 1;
+ Bean<SeaBass> bean = getBeans(SeaBass.class).iterator().next();
assert bean.getName() == null;
}
@@ -86,8 +86,8 @@
@Test @SpecAssertion(section="2.6.4", id = "a")
public void testNotNamedInStereotype()
{
- assert getCurrentManager().getBeans(Minnow.class).size() == 1;
- Bean<Minnow> bean = getCurrentManager().getBeans(Minnow.class).iterator().next();
+ assert getBeans(Minnow.class).size() == 1;
+ Bean<Minnow> bean = getBeans(Minnow.class).iterator().next();
assert bean.getName() == null;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/ScopeDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -29,8 +29,8 @@
@Test @SpecAssertion(section="2.4", id = "c")
public void testScopeTypesAreExtensible()
{
- assert getCurrentManager().getBeans(Mullet.class).size() == 1;
- Bean<Mullet> bean = getCurrentManager().getBeans(Mullet.class).iterator().next();
+ assert getBeans(Mullet.class).size() == 1;
+ Bean<Mullet> bean = getBeans(Mullet.class).iterator().next();
assert bean.getScopeType().equals(AnotherScopeType.class);
}
@@ -38,8 +38,8 @@
@SpecAssertion(section="2.4.2", id = "aa")
public void testScopeTypeHasCorrectTarget()
{
- assert getCurrentManager().getBeans(Mullet.class).size() == 1;
- Bean<Mullet> bean = getCurrentManager().getBeans(Mullet.class).iterator().next();
+ assert getBeans(Mullet.class).size() == 1;
+ Bean<Mullet> bean = getBeans(Mullet.class).iterator().next();
Target target = bean.getScopeType().getAnnotation(Target.class);
List<ElementType> elements = Arrays.asList(target.value());
assert elements.contains(ElementType.TYPE);
@@ -51,24 +51,24 @@
@SpecAssertion(section="2.4.2", id = "b")
public void testScopeTypeDeclaresScopeTypeAnnotation()
{
- assert getCurrentManager().getBeans(Mullet.class).size() == 1;
- Bean<Mullet> bean = getCurrentManager().getBeans(Mullet.class).iterator().next();
+ assert getBeans(Mullet.class).size() == 1;
+ Bean<Mullet> bean = getBeans(Mullet.class).iterator().next();
assert bean.getScopeType().getAnnotation(ScopeType.class) != null;
}
@Test @SpecAssertion(section="2.4.3", id = "a")
public void testScopeDeclaredInJava()
{
- assert getCurrentManager().getBeans(SeaBass.class).size() == 1;
- Bean<SeaBass> bean = getCurrentManager().getBeans(SeaBass.class).iterator().next();
+ assert getBeans(SeaBass.class).size() == 1;
+ Bean<SeaBass> bean = getBeans(SeaBass.class).iterator().next();
assert bean.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.4.5", id = "a")
public void testDefaultScope()
{
- assert getCurrentManager().getBeans(Order.class).size() == 1;
- Bean<Order> bean = getCurrentManager().getBeans(Order.class).iterator().next();
+ assert getBeans(Order.class).size() == 1;
+ Bean<Order> bean = getBeans(Order.class).iterator().next();
assert bean.getScopeType().equals(Dependent.class);
}
@@ -79,24 +79,24 @@
})
public void testScopeSpecifiedAndStereotyped()
{
- assert getCurrentManager().getBeans(Minnow.class).size() == 1;
- Bean<Minnow> bean = getCurrentManager().getBeans(Minnow.class).iterator().next();
+ assert getBeans(Minnow.class).size() == 1;
+ Bean<Minnow> bean = (Bean<Minnow>) getBeans(Minnow.class).iterator().next();
assert bean.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.4.5", id = "d")
public void testMutipleIncompatibleScopeStereotypesWithScopeSpecified()
{
- assert getCurrentManager().getBeans(Pollock.class).size() == 1;
- Bean<Pollock> bean = getCurrentManager().getBeans(Pollock.class).iterator().next();
+ assert getBeans(Pollock.class).size() == 1;
+ Bean<Pollock> bean = getBeans(Pollock.class).iterator().next();
assert bean.getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section="2.4.5", id = "c")
public void testMutipleCompatibleScopeStereotypes()
{
- assert getCurrentManager().getBeans(Grayling.class).size() == 1;
- Bean<Grayling> bean = getCurrentManager().getBeans(Grayling.class).iterator().next();
+ assert getBeans(Grayling.class).size() == 1;
+ Bean<Grayling> bean = getBeans(Grayling.class).iterator().next();
assert bean.getScopeType().equals(ApplicationScoped.class);
}
@@ -107,42 +107,42 @@
})
public void testWebBeanScopeTypeOverridesStereotype()
{
- assert getCurrentManager().getBeans(RedSnapper.class).size() == 1;
- Bean<RedSnapper> bean = getCurrentManager().getBeans(RedSnapper.class).iterator().next();
+ assert getBeans(RedSnapper.class).size() == 1;
+ Bean<RedSnapper> bean = getBeans(RedSnapper.class).iterator().next();
assert bean.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="4.1", id = "ba")
public void testScopeTypeDeclaredInheritedIsInherited() throws Exception
{
- assert getCurrentManager().getBeans(BorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(BorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="4.1", id = "ba")
public void testScopeTypeNotDeclaredInheritedIsNotInherited()
{
- assert getCurrentManager().getBeans(ShetlandPony.class).size() == 1;
- assert getCurrentManager().getBeans(ShetlandPony.class).iterator().next().getScopeType().equals(Dependent.class);
+ assert getBeans(ShetlandPony.class).size() == 1;
+ assert getBeans(ShetlandPony.class).iterator().next().getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section="4.1", id = "ba")
public void testScopeTypeDeclaredInheritedIsBlockedByIntermediateScopeTypeMarkedInherited()
{
- assert getCurrentManager().getBeans(GoldenRetriever.class).size() == 1;
+ assert getBeans(GoldenRetriever.class).size() == 1;
}
@Test @SpecAssertion(section="4.1", id = "ba")
public void testScopeTypeDeclaredInheritedIsBlockedByIntermediateScopeTypeNotMarkedInherited()
{
- assert getCurrentManager().getBeans(GoldenLabrador.class).size() == 1;
- assert getCurrentManager().getBeans(GoldenLabrador.class).iterator().next().getScopeType().equals(Dependent.class);
+ assert getBeans(GoldenLabrador.class).size() == 1;
+ assert getBeans(GoldenLabrador.class).iterator().next().getScopeType().equals(Dependent.class);
}
@Test
@SpecAssertion(section = "4.1", id = "bc")
public void testScopeTypeDeclaredInheritedIsIndirectlyInherited()
{
- assert getCurrentManager().getBeans(EnglishBorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(EnglishBorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
}
\ No newline at end of file
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/scope/enterprise/EnterpriseScopeDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -16,13 +16,13 @@
@Test @SpecAssertion(section="4.1", id = "bb")
public void testScopeTypeDeclaredInheritedIsInherited() throws Exception
{
- assert getCurrentManager().getBeans(BorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(BorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "bd")
public void testScopeTypeDeclaredInheritedIsIndirectlyInherited()
{
- assert getCurrentManager().getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -32,7 +32,7 @@
@SpecAssertion(section = "2.7.1", id = "b")
public void testHasStereotypeAnnotation()
{
- Bean<Goat> bean = getCurrentManager().getBeans(Goat.class).iterator().next();
+ Bean<Goat> bean = getBeans(Goat.class).iterator().next();
assert !bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -43,8 +43,8 @@
})
public void testStereotypeWithScopeType()
{
- assert getCurrentManager().getBeans(Moose.class).size() == 1;
- assert getCurrentManager().getBeans(Moose.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(Moose.class).size() == 1;
+ assert getBeans(Moose.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@@ -54,15 +54,15 @@
})
public void testStereotypeWithoutScopeType()
{
- assert getCurrentManager().getBeans(Reindeer.class).size() == 1;
- assert getCurrentManager().getBeans(Reindeer.class).iterator().next().getScopeType().equals(Dependent.class);
+ assert getBeans(Reindeer.class).size() == 1;
+ assert getBeans(Reindeer.class).iterator().next().getScopeType().equals(Dependent.class);
}
@Test
@SpecAssertion(section = "2.7", id = "c")
public void testOneStereotype()
{
- Bean<LongHairedDog> bean = getCurrentManager().getBeans(LongHairedDog.class).iterator().next();
+ Bean<LongHairedDog> bean = getBeans(LongHairedDog.class).iterator().next();
assert bean.getScopeType().equals(RequestScoped.class);
}
@@ -74,8 +74,8 @@
})
public void testMultipleStereotypes()
{
- assert getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).size() == 1;
- Bean<HighlandCow> highlandCow = getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).iterator().next();
+ assert getBeans(HighlandCow.class, TAME_LITERAL).size() == 1;
+ Bean<HighlandCow> highlandCow = getBeans(HighlandCow.class, TAME_LITERAL).iterator().next();
assert highlandCow.getName() == null;
assert highlandCow.getBindings().contains(TAME_LITERAL);
assert highlandCow.getScopeType().equals(RequestScoped.class);
@@ -87,8 +87,8 @@
@SpecAssertion(section = "2.7.4", id = "c") })
public void testMultipleStereotypesMergesScopes()
{
- assert getCurrentManager().getBeans(Springbok.class).size() == 1;
- assert getCurrentManager().getBeans(Springbok.class).iterator().next().getScopeType().equals(ApplicationScoped.class);
+ assert getBeans(Springbok.class).size() == 1;
+ assert getBeans(Springbok.class).iterator().next().getScopeType().equals(ApplicationScoped.class);
}
@Test
@@ -96,8 +96,8 @@
@SpecAssertion(section = "2.7.4", id = "a") })
public void testRequiredTypeIsImplemented()
{
- assert getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(HighlandCow.class, TAME_LITERAL).iterator().next().getTypes().contains(Animal.class);
+ assert getBeans(HighlandCow.class, TAME_LITERAL).size() == 1;
+ assert getBeans(HighlandCow.class, TAME_LITERAL).iterator().next().getTypes().contains(Animal.class);
}
@Test
@@ -105,44 +105,44 @@
@SpecAssertion(section = "2.7.4", id = "b") })
public void testScopeIsSupported()
{
- assert getCurrentManager().getBeans(Goldfish.class).size() == 1;
- assert getCurrentManager().getBeans(Goldfish.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(Goldfish.class).size() == 1;
+ assert getBeans(Goldfish.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "ab")
public void testStereotypeDeclaredInheritedIsInherited() throws Exception
{
- assert getCurrentManager().getBeans(BorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(BorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "ab")
public void testStereotypeNotDeclaredInheritedIsNotInherited()
{
- assert getCurrentManager().getBeans(ShetlandPony.class).size() == 1;
- assert getCurrentManager().getBeans(ShetlandPony.class).iterator().next().getDeploymentType().equals(Production.class);
+ assert getBeans(ShetlandPony.class).size() == 1;
+ assert getBeans(ShetlandPony.class).iterator().next().getDeploymentType().equals(Production.class);
}
@Test
@SpecAssertion(section = "4.1", id = "ah")
public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
{
- assert getCurrentManager().getBeans(EnglishBorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(EnglishBorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "daa")
public void testStereotypeScopeIsOverriddenByInheritedScope()
{
- assert getCurrentManager().getBeans(Chihuahua.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ assert getBeans(Chihuahua.class).iterator().next().getScopeType().equals(SessionScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "dca")
public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
{
- assert getCurrentManager().getBeans(MexicanChihuahua.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ assert getBeans(MexicanChihuahua.class).iterator().next().getScopeType().equals(SessionScoped.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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -24,27 +24,27 @@
@SpecAssertion(section = "4.1", id = "ae")
public void testStereotypeDeclaredInheritedIsInherited() throws Exception
{
- assert getCurrentManager().getBeans(BorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(BorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "ak")
public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
{
- assert getCurrentManager().getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "dba")
public void testStereotypeScopeIsOverriddenByInheritedScope()
{
- assert getCurrentManager().getBeans(ChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ assert getBeans(ChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
}
@Test
@SpecAssertion(section = "4.1", id = "dda")
public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
{
- assert getCurrentManager().getBeans(MexicanChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ assert getBeans(MexicanChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -17,6 +17,9 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -42,7 +45,7 @@
{
assert ManagerObserver.isManagerDeployed();
getCurrentManager().fireEvent("event");
- assert !getCurrentManager().resolveObservers(getCurrentManager(), new InitializedBinding()).isEmpty();
+ assert !getCurrentManager().resolveObservers(new InitializedBinding()).isEmpty();
}
@Test
@@ -61,9 +64,9 @@
})
public void testOnlyEnabledBeansDeployed()
{
- assert !getCurrentManager().getBeans(User.class).isEmpty();
- assert getCurrentManager().getBeans(DisabledBean.class).isEmpty();
- assert getCurrentManager().getBeans(Interceptor1.class).isEmpty();
- assert getCurrentManager().getBeans(DataAccessAuthorizationDecorator.class).isEmpty();
+ assert !getBeans(User.class).isEmpty();
+ assert getBeans(DisabledBean.class).isEmpty();
+ assert getBeans(Interceptor1.class).isEmpty();
+ assert getBeans(DataAccessAuthorizationDecorator.class).isEmpty();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InitializedBinding.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,9 +1,14 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-class InitializedBinding extends AnnotationLiteral<BeforeBeanDiscovery> implements BeforeBeanDiscovery
+class InitializedBinding implements AfterBeanDiscovery
{
+ public void addDefinitionError(Throwable t)
+ {
+ throw new RuntimeException(t);
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/ManagerObserver.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -2,7 +2,9 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Current;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
@@ -14,14 +16,14 @@
private static boolean requestContextActive = false;
private static boolean applicationContextActive = false;
- public void managerInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void managerInitialized(@Observes AfterBeanDiscovery event, @Current BeanManager beanManager)
{
managerInitialized = true;
requestContextActive = beanManager.getContext(RequestScoped.class).isActive();
applicationContextActive = beanManager.getContext(ApplicationScoped.class).isActive();
}
- public void managerDeployed(@Observes @AfterBeanDiscovery BeanManager beanManager)
+ public void managerDeployed(@Observes AfterDeploymentValidation event, @Current BeanManager beanManager)
{
assert managerInitialized : "Manager should have been initialized before deployed";
managerDeployed = true;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,12 +1,11 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle.fail;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
class ManagerObserver
{
- public void managerInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void managerInitialized(@Observes BeforeBeanDiscovery event)
{
assert false : "Deployment should already have failed";
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail2/ManagerObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail2/ManagerObserver.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail2/ManagerObserver.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,7 +1,6 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle.fail2;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
@@ -9,12 +8,12 @@
{
private static boolean managerInitialized;
- public void managerInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void managerInitialized(@Observes BeforeBeanDiscovery event)
{
managerInitialized = true;
}
- public void managerDeployed(@Observes @AfterBeanDiscovery BeanManager beanManager)
+ public void managerDeployed(@Observes AfterDeploymentValidation event)
{
assert false : "Manager should not be deployed due to deployment errors";
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail3/ManagerObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail3/ManagerObserver.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail3/ManagerObserver.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,12 +1,11 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle.fail3;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
class ManagerObserver
{
- public void managerInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void managerInitialized(@Observes BeforeBeanDiscovery event)
{
assert false : "This error should be turned into a DefinitionException";
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail4/ManagerObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail4/ManagerObserver.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail4/ManagerObserver.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,12 +1,12 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle.fail4;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
import javax.event.Observes;
class ManagerObserver
{
- public void managerDeployed(@Observes @AfterBeanDiscovery BeanManager beanManager)
+ public void managerDeployed(@Observes AfterDeploymentValidation event)
{
assert false : "This error should result in a DeploymentException";
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,3 +1,4 @@
+
package org.jboss.jsr299.tck.tests.event;
import java.lang.annotation.Annotation;
@@ -17,6 +18,7 @@
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.impl.OldSPIBridge;
import org.jboss.jsr299.tck.literals.AnyBinding;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
@@ -211,7 +213,7 @@
}
};
- getCurrentManager().addObserver(observer, new TypeLiteral<ArrayList<E>>() {});
+ getCurrentManager().addObserver(observer);
}
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@@ -225,7 +227,7 @@
}
};
- getCurrentManager().addObserver(observer, new TypeLiteral<ArrayList<?>>() {});
+ getCurrentManager().addObserver(observer);
}
@Test(groups = { "events", "underInvestigation" }, expectedExceptions = { IllegalArgumentException.class })
@@ -352,7 +354,7 @@
@Override
protected void execute() throws Exception
{
- RecluseSpider bean = getCurrentManager().getInstanceByType(RecluseSpider.class);
+ RecluseSpider bean = OldSPIBridge.getInstanceByType(getCurrentManager(),RecluseSpider.class);
assert bean != null;
// Must invoke a method to really create the instance
assert !bean.isNotified();
@@ -495,7 +497,7 @@
@Override
protected void execute() throws Exception
{
- SweeWaxbill bean = getCurrentManager().getInstanceByType(SweeWaxbill.class);
+ SweeWaxbill bean = OldSPIBridge.getInstanceByType(getCurrentManager(), SweeWaxbill.class);
bean.methodThatFiresEvent();
}
@@ -512,7 +514,7 @@
@Override
protected void execute() throws Exception
{
- SweeWaxbill bean = getCurrentManager().getInstanceByType(SweeWaxbill.class);
+ SweeWaxbill bean = OldSPIBridge.getInstanceByType(getCurrentManager(), SweeWaxbill.class);
bean.methodThatRegistersObserver();
}
@@ -529,7 +531,7 @@
@Override
protected void execute() throws Exception
{
- OwlFinch_Broken bean = getCurrentManager().getInstanceByType(OwlFinch_Broken.class);
+ OwlFinch_Broken bean = OldSPIBridge.getInstanceByType(getCurrentManager(), OwlFinch_Broken.class);
bean.methodThatFiresEvent();
}
@@ -546,7 +548,7 @@
@Override
protected void execute() throws Exception
{
- OwlFinch_Broken bean = getCurrentManager().getInstanceByType(OwlFinch_Broken.class);
+ OwlFinch_Broken bean = OldSPIBridge.getInstanceByType(getCurrentManager(), OwlFinch_Broken.class);
bean.methodThatRegistersObserver();
}
@@ -565,7 +567,7 @@
{
// Retrieve the implicit event bean from the manager only by
// its API type
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
+ Set<?> eventBeans = getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert !eventBeans.isEmpty();
}
@@ -584,7 +586,7 @@
{
// Retrieve the implicit event bean from the manager
// by its binding types (uses OrangeCheekedWaxbill)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding(), new TameAnnotationLiteral(), new RoleBinding("Admin"));
+ Set<?> eventBeans = getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding(), new TameAnnotationLiteral(), new RoleBinding("Admin"));
assert !eventBeans.isEmpty();
}
@@ -603,7 +605,7 @@
{
// Retrieve the implicit event bean from the manager
// only by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
+ Set<?> eventBeans = getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
assert eventBean.getDeploymentType().equals(Standard.class);
@@ -623,7 +625,7 @@
{
// Retrieve the implicit event bean from the manager only
// by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
+ Set<?> eventBeans = getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
assert eventBean.getScopeType().equals(Dependent.class);
@@ -642,7 +644,7 @@
{
// Retrieve the implicit event bean from the manager only
// by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
+ Set<?> eventBeans = getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
Bean<?> eventBean = (Bean<?>) eventBeans.iterator().next();
assert eventBean.getName() == null;
@@ -661,7 +663,7 @@
{
// Retrieve the implicit event bean from the manager only
// by its API type (uses BlueFacedParrotFinch)
- Set<?> eventBeans = getCurrentManager().getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
+ Set<?> eventBeans = getBeans(new TypeLiteral<Event<AnEventType>>() {}, new AnyBinding());
assert eventBeans.size() == 1;
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/YorkshireTerrier_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/YorkshireTerrier_Broken.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer2/YorkshireTerrier_Broken.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,13 +1,12 @@
package org.jboss.jsr299.tck.tests.event.broken.observer2;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
class YorkshireTerrier_Broken
{
- public void observeInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager, @Observes Boxer anotherDog)
+ public void observeInitialized(@Observes BeforeBeanDiscovery beforeBeanDiscovery, @Observes Boxer anotherDog)
{
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/BorderTerrier.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/BorderTerrier.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer4/BorderTerrier.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,14 +1,13 @@
package org.jboss.jsr299.tck.tests.event.broken.observer4;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
class BorderTerrier
{
@Produces
- public String observeInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public String observeInitialized(@Observes BeforeBeanDiscovery event)
{
return "product";
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/AustralianTerrier.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/AustralianTerrier.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer5/AustralianTerrier.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,7 +1,6 @@
package org.jboss.jsr299.tck.tests.event.broken.observer5;
import javax.enterprise.inject.Initializer;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
@@ -11,7 +10,7 @@
* @see org.jboss.jsr299.tck.unit.event.broken.observer5.Terrier#observeInitialized(javax.inject.manager.Manager)
*/
@Initializer
- public void observeInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager)
+ public void observeInitialized(@Observes BeforeBeanDiscovery discovery)
{
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/FoxTerrier.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/FoxTerrier.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/observer6/FoxTerrier.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,7 +1,6 @@
package org.jboss.jsr299.tck.tests.event.broken.observer6;
import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.event.Observes;
@@ -10,7 +9,7 @@
/* (non-Javadoc)
* @see org.jboss.jsr299.tck.unit.event.broken.observer6.Terrier#observeInitialized(javax.inject.manager.Manager, java.lang.String)
*/
- public void observeInitialized(@Observes @BeforeBeanDiscovery BeanManager beanManager, @Disposes String badParam)
+ public void observeInitialized(@Observes BeforeBeanDiscovery event, @Disposes String badParam)
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/AllEventTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/AllEventTypesTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/firesall/AllEventTypesTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -25,7 +25,7 @@
@Override
protected void execute() throws Exception
{
- AllEventTypesObserver theObserver = getCurrentManager().getInstanceByType(AllEventTypesObserver.class);
+ AllEventTypesObserver theObserver = getInstanceByType(AllEventTypesObserver.class);
getCurrentManager().fireEvent(new ComplexEvent());
assert theObserver.getTotalEventsObserved() == 4;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/ImplicitEventBeanTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -55,7 +55,7 @@
@Override
protected void execute() throws Exception
{
- BlueFacedParrotFinch bean = getCurrentManager().getInstanceByType(BlueFacedParrotFinch.class);
+ BlueFacedParrotFinch bean = getInstanceByType(BlueFacedParrotFinch.class);
bean.methodThatRegistersObserver();
Set<Observer<Integer>> observers = getCurrentManager().resolveObservers(new Integer(78));
@@ -70,7 +70,7 @@
protected void execute() throws Exception
{
BlueFacedParrotFinch.simpleStringEventObserved = false;
- BlueFacedParrotFinch bean = getCurrentManager().getInstanceByType(BlueFacedParrotFinch.class);
+ BlueFacedParrotFinch bean = getInstanceByType(BlueFacedParrotFinch.class);
bean.methodThatRegistersAnotherObserver();
bean.methodThatFiresAnotherEvent();
assert BlueFacedParrotFinch.simpleStringEventObserved;
@@ -83,9 +83,9 @@
@Override
protected void execute() throws Exception
{
- StarFinch starFinch = getCurrentManager().getInstanceByType(StarFinch.class);
- FinchKeeper birdKeeper = getCurrentManager().getInstanceByType(FinchKeeper.class);
- BirdCage birdCage = getCurrentManager().getInstanceByType(BirdCage.class);
+ StarFinch starFinch = getInstanceByType(StarFinch.class);
+ FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
+ BirdCage birdCage = getInstanceByType(BirdCage.class);
assert starFinch != null;
assert birdCage != null;
assert birdCage.getSomeMess() != null;
@@ -99,8 +99,8 @@
@Override
protected void execute() throws Exception
{
- OrangeCheekedWaxbill bird = getCurrentManager().getInstanceByType(OrangeCheekedWaxbill.class);
- FinchKeeper birdKeeper = getCurrentManager().getInstanceByType(FinchKeeper.class);
+ OrangeCheekedWaxbill bird = getInstanceByType(OrangeCheekedWaxbill.class);
+ FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
assert bird != null;
assert bird.getSomeMess() != null;
assert birdKeeper.isNewMessDetected();
@@ -113,8 +113,8 @@
@Override
protected void execute() throws Exception
{
- AuroraFinch bird = getCurrentManager().getInstanceByType(AuroraFinch.class);
- FinchKeeper birdKeeper = getCurrentManager().getInstanceByType(FinchKeeper.class);
+ AuroraFinch bird = getInstanceByType(AuroraFinch.class);
+ FinchKeeper birdKeeper = getInstanceByType(FinchKeeper.class);
assert bird != null;
assert birdKeeper.isNewMessDetected();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -38,8 +38,8 @@
Annotation roleBinding = new RoleBinding("Admin");
AnObserver observer1 = new AnObserver();
AnObserver observer2 = new AnObserver();
- getCurrentManager().addObserver(observer1, AnEventType.class);
- getCurrentManager().addObserver(observer2, AnEventType.class, roleBinding);
+ getCurrentManager().addObserver(observer1);
+ getCurrentManager().addObserver(observer2, roleBinding);
// Fire an event that will be delivered to the two above observers
AnEventType anEvent = new AnEventType();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -30,6 +30,6 @@
public void testMultipleInstancesOfSameBindingTypeWhenAddingObserverFails()
{
Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class, new RoleBinding("Admin"), new TameAnnotationLiteral(), new TameAnnotationLiteral());
+ getCurrentManager().addObserver(observer, new RoleBinding("Admin"), new TameAnnotationLiteral(), new TameAnnotationLiteral());
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,12 +1,9 @@
package org.jboss.jsr299.tck.tests.event.register.observer1;
import javax.event.Observer;
-import javax.inject.DuplicateBindingTypeException;
-import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
@Artifact
public class DuplicateBindingsToRemoveObserverTest extends AbstractJSR299Test
@@ -24,12 +21,15 @@
wasNotified = true;
}
}
-
+/*
+ * no longer valid under new spi
+ *
@Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
@SpecAssertion(section = "7.3", id = "k")
public void testMultipleInstancesOfSameBindingTypeWhenRemovingObserverFails()
{
Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().removeObserver(observer, AnEventType.class, new RoleBinding("Admin"), new TameAnnotationLiteral(), new TameAnnotationLiteral());
+ getCurrentManager().removeObserver(observer);
}
+ */
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -20,7 +20,6 @@
import java.lang.annotation.Annotation;
import java.util.Set;
-import javax.enterprise.inject.TypeLiteral;
import javax.event.Observer;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -59,16 +58,14 @@
Observer<AnEventType> observer1 = new AnObserver();
// First test with the Class<T> of the event type
- getCurrentManager().addObserver(observer1, AnEventType.class);
+ getCurrentManager().addObserver(observer1);
Set<Observer<AnEventType>> resolvedObservers = getCurrentManager().resolveObservers(new AnEventType());
assert resolvedObservers.size() == 1;
assert resolvedObservers.iterator().next() == observer1;
// Now test with the TypeLiteral<T> of the event type
Observer<AnEventType> observer2 = new AnObserver();
- getCurrentManager().addObserver(observer2, new TypeLiteral<AnEventType>()
- {
- });
+ getCurrentManager().addObserver(observer2);
resolvedObservers = getCurrentManager().resolveObservers(new AnEventType());
assert resolvedObservers.size() == 2;
boolean foundObserver = false;
@@ -85,7 +82,7 @@
// Try adding an observer with some binding types
Observer<AnEventType> observer3 = new AnObserver();
Annotation[] bindingTypes = new Annotation[] { new RoleBinding("Admin"), new RoleBinding("Manager") };
- getCurrentManager().addObserver(observer3, AnEventType.class, bindingTypes);
+ getCurrentManager().addObserver(observer3, bindingTypes);
resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), bindingTypes);
assert resolvedObservers.size() == 3;
foundObserver = false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -29,7 +29,7 @@
public void testNonBindingTypePassedToAddObserverFails()
{
Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class, new AnimalStereotypeAnnotationLiteral());
+ getCurrentManager().addObserver(observer, new AnimalStereotypeAnnotationLiteral());
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -2,10 +2,8 @@
import javax.event.Observer;
-import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
@Artifact
public class NonBindingTypesToRemoveObserverTest extends AbstractJSR299Test
@@ -23,13 +21,14 @@
wasNotified = true;
}
}
-
+/*
+ * No longer valid under new SPI
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertion(section = "7.3", id = "m")
public void testNonBindingTypePassedToRemoveObserverFails()
{
Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().removeObserver(observer, AnEventType.class, new AnimalStereotypeAnnotationLiteral());
+ getCurrentManager().removeObserver(observer);
}
-
+*/
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -42,8 +42,8 @@
{
AnObserverWithException observer = new AnObserverWithException();
AnObserverWithException anotherObserver = new AnObserverWithException();
- getCurrentManager().addObserver(anotherObserver, AnEventType.class);
- getCurrentManager().addObserver(observer, AnEventType.class);
+ getCurrentManager().addObserver(anotherObserver);
+ getCurrentManager().addObserver(observer);
// Fire an event that will be delivered to the two above observers
AnEventType anEvent = new AnEventType();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -1,12 +1,9 @@
package org.jboss.jsr299.tck.tests.event.register.observer2;
import javax.event.Observer;
-import javax.inject.DuplicateBindingTypeException;
-import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
@Artifact
public class DuplicateBindingsToRemoveObserverTest extends AbstractJSR299Test
@@ -24,13 +21,16 @@
wasNotified = true;
}
}
-
+/*
+ * No longer valid in new spi
+ *
@Test(groups = { "events" }, expectedExceptions = { DuplicateBindingTypeException.class })
@SpecAssertion(section = "7.3", id = "g")
public void testMultipleInstancesOfSameBindingTypeWhenRemovingObserverFails()
{
Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class);
- getCurrentManager().removeObserver(observer, AnEventType.class, new RoleBinding("Admin"), new TameAnnotationLiteral(), new TameAnnotationLiteral());
+ getCurrentManager().addObserver(observer);
+ getCurrentManager().removeObserver(observer);
}
+ */
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -20,7 +20,6 @@
import java.lang.annotation.Annotation;
import java.util.Set;
-import javax.enterprise.inject.TypeLiteral;
import javax.event.Observer;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -58,30 +57,16 @@
Observer<AnEventType> observer = new AnObserver();
// First test with the Class<T> of the event type
- getCurrentManager().addObserver(observer, AnEventType.class);
- getCurrentManager().removeObserver(observer, AnEventType.class);
+ getCurrentManager().addObserver(observer);
+ getCurrentManager().removeObserver(observer);
Set<Observer<AnEventType>> resolvedObservers = getCurrentManager().resolveObservers(new AnEventType());
assert resolvedObservers.isEmpty();
- // Now test with the TypeLiteral<T> of the event type
- observer = new AnObserver();
- getCurrentManager().addObserver(observer, new TypeLiteral<AnEventType>()
- {
- });
- getCurrentManager().removeObserver(observer, new TypeLiteral<AnEventType>()
- {
- });
- resolvedObservers = getCurrentManager().resolveObservers(new AnEventType());
- assert resolvedObservers.isEmpty();
-
// Also test with binding types
Annotation[] bindings = new Annotation[] { new RoleBinding("Admin") };
- getCurrentManager().addObserver(observer, AnEventType.class, bindings);
- getCurrentManager().removeObserver(observer, AnEventType.class);
+ getCurrentManager().addObserver(observer, bindings);
+ getCurrentManager().removeObserver(observer);
resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), bindings);
- assert !resolvedObservers.isEmpty();
- getCurrentManager().removeObserver(observer, AnEventType.class, new RoleBinding("Admin"));
- resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), bindings);
assert resolvedObservers.isEmpty();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -24,12 +24,14 @@
}
}
+ /* No longer valid under new SPI
@Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
@SpecAssertion(section = "7.3", id = "h")
public void testNonBindingTypePassedToRemoveObserverFails()
{
Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class);
- getCurrentManager().removeObserver(observer, AnEventType.class, new AnimalStereotypeAnnotationLiteral());
+ getCurrentManager().addObserver(observer);
+ getCurrentManager().removeObserver(observer);
}
+ */
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -30,7 +30,7 @@
public void testDuplicateBindingTypesWhenResolvingFails()
{
AnObserver observer = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class, new BindingTypeABinding());
+ getCurrentManager().addObserver(observer, new BindingTypeABinding());
getCurrentManager().resolveObservers(new AnEventType(), new BindingTypeABinding(), new BindingTypeABinding());
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -32,8 +32,8 @@
{
AnObserver observer = new AnObserver();
AnObserver anotherObserver = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class, new BindingTypeCBinding("first-observer"));
- getCurrentManager().addObserver(anotherObserver, AnEventType.class, new BindingTypeCBinding("second-observer"));
+ getCurrentManager().addObserver(observer, new BindingTypeCBinding("first-observer"));
+ getCurrentManager().addObserver(anotherObserver, new BindingTypeCBinding("second-observer"));
Set<Observer<AnEventType>> resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), new BindingTypeCBinding("first-observer"));
assert resolvedObservers.size() == 1;
resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), new BindingTypeCBinding("second-observer"));
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -32,8 +32,8 @@
{
AnObserver observer = new AnObserver();
AnObserver anotherObserver = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class, new BindingTypeABinding());
- getCurrentManager().addObserver(anotherObserver, AnEventType.class, new BindingTypeBBinding());
+ getCurrentManager().addObserver(observer, new BindingTypeABinding());
+ getCurrentManager().addObserver(anotherObserver, new BindingTypeBBinding());
Set<Observer<AnEventType>> resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), new BindingTypeABinding());
assert resolvedObservers.size() == 1;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -2,7 +2,6 @@
import java.util.Set;
-import javax.enterprise.inject.TypeLiteral;
import javax.event.Observer;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -32,9 +31,7 @@
public void testNonBindingTypeAnnotationWhenResolvingFails()
{
AnObserver observer = new AnObserver();
- getCurrentManager().addObserver(observer, new TypeLiteral<AnEventType>()
- {
- });
+ getCurrentManager().addObserver(observer);
Set<Observer<AnEventType>> resolvedObservers = getCurrentManager().resolveObservers(new AnEventType(), new AnimalStereotypeAnnotationLiteral());
assert !resolvedObservers.isEmpty();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -31,7 +31,7 @@
public void testResolvingChecksEventType()
{
Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().addObserver(observer, AnEventType.class);
+ getCurrentManager().addObserver(observer);
Set<Observer<AnEventType>> resolvedObservers = getCurrentManager().resolveObservers(new AnEventType());
assert !resolvedObservers.isEmpty();
Set<?> emptyObserverSet = getCurrentManager().resolveObservers(new UnusedEventType("name"));
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -2,7 +2,6 @@
import java.util.ArrayList;
-import javax.enterprise.inject.TypeLiteral;
import javax.event.Observer;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -52,8 +51,8 @@
{
AListObserver observer = new AListObserver();
AnotherListObserver anotherObserver = new AnotherListObserver();
- getCurrentManager().addObserver(observer, new TypeLiteral<ArrayList<String>>(){});
- getCurrentManager().addObserver(anotherObserver, new TypeLiteral<ArrayList<Integer>>(){});
+ getCurrentManager().addObserver(observer);
+ getCurrentManager().addObserver(anotherObserver);
assert getCurrentManager().resolveObservers(new AList()).size() == 1;
assert getCurrentManager().resolveObservers(new AList()).iterator().next().getClass().equals(AListObserver.class);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/transactionalObservers/EventTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -55,7 +55,7 @@
public void beforeMethod()
{
super.beforeMethod();
- dog = (PomeranianInterface) getCurrentManager().getInstanceByName("Teddy");
+ dog = (PomeranianInterface) getInstanceByName("Teddy");
}
// @AfterMethod(alwaysRun = true)
@@ -77,7 +77,7 @@
{
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
assert dogAgent != null;
dogAgent.sendOutsideTransaction(BigInteger.TEN);
assert dog.isCorrectTransactionState();
@@ -92,7 +92,7 @@
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
assert !getCurrentManager().resolveObservers("event").isEmpty();
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction("event");
Thread.sleep(100);
assert dog.isCorrectTransactionState();
@@ -106,7 +106,7 @@
{
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction(new Integer(4));
Thread.sleep(100);
assert dog.isCorrectTransactionState();
@@ -120,7 +120,7 @@
{
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction(new Float(4.0));
Thread.sleep(100);
assert dog.isCorrectTransactionState();
@@ -135,7 +135,7 @@
{
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction(new RuntimeException("test event"));
assert dog.isCorrectTransactionState();
// TODO Fix the security contexts
@@ -155,7 +155,7 @@
{
dog.setCorrectContext(false);
dog.setCorrectTransactionState(false);
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction('a');
Thread.sleep(200);
assert dog.isCorrectTransactionState();
@@ -216,7 +216,7 @@
@SpecAssertion(section = "7.4", id = "d")
public void testObserverCanSetRollbackOnlyOnTransaction()
{
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction(new DisobedientDog());
}
@@ -224,7 +224,7 @@
@SpecAssertion(section = "7.4", id = "e")
public void testObserverCannotInitiateJtaTransaction()
{
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction(new ShowDog());
}
@@ -232,7 +232,7 @@
@SpecAssertion(section = "7.4", id = "f")
public void testObserverCannotCommitJtaTransaction()
{
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction(new LargeDog());
}
@@ -240,7 +240,7 @@
@SpecAssertion(section = "7.4", id = "g")
public void testObserverCannotRollbackJtaTransaction()
{
- Agent dogAgent = getCurrentManager().getInstanceByType(Agent.class);
+ Agent dogAgent = getInstanceByType(Agent.class);
dogAgent.sendInTransaction(new SmallDog());
}
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -36,8 +36,8 @@
@Override
protected void execute() throws Exception
{
- Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = getCurrentManager().getInstance(tarantula);
+ Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ Tarantula instance = createBeanInstance(tarantula);
destroyAndRemoveBeanInstance(tarantula, instance);
}
@@ -59,8 +59,8 @@
@Override
protected void execute() throws Exception
{
- Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = getCurrentManager().getInstance(tarantula);
+ Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ Tarantula instance = getCurrentManager().getContext(tarantula.getScopeType()).get(tarantula);
destroyAndRemoveBeanInstance(tarantula, instance);
}
@@ -86,8 +86,8 @@
@Override
protected void execute() throws Exception
{
- Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = getCurrentManager().getInstance(tarantula);
+ Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ Tarantula instance = getCurrentManager().getContext(tarantula.getScopeType()).get(tarantula);
destroyAndRemoveBeanInstance(tarantula, instance);
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -29,28 +29,28 @@
@SpecAssertion(section = "3.3", id = "b")
public void testStatelessWithDependentScopeOK()
{
- assert getCurrentManager().getBeans(GiraffeLocal.class).size() == 1;
+ assert getBeans(GiraffeLocal.class).size() == 1;
}
@Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3", id = "c")
public void testSingletonWithDependentScopeOK()
{
- assert getCurrentManager().getBeans(Labrador.class).size() == 1;
+ assert getBeans(Labrador.class).size() == 1;
}
@Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3", id = "c")
public void testSingletonWithApplicationScopeOK()
{
- assert getCurrentManager().getBeans(Laika.class).size() == 1;
+ assert getBeans(Laika.class).size() == 1;
}
@Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3.2", id = "a")
public void testAnnotatedEnterpriseBean()
{
- assert getCurrentManager().getBeans(GiraffeLocal.class).size() > 0;
+ assert getBeans(GiraffeLocal.class).size() > 0;
}
@Test(groups = { "enterpriseBeans" })
@@ -60,7 +60,7 @@
@SpecAssertion(section = "3.3.4", id = "c") } )
public void testBeanTypesAreLocalInterfacesWithoutWildcardTypesOrTypeVariablesWithSuperInterfaces()
{
- Bean<DogLocal> dogBean = getCurrentManager().getBeans(DogLocal.class).iterator().next();
+ Bean<DogLocal> dogBean = getBeans(DogLocal.class).iterator().next();
assert dogBean.getTypes().contains(DogLocal.class);
assert dogBean.getTypes().contains(PitbullLocal.class);
assert !dogBean.getTypes().contains(Pitbull.class);
@@ -76,7 +76,7 @@
public void testEnterpriseBeanWithLocalViewAndNotParameterizedTypeHasClassAndSuperclassesAsBeanTypes()
{
//TODO We need a 3.1 compliant container for this test
- Bean<DogLocal> dogBean = getCurrentManager().getBeans(DogLocal.class).iterator().next();
+ Bean<DogLocal> dogBean = getBeans(DogLocal.class).iterator().next();
assert dogBean.getTypes().contains(Pitbull.class);
}
@@ -88,15 +88,15 @@
})
public void testObjectIsInAPITypes()
{
- assert getCurrentManager().getBeans(GiraffeLocal.class).size() == 1;
- assert getCurrentManager().getBeans(GiraffeLocal.class).iterator().next().getTypes().contains(Object.class);
+ assert getBeans(GiraffeLocal.class).size() == 1;
+ assert getBeans(GiraffeLocal.class).iterator().next().getTypes().contains(Object.class);
}
@Test(groups = { "enterpriseBeans" })
@SpecAssertion(section = "3.3.3", id = "d")
public void testRemoteInterfacesAreNotInAPITypes()
{
- Bean<DogLocal> dogBean = getCurrentManager().getBeans(DogLocal.class).iterator().next();
+ Bean<DogLocal> dogBean = getBeans(DogLocal.class).iterator().next();
assert !dogBean.getTypes().contains(DogRemote.class);
}
@@ -104,7 +104,7 @@
@SpecAssertion(section = "3.3.4", id = "ba")
public void testBeanWithScopeAnnotation()
{
- Bean<LionLocal> lionBean = getCurrentManager().getBeans(LionLocal.class).iterator().next();
+ Bean<LionLocal> lionBean = getBeans(LionLocal.class).iterator().next();
assert lionBean.getScopeType().equals(RequestScoped.class);
}
@@ -112,7 +112,7 @@
@SpecAssertion(section = "3.3.4", id = "bb")
public void testBeanWithNamedAnnotation()
{
- Bean<MonkeyLocal> monkeyBean = getCurrentManager().getBeans(MonkeyLocal.class).iterator().next();
+ Bean<MonkeyLocal> monkeyBean = getBeans(MonkeyLocal.class).iterator().next();
assert monkeyBean.getName().equals("Monkey");
}
@@ -120,7 +120,7 @@
@SpecAssertion(section = "3.3.4", id = "bc")
public void testBeanWithDeploymentType()
{
- Bean<MonkeyLocal> monkeyBean = getCurrentManager().getBeans(MonkeyLocal.class).iterator().next();
+ Bean<MonkeyLocal> monkeyBean = getBeans(MonkeyLocal.class).iterator().next();
assert monkeyBean.getDeploymentType().equals(AnotherDeploymentType.class);
}
@@ -128,7 +128,7 @@
@SpecAssertion(section = "3.3.4", id = "bd")
public void testBeanWithStereotype()
{
- Bean<PolarBearLocal> polarBearBean = getCurrentManager().getBeans(PolarBearLocal.class).iterator().next();
+ Bean<PolarBearLocal> polarBearBean = getBeans(PolarBearLocal.class).iterator().next();
assert polarBearBean.getDeploymentType().equals(AnotherDeploymentType.class);
assert polarBearBean.getScopeType().equals(RequestScoped.class);
assert polarBearBean.getName().equals("polarBear");
@@ -139,7 +139,7 @@
public void testBeanWithBindings()
{
Annotation tame = new AnnotationLiteral<Tame>(){};
- Bean<ApeLocal> apeBean = getCurrentManager().getBeans(ApeLocal.class, tame).iterator().next();
+ Bean<ApeLocal> apeBean = getBeans(ApeLocal.class, tame).iterator().next();
assert apeBean.getBindings().contains(tame);
}
@@ -147,8 +147,8 @@
@SpecAssertion(section = "3.3.8", id = "a")
public void testDefaultName()
{
- assert getCurrentManager().getBeans(PitbullLocal.class).size() == 1;
- assert getCurrentManager().getBeans(PitbullLocal.class).iterator().next().getName().equals("pitbull");
+ assert getBeans(PitbullLocal.class).size() == 1;
+ assert getBeans(PitbullLocal.class).iterator().next().getName().equals("pitbull");
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/definition/EnterpriseBeanViaXmlTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -48,7 +48,7 @@
})
public void testEjbDeclaredInXmlNotSimpleBean()
{
- Bean<ElephantLocal> elephantBean = getCurrentManager().getBeans(ElephantLocal.class).iterator().next();
+ Bean<ElephantLocal> elephantBean = getBeans(ElephantLocal.class).iterator().next();
// The interface is a known type but the class should not be
assert elephantBean.getTypes().contains(ElephantLocal.class);
assert !elephantBean.getTypes().contains(Elephant.class);
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -55,8 +55,8 @@
@SpecAssertion(section = "6.5", id = "a") })
public void testCreateSFSB() throws Exception
{
- GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
- Bean<KleinStadt> stadtBean = getCurrentManager().getBeans(KleinStadt.class).iterator().next();
+ GrossStadt frankfurt = getInstanceByType(GrossStadt.class);
+ Bean<KleinStadt> stadtBean = getBeans(KleinStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
KleinStadt stadtInstance = createBeanInstance(stadtBean);
assert stadtInstance != null : "Expected instance to be created by container";
@@ -81,19 +81,18 @@
//frankfurt.dispose();
}
- @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration" })
+ @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration", "ri-broken" })
@SpecAssertions({
@SpecAssertion(section = "6.5", id = "b"),
@SpecAssertion(section = "6", id = "e")
})
public void testDestroyRemovesSFSB() throws Exception
{
- GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
- Bean<KleinStadt> stadtBean = getCurrentManager().getBeans(KleinStadt.class).iterator().next();
+ GrossStadt frankfurt = getInstanceByType(GrossStadt.class);
+ Bean<KleinStadt> stadtBean = getBeans(KleinStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
KleinStadt kassel = createBeanInstance(stadtBean);
- kassel.ping();
destroyAndRemoveBeanInstance(stadtBean, kassel);
assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
@@ -106,12 +105,12 @@
@SpecAssertion(section = "6.5", id = "c")
public void testRemovedEjbIgnored()
{
- KleinStadt stadtInstance = getCurrentManager().getInstanceByType(KleinStadt.class);
+ KleinStadt stadtInstance = getInstanceByType(KleinStadt.class);
assert stadtInstance != null : "Expected instance to be created by container";
stadtInstance.zustandVergessen();
// Now make sure that the container does not return this instance again
- KleinStadt newStadtInstance = getCurrentManager().getInstanceByType(KleinStadt.class);
+ KleinStadt newStadtInstance = getInstanceByType(KleinStadt.class);
assert newStadtInstance != null : "Failed to get SFSB instance the second time";
assert !newStadtInstance.equals(stadtInstance) : "The destroyed SFSB was not ignored";
}
@@ -120,7 +119,7 @@
@SpecAssertion(section = "6.6", id = "a")
public void testCreateSLSB()
{
- Bean<NeueStadt> stadtBean = getCurrentManager().getBeans(NeueStadt.class).iterator().next();
+ Bean<NeueStadt> stadtBean = getBeans(NeueStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
NeueStadt stadtInstance = createBeanInstance(stadtBean);
assert stadtInstance != null : "Expected instance to be created by container";
@@ -149,15 +148,15 @@
assert alteStadt.getAnotherPlaceOfInterest() != null;
}
- @Test(groups = { "enterpriseBeans", "lifecycle" })
+ @Test(groups = { "enterpriseBeans", "lifecycle", "ri-broken" })
@SpecAssertion(section = "6.11", id = "f")
public void testDependentObjectsDestroyed()
{
- UniStadt marburg = getCurrentManager().getInstanceByType(UniStadt.class);
+ UniStadt marburg = getInstanceByType(UniStadt.class);
assert marburg != null : "Couldn't find the main SFSB";
- Bean<UniStadt> uniStadtBean = getCurrentManager().getBeans(UniStadt.class).iterator().next();
+ Bean<UniStadt> uniStadtBean = getBeans(UniStadt.class).iterator().next();
destroyAndRemoveBeanInstance(uniStadtBean, marburg);
- GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
+ GrossStadt frankfurt = getInstanceByType(GrossStadt.class);
assert frankfurt.isSchlossDestroyed();
}
@@ -166,13 +165,13 @@
public void testDirectSubClassInheritsPostConstructOnSuperclass() throws Exception
{
OrderProcessor.postConstructCalled = false;
- assert getCurrentManager().getBeans(DirectOrderProcessorLocal.class).size() == 1;
+ assert getBeans(DirectOrderProcessorLocal.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(DirectOrderProcessorLocal.class).order();
+ getInstanceByType(DirectOrderProcessorLocal.class).order();
}
}.run();
assert OrderProcessor.postConstructCalled;
@@ -183,51 +182,50 @@
public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
{
OrderProcessor.postConstructCalled = false;
- assert getCurrentManager().getBeans(OrderProcessorLocal.class).size() == 1;
+ assert getBeans(OrderProcessorLocal.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(OrderProcessorLocal.class).order();
+ getInstanceByType(OrderProcessorLocal.class).order();
}
}.run();
assert OrderProcessor.postConstructCalled;
}
- @Test
+ @Test(groups = "ri-broken")
@SpecAssertion(section = "4.2", id = "bbb")
public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception
{
OrderProcessor.preDestroyCalled = false;
- assert getCurrentManager().getBeans(DirectOrderProcessorLocal.class).size() == 1;
+ assert getBeans(DirectOrderProcessorLocal.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- Bean<DirectOrderProcessorLocal> bean = getCurrentManager().getBeans(DirectOrderProcessorLocal.class).iterator().next();
- DirectOrderProcessorLocal instance = getCurrentManager().getInstanceByType(DirectOrderProcessorLocal.class);
+ Bean<DirectOrderProcessorLocal> bean = getBeans(DirectOrderProcessorLocal.class).iterator().next();
+ DirectOrderProcessorLocal instance = getInstanceByType(DirectOrderProcessorLocal.class);
destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
assert OrderProcessor.preDestroyCalled;
}
- @Test
+ @Test(groups = "ri-broken")
@SpecAssertion(section = "4.2", id = "bbd")
public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception
{
OrderProcessor.preDestroyCalled = false;
- assert getCurrentManager().getBeans(OrderProcessorLocal.class).size() == 1;
+ assert getBeans(IndirectOrderProcessor.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- Bean<OrderProcessorLocal> bean = getCurrentManager().getBeans(OrderProcessorLocal.class).iterator().next();
- OrderProcessorLocal instance = getCurrentManager().getInstanceByType(OrderProcessorLocal.class);
- instance.order();
+ Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
+ IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -22,8 +22,8 @@
@SpecAssertion(section = "3.3.6", id = "b")
public void testNewBeanHasSameInitializers()
{
- InitializerSimpleBeanLocal bean = getCurrentManager().getInstanceByType(InitializerSimpleBeanLocal.class);
- InitializerSimpleBeanLocal newBean = getCurrentManager().getInstanceByType(InitializerSimpleBeanLocal.class, new NewLiteral());
+ InitializerSimpleBeanLocal bean = getInstanceByType(InitializerSimpleBeanLocal.class);
+ InitializerSimpleBeanLocal newBean = getInstanceByType(InitializerSimpleBeanLocal.class,new NewLiteral());
assert bean != newBean;
assert bean.getInitializerCalls() == 2;
}
@@ -44,11 +44,11 @@
@Override
protected void execute() throws Exception
{
- FoxLocal fox = getCurrentManager().getInstanceByType(FoxLocal.class);
- FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new NewLiteral());
+ FoxLocal fox = getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
fox.setNextLitterSize(3);
newFox.setNextLitterSize(5);
- Litter theOnlyLitter = getCurrentManager().getInstanceByType(Litter.class, new AnnotationLiteral<Tame>(){});
+ Litter theOnlyLitter = getInstanceByType(Litter.class,new AnnotationLiteral<Tame>(){});
assert theOnlyLitter.getQuantity() == fox.getNextLitterSize();
}
@@ -70,10 +70,10 @@
@Override
protected void execute() throws Exception
{
- FoxLocal fox = getCurrentManager().getInstanceByType(FoxLocal.class);
- FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new NewLiteral());
+ FoxLocal fox = getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
newFox.setDen(new Den("NewFoxDen"));
- Den theOnlyDen = getCurrentManager().getInstanceByType(Den.class, new AnnotationLiteral<Tame>(){});
+ Den theOnlyDen = getInstanceByType(Den.class,new AnnotationLiteral<Tame>(){});
assert theOnlyDen.getName().equals(fox.getDen().getName());
}
@@ -90,10 +90,10 @@
@Override
protected void execute() throws Exception
{
- FoxLocal fox = getCurrentManager().getInstanceByType(FoxLocal.class);
- FoxLocal newFox = getCurrentManager().getInstanceByType(FoxLocal.class, new NewLiteral());
- Bean<Litter> litterBean = getCurrentManager().getBeans(Litter.class).iterator().next();
- Litter litter = getCurrentManager().getInstanceByType(Litter.class);
+ FoxLocal fox = getInstanceByType(FoxLocal.class);
+ FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
+ Bean<Litter> litterBean = getBeans(Litter.class).iterator().next();
+ Litter litter = getInstanceByType(Litter.class);
destroyAndRemoveBeanInstance(litterBean, litter);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -39,7 +39,7 @@
@SpecAssertion(section = "3.3.6", id = "d")
public void testNewBeanIsDependentScoped()
{
- Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+ Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
assert beans.size() == 1;
newEnterpriseBean = beans.iterator().next();
assert Dependent.class.equals(newEnterpriseBean.getScopeType());
@@ -49,7 +49,7 @@
@SpecAssertion(section = "3.3.6", id = "e")
public void testNewBeanIsOfStandardDeploymentType()
{
- Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+ Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
assert beans.size() == 1;
newEnterpriseBean = beans.iterator().next();
assert Standard.class.equals(newEnterpriseBean.getDeploymentType());
@@ -59,7 +59,7 @@
@SpecAssertion(section = "3.3.6", id = "f")
public void testNewBeanIsHasOnlyNewBinding()
{
- Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+ Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
assert beans.size() == 1;
newEnterpriseBean = beans.iterator().next();
assert newEnterpriseBean.getBindings().size() == 1;
@@ -70,7 +70,7 @@
@SpecAssertion(section = "3.3.6", id = "g")
public void testNewBeanHasNoWebBeanName()
{
- Set<Bean<WrappedEnterpriseBeanLocal>> beans = getCurrentManager().getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
+ Set<Bean<WrappedEnterpriseBeanLocal>> beans = getBeans(WrappedEnterpriseBeanLocal.class, new NewLiteral());
assert beans.size() == 1;
newEnterpriseBean = beans.iterator().next();
assert newEnterpriseBean.getName() == null;
@@ -80,8 +80,8 @@
@SpecAssertion(section = "3.3.6", id = "h")
public void testNewBeanHasNoStereotypes()
{
- Bean<MonkeyLocal> monkeyBean = getCurrentManager().getBeans(MonkeyLocal.class).iterator().next();
- Bean<MonkeyLocal> newMonkeyBean = getCurrentManager().getBeans(MonkeyLocal.class, new NewLiteral()).iterator().next();
+ Bean<MonkeyLocal> monkeyBean = getBeans(MonkeyLocal.class).iterator().next();
+ Bean<MonkeyLocal> newMonkeyBean = getBeans(MonkeyLocal.class, new NewLiteral()).iterator().next();
assert monkeyBean.getScopeType().equals(RequestScoped.class);
assert newMonkeyBean.getScopeType().equals(Dependent.class);
assert monkeyBean.getName().equals("monkey");
@@ -103,26 +103,26 @@
})
public void testForEachEnterpriseBeanANewBeanExists()
{
- Bean<OrderLocal> orderBean = getCurrentManager().getBeans(OrderLocal.class).iterator().next();
- Bean<OrderLocal> newOrderBean = getCurrentManager().getBeans(OrderLocal.class, new NewLiteral()).iterator().next();
+ Bean<OrderLocal> orderBean = getBeans(OrderLocal.class).iterator().next();
+ Bean<OrderLocal> newOrderBean = getBeans(OrderLocal.class, new NewLiteral()).iterator().next();
assert orderBean.getBindings().size() == 2;
assert orderBean.getBindings().contains(new CurrentLiteral());
assert orderBean.getBindings().contains(new AnyBinding());
- assert getCurrentManager().getBeans(OrderLocal.class, new NewLiteral()).size() == 1;
+ assert getBeans(OrderLocal.class, new NewLiteral()).size() == 1;
assert newOrderBean.getBindings().size() == 1;
assert newOrderBean.getBindings().iterator().next().annotationType().equals(New.class);
assert orderBean.getTypes().equals(newOrderBean.getTypes());
- Bean<LionLocal> lionBean = getCurrentManager().getBeans(LionLocal.class, TAME_LITERAL).iterator().next();
- Bean<LionLocal> newLionBean = getCurrentManager().getBeans(LionLocal.class, new NewLiteral()).iterator().next();
- assert getCurrentManager().getBeans(LionLocal.class, TAME_LITERAL).size() == 1;
+ Bean<LionLocal> lionBean = getBeans(LionLocal.class, TAME_LITERAL).iterator().next();
+ Bean<LionLocal> newLionBean = getBeans(LionLocal.class, new NewLiteral()).iterator().next();
+ assert getBeans(LionLocal.class, TAME_LITERAL).size() == 1;
assert lionBean.getBindings().size() == 2;
assert lionBean.getBindings().contains(TAME_LITERAL);
assert lionBean.getBindings().contains(new AnyBinding());
- assert getCurrentManager().getBeans(LionLocal.class, new NewLiteral()).size() == 1;
+ assert getBeans(LionLocal.class, new NewLiteral()).size() == 1;
assert newLionBean.getBindings().size() == 1;
assert newLionBean.getBindings().iterator().next().annotationType().equals(New.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/EnterpriseBeanRemoveMethodTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -32,9 +32,10 @@
@Override
protected void execute() throws Exception
{
- DependentSessionInterface sessionBean = getCurrentManager().getInstanceByType(DependentSessionInterface.class);
+ DependentSessionInterface sessionBean = getInstanceByType(DependentSessionInterface.class);
sessionBean.remove();
- StateKeeper stateKeeper = getCurrentManager().getInstanceByType(StateKeeper.class);
+ StateKeeper stateKeeper = (StateKeeper)
+ getCurrentManager().getReference(getCurrentManager().getBeans(StateKeeper.class).iterator().next(),StateKeeper.class);
assert stateKeeper.isRemoveCalled();
}
}.run();
@@ -50,9 +51,9 @@
@Override
protected void execute() throws Exception
{
- DependentSessionInterface sessionBean = getCurrentManager().getInstanceByType(DependentSessionInterface.class);
+ DependentSessionInterface sessionBean = getInstanceByType(DependentSessionInterface.class);
sessionBean.anotherRemoveWithParameters("required");
- StateKeeper stateKeeper = getCurrentManager().getInstanceByType(StateKeeper.class);
+ StateKeeper stateKeeper = getInstanceByType(StateKeeper.class);
assert stateKeeper.isRemoveCalled();
}
}.run();
@@ -65,7 +66,7 @@
})
public void applicationCannotCallRemoveMethodOnNonDependentScopedSessionEnterpriseBean()
{
- SessionScopedSessionInterface sessionBean = getCurrentManager().getInstanceByType(SessionScopedSessionInterface.class);
+ SessionScopedSessionInterface sessionBean = getInstanceByType(SessionScopedSessionInterface.class);
sessionBean.remove();
assert false : "Should never reach this assertion";
}
@@ -74,14 +75,17 @@
@SpecAssertion(section = "3.3.1", id = "db")
public void applicationMayCallRemoveMethodOnDependentScopedSessionEnterpriseBeansButInstanceIsNotDestroyed() throws Exception
{
- StateKeeper stateKeeper = getCurrentManager().getInstanceByType(StateKeeper.class);
+ StateKeeper stateKeeper = getInstanceByType(StateKeeper.class);
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- DependentSessionInterface sessionBean = getCurrentManager().getInstanceByType(DependentSessionInterface.class);
+ DependentSessionInterface sessionBean = (DependentSessionInterface)
+ getCurrentManager().getReference(getCurrentManager().getBeans(DependentSessionInterface.class).iterator().next(),
+ DependentSessionInterface.class);
+
sessionBean.businessMethod();
}
}.run();
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/EjbInitializerMethodTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -23,7 +23,7 @@
public void testInitializerMethodNotABusinessMethod()
{
AndalusianChicken.nonBusinessMethodCalled = false;
- getCurrentManager().getInstanceByType(LocalChicken.class).cluck();
+ getInstanceByType(LocalChicken.class).cluck();
assert AndalusianChicken.nonBusinessMethodCalled = true;
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -24,9 +24,9 @@
})
public void testBindingTypeOnInitializerParameter()
{
- PremiumChickenHutch hutch = getCurrentManager().getInstanceByType(PremiumChickenHutch.class);
+ PremiumChickenHutch hutch = getInstanceByType(PremiumChickenHutch.class);
assert hutch.getChicken().getName().equals("Preferred");
- StandardChickenHutch anotherHutch = getCurrentManager().getInstanceByType(StandardChickenHutch.class);
+ StandardChickenHutch anotherHutch = getInstanceByType(StandardChickenHutch.class);
assert anotherHutch.getChicken().getName().equals("Standard");
}
@@ -74,7 +74,7 @@
})
public void testMultipleInitializerMethodsAreCalled()
{
- ChickenHutch chickenHutch = getCurrentManager().getInstanceByType(ChickenHutch.class);
+ ChickenHutch chickenHutch = getInstanceByType(ChickenHutch.class);
assert chickenHutch.fox != null;
assert chickenHutch.chicken != null;
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -35,7 +35,7 @@
@SpecAssertion(section = "2.5.3", id = "h")
public void testProducerFieldInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class);
assert tarantulaBeans.size() == 1;
assert tarantulaBeans.iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@@ -48,7 +48,7 @@
{
public void execute()
{
- FunnelWeaverSpiderConsumer spiderConsumer = getCurrentManager().getInstanceByType(FunnelWeaverSpiderConsumer.class);
+ FunnelWeaverSpiderConsumer spiderConsumer = getInstanceByType(FunnelWeaverSpiderConsumer.class);
assert spiderConsumer != null;
assert spiderConsumer.getInjectedSpider() != null;
assert spiderConsumer.getInjectedSpider().equals(FunnelWeaverSpiderProducer.getSpider());
@@ -64,10 +64,10 @@
})
public void testBeanDeclaresMultipleProducerFields()
{
- assert getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
- assert getCurrentManager().getInstanceByType(Tarantula.class, TAME_LITERAL).equals(OtherSpiderProducer.TARANTULA) ;
- assert getCurrentManager().getBeans(BlackWidow.class, TAME_LITERAL).size() == 1;
- assert getCurrentManager().getInstanceByType(BlackWidow.class, TAME_LITERAL).equals(OtherSpiderProducer.BLACK_WIDOW) ;
+ assert getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
+ assert getInstanceByType(Tarantula.class,TAME_LITERAL).equals(OtherSpiderProducer.TARANTULA) ;
+ assert getBeans(BlackWidow.class, TAME_LITERAL).size() == 1;
+ assert getInstanceByType(BlackWidow.class,TAME_LITERAL).equals(OtherSpiderProducer.BLACK_WIDOW) ;
}
@Test(groups = "producerField")
@@ -76,7 +76,7 @@
})
public void testDefaultBindingType()
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class);
assert tarantulaBeans.size() == 1;
assert tarantulaBeans.iterator().next().getBindings().contains(new CurrentLiteral());
}
@@ -85,7 +85,7 @@
@SpecAssertion(section = "3.5.1", id = "c")
public void testApiTypeForClassReturn()
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class);
assert tarantulaBeans.size() == 1;
Bean<Tarantula> tarantulaBean = tarantulaBeans.iterator().next();
assert tarantulaBean.getTypes().size() == 6;
@@ -101,7 +101,7 @@
@SpecAssertion(section = "3.5.1", id = "a")
public void testApiTypeForInterfaceReturn()
{
- Set<Bean<Animal>> animalBeans = getCurrentManager().getBeans(Animal.class, new AnnotationLiteral<AsAnimal>() {});
+ Set<Bean<Animal>> animalBeans = getBeans(Animal.class, new AnnotationLiteral<AsAnimal>() {});
assert animalBeans.size() == 1;
Bean<Animal> animalModel = animalBeans.iterator().next();
assert animalModel.getTypes().size() == 2;
@@ -128,7 +128,7 @@
})
public void testApiTypeForArrayTypeReturn()
{
- Set<Bean<Spider[]>> spidersBeans = getCurrentManager().getBeans(Spider[].class);
+ Set<Bean<Spider[]>> spidersBeans = getBeans(Spider[].class);
assert spidersBeans.size() == 1;
Bean<Spider[]> spidersModel = spidersBeans.iterator().next();
assert spidersModel.getTypes().size() == 2;
@@ -143,7 +143,7 @@
})
public void testBindingType()
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class, new TameAnnotationLiteral());
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, new TameAnnotationLiteral());
assert tarantulaBeans.size() == 1;
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
assert tarantulaModel.getBindings().size() == 2;
@@ -154,7 +154,7 @@
@SpecAssertion(section = "3.5.2", id = "b")
public void testScopeType()
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL, FOO_LITERAL);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, TAME_LITERAL, FOO_LITERAL);
assert !tarantulaBeans.isEmpty();
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
assert tarantulaModel.getScopeType().equals(RequestScoped.class);
@@ -164,7 +164,7 @@
@SpecAssertion(section = "3.5.2", id = "d")
public void testDeploymentType()
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL, FOO_LITERAL);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, TAME_LITERAL, FOO_LITERAL);
assert !tarantulaBeans.isEmpty();
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
assert tarantulaModel.getDeploymentType().equals(Production.class);
@@ -193,7 +193,7 @@
})
public void testDefaultNamedField()
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class, STATIC_LITERAL);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, STATIC_LITERAL);
assert tarantulaBeans.size() == 1;
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
assert tarantulaModel.getName().equals("produceTarantula");
@@ -207,7 +207,7 @@
})
public void testStereotype()
{
- Set<Bean<Tarantula>> tarantulaBeans = getCurrentManager().getBeans(Tarantula.class, STATIC_LITERAL);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, STATIC_LITERAL);
assert !tarantulaBeans.isEmpty();
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
assert tarantulaModel.getScopeType().equals(RequestScoped.class);
@@ -218,13 +218,13 @@
@SpecAssertion(section = "4.2", id = "ea")
public void testNonStaticProducerFieldNotInherited()
{
- assert !(getCurrentManager().getInstanceByType(Egg.class, FOO_LITERAL).getMother() instanceof InfertileChicken);
+ assert !(getInstanceByType(Egg.class,FOO_LITERAL).getMother() instanceof InfertileChicken);
}
@Test(groups = "producerField")
@SpecAssertion(section = "4.2", id = "ec")
public void testNonStaticProducerFieldNotIndirectlyInherited()
{
- assert !(getCurrentManager().getInstanceByType(Egg.class, FOO_LITERAL).getMother() instanceof LameInfertileChicken);
+ assert !(getInstanceByType(Egg.class,FOO_LITERAL).getMother() instanceof LameInfertileChicken);
}
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/enterprise/EnterpriseProducerFieldDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -25,13 +25,13 @@
@SpecAssertion(section = "4.2", id = "eb")
public void testNonStaticProducerFieldNotInherited()
{
- assert !(getCurrentManager().getInstanceByType(Egg.class, FOO_LITERAL).getMother() instanceof InfertileChicken);
+ assert !(getInstanceByType(Egg.class,FOO_LITERAL).getMother() instanceof InfertileChicken);
}
@Test(groups = {"producerField", "ri-broken"})
@SpecAssertion(section = "4.2", id = "ed")
public void testNonStaticProducerFieldNotIndirectlyInherited()
{
- assert !(getCurrentManager().getInstanceByType(Egg.class, FOO_LITERAL).getMother() instanceof LameInfertileChicken);
+ assert !(getInstanceByType(Egg.class,FOO_LITERAL).getMother() instanceof LameInfertileChicken);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/ProducerFieldLifecycleTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -31,7 +31,7 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getInstanceByType(BrownRecluse.class) != null;
+ assert getInstanceByType(BrownRecluse.class) != null;
}
};
}
@@ -49,7 +49,7 @@
@Override
protected void execute() throws Exception
{
- TarantulaConsumer tarantulaConsumer = getCurrentManager().getInstanceByType(TarantulaConsumer.class);
+ TarantulaConsumer tarantulaConsumer = getInstanceByType(TarantulaConsumer.class);
assert tarantulaConsumer.getConsumedTarantula().equals(StaticTarantulaProducer.produceTarantula);
}
};
@@ -70,7 +70,7 @@
@Override
protected void execute() throws Exception
{
- BlackWidowConsumer spiderConsumer = getCurrentManager().getInstanceByType(BlackWidowConsumer.class);
+ BlackWidowConsumer spiderConsumer = getInstanceByType(BlackWidowConsumer.class);
assert spiderConsumer.getInjectedSpider().equals(BlackWidowProducer.blackWidow);
}
}.run();
@@ -88,7 +88,7 @@
@Override
protected void execute() throws Exception
{
- TarantulaConsumer spiderConsumer = getCurrentManager().getInstanceByType(TarantulaConsumer.class);
+ TarantulaConsumer spiderConsumer = getInstanceByType(TarantulaConsumer.class);
assert spiderConsumer.getConsumedTarantula() != null;
assert spiderConsumer.getConsumedTarantula() instanceof DefangedTarantula;
}
@@ -107,7 +107,7 @@
@Override
protected void execute() throws Exception
{
- NullSpiderConsumer consumerBean = getCurrentManager().getInstanceByType(NullSpiderConsumer.class);
+ NullSpiderConsumer consumerBean = getInstanceByType(NullSpiderConsumer.class);
assert consumerBean.getInjectedSpider() == null;
}
}.run();
@@ -125,7 +125,7 @@
@Override
protected void execute() throws Exception
{
- NullSpiderConsumerForBrokenProducer consumer = getCurrentManager().getInstanceByType(NullSpiderConsumerForBrokenProducer.class);
+ NullSpiderConsumerForBrokenProducer consumer = getInstanceByType(NullSpiderConsumerForBrokenProducer.class);
// The injected spider is proxied since it is in the request scope.
// So to actually create the bean instance, we need to invoke
// some method on the proxy.
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -37,8 +37,8 @@
} )
public void testProducerMethodInheritsDeploymentTypeOfDeclaringWebBean() throws Exception
{
- assert getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
+ assert getBeans(Tarantula.class, TAME_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups = "producerMethod")
@@ -49,8 +49,8 @@
} )
public void testStaticMethod() throws Exception
{
- assert getCurrentManager().getBeans(String.class).size() == 1;
- assert getCurrentManager().getInstanceByType(String.class).equals(BeanWithStaticProducerMethod.getString());
+ assert getBeans(String.class).size() == 1;
+ assert getInstanceByType(String.class).equals(BeanWithStaticProducerMethod.getString());
}
@Test(groups = { "producerMethod" })
@@ -59,7 +59,7 @@
} )
public void testProducerOnNonBean() throws Exception
{
- assert getCurrentManager().getBeans(Cherry.class).isEmpty();
+ assert getBeans(Cherry.class).isEmpty();
}
@Test(groups = "producerMethod")
@@ -68,9 +68,9 @@
} )
public void testStaticDisposalMethod() throws Exception
{
- assert getCurrentManager().getBeans(String.class).size() == 1;
- String aString = getCurrentManager().getInstanceByType(String.class);
- Bean<String> stringBean = getCurrentManager().getBeans(String.class).iterator().next();
+ assert getBeans(String.class).size() == 1;
+ String aString = getInstanceByType(String.class);
+ Bean<String> stringBean = getBeans(String.class).iterator().next();
destroyAndRemoveBeanInstance(stringBean, aString);
assert BeanWithStaticProducerMethod.stringDestroyed;
}
@@ -79,7 +79,7 @@
@SpecAssertion(section = "3.4", id = "g")
public void testParameterizedReturnType() throws Exception
{
- assert getCurrentManager().getBeans(new TypeLiteral<FunnelWeaver<Spider>>() {}).size() == 1;
+ assert getBeans(new TypeLiteral<FunnelWeaver<Spider>>() {}).size() == 1;
}
@Test(groups = "producerMethod")
@@ -103,8 +103,8 @@
})
public void testApiTypeForClassReturn() throws Exception
{
- assert getCurrentManager().getBeans(Tarantula.class).size() == 1;
- Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ assert getBeans(Tarantula.class).size() == 1;
+ Bean<Tarantula> tarantula = getBeans(Tarantula.class).iterator().next();
assert tarantula.getTypes().size() == 6;
assert tarantula.getTypes().contains(Tarantula.class);
@@ -119,8 +119,8 @@
@SpecAssertion(section = "3.4.1", id = "a")
public void testApiTypeForInterfaceReturn() throws Exception
{
- assert getCurrentManager().getBeans(Bite.class).size() == 1;
- Bean<Bite> animal = getCurrentManager().getBeans(Bite.class).iterator().next();
+ assert getBeans(Bite.class).size() == 1;
+ Bean<Bite> animal = getBeans(Bite.class).iterator().next();
assert animal.getTypes().size() == 2;
assert animal.getTypes().contains(Bite.class);
assert animal.getTypes().contains(Object.class);
@@ -130,8 +130,8 @@
@SpecAssertion(section = "3.4.1", id = "b")
public void testApiTypeForPrimitiveReturn() throws Exception
{
- assert getCurrentManager().getBeans(Integer.class).size() == 1;
- Bean<Integer> integer = getCurrentManager().getBeans(Integer.class).iterator().next();
+ assert getBeans(Integer.class).size() == 1;
+ Bean<Integer> integer = getBeans(Integer.class).iterator().next();
assert integer.getTypes().size() == 2;
assert integer.getTypes().contains(int.class);
assert integer.getTypes().contains(Object.class);
@@ -144,8 +144,8 @@
})
public void testApiTypeForArrayTypeReturn() throws Exception
{
- assert getCurrentManager().getBeans(Spider[].class).size() == 1;
- Bean<Spider[]> spiders = getCurrentManager().getBeans(Spider[].class).iterator().next();
+ assert getBeans(Spider[].class).size() == 1;
+ Bean<Spider[]> spiders = getBeans(Spider[].class).iterator().next();
assert spiders.getTypes().size() == 2;
assert spiders.getTypes().contains(Spider[].class);
assert spiders.getTypes().contains(Object.class);
@@ -158,8 +158,8 @@
})
public void testBindingType() throws Exception
{
- assert getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
- Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, TAME_LITERAL).iterator().next();
+ assert getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
+ Bean<Tarantula> tarantula = getBeans(Tarantula.class, TAME_LITERAL).iterator().next();
assert tarantula.getBindings().size() == 2;
assert tarantula.getBindings().contains(TAME_LITERAL);
}
@@ -171,8 +171,8 @@
})
public void testScopeType() throws Exception
{
- assert getCurrentManager().getBeans(DaddyLongLegs.class).size() == 1;
- Bean<DaddyLongLegs> daddyLongLegs = getCurrentManager().getBeans(DaddyLongLegs.class).iterator().next();
+ assert getBeans(DaddyLongLegs.class).size() == 1;
+ Bean<DaddyLongLegs> daddyLongLegs = getBeans(DaddyLongLegs.class).iterator().next();
assert daddyLongLegs.getScopeType().equals(RequestScoped.class);
}
@@ -183,8 +183,8 @@
})
public void testDeploymentType() throws Exception
{
- assert getCurrentManager().getBeans(LadybirdSpider.class).size() == 1;
- Bean<LadybirdSpider> ladybirdSpider = getCurrentManager().getBeans(LadybirdSpider.class).iterator().next();
+ assert getBeans(LadybirdSpider.class).size() == 1;
+ Bean<LadybirdSpider> ladybirdSpider = getBeans(LadybirdSpider.class).iterator().next();
assert ladybirdSpider.getDeploymentType().equals(SpiderDeploymentType.class);
}
@@ -195,8 +195,8 @@
})
public void testNamedMethod() throws Exception
{
- assert getCurrentManager().getBeans(BlackWidow.class).size() == 1;
- Bean<BlackWidow> blackWidowSpider = getCurrentManager().getBeans(BlackWidow.class).iterator().next();
+ assert getBeans(BlackWidow.class).size() == 1;
+ Bean<BlackWidow> blackWidowSpider = getBeans(BlackWidow.class).iterator().next();
assert blackWidowSpider.getName().equals("blackWidow");
}
@@ -208,8 +208,8 @@
})
public void testDefaultNamedMethod() throws Exception
{
- assert getCurrentManager().getBeans(DaddyLongLegs.class).size() == 1;
- Bean<DaddyLongLegs> daddyLongLegsSpider = getCurrentManager().getBeans(DaddyLongLegs.class).iterator().next();
+ assert getBeans(DaddyLongLegs.class).size() == 1;
+ Bean<DaddyLongLegs> daddyLongLegsSpider = getBeans(DaddyLongLegs.class).iterator().next();
assert daddyLongLegsSpider.getName().equals("produceDaddyLongLegs");
}
@@ -226,8 +226,8 @@
})
public void testStereotypeSpecifiesScope() throws Exception
{
- assert getCurrentManager().getBeans(WolfSpider.class).size() == 1;
- Bean<WolfSpider> wolfSpider = getCurrentManager().getBeans(WolfSpider.class).iterator().next();
+ assert getBeans(WolfSpider.class).size() == 1;
+ Bean<WolfSpider> wolfSpider = getBeans(WolfSpider.class).iterator().next();
assert wolfSpider.getScopeType().equals(RequestScoped.class);
}
@@ -235,8 +235,8 @@
@SpecAssertion(section = "4.2", id = "da")
public void testNonStaticProducerMethodInheritedBySpecializingSubclass()
{
- assert getCurrentManager().getBeans(Egg.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
- assert getCurrentManager().getInstanceByType(Egg.class, new AnnotationLiteral<Yummy>() {}).getMother().getClass().equals(AndalusianChicken.class);
+ assert getBeans(Egg.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
+ assert getInstanceByType(Egg.class,new AnnotationLiteral<Yummy>() {}).getMother().getClass().equals(AndalusianChicken.class);
}
@Test
@@ -246,16 +246,16 @@
})
public void testNonStaticProducerMethodNotInherited()
{
- assert getCurrentManager().getBeans(Apple.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
- assert getCurrentManager().getInstanceByType(Apple.class, new AnnotationLiteral<Yummy>() {}).getTree().getClass().equals(AppleTree.class);
+ assert getBeans(Apple.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
+ assert getInstanceByType(Apple.class,new AnnotationLiteral<Yummy>() {}).getTree().getClass().equals(AppleTree.class);
}
@Test
@SpecAssertion(section = "2.3.6", id = "a")
public void testBindingTypesAppliedToProducerMethodParameters()
{
- Bean<Tarantula> tarantula = getCurrentManager().getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = getCurrentManager().getInstance(tarantula);
+ Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ Tarantula instance = createBeanInstance(tarantula);
assert instance.getDeathsCaused() == 1;
}
@@ -263,14 +263,14 @@
@SpecAssertion(section = "3.4", id = "e")
public void testDependentProducerReturnsNullValue()
{
- assert getCurrentManager().getInstanceByType(Acorn.class) == null;
+ assert getInstanceByType(Acorn.class) == null;
}
@Test(groups = { "ri-broken" }, expectedExceptions = { IllegalProductException.class })
@SpecAssertion(section = "3.4", id = "f")
public void testNonDependentProducerReturnsNullValue()
{
- getCurrentManager().getInstanceByType(Pollen.class);
+ getInstanceByType(Pollen.class);
assert false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -22,8 +22,8 @@
@SpecAssertion(section = "4.2", id = "dd")
public void testNonStaticProducerMethodInheritedBySpecializingSubclass()
{
- assert getCurrentManager().getBeans(Egg.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
- assert getCurrentManager().getInstanceByType(Egg.class, new AnnotationLiteral<Yummy>() {}).getMother().getClass().equals(AndalusianChicken.class);
+ assert getBeans(Egg.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
+ assert getInstanceByType(Egg.class,new AnnotationLiteral<Yummy>() {}).getMother().getClass().equals(AndalusianChicken.class);
}
@Test
@@ -33,8 +33,8 @@
})
public void testNonStaticProducerMethodNotInherited()
{
- assert getCurrentManager().getBeans(Apple.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
- assert getCurrentManager().getInstanceByType(Apple.class, new AnnotationLiteral<Yummy>() {}).getTree().getClass().equals(AppleTree.class);
+ assert getBeans(Apple.class, new AnnotationLiteral<Yummy>() {}).size() == 1;
+ assert getInstanceByType(Apple.class,new AnnotationLiteral<Yummy>() {}).getTree().getClass().equals(AppleTree.class);
}
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -38,8 +38,8 @@
protected void execute() throws Exception
{
SpiderProducer.setTarantulaDestroyed(false);
- Tarantula tarantula = getCurrentManager().getInstanceByType(Tarantula.class);
- Bean<Tarantula> tarantulaBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
+ Tarantula tarantula = getInstanceByType(Tarantula.class);
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
assert SpiderProducer.isTarantulaDestroyed();
assert SpiderProducer.isDestroyArgumentsSet();
@@ -61,7 +61,7 @@
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(Tarantula.class);
+ getInstanceByType(Tarantula.class);
assert SpiderProducer.isTarantulaCreated();
}
@@ -80,7 +80,7 @@
@Override
protected void execute() throws Exception
{
- Bean<SpiderEgg> eggBean = getCurrentManager().getBeans(SpiderEgg.class).iterator().next();
+ Bean<SpiderEgg> eggBean = getBeans(SpiderEgg.class).iterator().next();
assert createBeanInstance(eggBean) != null;
}
@@ -102,8 +102,8 @@
protected void execute() throws Exception
{
Tarantula.setNumberCreated(0);
- Bean<Tarantula> spiderBean = getCurrentManager().getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = getCurrentManager().getInstance(spiderBean);
+ Bean<Tarantula> spiderBean = getBeans(Tarantula.class).iterator().next();
+ Tarantula tarantula = createBeanInstance(spiderBean);
assert tarantula.getValue().equals("Pete");
assert Tarantula.getNumberCreated() == 1;
}
@@ -116,7 +116,7 @@
})
public void testCreateReturnsNullIfProducerDoesAndDependent() throws Exception
{
- Bean<Bread> breadBean = getCurrentManager().getBeans(Bread.class).iterator().next();
+ Bean<Bread> breadBean = getBeans(Bread.class).iterator().next();
assert createBeanInstance(breadBean) == null;
}
@@ -127,7 +127,7 @@
// TODO I'm not quite sure what this test is currently doing!
public void testCreateFailsIfProducerReturnsNullAndNotDependent() throws Exception
{
- Bean<PotatoChip> chipBean = getCurrentManager().getBeans(PotatoChip.class).iterator().next();
+ Bean<PotatoChip> chipBean = getBeans(PotatoChip.class).iterator().next();
assert createBeanInstance(chipBean) == null;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -24,7 +24,7 @@
})
public void testAbstractClassDeclaredInJavaNotDiscovered()
{
- assert getCurrentManager().getBeans(Cow_NotBean.class).size() == 0;
+ assert getBeans(Cow_NotBean.class).size() == 0;
}
@Test(groups = "innerClass")
@@ -34,7 +34,7 @@
})
public void testStaticInnerClassDeclaredInJavaAllowed()
{
- assert getCurrentManager().getBeans(StaticInnerClass.class).size() == 1;
+ assert getBeans(StaticInnerClass.class).size() == 1;
}
@Test
@@ -44,7 +44,7 @@
})
public void testNonStaticInnerClassDeclaredInJavaNotDiscovered()
{
- assert getCurrentManager().getBeans(InnerClass_NotBeean.class).size() == 0;
+ assert getBeans(InnerClass_NotBeean.class).size() == 0;
}
@Test
@@ -54,21 +54,21 @@
})
public void testParameterizedClassDeclaredInJavaIsNotDiscovered()
{
- assert getCurrentManager().getBeans(ParameterizedClass_NotBean.class).size() == 0;
+ assert getBeans(ParameterizedClass_NotBean.class).size() == 0;
}
@Test
@SpecAssertion(section = "3.2.1", id = "cb")
public void testInterfaceNotDiscoveredAsSimpleBean()
{
- assert getCurrentManager().getBeans(Animal.class).size() == 0;
+ assert getBeans(Animal.class).size() == 0;
}
@Test
@SpecAssertion(section = "3.2.1", id = "e")
public void testEntityClassesNotDiscoveredAsSimpleBean()
{
- assert getCurrentManager().getBeans(MockEntity.class).size() == 0;
+ assert getBeans(MockEntity.class).size() == 0;
}
@Test
@@ -80,41 +80,41 @@
@SpecAssertion(section = "3.2.1", id = "k")})
public void testClassesImplementingServletInterfacesNotDiscoveredAsSimpleBeans()
{
- assert getCurrentManager().getBeans(MockFilter.class).size() == 0;
- assert getCurrentManager().getBeans(MockHttpSessionListener.class).size() == 0;
- assert getCurrentManager().getBeans(MockServlet.class).size() == 0;
- assert getCurrentManager().getBeans(MockServletContextListener.class).size() == 0;
- assert getCurrentManager().getBeans(MockServletRequestListener.class).size() == 0;
+ assert getBeans(MockFilter.class).size() == 0;
+ assert getBeans(MockHttpSessionListener.class).size() == 0;
+ assert getBeans(MockServlet.class).size() == 0;
+ assert getBeans(MockServletContextListener.class).size() == 0;
+ assert getBeans(MockServletRequestListener.class).size() == 0;
}
@Test
@SpecAssertion(section="3.2.1", id="l")
public void testClassesImplementingEnterpriseBeanInterfaceNotDiscoveredAsSimpleBean()
{
- assert getCurrentManager().getBeans(MockEnterpriseBean.class).size() == 0;
+ assert getBeans(MockEnterpriseBean.class).size() == 0;
}
@Test
@SpecAssertion(section="3.2.1", id="m")
public void testClassExtendingUiComponentNotDiscoveredAsSimpleBean()
{
- assert getCurrentManager().getBeans(MockUIComponent.class).size() == 0;
+ assert getBeans(MockUIComponent.class).size() == 0;
}
@Test
@SpecAssertion(section="3.2.1", id="p")
public void testSimpleBeanOnlyIfConstructorParameterless()
{
- assert getCurrentManager().getBeans(Antelope_NotBean.class).isEmpty();
- assert !getCurrentManager().getBeans(Donkey.class).isEmpty();
+ assert getBeans(Antelope_NotBean.class).isEmpty();
+ assert !getBeans(Donkey.class).isEmpty();
}
@Test
@SpecAssertion(section="3.2.1", id="q")
public void testSimpleBeanOnlyIfConstructorIsInitializer()
{
- assert getCurrentManager().getBeans(Antelope_NotBean.class).isEmpty();
- assert !getCurrentManager().getBeans(Sheep.class).isEmpty();
+ assert getBeans(Antelope_NotBean.class).isEmpty();
+ assert !getBeans(Sheep.class).isEmpty();
}
@Test
@@ -127,7 +127,7 @@
protected void execute() throws Exception
{
Sheep.constructedCorrectly = false;
- getCurrentManager().getInstanceByType(Sheep.class);
+ getInstanceByType(Sheep.class);
assert Sheep.constructedCorrectly;
}
@@ -145,7 +145,7 @@
public void testEmptyConstructorUsed()
{
Donkey.constructedCorrectly = false;
- getCurrentManager().getInstanceByType(Donkey.class);
+ getInstanceByType(Donkey.class);
assert Donkey.constructedCorrectly;
}
@@ -158,7 +158,7 @@
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(Turkey.class);
+ getInstanceByType(Turkey.class);
assert Turkey.constructedCorrectly;
}
}.run();
@@ -174,7 +174,7 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getInstanceByType(Tiger.class).name.equals("pete");
+ assert getInstanceByType(Tiger.class).name.equals("pete");
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedPackageTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
@SpecAssertion(section = "3.2.1", id = "o")
public void testOrmMappedEntityClassesNotDiscoveredAsSimpleBean()
{
- assert getCurrentManager().getBeans(Vet.class).size() == 0;
+ assert getBeans(Vet.class).size() == 0;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanOrmMappedTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -21,7 +21,7 @@
@SpecAssertion(section = "3.2.1", id = "o")
public void testOrmMappedEntityClassesNotDiscoveredAsSimpleBean()
{
- assert getCurrentManager().getBeans(Vet.class).size() == 0;
+ assert getBeans(Vet.class).size() == 0;
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -39,8 +39,8 @@
})
public void testInjectionOfParametersIntoBeanConstructor()
{
- assert getCurrentManager().getBeans(FishPond.class).size() == 1;
- FishPond fishPond = getCurrentManager().getInstanceByType(FishPond.class);
+ assert getBeans(FishPond.class).size() == 1;
+ FishPond fishPond = getInstanceByType(FishPond.class);
assert fishPond.goldfish != null;
}
@@ -53,7 +53,7 @@
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(Duck.class);
+ getInstanceByType(Duck.class);
assert Duck.constructedCorrectly;
}
}.run();
@@ -69,7 +69,7 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getInstanceByType(Lion.class, TAME_LITERAL) instanceof MountainLion;
+ assert getInstanceByType(Lion.class,TAME_LITERAL) instanceof MountainLion;
}
}.run();
@@ -83,7 +83,7 @@
public void testCreateReturnsSameBeanPushed() throws Exception
{
final CreationalContext<Farm> farmCreationalContext = new MockCreationalContext<Farm>();
- final Contextual<Farm> farmBean = getCurrentManager().getBeans(Farm.class).iterator().next();
+ final Contextual<Farm> farmBean = getBeans(Farm.class).iterator().next();
MockCreationalContext.setLastBeanPushed(null);
MockCreationalContext.setPushCalled(false);
new RunInDependentContext()
@@ -113,8 +113,8 @@
})
public void testCreateReturnsInstanceOfBean()
{
- assert getCurrentManager().getBeans(RedSnapper.class).size() == 1;
- assert getCurrentManager().getInstanceByType(RedSnapper.class) instanceof RedSnapper;
+ assert getBeans(RedSnapper.class).size() == 1;
+ assert getInstanceByType(RedSnapper.class) instanceof RedSnapper;
}
@Test(groups = "injection")
@@ -124,8 +124,8 @@
})
public void testCreateInjectsFieldsDeclaredInJava()
{
- assert getCurrentManager().getBeans(TunaFarm.class).size() == 1;
- TunaFarm tunaFarm = getCurrentManager().getInstanceByType(TunaFarm.class);
+ assert getBeans(TunaFarm.class).size() == 1;
+ TunaFarm tunaFarm = getInstanceByType(TunaFarm.class);
assert tunaFarm.tuna != null;
}
@@ -136,9 +136,9 @@
public void testContextCreatesNewInstanceForInjection()
{
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
- Bean<Tuna> tunaBean = getCurrentManager().getBeans(Tuna.class).iterator().next();
+ Bean<Tuna> tunaBean = getBeans(Tuna.class).iterator().next();
assert requestContext.get(tunaBean) == null;
- TunaFarm tunaFarm = getCurrentManager().getInstanceByType(TunaFarm.class);
+ TunaFarm tunaFarm = getInstanceByType(TunaFarm.class);
assert tunaFarm.tuna != null;
}
@@ -150,9 +150,9 @@
})
public void testPostConstructPreDestroy() throws Exception
{
- assert getCurrentManager().getBeans(Farm.class).size() == 1;
- Bean<Farm> farmBean = getCurrentManager().getBeans(Farm.class).iterator().next();
- Farm farm = getCurrentManager().getInstanceByType(Farm.class);
+ assert getBeans(Farm.class).size() == 1;
+ Bean<Farm> farmBean = getBeans(Farm.class).iterator().next();
+ Farm farm = getInstanceByType(Farm.class);
assert farm.founded != null;
assert farm.initialStaff == 20;
assert farm.closed == null;
@@ -167,8 +167,8 @@
})
public void testContextualDestroyDisposesWhenNecessary() throws Exception
{
- final Bean<Goose> gooseBean = getCurrentManager().getBeans(Goose.class).iterator().next();
- final Goose goose = getCurrentManager().getInstanceByType(Goose.class);
+ final Bean<Goose> gooseBean = getBeans(Goose.class).iterator().next();
+ final Goose goose = getInstanceByType(Goose.class);
assert !EggProducer.isEggDisposed();
assert !Egg.isEggDestroyed();
@@ -184,8 +184,8 @@
})
public void testContextualDestroyCatchesException()
{
- Bean<Cod> codBean = getCurrentManager().getBeans(Cod.class).iterator().next();
- Cod codInstance = getCurrentManager().getInstanceByType(Cod.class);
+ Bean<Cod> codBean = getBeans(Cod.class).iterator().next();
+ Cod codInstance = getInstanceByType(Cod.class);
codInstance.ping();
destroyAndRemoveBeanInstance(codBean, codInstance);
}
@@ -196,8 +196,8 @@
})
public void testDependentsDestroyedAfterPreDestroy()
{
- Bean<FishPond> pondBean = getCurrentManager().getBeans(FishPond.class).iterator().next();
- FishPond fishPond = getCurrentManager().getInstanceByType(FishPond.class);
+ Bean<FishPond> pondBean = getBeans(FishPond.class).iterator().next();
+ FishPond fishPond = getInstanceByType(FishPond.class);
destroyAndRemoveBeanInstance(pondBean, fishPond);
assert Salmon.isBeanDestroyed();
}
@@ -207,13 +207,13 @@
public void testSubClassInheritsPostConstructOnSuperclass() throws Exception
{
OrderProcessor.postConstructCalled = false;
- assert getCurrentManager().getBeans(CdOrderProcessor.class).size() == 1;
+ assert getBeans(CdOrderProcessor.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(CdOrderProcessor.class).order();
+ getInstanceByType(CdOrderProcessor.class).order();
}
}.run();
assert OrderProcessor.postConstructCalled;
@@ -224,13 +224,13 @@
public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
{
OrderProcessor.postConstructCalled = false;
- assert getCurrentManager().getBeans(IndirectOrderProcessor.class).size() == 1;
+ assert getBeans(IndirectOrderProcessor.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(IndirectOrderProcessor.class).order();
+ getInstanceByType(IndirectOrderProcessor.class).order();
}
}.run();
assert OrderProcessor.postConstructCalled;
@@ -241,14 +241,14 @@
public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception
{
OrderProcessor.preDestroyCalled = false;
- assert getCurrentManager().getBeans(CdOrderProcessor.class).size() == 1;
+ assert getBeans(CdOrderProcessor.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- Bean<CdOrderProcessor> bean = getCurrentManager().getBeans(CdOrderProcessor.class).iterator().next();
- CdOrderProcessor instance = getCurrentManager().getInstanceByType(CdOrderProcessor.class);
+ Bean<CdOrderProcessor> bean = getBeans(CdOrderProcessor.class).iterator().next();
+ CdOrderProcessor instance = getInstanceByType(CdOrderProcessor.class);
destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
@@ -260,14 +260,14 @@
public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception
{
OrderProcessor.preDestroyCalled = false;
- assert getCurrentManager().getBeans(IndirectOrderProcessor.class).size() == 1;
+ assert getBeans(IndirectOrderProcessor.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- Bean<IndirectOrderProcessor> bean = getCurrentManager().getBeans(IndirectOrderProcessor.class).iterator().next();
- IndirectOrderProcessor instance = getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
+ Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
+ IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
@@ -278,14 +278,14 @@
@SpecAssertion(section = "4.2", id = "baa")
public void testSubClassDoesNotInheritPostConstructOnSuperclassBlockedByIntermediateClass() throws Exception
{
- assert getCurrentManager().getBeans(NovelOrderProcessor.class).size() == 1;
+ assert getBeans(NovelOrderProcessor.class).size() == 1;
OrderProcessor.postConstructCalled = false;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(NovelOrderProcessor.class).order();
+ getInstanceByType(NovelOrderProcessor.class).order();
}
}.run();
assert !OrderProcessor.postConstructCalled;
@@ -296,14 +296,14 @@
public void testSubClassDoesNotInheritPreDestroyConstructOnSuperclassBlockedByIntermediateClass() throws Exception
{
OrderProcessor.preDestroyCalled = false;
- assert getCurrentManager().getBeans(NovelOrderProcessor.class).size() == 1;
+ assert getBeans(NovelOrderProcessor.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- Bean<NovelOrderProcessor> bean = getCurrentManager().getBeans(NovelOrderProcessor.class).iterator().next();
- NovelOrderProcessor instance = getCurrentManager().getInstanceByType(NovelOrderProcessor.class);
+ Bean<NovelOrderProcessor> bean = getBeans(NovelOrderProcessor.class).iterator().next();
+ NovelOrderProcessor instance = getInstanceByType(NovelOrderProcessor.class);
destroyAndRemoveBeanInstance(bean, instance);
}
}.run();
@@ -315,14 +315,14 @@
@SpecAssertion(section = "6.2", id = "h")
public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate() throws Exception
{
- assert getCurrentManager().getBeans(Lorry_Broken.class).size() == 1;
+ assert getBeans(Lorry_Broken.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(Lorry_Broken.class);
+ getInstanceByType(Lorry_Broken.class);
}
}.run();
@@ -332,14 +332,14 @@
@SpecAssertion(section = "6.2", id = "g")
public void testUncheckedExceptionThrownFromCreateNotWrapped() throws Exception
{
- assert getCurrentManager().getBeans(Van_Broken.class).size() == 1;
+ assert getBeans(Van_Broken.class).size() == 1;
new RunInDependentContext()
{
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(Van_Broken.class);
+ getInstanceByType(Van_Broken.class);
}
}.run();
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -37,7 +37,7 @@
@SpecAssertion(section = "3.2.5", id = "d")
public void testNewBeanIsDependentScoped()
{
- Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert Dependent.class.equals(newSimpleBean.getScopeType());
@@ -47,7 +47,7 @@
@SpecAssertion(section = "3.2.5", id = "e")
public void testNewBeanIsOfStandardDeploymentType()
{
- Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert Standard.class.equals(newSimpleBean.getDeploymentType());
@@ -57,7 +57,7 @@
@SpecAssertion(section = "3.2.5", id = "f")
public void testNewBeanHasOnlyNewBinding()
{
- Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert newSimpleBean.getBindings().size() == 1;
@@ -68,7 +68,7 @@
@SpecAssertion(section = "3.2.5", id = "g")
public void testNewBeanHasNoWebBeanName()
{
- Set<Bean<ExplicitContructorSimpleBean>> beans = getCurrentManager().getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
+ Set<Bean<ExplicitContructorSimpleBean>> beans = getBeans(ExplicitContructorSimpleBean.class, new NewLiteral());
assert beans.size() == 1;
Bean<ExplicitContructorSimpleBean> newSimpleBean = beans.iterator().next();
assert newSimpleBean.getName() == null;
@@ -78,10 +78,10 @@
@SpecAssertion(section = "3.2.5", id = "h")
public void testNewBeanHasNoStereotypes()
{
- Bean<Fox> foxBean = getCurrentManager().getBeans(Fox.class).iterator().next();
+ Bean<Fox> foxBean = getBeans(Fox.class).iterator().next();
assert foxBean.getScopeType().equals(RequestScoped.class);
assert foxBean.getName().equals("fox");
- Bean<Fox> newFoxBean = getCurrentManager().getBeans(Fox.class, new NewLiteral()).iterator().next();
+ Bean<Fox> newFoxBean = getBeans(Fox.class, new NewLiteral()).iterator().next();
assert newFoxBean.getScopeType().equals(Dependent.class);
assert newFoxBean.getName() == null;
}
@@ -104,10 +104,10 @@
@Override
protected void execute() throws Exception
{
- Fox fox = getCurrentManager().getInstanceByType(Fox.class);
- Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new NewLiteral());
+ Fox fox = getInstanceByType(Fox.class);
+ Fox newFox = getInstanceByType(Fox.class,new NewLiteral());
newFox.setDen(new Den("NewFoxDen"));
- Den theOnlyDen = getCurrentManager().getInstanceByType(Den.class);
+ Den theOnlyDen = getInstanceByType(Den.class);
assert theOnlyDen.getName().equals(fox.getDen().getName());
}
@@ -125,11 +125,11 @@
@Override
protected void execute() throws Exception
{
- Fox fox = getCurrentManager().getInstanceByType(Fox.class);
- Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new NewLiteral());
+ Fox fox = getInstanceByType(Fox.class);
+ Fox newFox = getInstanceByType(Fox.class,new NewLiteral());
fox.setNextLitterSize(3);
newFox.setNextLitterSize(5);
- Litter theOnlyLitter = getCurrentManager().getInstanceByType(Litter.class);
+ Litter theOnlyLitter = getInstanceByType(Litter.class);
assert theOnlyLitter.getQuantity() == fox.getNextLitterSize();
}
@@ -146,10 +146,10 @@
@Override
protected void execute() throws Exception
{
- Fox fox = getCurrentManager().getInstanceByType(Fox.class);
- Fox newFox = getCurrentManager().getInstanceByType(Fox.class, new NewLiteral());
- Bean<Litter> litterBean = getCurrentManager().getBeans(Litter.class).iterator().next();
- Litter litter = getCurrentManager().getInstanceByType(Litter.class);
+ Fox fox = getInstanceByType(Fox.class);
+ Fox newFox = getInstanceByType(Fox.class,new NewLiteral());
+ Bean<Litter> litterBean = getBeans(Litter.class).iterator().next();
+ Litter litter = getInstanceByType(Litter.class);
destroyAndRemoveBeanInstance(litterBean, litter);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
@@ -179,18 +179,18 @@
assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().size() == 2;
assert getCurrentManager().getBeans(Order.class).iterator().next().getBindings().contains(new CurrentLiteral());
- assert getCurrentManager().getBeans(Order.class, new NewLiteral()).size() == 1;
- assert getCurrentManager().getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
- assert getCurrentManager().getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
+ assert getBeans(Order.class, new NewLiteral()).size() == 1;
+ assert getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
+ assert getBeans(Order.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).size() == 1;
assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().size() == 2;
assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().contains(TAME_LITERAL);
assert getCurrentManager().getBeans(Lion.class, TAME_LITERAL).iterator().next().getBindings().contains(new AnyBinding());
- assert getCurrentManager().getBeans(Lion.class, new NewLiteral()).size() == 1;
- assert getCurrentManager().getBeans(Lion.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
- assert getCurrentManager().getBeans(Lion.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
+ assert getBeans(Lion.class, new NewLiteral()).size() == 1;
+ assert getBeans(Lion.class, new NewLiteral()).iterator().next().getBindings().size() == 1;
+ assert getBeans(Lion.class, new NewLiteral()).iterator().next().getBindings().iterator().next().annotationType().equals(New.class);
}
@Test(groups = { "new" })
@@ -198,8 +198,8 @@
public void testNewBeanHasSameConstructor()
{
ExplicitContructorSimpleBean.setConstructorCalls(0);
- ExplicitContructorSimpleBean bean = getCurrentManager().getInstanceByType(ExplicitContructorSimpleBean.class);
- ExplicitContructorSimpleBean newBean = getCurrentManager().getInstanceByType(ExplicitContructorSimpleBean.class, new NewLiteral());
+ ExplicitContructorSimpleBean bean = getInstanceByType(ExplicitContructorSimpleBean.class);
+ ExplicitContructorSimpleBean newBean = getInstanceByType(ExplicitContructorSimpleBean.class,new NewLiteral());
assert bean != newBean;
assert ExplicitContructorSimpleBean.getConstructorCalls() == 2;
}
@@ -209,9 +209,9 @@
public void testNewBeanHasSameInitializers()
{
InitializerSimpleBean.setInitializerCalls(0);
- InitializerSimpleBean bean = getCurrentManager().getInstanceByType(InitializerSimpleBean.class);
+ InitializerSimpleBean bean = getInstanceByType(InitializerSimpleBean.class);
bean.businessMethod(); // Cause proxy to initialize the bean
- InitializerSimpleBean newBean = getCurrentManager().getInstanceByType(InitializerSimpleBean.class, new NewLiteral());
+ InitializerSimpleBean newBean = getInstanceByType(InitializerSimpleBean.class,new NewLiteral());
assert bean != newBean;
assert InitializerSimpleBean.getInitializerCalls() == 2;
}
@@ -220,8 +220,8 @@
@SpecAssertion(section = "3.2.5", id = "bc")
public void testNewBeanHasSameInjectedFields()
{
- Bean<InitializerSimpleBean> simpleBean = getCurrentManager().getBeans(InitializerSimpleBean.class).iterator().next();
- Bean<InitializerSimpleBean> newSimpleBean = getCurrentManager().getBeans(InitializerSimpleBean.class, new NewLiteral()).iterator().next();
+ Bean<InitializerSimpleBean> simpleBean = getBeans(InitializerSimpleBean.class).iterator().next();
+ Bean<InitializerSimpleBean> newSimpleBean = getBeans(InitializerSimpleBean.class, new NewLiteral()).iterator().next();
assert !newSimpleBean.getInjectionPoints().isEmpty();
assert simpleBean.getInjectionPoints().equals(newSimpleBean.getInjectionPoints());
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -49,7 +49,7 @@
@SpecAssertion(section = "6.4", id = "b")
public void testInjectionOfEjbs()
{
- Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
+ Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
assert !simpleBean.isMyEjbExists() : "Ejb was injected too early";
assert simpleBean.getMyEjb() != null : "Ejb was not injected into bean";
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -37,7 +37,7 @@
})
public void testInjectionOfPersistenceContext()
{
- Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
+ Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
EntityManager entityManager = simpleBean.getPersistenceContext();
assert !simpleBean.isPersistenceContextExistsDuringConstruction() : "Persistence context injected too early";
@@ -49,7 +49,7 @@
public void testInjectionOfPersistenceUnit()
{
//TODO There is no spec assertion for this test and it does not work, but there is bean support for persistence units
- Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
+ Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
EntityManagerFactory entityManagerFactory = simpleBean.getPersistenceUnit();
assert !simpleBean.isPersistenceUnitExistsDuringConstruction() : "Persistence unit injected too early";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -22,7 +22,7 @@
@SpecAssertion(section = "6.4", id = "d")
public void testInjectionOfResource()
{
- Bean<SimpleBean> simpleBeanBean = getCurrentManager().getBeans(SimpleBean.class).iterator().next();
+ Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
BeanManager beanManager = simpleBean.getManager();
assert !simpleBean.isManagerInjected() : "Manager injected too early";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/realization/RealizationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -33,16 +33,16 @@
@SpecAssertion(section = "4.4.1", id = "ca")
public void testRealizedBeanWithProducerMethodHasSameScope()
{
- assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
+ assert getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.4.1", id = "ca")
public void testRealizedBeanWithProducerMethodHasDeploymentTypeOfRealizingClass()
{
- assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(CowDung.class, SMELLY_LITERAL).size() == 1;
+ assert getBeans(CowDung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test
@@ -68,24 +68,24 @@
@SpecAssertion(section = "4.4.1", id = "ca")
public void testRealizedBeanWithProducerMethodHasSameStereotypes()
{
- assert getCurrentManager().getBeans(Dog.class).size() == 1;
- assert getCurrentManager().getBeans(Dog.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(Dog.class).size() == 1;
+ assert getBeans(Dog.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.4.1", id = "cb")
public void testRealizedBeanWithProducerFieldHasSameScope()
{
- assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
+ assert getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test
@SpecAssertion(section = "4.4.1", id = "cb")
public void testRealizedBeanWithProducerFieldHasDeploymentTypeOfRealizingClass()
{
- assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert getBeans(HorseDung.class, SMELLY_LITERAL).size() == 1;
+ assert getBeans(HorseDung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test
@@ -111,8 +111,8 @@
@SpecAssertion(section = "4.4.1", id = "cb")
public void testRealizedBeanWithProducerFieldHasSameStereotypes()
{
- assert getCurrentManager().getBeans(Donkey.class).size() == 1;
- assert getCurrentManager().getBeans(Donkey.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert getBeans(Donkey.class).size() == 1;
+ assert getBeans(Donkey.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test(groups = "stub")
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationIntegrationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -37,7 +37,7 @@
@Override
protected void execute() throws Exception
{
- FarmerLocal farmer = getCurrentManager().getInstanceByType(FarmerLocal.class, LANDOWNER_LITERAL);
+ FarmerLocal farmer = getInstanceByType(FarmerLocal.class,LANDOWNER_LITERAL);
assert farmer.getClassName().equals(LazyFarmer.class.getName());
}
@@ -55,8 +55,8 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getBeans(Waste.class).size() == 1;
- assert getCurrentManager().getInstanceByType(Waste.class).getFrom().equals(Office.class.getName());
+ assert getBeans(Waste.class).size() == 1;
+ assert getInstanceByType(Waste.class).getFrom().equals(Office.class.getName());
}
}.run();
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -36,7 +36,7 @@
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
- Bean<FarmerLocal> bean = getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next();
+ Bean<FarmerLocal> bean = getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next();
assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmerLocal.class);
assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 3;
assert annotationSetMatches( getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class, Any.class);
@@ -49,9 +49,9 @@
})
public void testSpecializingBeanHasNameOfSpecializedBean()
{
- assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmerLocal.class);
- assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getName().equals("farmer");
+ assert getBeans(FarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
+ assert getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmerLocal.class);
+ assert getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getName().equals("farmer");
}
@Test(groups={"stub", "specialization"},expectedExceptions=DefinitionException.class)
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -42,8 +42,8 @@
})
public void testSpecializingBeanHasNameOfSpecializedBean()
{
- assert getCurrentManager().getBeans(Product.class, new AnnotationLiteral<Sparkly>(){}).size() == 1;
- assert getCurrentManager().getBeans(Product.class, new AnnotationLiteral<Sparkly>(){}).iterator().next().getName().equals("expensiveGift");
+ assert getBeans(Product.class, new AnnotationLiteral<Sparkly>(){}).size() == 1;
+ assert getBeans(Product.class, new AnnotationLiteral<Sparkly>(){}).iterator().next().getName().equals("expensiveGift");
}
@Test
@@ -59,7 +59,7 @@
@Override
protected void execute() throws Exception
{
- Product product = getCurrentManager().getInstanceByType(Product.class, EXPENSIVE_LITERAL);
+ Product product = getInstanceByType(Product.class,EXPENSIVE_LITERAL);
assert product instanceof Necklace;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -34,8 +34,8 @@
})
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
- assert getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
- Bean<?> bean = getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next();
+ assert getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
+ Bean<?> bean = getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next();
assert bean.getTypes().contains(LazyFarmer.class);
assert bean.getBindings().size() == 3;
assert annotationSetMatches(bean.getBindings(), Landowner.class, Lazy.class, Any.class);
@@ -48,9 +48,9 @@
})
public void testSpecializingBeanHasNameOfSpecializedBean()
{
- assert getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmer.class);
- assert "farmer".equals(getCurrentManager().getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next().getName());
+ assert getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
+ assert getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmer.class);
+ assert "farmer".equals(getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next().getName());
}
@Test
@@ -66,7 +66,7 @@
@Override
protected void execute() throws Exception
{
- Farmer farmer = getCurrentManager().getInstanceByType(Farmer.class, LANDOWNER_LITERAL);
+ Farmer farmer = getInstanceByType(Farmer.class,LANDOWNER_LITERAL);
assert farmer.getClassName().equals(LazyFarmer.class.getName());
}
@@ -84,8 +84,8 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getBeans(Waste.class).size() == 1;
- assert getCurrentManager().getInstanceByType(Waste.class).getFrom().equals(Office.class.getName());
+ assert getBeans(Waste.class).size() == 1;
+ assert getInstanceByType(Waste.class).getFrom().equals(Office.class.getName());
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/InstantiationByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/InstantiationByNameTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/InstantiationByNameTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -37,8 +37,8 @@
protected void execute() throws Exception
{
assert getCurrentManager().getBeans("nonexistant").size() == 0;
- assert getCurrentManager().getInstanceByName("nonexistant") == null;
- assert getCurrentManager().getInstanceByName("salmon") instanceof Salmon;
+ assert getInstanceByName("nonexistant") == null;
+ assert getInstanceByName("salmon") instanceof Salmon;
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/DuplicateNameResolutionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -49,7 +49,7 @@
protected void execute() throws Exception
{
assert getCurrentManager().getBeans("whitefish").size() == 2;
- getCurrentManager().getInstanceByName("whitefish");
+ getInstanceByName("whitefish");
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -9,6 +9,8 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
+import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
+
/**
*
* Spec version: PRD2
@@ -22,7 +24,7 @@
@SpecAssertion(section = "5.4", id = "b")
public void testClientProxyUsedForNormalScope()
{
- Tuna tuna = getCurrentManager().getInstanceByType(Tuna.class);
+ Tuna tuna = getInstanceByType(Tuna.class);
assert getCurrentConfiguration().getBeans().isProxy(tuna);
}
@@ -36,8 +38,8 @@
@Override
protected void execute() throws Exception
{
- Bean<Fox> foxBean = getCurrentManager().getBeans(Fox.class).iterator().next();
- Fox fox = getCurrentManager().getInstance(foxBean);
+ Bean<Fox> foxBean = getBeans(Fox.class).iterator().next();
+ Fox fox = (Fox) getCurrentManager().getReference(foxBean,Fox.class);
assert !getCurrentConfiguration().getBeans().isProxy(fox);
}
@@ -48,7 +50,7 @@
@SpecAssertion(section = "5.4", id = "c")
public void testSimpleWebBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException
{
- TunedTuna tuna = getCurrentManager().getInstanceByType(TunedTuna.class);
+ TunedTuna tuna = getInstanceByType(TunedTuna.class);
assert getCurrentConfiguration().getBeans().isProxy(tuna);
byte[] bytes = serialize(tuna);
tuna = (TunedTuna) deserialize(bytes);
@@ -60,8 +62,8 @@
@SpecAssertion(section = "5.4.2", id = "a")
public void testClientProxyInvocation()
{
- Bean<TunedTuna> tunaBean = getCurrentManager().getBeans(TunedTuna.class).iterator().next();
- TunedTuna tuna = getCurrentManager().getInstance(tunaBean);
+ Bean<TunedTuna> tunaBean = getBeans(TunedTuna.class).iterator().next();
+ TunedTuna tuna = (TunedTuna) getCurrentManager().getReference(tunaBean, TunedTuna.class);
assert getCurrentConfiguration().getBeans().isProxy(tuna);
assert tuna.getState().equals("tuned");
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -84,7 +84,7 @@
})
public void testGetInstanceToInjectReturnsContextualInstance() throws Exception
{
- Bean<Vanilla> vanillaBean = getCurrentManager().getBeans(Vanilla.class).iterator().next();
+ Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
@@ -98,7 +98,7 @@
@SpecAssertion(section = "5.7.1", id = "e")
public void testGetInstanceToInjectThrowsUnsatisfiedDependencyException() throws Exception
{
- Bean<Vanilla> vanillaBean = getCurrentManager().getBeans(Vanilla.class).iterator().next();
+ Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
@@ -112,7 +112,7 @@
@SpecAssertion(section = "5.7.1", id = "f")
public void testGetInstanceToInjectThrowsAmbiguousDependencyException() throws Exception
{
- Bean<Vanilla> vanillaBean = getCurrentManager().getBeans(Vanilla.class).iterator().next();
+ Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
@@ -125,7 +125,7 @@
@SpecAssertion(section = "5.7.1", id = "g")
public void testGetInstanceToInjectThrowsUnproxyableDependencyException() throws Exception
{
- final Bean<Mustard> bean = getCurrentManager().getBeans(Mustard.class).iterator().next();
+ final Bean<Mustard> bean = getBeans(Mustard.class).iterator().next();
final Set<Annotation> bindings = new HashSet<Annotation>();
bindings.add(new OtherLiteral());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -28,9 +28,10 @@
public void testObtainsInjectsInstanceOfInstance()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
- getCurrentManager().getBeans(ObtainsInjectionPointBean.class).iterator().next();
+ getBeans(ObtainsInjectionPointBean.class).iterator().next();
- ObtainsInjectionPointBean injectionPoint = getCurrentManager().getInstance(injectionPointBean);
+ ObtainsInjectionPointBean injectionPoint = (ObtainsInjectionPointBean)
+ getCurrentManager().getReference(injectionPointBean,ObtainsInjectionPointBean.class);
assert injectionPoint.getPaymentProcessor() instanceof Instance;
}
@@ -43,9 +44,10 @@
public void testDynamicLookup()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
- getCurrentManager().getBeans(ObtainsInjectionPointBean.class).iterator().next();
+ getBeans(ObtainsInjectionPointBean.class).iterator().next();
- ObtainsInjectionPointBean injectionPoint = getCurrentManager().getInstance(injectionPointBean);
+ ObtainsInjectionPointBean injectionPoint = (ObtainsInjectionPointBean)
+ getCurrentManager().getReference( injectionPointBean, ObtainsInjectionPointBean.class);
assert injectionPoint.getPaymentProcessor().get() instanceof ChequePaymentProcessor;
}
@@ -54,9 +56,10 @@
public void testDuplicateBindingsThrowsException()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
- getCurrentManager().getBeans(ObtainsInjectionPointBean.class).iterator().next();
+ getBeans(ObtainsInjectionPointBean.class).iterator().next();
- ObtainsInjectionPointBean injectionPoint = getCurrentManager().getInstance(injectionPointBean);
+ ObtainsInjectionPointBean injectionPoint = (ObtainsInjectionPointBean)
+ getCurrentManager().getReference(injectionPointBean,ObtainsInjectionPointBean.class);
injectionPoint.getPaymentProcessor().get(new PayByBinding() { public PaymentMethod value() { return CHEQUE; }});
}
@@ -65,9 +68,10 @@
public void testNonBindingThrowsException()
{
Bean<ObtainsInjectionPointBean> injectionPointBean =
- getCurrentManager().getBeans(ObtainsInjectionPointBean.class).iterator().next();
+ getBeans(ObtainsInjectionPointBean.class).iterator().next();
- ObtainsInjectionPointBean injectionPoint = getCurrentManager().getInstance(injectionPointBean);
+ ObtainsInjectionPointBean injectionPoint = (ObtainsInjectionPointBean)
+ getCurrentManager().getReference(injectionPointBean,ObtainsInjectionPointBean.class);
injectionPoint.getPaymentProcessor().get(new NonBinding() );
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -47,7 +47,7 @@
public void testContextCreatesNewInstanceForInjection()
{
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
- Bean<Tuna> tunaBean = getCurrentManager().getBeans(Tuna.class).iterator().next();
+ Bean<Tuna> tunaBean = getBeans(Tuna.class).iterator().next();
assert requestContext.get(tunaBean) == null;
TunaFarm tunaFarm = getCurrentConfiguration().getEl().evaluateValueExpression("#{tunaFarm}", TunaFarm.class);
assert tunaFarm.tuna != null;
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -22,8 +22,8 @@
@SpecAssertion(section = "5.2", id = "aa")
public void testInjectionPerformsBoxingIfNecessary() throws Exception
{
- assert getCurrentManager().getBeans(SpiderNest.class).size() == 1;
- SpiderNest spiderNest = getCurrentManager().getInstanceByType(SpiderNest.class);
+ assert getBeans(SpiderNest.class).size() == 1;
+ SpiderNest spiderNest = getInstanceByType(SpiderNest.class);
assert spiderNest.numberOfSpiders != null;
assert spiderNest.numberOfSpiders.equals(4);
}
@@ -32,8 +32,8 @@
@SpecAssertion(section = "5.3", id = "a")
public void testInvokeNormalInjectedWebBeanWhenContextNotActive()
{
- assert getCurrentManager().getBeans(TunaFarm.class).size() == 1;
- TunaFarm tunaFarm = getCurrentManager().getInstanceByType(TunaFarm.class);
+ assert getBeans(TunaFarm.class).size() == 1;
+ TunaFarm tunaFarm = getInstanceByType(TunaFarm.class);
assert tunaFarm.tuna != null;
getCurrentConfiguration().getContexts().setInactive(getCurrentConfiguration().getContexts().getRequestContext());
tunaFarm.tuna.getName();
@@ -43,8 +43,8 @@
@SpecAssertion(section = "5.3", id = "b")
public void testInvokeDependentScopeWhenContextNotActive()
{
- assert getCurrentManager().getBeans(FoxRun.class).size() == 1;
- FoxRun foxRun = getCurrentManager().getInstanceByType(FoxRun.class);
+ assert getBeans(FoxRun.class).size() == 1;
+ FoxRun foxRun = getInstanceByType(FoxRun.class);
assert foxRun.fox.getName().equals("gavin");
}
@@ -57,7 +57,7 @@
@Override
protected void execute() throws Exception
{
- DeluxeHenHouse henHouse = getCurrentManager().getInstanceByType(DeluxeHenHouse.class);
+ DeluxeHenHouse henHouse = getInstanceByType(DeluxeHenHouse.class);
assert henHouse.fox != null;
assert henHouse.fox.getName().equals("gavin");
}
@@ -73,7 +73,7 @@
@Override
protected void execute() throws Exception
{
- MegaPoorHenHouse henHouse = getCurrentManager().getInstanceByType(MegaPoorHenHouse.class);
+ MegaPoorHenHouse henHouse = getInstanceByType(MegaPoorHenHouse.class);
assert henHouse.fox != null;
assert henHouse.fox.getName().equals("gavin");
}
@@ -84,16 +84,16 @@
@SpecAssertion(section = "3.8", id = "aa")
public void testInjectingStaticField()
{
- assert getCurrentManager().getBeans(BeanWithStaticBoundField_Broken.class).size() == 1;
- assert getCurrentManager().getInstanceByType(BeanWithStaticBoundField_Broken.class).tuna == null;
+ assert getBeans(BeanWithStaticBoundField_Broken.class).size() == 1;
+ assert getInstanceByType(BeanWithStaticBoundField_Broken.class).tuna == null;
}
@Test(groups = {"injection", "underInvestigation"})
@SpecAssertion(section = "3.8", id = "ab")
public void testInjectingFinalField()
{
- assert getCurrentManager().getBeans(BeanWithFinalBoundField_Broken.class).size() == 1;
- assert getCurrentManager().getInstanceByType(BeanWithFinalBoundField_Broken.class).tuna == null;
+ assert getBeans(BeanWithFinalBoundField_Broken.class).size() == 1;
+ assert getInstanceByType(BeanWithFinalBoundField_Broken.class).tuna == null;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/EnterpriseBeanInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/EnterpriseBeanInjectionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/EnterpriseBeanInjectionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -28,8 +28,8 @@
@Override
protected void execute() throws Exception
{
- Bean<HenHouseLocal> bean = getCurrentManager().getBeans(HenHouseLocal.class).iterator().next();
- HenHouseLocal henHouse = getCurrentManager().getInstance(bean);
+ Bean<HenHouseLocal> bean = getBeans(HenHouseLocal.class).iterator().next();
+ HenHouseLocal henHouse = getCurrentManager().getContext(bean.getScopeType()).get(bean);
assert henHouse.getFox() != null;
assert henHouse.getFox().getName().equals("gavin");
}
@@ -45,8 +45,8 @@
@Override
protected void execute() throws Exception
{
- Bean<HenHouseLocal> bean = getCurrentManager().getBeans(HenHouseLocal.class, new MegaPoorBinding()).iterator().next();
- HenHouseLocal henHouse = getCurrentManager().getInstance(bean);
+ Bean<HenHouseLocal> bean = getBeans(HenHouseLocal.class, new MegaPoorBinding()).iterator().next();
+ HenHouseLocal henHouse = getCurrentManager().getContext(bean.getScopeType()).get(bean);
assert henHouse.getFox() != null;
assert henHouse.getFox().getName().equals("gavin");
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -60,11 +60,11 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
- Set<Bean<FieldInjectionPointBean>> resolvedBeans = getCurrentManager().getBeans(FieldInjectionPointBean.class);
+ Set<Bean<FieldInjectionPointBean>> resolvedBeans = getBeans(FieldInjectionPointBean.class);
assert resolvedBeans.size() == 1;
assert beanWithInjectionPoint.getInjectedMetadata().getBean().equals(resolvedBeans.iterator().next());
}
@@ -82,7 +82,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert beanWithInjectionPoint.getInjectedMetadata().getType().equals(BeanWithInjectionPointMetadata.class);
@@ -101,7 +101,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
Set<Annotation> bindingTypes = beanWithInjectionPoint.getInjectedMetadata().getBindings();
@@ -122,7 +122,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert Field.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
@@ -141,7 +141,7 @@
@Override
protected void execute() throws Exception
{
- MethodInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(MethodInjectionPointBean.class, new CurrentLiteral());
+ MethodInjectionPointBean beanWithInjectedBean = getInstanceByType(MethodInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert Method.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
@@ -165,7 +165,7 @@
@Override
protected void execute() throws Exception
{
- ConstructorInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(ConstructorInjectionPointBean.class, new CurrentLiteral());
+ ConstructorInjectionPointBean beanWithInjectedBean = getInstanceByType(ConstructorInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert Constructor.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getMember().getClass());
@@ -189,7 +189,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert beanWithInjectionPoint.getInjectedMetadata().getAnnotation(AnimalStereotype.class) != null;
@@ -208,7 +208,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
Set<Annotation> annotations = new HashSet<Annotation>(Arrays.asList(beanWithInjectionPoint.getInjectedMetadata().getAnnotations()));
@@ -232,8 +232,8 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getBeans(InjectionPoint.class).size() == 1;
- assert getCurrentManager().getBeans(InjectionPoint.class).iterator().next().getDeploymentType().equals(Standard.class);
+ assert getBeans(InjectionPoint.class).size() == 1;
+ assert getBeans(InjectionPoint.class).iterator().next().getDeploymentType().equals(Standard.class);
}
}.run();
@@ -249,8 +249,8 @@
@Override
protected void execute() throws Exception
{
- assert getCurrentManager().getBeans(InjectionPoint.class).size() == 1;
- assert getCurrentManager().getBeans(InjectionPoint.class).iterator().next().getScopeType().equals(Dependent.class);
+ assert getBeans(InjectionPoint.class).size() == 1;
+ assert getBeans(InjectionPoint.class).iterator().next().getScopeType().equals(Dependent.class);
}
}.run();
@@ -269,7 +269,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert InjectionPoint.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getClass());
@@ -290,7 +290,7 @@
@Override
protected void execute() throws Exception
{
- FieldInjectionPointBean beanWithInjectedBean = getCurrentManager().getInstanceByType(FieldInjectionPointBean.class, new CurrentLiteral());
+ FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -31,7 +31,7 @@
@Override
protected void execute() throws Exception
{
- FishFarmOffice fishFarmOffice = getCurrentManager().getInstanceByType(FishFarmOffice.class);
+ FishFarmOffice fishFarmOffice = getInstanceByType(FishFarmOffice.class);
assert fishFarmOffice.beanManager != null;
}
@@ -42,14 +42,14 @@
@SpecAssertion(section = "5.7.2", id = "aa")
public void testContainerProvidesManagerBean()
{
- assert getCurrentManager().getBeans(BeanManager.class).size() > 0;
+ assert getBeans(BeanManager.class).size() > 0;
}
@Test
@SpecAssertion(section = "5.7.2", id = "ab")
public void testManagerBeanIsDependentScoped()
{
- Bean<BeanManager> beanManager = getCurrentManager().getBeans(BeanManager.class).iterator().next();
+ Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
assert beanManager.getScopeType().equals(Dependent.class);
}
@@ -57,7 +57,7 @@
@SpecAssertion(section = "5.7.2", id = "ac")
public void testManagerBeanHasStandardDeployment()
{
- Bean<BeanManager> beanManager = getCurrentManager().getBeans(BeanManager.class).iterator().next();
+ Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
assert beanManager.getDeploymentType().equals(Standard.class);
}
@@ -65,7 +65,7 @@
@SpecAssertion(section = "5.7.2", id = "ad")
public void testManagerBeanHasCurrentBinding()
{
- Bean<BeanManager> beanManager = getCurrentManager().getBeans(BeanManager.class).iterator().next();
+ Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
assert beanManager.getBindings().contains(new AnnotationLiteral<Current>(){});
}
@@ -76,7 +76,7 @@
})
public void testGetInstanceReturnsContextualInstance()
{
- Bean<FishFarmOffice> bean = getCurrentManager().getBeans(FishFarmOffice.class).iterator().next();
- assert getCurrentManager().getInstance(bean) instanceof FishFarmOffice;
+ Bean<FishFarmOffice> bean = getBeans(FishFarmOffice.class).iterator().next();
+ assert getCurrentManager().getReference(bean,FishFarmOffice.class) instanceof FishFarmOffice;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -31,8 +31,8 @@
@SpecAssertion(section = "5.12.1", id = "a")
public void testInjectionIntoSessionBeanInjectedViaEjb() throws Exception
{
- assert getCurrentManager().getBeans(VillageLocal.class).size() == 1;
- assert getCurrentManager().getInstanceByType(VillageLocal.class).getFarm().getBarn() != null;
+ assert getBeans(VillageLocal.class).size() == 1;
+ assert getInstanceByType(VillageLocal.class).getFarm().getBarn() != null;
}
@Test(groups = { "integration", "broken" })
@@ -40,8 +40,8 @@
public void testInjectionIntoSessionBeanInjectedViaResource() throws Exception
{
// Quite tough as no universal names. Need to allow these to be specified or something...
- assert getCurrentManager().getBeans(HamletLocal.class).size() == 1;
- assert getCurrentManager().getInstanceByType(HamletLocal.class).getFarm().getBarn() != null;
+ assert getBeans(HamletLocal.class).size() == 1;
+ assert getInstanceByType(HamletLocal.class).getFarm().getBarn() != null;
}
@Test(groups = { "stub", "integration" })
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/InstantiationByTypeTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -27,21 +27,21 @@
@SpecAssertion(section="5.7.2", id = "h")
public void testCurrentBindingTypeAssumed()
{
- assert getCurrentManager().getInstanceByType(Tuna.class) != null;
+ assert getInstanceByType(Tuna.class) != null;
}
@Test(groups="resolution", expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.7.2", id = "ib")
public void testParameterizedTypeWithWildcardParameter()
{
- getCurrentManager().getInstanceByType(new TypeLiteral<ParameterizedBean_Broken<?>>(){});
+ getInstanceByType(new TypeLiteral<ParameterizedBean_Broken<?>>(){});
}
@Test(groups="resolution", expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.7.2", id = "ia")
public <T> void testParameterizedTypeWithTypeParameter()
{
- getCurrentManager().getInstanceByType(new TypeLiteral<ParameterizedBean_Broken<T>>(){});
+ getInstanceByType(new TypeLiteral<ParameterizedBean_Broken<T>>(){});
}
@@ -49,27 +49,27 @@
@SpecAssertion(section="5.7.2", id = "j")
public void testDuplicateBindingTypesUsed()
{
- getCurrentManager().getInstanceByType(Tuna.class, new CurrentLiteral(), new CurrentLiteral());
+ getInstanceByType(Tuna.class,new CurrentLiteral(), new CurrentLiteral());
}
@Test(groups="resolution", expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.7.2", id = "k")
public void testNonBindingTypeUsed()
{
- getCurrentManager().getInstanceByType(Tuna.class, new AnotherDeploymentTypeLiteral());
+ getInstanceByType(Tuna.class,new AnotherDeploymentTypeLiteral());
}
@Test(expectedExceptions=AmbiguousResolutionException.class)
@SpecAssertion(section="5.7.2", id = "n")
public void testAmbiguousDependencies() throws Exception
{
- getCurrentManager().getInstanceByType(ScottishFish.class, new AnnotationLiteral<Whitefish>(){});
+ getInstanceByType(ScottishFish.class,new AnnotationLiteral<Whitefish>(){});
}
@Test(expectedExceptions=UnsatisfiedResolutionException.class)
@SpecAssertion(section="5.7.2", id = "m")
public void testUnsatisfiedDependencies() throws Exception
{
- getCurrentManager().getInstanceByType(Tuna.class, new AnnotationLiteral<FakeFish>() {});
+ getInstanceByType(Tuna.class,new AnnotationLiteral<FakeFish>() {});
}
}
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-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -9,7 +9,6 @@
import javax.enterprise.inject.spi.Bean;
import javax.inject.DefinitionException;
import javax.inject.DuplicateBindingTypeException;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -36,7 +35,7 @@
})
public void testDefaultBindingTypeAssumed() throws Exception
{
- Set<Bean<Tuna>> possibleTargets = getCurrentManager().getBeans(Tuna.class);
+ Set<Bean<Tuna>> possibleTargets = getBeans(Tuna.class);
assert possibleTargets.size() == 1;
assert possibleTargets.iterator().next().getTypes().contains(Tuna.class);
}
@@ -45,28 +44,28 @@
@SpecAssertion(section="5.9", id = "cb")
public void testParameterizedTypeWithWildcardParameter()
{
- getCurrentManager().getBeans(new TypeLiteral<ParameterizedBean_Broken<?>>(){});
+ getBeans(new TypeLiteral<ParameterizedBean_Broken<?>>(){});
}
@Test(groups="resolution", expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.9", id = "ca")
public <T> void testParameterizedTypeWithTypeParameter()
{
- getCurrentManager().getBeans(new TypeLiteral<ParameterizedBean_Broken<T>>(){});
+ getBeans(new TypeLiteral<ParameterizedBean_Broken<T>>(){});
}
@Test(groups="resolution", expectedExceptions=DuplicateBindingTypeException.class)
@SpecAssertion(section="5.9", id = "d")
public void testDuplicateBindingTypesUsed()
{
- getCurrentManager().getBeans(Tuna.class, new CurrentLiteral(), new CurrentLiteral());
+ getBeans(Tuna.class, new CurrentLiteral(), new CurrentLiteral());
}
@Test(groups="resolution", expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.9", id = "e")
public void testNonBindingTypeUsed()
{
- getCurrentManager().getBeans(Tuna.class, new AnotherDeploymentTypeLiteral());
+ getBeans(Tuna.class, new AnotherDeploymentTypeLiteral());
}
@Test(groups="resolution")
@@ -77,11 +76,11 @@
public void testResolveByType() throws Exception
{
- assert getCurrentManager().getBeans(Tuna.class, new CurrentLiteral()).size() == 1;
+ assert getBeans(Tuna.class, new CurrentLiteral()).size() == 1;
- assert getCurrentManager().getBeans(Tuna.class).size() == 1;
+ assert getBeans(Tuna.class).size() == 1;
- Set<Bean<Animal>> beans = getCurrentManager().getBeans(Animal.class, new AnnotationLiteral<FishILike>() {});
+ Set<Bean<Animal>> beans = getBeans(Animal.class, new AnnotationLiteral<FishILike>() {});
assert beans.size() == 3;
List<Class<? extends Animal>> classes = new ArrayList<Class<? extends Animal>>();
for (Bean<Animal> bean : beans)
@@ -113,7 +112,7 @@
})
public void testAllBindingTypesSpecifiedForResolutionMustAppearOnWebBean()
{
- assert getCurrentManager().getBeans(Animal.class, new ChunkyLiteral() {
+ assert getBeans(Animal.class, new ChunkyLiteral() {
public boolean realChunky()
{
@@ -121,7 +120,7 @@
}
}, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert getCurrentManager().getBeans(Animal.class, new ChunkyLiteral() {
+ assert getBeans(Animal.class, new ChunkyLiteral() {
public boolean realChunky()
{
@@ -130,9 +129,9 @@
}, new AnnotationLiteral<Whitefish>() {}).iterator().next().getTypes().contains(Cod.class);
- assert getCurrentManager().getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
+ assert getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
List<Class<? extends Animal>> classes = new ArrayList<Class<? extends Animal>>();
- for (Bean<ScottishFish> bean : getCurrentManager().getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}))
+ for (Bean<ScottishFish> bean : getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}))
{
if (bean.getTypes().contains(Cod.class))
{
@@ -155,22 +154,22 @@
})
public void testResolveByTypeWithTypeParameter() throws Exception
{
- assert getCurrentManager().getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
- assert getCurrentManager().getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}).iterator().next().getTypes().contains(ScottishFishFarmer.class);
+ assert getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
+ assert getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}).iterator().next().getTypes().contains(ScottishFishFarmer.class);
}
@Test(groups={"resolution", "producerMethod"})
@SpecAssertion(section="5.9", id = "fc")
public void testResolveByTypeWithArray() throws Exception
{
- assert getCurrentManager().getBeans(Spider[].class).size() == 1;
+ assert getBeans(Spider[].class).size() == 1;
}
@Test @SpecAssertion(section="5.9", id = "ha")
public void testOnlyHighestEnabledPrecedenceWebBeansResolved() throws Exception
{
- assert getCurrentManager().getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert getCurrentManager().getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).iterator().next().getTypes().contains(Plaice.class);
+ assert getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
+ assert getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).iterator().next().getTypes().contains(Plaice.class);
}
@@ -179,7 +178,7 @@
@SpecAssertion(section="5.9", id = "hb")
public void testNoWebBeansFound() throws Exception
{
- assert getCurrentManager().getBeans(Tuna.class, new AnnotationLiteral<FakeFish>() {}).size() == 0;
+ assert getBeans(Tuna.class, new AnnotationLiteral<FakeFish>() {}).size() == 0;
}
@Test(groups="resolution")
@@ -191,7 +190,7 @@
public void testResolveByTypeWithNonBindingMembers() throws Exception
{
- Set<Bean<Animal>> beans = getCurrentManager().getBeans(Animal.class, new ExpensiveLiteral()
+ Set<Bean<Animal>> beans = getBeans(Animal.class, new ExpensiveLiteral()
{
public int cost()
@@ -227,7 +226,7 @@
@SpecAssertion(section="5.9.1", id = "ca")
public void testArrayValuedAnnotationMemberWithoutNonBinding()
{
- getCurrentManager().getBeans(Animal.class, new BindingTypeWithBindingArrayTypeMemberLiteral_Broken() {
+ getBeans(Animal.class, new BindingTypeWithBindingArrayTypeMemberLiteral_Broken() {
public boolean[] bool()
{
@@ -241,7 +240,7 @@
@SpecAssertion(section="5.9.1", id = "cb")
public void testAnnotationValuedAnnotationMemberWithoutNonBinding()
{
- getCurrentManager().getBeans(Animal.class, new BindingTypeWithBindingAnnotationMemberLiteral_Broken()
+ getBeans(Animal.class, new BindingTypeWithBindingAnnotationMemberLiteral_Broken()
{
public Expensive expensive()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/annotationtypes/AnnotationTypesTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -23,7 +23,7 @@
public void testBindingTypeFromXML()
{
//TODO The binding type appears as a non-binding annotation in the call to resolveByType()
- assert getCurrentManager().getBeans(BeanWithBinding.class, new AnnotationLiteral<TestBindingType>(){}).size() > 0;
+ assert getBeans(BeanWithBinding.class, new AnnotationLiteral<TestBindingType>(){}).size() > 0;
}
@Test(groups = { "ri-broken", "xml" })
@@ -32,7 +32,7 @@
})
public void testInterceptorBindingTypeFromXML()
{
- BeanWithInterceptorBinding bean = getCurrentManager().getInstanceByType(BeanWithInterceptorBinding.class);
+ BeanWithInterceptorBinding bean = getInstanceByType(BeanWithInterceptorBinding.class);
assert bean != null : "Test bean not resolvable";
Object returnValue = bean.getInterceptor();
//TODO Bean method is not currently being intercepted due to lack of interceptor support in the RI
@@ -52,7 +52,7 @@
public void testStereotypeFromXML()
{
//TODO The stereotype is not being applied to this bean
- Bean<BeanWithStereotype> bean = getCurrentManager().getBeans(BeanWithStereotype.class).iterator().next();
+ Bean<BeanWithStereotype> bean = getBeans(BeanWithStereotype.class).iterator().next();
assert TestScopeType.class.isAssignableFrom(bean.getScopeType());
assert TestDeploymentType.class.isAssignableFrom(bean.getDeploymentType());
assert bean.getName() != null : "No default name for bean";
@@ -60,7 +60,7 @@
// Now check that the correct interceptor is also being applied through the
// stereotype.
- BeanWithStereotype beanWithStereotype = (BeanWithStereotype) getCurrentManager().getInstanceByName("beanWithStereotype");
+ BeanWithStereotype beanWithStereotype = (BeanWithStereotype) getInstanceByName("beanWithStereotype");
Object interceptor = beanWithStereotype.getInterceptor();
assert interceptor != null : "Bean method was not intercepted";
assert interceptor instanceof AnotherTestInterceptor : "Incorrect return type";
@@ -72,7 +72,7 @@
})
public void testBindingAnnotationOverridenByXML()
{
- assert getCurrentManager().getInstanceByType(BeanWithBindingAnnotation.class, new AnnotationLiteral<AnotherTestBindingType>(){}) != null;
+ assert getInstanceByType(BeanWithBindingAnnotation.class,new AnnotationLiteral<AnotherTestBindingType>(){}) != null;
}
@Test(groups = { "ri-broken", "xml" })
@@ -81,7 +81,7 @@
})
public void testInterceptorBindingAnnotationOverridenByXML()
{
- BeanWithAnotherInterceptorBinding bean = getCurrentManager().getInstanceByType(BeanWithAnotherInterceptorBinding.class);
+ BeanWithAnotherInterceptorBinding bean = getInstanceByType(BeanWithAnotherInterceptorBinding.class);
assert bean != null : "Test bean not resolvable";
Object returnValue = bean.getInterceptor();
//TODO Bean method is not currently being intercepted due to lack of interceptor support in the RI
@@ -96,7 +96,7 @@
public void testStereotypeAnnotationOverridenByXML()
{
//TODO The stereotype is not being applied to this bean
- Bean<BeanWithAnotherStereotype> bean = getCurrentManager().getBeans(BeanWithAnotherStereotype.class).iterator().next();
+ Bean<BeanWithAnotherStereotype> bean = getBeans(BeanWithAnotherStereotype.class).iterator().next();
assert RequestScoped.class.isAssignableFrom(bean.getScopeType());
}
@@ -107,7 +107,7 @@
})
public void testInheritedInterceptorsFromXML()
{
- InheritedInterceptorTestBean bean = getCurrentManager().getInstanceByType(InheritedInterceptorTestBean.class);
+ InheritedInterceptorTestBean bean = getInstanceByType(InheritedInterceptorTestBean.class);
InterceptorRecorder interceptorRecorder = bean.getInterceptors();
assert interceptorRecorder.containsInterceptor(InterceptorType1.class);
assert interceptorRecorder.containsInterceptor(InterceptorType2.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/deployment/DeploymentDeclarationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/deployment/DeploymentDeclarationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/declaration/deployment/DeploymentDeclarationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -2,8 +2,8 @@
import java.util.Set;
+import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -29,7 +29,7 @@
public void testDeploymentDeclaration()
{
BeanManager beanManager = getCurrentManager();
- Set<Bean<Order>> beans = beanManager.getBeans(Order.class);
+ Set<Bean<Order>> beans = getBeans(Order.class);
assert !beans.isEmpty() : "There are no registered beans of type '" + Order.class + "'";
assert beans.iterator().next().getDeploymentType().equals(TestDeploymentType.class) : "Deployment type of bean '" + Order.class.getName() + "' is not '" + TestDeploymentType.class.getName() + "'";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/metadata/XmlBasedMetadataTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -35,7 +35,7 @@
})
public void testXmlBasedMetadata()
{
- assert getCurrentManager().getBeans(Order.class).size() == 1 : "There is no one or more than one registered beans with type '" + Order.class + "'";
- assert getCurrentManager().getBeans(AnotherOrder.class).size() == 1 : "There is no one or more than one registered beans with type '" + AnotherOrder.class + "'";
+ assert getBeans(Order.class).size() == 1 : "There is no one or more than one registered beans with type '" + Order.class + "'";
+ assert getBeans(AnotherOrder.class).size() == 1 : "There is no one or more than one registered beans with type '" + AnotherOrder.class + "'";
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/NamespaceAggregationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -30,7 +30,7 @@
})
public void testNamespaceAggregation()
{
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).size() == 1;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/aggregation/multipleTypes/MultipleTypesInAggregatedNamespacesTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -31,7 +31,7 @@
})
public void testNamespaceAggregation()
{
- assert getCurrentManager().getBeans(Cow.class).size() == 1;
+ assert getBeans(Cow.class).size() == 1;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/JavaEePkgTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/JavaEePkgTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javaee/pkg/JavaEePkgTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -40,7 +40,7 @@
public void testJavaEePkg()
{
BeanManager beanManager = getCurrentManager();
- Set<Bean<Order>> beans = beanManager.getBeans(Order.class, bindings);
+ Set<Bean<Order>> beans = getBeans(Order.class, bindings);
assert beans.size() == 1;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/PrimitiveTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -50,11 +50,11 @@
@Override
protected void execute() throws Exception
{
- StringBuilder customerName = getCurrentManager().getInstanceByType(StringBuilder.class, new AnnotationLiteral<CurrentCustomerName>(){});
- StringBuilder customerAddress = getCurrentManager().getInstanceByType(StringBuilder.class, new AnnotationLiteral<CurrentCustomerAddress>(){});
+ StringBuilder customerName = getInstanceByType(StringBuilder.class,new AnnotationLiteral<CurrentCustomerName>(){});
+ StringBuilder customerAddress = getInstanceByType(StringBuilder.class,new AnnotationLiteral<CurrentCustomerAddress>(){});
customerName.append("Customer");
customerAddress.append("Address");
- ShipTo shipTo = getCurrentManager().getInstanceByType(ShipTo.class);
+ ShipTo shipTo = getInstanceByType(ShipTo.class);
assert shipTo.getName() != null;
assert shipTo.getAddress() != null;
assert shipTo.getName().equals("Customer");
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypeMemberTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -43,7 +43,7 @@
//TODO Cannot test type members since w/o 9.5 there is no defined behavior to test
public void testTypeMembers()
{
- LineItem lineItem = getCurrentManager().getInstanceByType(LineItem.class);
+ LineItem lineItem = getInstanceByType(LineItem.class);
assert lineItem.getAmount().equals(42.50d);
assert lineItem.getDescription().equals("Line item 1");
assert lineItem.getProductId().equals("prod-1");
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/namespace/javatypes/TypedParameterTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -41,7 +41,7 @@
//TODO Fix test by adding some class to the XML with a type parameter
public void testTypeParameterForEEType()
{
- PurchaseOrder purchaseOrder = getCurrentManager().getInstanceByType(PurchaseOrder.class);
+ PurchaseOrder purchaseOrder = getInstanceByType(PurchaseOrder.class);
assert purchaseOrder.getStrArr() != null;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/ejb/DeclarationOfEjbTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/ejb/DeclarationOfEjbTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/ejb/DeclarationOfEjbTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -57,7 +57,7 @@
})
public void testXMLDeclarationOfEjb()
{
- RemoteEjbInterface remoteEjbInterface = getCurrentManager().getInstanceByType(RemoteEjbInterface.class);
+ RemoteEjbInterface remoteEjbInterface = getInstanceByType(RemoteEjbInterface.class);
assert remoteEjbInterface.hello().equals("hi!");
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/persistenceContext/DeclarationOfPersistenceUnitAndContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/persistenceContext/DeclarationOfPersistenceUnitAndContextTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/persistenceContext/DeclarationOfPersistenceUnitAndContextTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -33,7 +33,7 @@
})
public void testXMLDeclarationOfPersistenceContext()
{
- EntityManager entityManager = getCurrentManager().getInstanceByType(EntityManager.class);
+ EntityManager entityManager = getInstanceByType(EntityManager.class);
assert entityManager != null : "Persistence context was not injected into bean";
assert entityManager.isOpen() : "persistence context not open injected into bean";
}
@@ -47,7 +47,7 @@
})
public void testDeclarationOfPersistenceUnit()
{
- EntityManagerFactory entityManagerFactory = getCurrentManager().getInstanceByType(EntityManagerFactory.class);
+ EntityManagerFactory entityManagerFactory = getInstanceByType(EntityManagerFactory.class);
assert entityManagerFactory != null : "Persistence unit was not injected into bean";
assert entityManagerFactory.isOpen() : "persistence unit not open injected into bean";
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/resource/DeclarationOfResourceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/resource/DeclarationOfResourceTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/resource/resource/DeclarationOfResourceTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -29,7 +29,7 @@
})
public void testXMLDeclarationOfResource()
{
- BeanManager beanManager = getCurrentManager().getInstanceByType(BeanManager.class, new AnnotationLiteral<Another>() {});
+ BeanManager beanManager = getInstanceByType(BeanManager.class,new AnnotationLiteral<Another>() {});
assert beanManager != null : "@Another Manager not found";
assert beanManager.equals(getCurrentManager()): "Wrong manager found";
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java 2009-06-04 17:22:52 UTC (rev 2764)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/schema/StandardSchemaLocationTest.java 2009-06-04 23:09:42 UTC (rev 2765)
@@ -23,7 +23,7 @@
})
public void testStandardSchemaLocation()
{
- Order order = getCurrentManager().getInstanceByType(Order.class);
+ Order order = getInstanceByType(Order.class);
assert order.getShipToAddress() != null;
assert order.getShipToAddress().equals("123 Main St., Anywhere, MA");
}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2764 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-04 13:22:52 -0400 (Thu, 04 Jun 2009)
New Revision: 2764
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBeanTest.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/mock/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java
Log:
WBRI-265
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -352,7 +352,7 @@
return ejbDescriptor;
}
- public boolean canCallRemoveMethods()
+ public boolean isClientCanCallRemoveMethods()
{
return getEjbDescriptor().isStateful() && isDependent();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.bean.proxy;
import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javassist.util.proxy.MethodHandler;
@@ -93,9 +94,16 @@
bean = manager.getBeans().get(beanIndex);
}
Object proxiedInstance = getProxiedInstance(bean);
- Object returnValue = Reflections.lookupMethod(proxiedMethod, proxiedInstance).invoke(proxiedInstance, args);
- log.trace("Executed method " + proxiedMethod + " on " + proxiedInstance + " with parameters " + args + " and got return value " + returnValue);
- return returnValue;
+ try
+ {
+ Object returnValue = Reflections.lookupMethod(proxiedMethod, proxiedInstance).invoke(proxiedInstance, args);
+ log.trace("Executed method " + proxiedMethod + " on " + proxiedInstance + " with parameters " + args + " and got return value " + returnValue);
+ return returnValue;
+ }
+ catch (InvocationTargetException e)
+ {
+ throw e.getCause();
+ }
}
private <T> T getProxiedInstance(Bean<T> bean)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -17,11 +17,14 @@
package org.jboss.webbeans.bean.proxy;
import java.lang.reflect.Method;
+import java.util.Collection;
import javassist.util.proxy.MethodHandler;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.ejb.api.SessionObjectReference;
+import org.jboss.webbeans.introspector.MethodSignature;
+import org.jboss.webbeans.introspector.jlr.MethodSignatureImpl;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.Reflections;
@@ -56,9 +59,12 @@
enterpriseBean.set(bean);
}
- final SessionObjectReference reference;
- final Class<?> objectInterface;
- boolean destroyed;
+ private final SessionObjectReference reference;
+ private final Class<?> objectInterface;
+ private final Collection<MethodSignature> removeMethodSignatures;
+ private final boolean clientCanCallRemoveMethods;
+
+ private boolean destroyed;
/**
* Constructor
@@ -71,6 +77,8 @@
{
this.destroyed = false;
this.objectInterface = bean.getEjbDescriptor().getObjectInterface();
+ this.removeMethodSignatures = bean.getEjbDescriptor().getRemoveMethodSignatures();
+ this.clientCanCallRemoveMethods = bean.isClientCanCallRemoveMethods();
try
{
setEnterpriseBean(bean);
@@ -131,6 +139,16 @@
return null;
}
+ if (!clientCanCallRemoveMethods)
+ {
+ // TODO we can certainly optimize this search algorithm!
+ MethodSignature methodSignature = new MethodSignatureImpl(method);
+ if (removeMethodSignatures.contains(methodSignature))
+ {
+ throw new UnsupportedOperationException("Cannot call EJB remove method directly on non-dependent scoped bean " + method );
+ }
+ }
+
Class<?> businessInterface = method.getDeclaringClass();
if (businessInterface.equals(Object.class))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -16,10 +16,15 @@
*/
package org.jboss.webbeans.ejb;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import org.jboss.webbeans.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.introspector.MethodSignature;
+import org.jboss.webbeans.introspector.jlr.MethodSignatureImpl;
/**
* More powerful version of {@link EjbDescriptor} that exposes Maps for some
@@ -34,6 +39,7 @@
private final Class<?> objectInterface;
private final EjbDescriptor<T> delegate;
+ private final Collection<MethodSignature> removeMethodSignatures;
public InternalEjbDescriptor(EjbDescriptor<T> ejbDescriptor)
{
@@ -47,6 +53,11 @@
{
this.objectInterface = null;
}
+ removeMethodSignatures = new ArrayList<MethodSignature>();
+ for (Method method : delegate.getRemoveMethods())
+ {
+ removeMethodSignatures.add(new MethodSignatureImpl(method));
+ }
}
@Override
@@ -60,4 +71,9 @@
return objectInterface;
}
+ public Collection<MethodSignature> getRemoveMethodSignatures()
+ {
+ return removeMethodSignatures;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ConstructorSignature.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -16,7 +16,9 @@
*/
package org.jboss.webbeans.introspector;
-public interface ConstructorSignature
+import java.io.Serializable;
+
+public interface ConstructorSignature extends Serializable
{
public String[] getParameterTypes();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/MethodSignature.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -16,7 +16,9 @@
*/
package org.jboss.webbeans.introspector;
-public interface MethodSignature
+import java.io.Serializable;
+
+public interface MethodSignature extends Serializable
{
public String getMethodName();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -16,6 +16,7 @@
*/
package org.jboss.webbeans.introspector.jlr;
+import java.lang.reflect.Method;
import java.util.Arrays;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -24,6 +25,8 @@
public class MethodSignatureImpl implements MethodSignature
{
+ private static final long serialVersionUID = 870948075030895317L;
+
private final String methodName;
private final String[] parameterTypes;
@@ -35,6 +38,16 @@
{
parameterTypes[i] = method.getParameters().get(i).getRawType().getName();
}
+ }
+
+ public MethodSignatureImpl(Method method)
+ {
+ this.methodName = method.getName();
+ this.parameterTypes = new String[method.getParameterTypes().length];
+ for (int i = 0; i < method.getParameterTypes().length; i++)
+ {
+ parameterTypes[i] = method.getParameterTypes()[i].getName();
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/remove/SessionScopedSessionBean.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.remove;
+import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.enterprise.context.SessionScoped;
@@ -7,7 +8,8 @@
@SessionScoped
public class SessionScopedSessionBean implements SessionScopedSessionInterface
{
-
+
+ @Remove
public void remove()
{
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java 2009-06-04 17:20:38 UTC (rev 2763)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -1,22 +0,0 @@
-package org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.noextend3;
-
-import javax.inject.DefinitionException;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
-import org.testng.annotations.Test;
-
-@Artifact
-(a)ExpectedDeploymentException(DefinitionException.class)
-public class SpecializingClassExtendsNonSimpleBean extends AbstractJSR299Test
-{
- @Test(groups = { "specialization", "ri-broken" })
- @SpecAssertion(section = "3.2.7", id = "d")
- public void testSpecializingClassExtendsNonSimpleBean()
- {
- assert false;
- }
-
-}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBeanTest.java (from rev 2749, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBean.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBeanTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBeanTest.java 2009-06-04 17:22:52 UTC (rev 2764)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.inheritance.specialization.simple.broken.noextend3;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class SpecializingClassExtendsNonSimpleBeanTest extends AbstractJSR299Test
+{
+ @Test(groups = { "specialization", "ri-broken" })
+ @SpecAssertion(section = "3.2.7", id = "d")
+ public void testSpecializingClassExtendsNonSimpleBean()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/SpecializingClassExtendsNonSimpleBeanTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2763 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-04 13:20:38 -0400 (Thu, 04 Jun 2009)
New Revision: 2763
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
Log:
WBRI-266
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-04 17:18:05 UTC (rev 2762)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-04 17:20:38 UTC (rev 2763)
@@ -384,12 +384,12 @@
{
if (environment.getClassBean(getAnnotatedItem().getSuperclass()) == null)
{
- throw new IllegalStateException(toString() + " does not specialize a bean");
+ throw new DefinitionException(toString() + " does not specialize a bean");
}
AbstractClassBean<?> specializedBean = environment.getClassBean(getAnnotatedItem().getSuperclass());
if (!(specializedBean instanceof SimpleBean))
{
- throw new IllegalStateException(toString() + " doesn't have a simple bean as a superclass " + specializedBean);
+ throw new DefinitionException(toString() + " doesn't have a simple bean as a superclass " + specializedBean);
}
else
{
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2762 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-04 13:18:05 -0400 (Thu, 04 Jun 2009)
New Revision: 2762
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
Log:
WBRI-255
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-04 17:17:23 UTC (rev 2761)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-04 17:18:05 UTC (rev 2762)
@@ -54,6 +54,7 @@
import org.jboss.webbeans.literal.InitializedLiteral;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.messaging.spi.JmsServices;
import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.persistence.DefaultEntityDiscovery;
import org.jboss.webbeans.persistence.PersistenceApiAbstraction;
@@ -66,6 +67,7 @@
import org.jboss.webbeans.servlet.HttpSessionManager;
import org.jboss.webbeans.servlet.ServletApiAbstraction;
import org.jboss.webbeans.transaction.spi.TransactionServices;
+import org.jboss.webbeans.ws.spi.WebServices;
import org.jboss.webbeans.xml.XmlEnvironment;
import org.jboss.webbeans.xml.XmlParser;
@@ -104,8 +106,12 @@
}
if (!getServices().contains(EjbServices.class))
{
- log.info("EJB services not available. Session beans will be simple beans, injection into non-contextual EJBs, injection of @EJB in simple beans, injection of Java EE resources and JMS resources will not be available.");
+ log.info("EJB services not available. Session beans will be simple beans, CDI-style injection into non-contextual EJBs, injection of remote EJBs and injection of @EJB in simple beans will not be available");
}
+ if (!getServices().contains(JmsServices.class))
+ {
+ log.info("JMS services not available. JMS resources will not be available.");
+ }
if (!getServices().contains(JpaServices.class))
{
log.info("JPA services not available. Injection of @PersistenceContext will not occur. Entity beans will be discovered as simple beans.");
@@ -114,6 +120,10 @@
{
log.info("@Resource injection not available.");
}
+ if (!getServices().contains(WebServices.class))
+ {
+ log.info("WebService reference injection not available.");
+ }
addImplementationServices();
createContexts();
this.manager = ManagerImpl.newRootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2761 - ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-04 13:17:23 -0400 (Thu, 04 Jun 2009)
New Revision: 2761
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/Foo.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java
Log:
WBRI-273 test
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/Foo.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/Foo.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/Foo.java 2009-06-04 17:17:23 UTC (rev 2761)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.implementation.event;
+
+public class Foo
+{
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java 2009-06-04 17:17:23 UTC (rev 2761)
@@ -0,0 +1,16 @@
+
+package org.jboss.webbeans.test.unit.implementation.event;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Any;
+import javax.event.Event;
+
+@SessionScoped
+public class NormalScopedBean implements Serializable
+{
+
+ @Any Event<Foo> event;
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2760 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-04 13:12:17 -0400 (Thu, 04 Jun 2009)
New Revision: 2760
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
Log:
WBRI-273
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-04 17:09:38 UTC (rev 2759)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-04 17:12:17 UTC (rev 2760)
@@ -87,4 +87,10 @@
return "Built-in implicit javax.event.Event bean";
}
+ @Override
+ public boolean isSerializable()
+ {
+ return true;
+ }
+
}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2759 - examples/trunk/translator/webbeans-translator-war/src/main/webapp.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-04 13:09:38 -0400 (Thu, 04 Jun 2009)
New Revision: 2759
Modified:
examples/trunk/translator/webbeans-translator-war/src/main/webapp/home.xhtml
Log:
WBRI-249
Modified: examples/trunk/translator/webbeans-translator-war/src/main/webapp/home.xhtml
===================================================================
--- examples/trunk/translator/webbeans-translator-war/src/main/webapp/home.xhtml 2009-06-04 17:06:17 UTC (rev 2758)
+++ examples/trunk/translator/webbeans-translator-war/src/main/webapp/home.xhtml 2009-06-04 17:09:38 UTC (rev 2759)
@@ -8,7 +8,7 @@
<ui:composition template="template.xhtml">
<ui:define name="content">
<h1>Translate your text into Latin!</h1>
- <h:form id="NumberGuessMain">
+ <h:form id="TranslatorMain">
<table>
<tr align="center" style="font-weight: bold" >
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2758 - examples/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-04 13:06:17 -0400 (Thu, 04 Jun 2009)
New Revision: 2758
Modified:
examples/trunk/readme.txt
Log:
WBRI-250
Modified: examples/trunk/readme.txt
===================================================================
--- examples/trunk/readme.txt 2009-06-04 15:58:03 UTC (rev 2757)
+++ examples/trunk/readme.txt 2009-06-04 17:06:17 UTC (rev 2758)
@@ -1,6 +1,15 @@
-Web Beans currently comes with two examples, webbeans-numberguess (a
-war example) and webbeans-translator (an EJB example). Before running the
-examples, you'll need to ensure your server supports Web Beans.
+Web Beans currently comes with a number of examples:
+* numberguess (a war example for JSF)
+* translator (an EJB example for JSF).
+* jsf2 (the numberguess example for JSF 2)
+* se/numberguess (the numberguess example for Java SE using Swing)
+* se/helloworld (a simple example for Java SE)
+* wicket/numberguess (the numberguess example for Wicket)
+* servlet-numberguess (the numberguess example for using on Tomcat or Jetty)
+
+Before running the examples, you'll need to ensure your
+server supports Web Beans.
+
The examples and RI are explained in detail in the reference guide, including
how to add Web Beans support to JBoss 5.
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2757 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-04 11:58:03 -0400 (Thu, 04 Jun 2009)
New Revision: 2757
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
section 6 assertions updated
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-03 23:00:24 UTC (rev 2756)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-04 15:58:03 UTC (rev 2757)
@@ -2518,6 +2518,572 @@
<text>For each distinct name that appears in the EL expression, the resolver must be called at most once. Even if a name appears more than once in the same expression, the container may not call the resolver multiple times with that name. This restriction ensures that there is a unique instance of each bean with scope |@Dependent| in any EL evaluation.</text>
</assertion>
</section>
+
+ <section id="6" title="Scopes and contexts">
+
+ </section>
+
+ <section id="6.1" title="The Contextual interface">
+ <assertion id="a">
+ <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>
+ </assertion>
+ </section>
+
+ <section id="6.1.1" title="Instance creation">
+ <assertion id="a">
+ <text>The |Contextual.create()| method is responsible for creating new contextual instances of the type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If any exception occurs while creating an instance, the exception is rethrown by the |create()| method. If the exception is a checked exception, it is wrapped and rethrown as an (unchecked) |CreationException|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The interface |javax.enterprise.context.spi.CreationalContext| provides an operation that allows the |create()| method to register an incompletely initialized contextual instance with the container. A contextual instance is considered incompletely initialized until the create() method returns the instance.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The method |push()| registers the incompletely initialized instance.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If |create()| calls |CreationalContext.push()|, it must also return the instance passed to |push()|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.1.2" title="Instance destruction">
+ <assertion id="a">
+ <text>The |Contextual.destroy()| method is responsible for destroying instances of the type. In particular, it is responsible for destroying all dependent objects of an instance, as defined in Section 6.4.3, "Dependent object destruction". If any exception occurs while destroying an instance, the exception is caught by the |destroy()| method.</text>
+ </assertion>
+ </section>
+
+ <section id="6.2" title="The Context interface">
+ <assertion id="ha">
+ <text>When a context object is active the |isActive()| method returns |true|. Otherwise, we say that the context object is inactive and the |isActive()| method returns false.</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>The |Context.get()| method may either return an existing instance of the given contextual type, ~or if no |CreationalContext| is given, return a null value, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance~.</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type~, or if no |CreationalContext| is given, return a null value, ~or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance~.</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The |Context.get()| method may either ~return an existing instance of the given contextual type, or if no |CreationalContext| is given, return a null value~, or if a |CreationalContext| is given, create a new instance of the given contextual type by calling |Contextual.create() and return the new instance.</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>If the context object is inactive, the |get()| method must throw a |ContextNotActiveException|.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The |get()| method may not return a null value unless no |CreationalContext| is given, or |Contextual.create()| returns a null value.</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>The |get()| method may not create a new instance of the given contextual type unless a |CreationalContext| is given.</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>The context object is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()|
+method of the Contextual object representing the contextual type. A destroyed instance must not subsequently be returned by the |get()| method.</text>
+ </assertion>
+ </section>
+
+ <section id="6.3" title="Normal scopes and pseudo-scopes">
+ <assertion id="a" testable="false">
+ <text>There may be no more than one mapped instance of a context object per contextual type per thread</text>
+ <note>Not testable through API</note>
+ </assertion>
+
+ <assertion id="b" testable="false">
+ <text>A context may be associated with one or more threads</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="c">
+ <text>The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a context is destroyed, all mapped instances belonging to that context are destroyed by passing them to the |Contextual.destroy()| method.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Contexts with normal scopes must obey the following rule: Suppose beans A, B and Z all have normal scopes. Suppose A has an injection point x, and B has an injection point y. Suppose further that both x and y resolve to bean Z according to the typesafe resolution algorithm. If a is the current instance of A, and b is the current instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the current instance of Z.</text>
+ </assertion>
+
+ <assertion id="f" testable="false">
+ <text>All pseudo-scopes must be explicitly declared |@ScopeType(normal=false)|, to indicate to the container that no client proxy is required</text>
+ <note>A statement of intent</note>
+ </assertion>
+
+ <assertion id="g" testable="false">
+ <text>All scopes defined by this specification, except for the |@Dependent| pseudo-scope, are normal scopes</text>
+ <note>A statement of intent</note>
+ </assertion>
+ </section>
+
+ <section id="6.4" title="Dependent pseudo-scope">
+ <assertion id="a">
+ <text>When a bean is declared to have |@Dependent| scope, no injected instance of the bean is ever shared between multiple injection points</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>When a bean is declared to have |@Dependent| scope, any injected instance of the bean is bound to the lifecycle of the bean, servlet or EJB into which it is injected</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that is used to evaluate a Unified EL expression exists to service that evaluation only</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a producer method, producer field, disposal method or observer method invocation exists to service that invocation only</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with a |CreationalContext| returns a new instance of the given bean</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with no |CreationalContext| returns a null value</text>
+ </assertion>
+ </section>
+
+ <section id="6.4.1" title="Dependent scope lifecycle">
+ <assertion id="g">
+ <text>The |@Dependent| scope is inactive except when an instance of a bean with scope |@Dependent| is created by the container to receive a producer method, producer field, disposal method or observer method invocation</text>
+ <note>Assertions g through k are all related and should be treated as "or" conditions</note>
+ </assertion>
+
+ <assertion id="h">
+ <text>The |@Dependent| scope is inactive except while a Unified EL expression is evaluated</text>
+ </assertion>
+
+ <assertion id="i">
+ <text>The |@Dependent| scope is inactive except while an observer method is invoked</text>
+ </assertion>
+
+ <assertion id="ja">
+ <text>The |@Dependent| scope is inactive except when the container is creating or destroying a contextual instance of a bean, injecting its dependencies, invoking its observer methods, or invoke its |@PostConstruct| or |@PreDestroy| callback.</text>
+ </assertion>
+
+ <assertion id="ka">
+ <text>The |@Dependent| scope is inactive except when the container is injecting dependencies or invoking the |@PostConstruct| or |@PreDestroy| callback of a Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="la">
+ <text>The |@Dependent| scope is inactive except when |Instance.get()|, |Instance.iterator()| or |BeanManager.getReference()| is invoked upon an instance of |Instance| or |BeanManager| injected by the container into a bean or other Java EE component class supporting injection.</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The |@Dependent| scope is not active when |Instance.get()|, |Instance.iterator()| or |BeanManager.getReference()| is invoked upon an instance of |Instance| or |BeanManager| that was not injected by the container.</text>
+ </assertion>
+ </section>
+
+ <section id="6.4.2" title="Dependent objects">
+ <assertion id="a">
+ <text>Instances of interceptors or decorators with scope |@Dependent| are dependent objects of the bean instance they intercept or decorate.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An instance of a bean with scope |@Dependent| injected into a field, bean constructor, initializer method or observer method is a dependent object of the bean or Java EE component class instance into which it was injected.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>An instance of a bean with scope |@Dependent| injected into a producer method or disposal method is a dependent object of the producer method bean instance that is being produced or disposed.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An instance of a bean with scope |@Dependent| obtained by direct invocation of |BeanManager| or |Instance| during invocation of a bean constructor, initializer method, observer method, |@PostConstruct| or |@PreDestroy| callback is a dependent object of the bean or Java EE component class instance upon which the method is being invoked.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>An instance of a bean with scope |@Dependent| obtained by direct invocation of |BeanManager| or |Instance| during invocation of a producer method or disposal method is a dependent object of the producer method bean instance that is being produced or disposed.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Otherwise, an instance of a bean with scope |@Dependent| obtained by direct invocation of an instance of |Instance| or |BeanManager| that was injected by the container into a bean or Java EE component class instance is a dependent object of the bean or Java EE component class instance. </text>
+ </assertion>
+ </section>
+
+ <section id="6.4.3" title="Dependent object destruction">
+ <assertion id="a">
+ <text>The container must destroy all dependent objects of a contextual bean instance when the instance is destroyed</text>
+ </assertion>
+
+ <assertion id="baa">
+ <text>The container must destroy all dependent objects of a non-contextual instance of a bean or instance of other Java EE component class when the instance is destroyed.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must destroy all |@Dependent| scoped contextual instances created during an EL expression evaluation when the evaluation completes</text>
+ </assertion>
+
+ <assertion id="da">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a producer method~, producer field, disposal method or observer method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="db">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method,~ producer field~, disposal method or observer method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="dc">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method, producer field,~ disposal method ~or observer method~ invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="dd">
+ <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method, producer field, disposal method or~ observer method invocation when the invocation completes</text>
+ </assertion>
+
+ <assertion id="e" testable="false">
+ <text>The container is permitted to destroy any |@Dependent| scoped contextual instance at any time if the instance is no Scopes and contexts longer referenced by the application (excluding weak, soft and phantom references)</text>
+ <note>In other words this is unspecified</note>
+ </assertion>
+ </section>
+
+ <section id="6.5" title="Contextual instances and contextual references">
+
+ </section>
+
+ <section id="6.5.1" title="The active context object for a scope">
+ <assertion id="a">
+ <text>From time to time, the container must obtain an active context object for a certain scope type. The container must search for an active instance of |Context| associated with the scope type. If no active context object exists for the scope type, the container throws a |ContextNotActiveException|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If more than one active context object exists for the given scope type, the container must throw an |IllegalStateException|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.2" title="Contextual instance of a bean">
+ <assertion id="a">
+ <text>From time to time, the container must obtain a contextual instance of a bean. The container must obtain the active context object for the bean scope, then obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean and an instance of |CreationalContext|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>From time to time, the container attempts to obtain a contextual instance of a bean that already exists, without creating a
+new contextual instance. The container must obtain the active context object for the bean scope, then obtain an instance of the bean by calling |Context.get()|, passing the |Bean| instance representing the bean without
+passing any instance of |CreationalContext|.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.3" title="Contextual reference for a bean">
+ <assertion id="a">
+ <text>If the bean has a normal scope and the given bean type cannot be proxied by the container, as defined in Section 5.3.1, "Unproxyable bean types", the container throws an |UnproxyableResolutionException|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If the bean has a normal scope, then the contextual reference for the bean is a client proxy, as defined in Section 5.3, "Client proxies", created by the container, that implements the given bean type and all bean types of the bean which are Java interfaces.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If the bean has a pseudo-scope, the container must obtain a contextual instance of the bean.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must ensure that every injection point of type |InjectionPoint| and binding |@Current| of any dependent object instantiated during this process receives an instance of |InjectionPoint| representing the injection point into which the dependent object will be injected, or a null value if it is not being injected into any injection point.</text>
+ </assertion>
+ </section>
+
+ <section id="6.5.4" title="Contextual reference validity">
+ <assertion id="a">
+ <text>Any reference to a bean with a normal scope is valid as long as the application maintains a hard reference to it. However, it may only be invoked when the context associated with the normal scope is active. If it is invoked when the context is inactive, a |ContextNotActiveException| is thrown by the container.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Any reference to a bean with a pseudo-scope (such as |@Dependent|) is valid until the bean instance to which it refers is
+destroyed. It may be invoked even if the context associated with the pseudo-scope is not active. If the application invokes a method of a reference to an instance that has already been destroyed, the behavior is undefined.</text>
+ </assertion>
+ </section>
+
+ <section id="6.6" title="Passivation and passivating scopes">
+
+ </section>
+
+ <section id="6.6.1" title="Passivation capable beans">
+ <assertion id="a">
+ <text>As defined by the EJB specification, all stateful session beans are passivation capable. Stateless and singleton session beans are not passivation capable.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A managed bean is passivation capable if and only if the bean class is serializable.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a return type that implements or extends serializable is passivation capable. A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a type that implements or extends serializable is passivation capable. A producer field with a type that is declared |final| and does not implement serializable is not passivation capable.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>A custom implementation of Bean is passivation capable if |isPassivationCapable()| returns true.</text>
+ </assertion>
+ </section>
+
+ <section id="6.6.2" title="Passivation capable dependencies">
+ <assertion id="a">
+ <text>The container must guarantee that all session beans are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The container must guarantee that all beans with normal scope are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The container must guarantee that all passivation capable beans with scope |@Dependent| are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The container must guarantee that all resources and message destinations are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The container must guarantee that the built-in beans of type |Instance|, |Event|, |InjectionPoint| and |BeanManager| are passivation capable dependencies.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A custom implementation of |Bean| is a passivation capable dependency if |isPassivationCapable()| returns |true| or |getScopeType()| returns a normal scope type.</text>
+ </assertion>
+ </section>
+
+ <section id="6.6.3" title="Passivating scopes">
+
+
+ </section>
+
+ <section id="6.6.4" title="Validation of passivation capable beans and dependencies">
+ <assertion id="a">
+ <text>If a managed bean which declares a passivating scope is not passivation capable, or has a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If a stateful session bean has a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a producer method declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its return type, or has a parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a producer field declares a passivating scope and the container is able to determine that it is not passivation capable by inspecting its type, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4,
+"Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a producer method or field which declares a passivating scope returns an unserializable object at runtime, the container must
+throw an |IllegalProductException|.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>If a producer method or field of scope |@Dependent| returns an unserializable object for injection into an injection point that requires a passivation capable dependency, the container must throw an |IllegalProductException|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>For a custom implementation of |Bean|, the container calls |getInjectionPoints()| to determine the injection points, and
+|InjectionPoint.isTransient()| to determine whether the injected point is a transient field.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>If a bean which declares a passivating scope type, or any stateful session bean, has a decorator which is not a passivation capable dependency, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="6.7" title="Context management for built-in scopes">
+ <assertion id="a">
+ <text>The built-in context object is active during servlet, web service and EJB invocations, or in the case of the conversation context object, for JSF requests.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.1" title="Request context lifecycle">
+ <assertion id="a">
+ <text>The request scope is active during the |service()| method of any servlet in the web application and during the |doFilter()| method of any servlet filter.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The request context is destroyed at the end of the servlet request, after the |service()| method and all |doFilter()| methods return.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The request scope is active during any Java EE web service invocation.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The request context is destroyed after the web service invocation completes.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The request scope is active during any asynchronous observer method notification.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The request context is destroyed after the notification completes</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>The request scope is active during any remote method invocation of any EJB, during any asynchronous method invocation
+of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.</text>
+ </assertion>
+
+ <assertion id="h">
+ <text>The request context is destroyed after the remote method invocation, asynchronous method invocation, timeout or message delivery completes.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.2" title="Session context lifecycle">
+ <assertion id="a">
+ <text>The session scope is active during the |service()| method of any servlet in the web application and during the |doFilter()| method of any servlet filter.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The session context is shared between all servlet requests that occur in the same HTTP servlet session. The session context is destroyed when the |HTTPSession| is invalidated or times out.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.3" title="Application context lifecycle">
+ <assertion id="a">
+ <text>The application scope is active during the |service()| method of any servlet in the web application and during the |doFilter()| method of any servlet filter.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The application scope is active during any Java EE web service invocation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The application scope is active during any asynchronous observer method notification.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The application scope is also active during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>The application context is shared between all servlet requests, asynchronous observer method notifications, web service invocations, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message driven beans that execute within the same application.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>The application context is destroyed when the application
+is undeployed.</text>
+ </assertion>
+ </section>
+
+ <section id="6.7.4" title="Conversation context lifecycle">
+ <assertion id="a">
+ <text>For a JSF faces request, the conversation context is active from the beginning of the apply request values phase, until the response is complete</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a JSF non-faces request, the context is active during the render response phase</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Any JSF request has exactly one associated conversation</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The conversation associated with a JSF request is determined at the end of the restore view phase and does not change during the request</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>By default, a conversation is transient</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>A transient conversation may be marked long-running by calling |Conversation.begin()|</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>A long-running conversation may be marked transient by calling |Conversation.end()|</text>
+ </assertion>
+
+ <assertion id="ha">
+ <text>All long-running conversations have a string-valued unique identifier, _which may be set by the application_ when the conversation is marked long-running~, or generated by the container~</text>
+ </assertion>
+
+ <assertion id="hb">
+ <text>All long-running conversations have a string-valued unique identifier, ~which may be set by the application when the conversation is marked long-running,~ or generated by the container</text>
+ </assertion>
+
+ <assertion id="iaa">
+ <text>The container provides a built-in bean with bean type |Conversation|~, scope |@RequestScoped|, deployment type |@Standard| and binding |@Current|, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="ib">
+ <text>The container provides a built-in bean with ~bean type |Conversation|~, scope |@RequestScoped|~, deployment type |@Standard| and binding |@Current|, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="ic">
+ <text>The container provides a built-in bean with~ bean type |Conversation|, scope |@RequestScoped|,~ deployment type |@Standard|~ and binding |@Current|, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="id">
+ <text>The container provides a built-in bean with bean type ~|Conversation|, scope |@RequestScoped|, deployment type |@Standard| and~ binding |@Current|~, named |javax.enterprise.context.conversation|~</text>
+ </assertion>
+
+ <assertion id="ie">
+ <text>The container provides a built-in bean with bean type ~|Conversation|, scope |@RequestScoped|, deployment type |@Standard| and binding |@Current|,~ named |javax.enterprise.context.conversation|</text>
+ </assertion>
+
+ <assertion id="j">
+ <text>If the conversation associated with the current JSF request is in the transient state at the end of a JSF request, it is destroyed, and the conversation context is also destroyed</text>
+ </assertion>
+
+ <assertion id="k">
+ <text>If the conversation associated with the current JSF request is in the long-running state at the end of a JSF request, it is not destroyed</text>
+ </assertion>
+
+ <assertion id="l">
+ <text>The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF form submission) that originates from that rendered page</text>
+ </assertion>
+
+ <assertion id="m">
+ <text>The long-running conversation context associated with a request that results in a JSF redirect (via a navigation rule) is automatically propagated to the resulting non-faces request, and to any other subsequent request to the same URL. This is accomplished via use of a GET request parameter named cid containing the unique identifier of the conversation</text>
+ </assertion>
+
+ <assertion id="n">
+ <text>The long-running conversation associated with a request may be propagated to any non-faces request via use of a GET request parameter named cid containing the unique identifier of the conversation. In this case, the application must manage this request parameter</text>
+ </assertion>
+
+ <assertion id="o">
+ <text>When no conversation is propagated to a JSF request, the request is associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="p">
+ <text>All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries</text>
+ </assertion>
+
+ <assertion id="q">
+ <text>When the HTTP servlet session is invalidated, all long-running conversation contexts created during the current session are destroyed</text>
+ </assertion>
+
+ <assertion id="r" testable="false">
+ <text>The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to conserve resources</text>
+ <note>In other words, this is unspecified</note>
+ </assertion>
+
+ <assertion id="s">
+ <text>If the propagated conversation cannot be restored, the request is associated with a new transient conversation</text>
+ </assertion>
+
+ <assertion id="t" testable="false">
+ <text>The method |Conversation.setTimeout()| is a hint to the container that a conversation should not be destroyed if it has been active within the last given interval in milliseconds</text>
+ <note>Not required</note>
+ </assertion>
+
+ <assertion id="u" testable="false">
+ <text>The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or rejecting concurrent requests</text>
+ <note>Cannot test as their as what happens is not well defined</note>
+ </assertion>
+ </section>
+
+
+
+
+
<section id="6" title="Bean lifecycle">
<assertion id="a">
@@ -2585,7 +3151,6 @@
<assertion id="d">
<text>The |Contextual.create()| method injects any dependencies</text>
</assertion>
-
<assertion id="f">
<text>The |Contextual.create()| method calls the |@PostConstruct| method, if necessary</text>
@@ -3551,137 +4116,7 @@
</section>
- <section id="8.1" title="The Context interface">
-
- <assertion id="a">
- <text>The |get()| method of the |Context| object may return an existing instance of the given contextual type</text>
- </assertion>
-
- <assertion id="b">
- <text>The |get()| method of the |Context| object may return a null value if no |CreationalContext| is given</text>
- </assertion>
-
- <assertion id="c">
- <text>The |get()| method of the |Context| object may create a new instance of the given contextual type by calling |Contextual.create()| and return the new instance, if a |CreationalContext| is given</text>
- </assertion>
-
- <assertion id="d">
- <text>The |get()| method of a |Context| object may not return a null value unless no |CreationalContext| is given, or |Contextual.create()| returns a null value</text>
- </assertion>
-
- <assertion id="e">
- <text>The |get()| method of a |Context| object may not create a new instance of the given contextual type unless a |CreationalContext| is given</text>
- </assertion>
-
- <assertion id="f">
- <text>The |Context| implementation is responsible for destroying any contextual instance it creates by passing the instance to the |destroy()| method of the |Contextual| object representing the contextual type</text>
- </assertion>
-
- <assertion id="g">
- <text>A destroyed instance must not subsequently be returned by a |Context| object's |get()| method</text>
- </assertion>
-
- <assertion id="h">
- <text>When a scope is inactive, any invocation of the |get()| from the current thread upon the |Context| object for that scope results in a |ContextNotActiveException|</text>
- </assertion>
-
- <assertion id="i">
- <text>The |isActive()| method returns false when the scope of the context object is inactive, and true when it is active</text>
- </assertion>
-
- </section>
-
- <section id="8.2" title="Normal scopes and pseudo-scopes">
- <assertion id="a" testable="false">
- <text>There may be no more than one mapped instance of a context object per contextual type per thread</text>
- <note>Not testable through API</note>
- </assertion>
-
- <assertion id="b" testable="false">
- <text>A context may be associated with one or more threads</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="c">
- <text>The |get()| operation of the |Context| object for an active normal scope returns the current instance of the given contextual type</text>
- </assertion>
-
- <assertion id="d">
- <text>When a context is destroyed, all mapped instances of contextual types with that scope are destroyed by passing them to the |Contextual.destroy()| method</text>
- </assertion>
-
- <assertion id="e">
- <text>Contexts with normal scopes must obey the following rule: Suppose beans A, B and Z all have normal scopes. Suppose A has an injection point x, and B has an injection point y. Suppose further that both x and y resolve to bean Z according to the typesafe resolution algorithm. If a is the current instance of A, and b is the current instance of B, then both a.x and b.y refer to the same instance of Z. This instance is the current instance of Z.</text>
- </assertion>
-
- <assertion id="f" testable="false">
- <text>All pseudo-scopes must be explicitly declared |@ScopeType(normal=false)|, to indicate to the container that no client proxy is required</text>
- <note>A statement of intent</note>
- </assertion>
-
- <assertion id="g" testable="false">
- <text>All scopes defined by this specification, except for the |@Dependent| pseudo-scope, are normal scopes</text>
- <note>A statement of intent</note>
- </assertion>
- </section>
-
- <section id="8.3" title="Dependent pseudo-scope">
-
- <assertion id="a">
- <text>When a bean is declared to have |@Dependent| scope, no injected instance of the bean is ever shared between multiple injection points</text>
- </assertion>
-
- <assertion id="b">
- <text>When a bean is declared to have |@Dependent| scope, any injected instance of the bean is bound to the lifecycle of the bean, servlet or EJB into which it is injected</text>
- </assertion>
-
- <assertion id="c">
- <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that is used to evaluate a Unified EL expression exists to service that evaluation only</text>
- </assertion>
-
- <assertion id="d">
- <text>When a bean is declared to have |@Dependent| scope, any instance of the bean that receives a producer method, producer field, disposal method or observer method invocation exists to service that invocation only</text>
- </assertion>
-
- <assertion id="e">
- <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with a |CreationalContext| returns a new instance of the given bean</text>
- </assertion>
-
- <assertion id="f">
- <text>Every invocation of the |get()| operation of the |Context| object for the |@Dependent| scope with no |CreationalContext| returns a null value</text>
- </assertion>
-
- <assertion id="g">
- <text>The |@Dependent| scope is inactive except when an instance of a bean with scope |@Dependent| is created by the container to receive a producer method, producer field, disposal method or observer method invocation</text>
- <note>Assertions g through k are all related and should be treated as "or" conditions</note>
- </assertion>
-
- <assertion id="h">
- <text>The |@Dependent| scope is inactive except while a Unified EL expression is evaluated</text>
- </assertion>
-
- <assertion id="i">
- <text>The |@Dependent| scope is inactive except while an observer method is invoked</text>
- </assertion>
-
- <assertion id="j">
- <text>The |@Dependent| scope is inactive except when the container is creating or destroying a contextual instance of a bean or injecting its dependencies</text>
- </assertion>
-
- <assertion id="k">
- <text>The |@Dependent| scope is inactive except when the container is injecting dependencies of an EJB</text>
- </assertion>
-
- <assertion id="l">
- <text>The |@Dependent| scope is inactive except when a |@PostConstruct| or |@PreDestroy| callback is invoked by the EJB container</text>
- </assertion>
-
- <assertion id="m">
- <text>The |@Dependent| scope is inactive except when the container is injecting dependencies of a servlet</text>
- </assertion>
-
- </section>
-
+
<section id="8.3.1" title="Dependent objects">
<assertion id="a" testable="false">
<text>A bean, EJB or servlet may obtain an instance of a bean with scope |@Dependent| via dependency injection or by calling |Manager.getInstance()|, |Manager.getInstanceByType()| or |Instance.get()| when the |@Dependent| scope is active</text>
@@ -3690,46 +4125,6 @@
</section>
- <section id="8.3.2" title="Dependent object destruction">
-
- <assertion id="a">
- <text>The container must destroy all dependent objects of a contextual bean instance when the instance is destroyed</text>
- </assertion>
-
- <assertion id="ba">
- <text>The container must destroy all dependent objects of an EJB ~or servlet~ when the EJB ~or servlet~ is destroyed</text>
- </assertion>
-
- <assertion id="bb">
- <text>The container must destroy all dependent objects of a~n EJB or~ servlet when the ~EJB or~ servlet is destroyed</text>
- </assertion>
-
- <assertion id="c">
- <text>The container must destroy all |@Dependent| scoped contextual instances created during an EL expression evaluation when the evaluation completes</text>
- </assertion>
-
- <assertion id="da">
- <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a producer method~, producer field, disposal method or observer method~ invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="db">
- <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method,~ producer field~, disposal method or observer method~ invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="dc">
- <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method, producer field,~ disposal method ~or observer method~ invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="dd">
- <text>The container must destroy any |@Dependent| scoped contextual instance created to receive a ~producer method, producer field, disposal method or~ observer method invocation when the invocation completes</text>
- </assertion>
-
- <assertion id="e" testable="false">
- <text>The container is permitted to destroy any |@Dependent| scoped contextual instance at any time if the instance is no Scopes and contexts longer referenced by the application (excluding weak, soft and phantom references)</text>
- <note>In other words this is unspecified</note>
- </assertion>
- </section>
-
<section id="8.4" title="Passivating scopes and serialization">
<assertion id="a">
<text>The container must validate that every bean declared with a passivating scope truly is serializable - EJB local objects are serializable. Therefore, a session bean may declare any passivating scope</text>
@@ -3990,118 +4385,8 @@
<assertion id="n">
<text>The application context is destroyed when the application is undeployed</text>
</assertion>
- </section>
+ </section>
- <section id="8.5.4" title="Conversation context lifecycle">
-
- <assertion id="a">
- <text>For a JSF faces request, the conversation context is active from the beginning of the apply request values phase, until the response is complete</text>
- </assertion>
-
- <assertion id="b">
- <text>For a JSF non-faces request, the context is active during the render response phase</text>
- </assertion>
-
- <assertion id="c">
- <text>Any JSF request has exactly one associated conversation</text>
- </assertion>
-
- <assertion id="d">
- <text>The conversation associated with a JSF request is determined at the end of the restore view phase and does not change during the request</text>
- </assertion>
-
- <assertion id="e">
- <text>By default, a conversation is transient</text>
- </assertion>
-
- <assertion id="f">
- <text>A transient conversation may be marked long-running by calling |Conversation.begin()|</text>
- </assertion>
-
- <assertion id="g">
- <text>A long-running conversation may be marked transient by calling |Conversation.end()|</text>
- </assertion>
-
- <assertion id="ha">
- <text>All long-running conversations have a string-valued unique identifier, _which may be set by the application_ when the conversation is marked long-running~, or generated by the container~</text>
- </assertion>
-
- <assertion id="hb">
- <text>All long-running conversations have a string-valued unique identifier, ~which may be set by the application when the conversation is marked long-running,~ or generated by the container</text>
- </assertion>
-
- <assertion id="ia">
- <text>The container provides a built-in bean with bean type |javax.context.Conversation|~, scope |@RequestScoped|, deployment type |@Standard| and binding |@Current|, named |javax.context.conversation|~</text>
- </assertion>
-
- <assertion id="ib">
- <text>The container provides a built-in bean with ~bean type |javax.context.Conversation|~, scope |@RequestScoped|~, deployment type |@Standard| and binding |@Current|, named |javax.context.conversation|~</text>
- </assertion>
-
- <assertion id="ic">
- <text>The container provides a built-in bean with~ bean type |javax.context.Conversation|, scope |@RequestScoped|,~ deployment type |@Standard|~ and binding |@Current|, named |javax.context.conversation|~</text>
- </assertion>
-
- <assertion id="id">
- <text>The container provides a built-in bean with bean type ~|javax.context.Conversation|, scope |@RequestScoped|, deployment type |@Standard| and~ binding |@Current|~, named |javax.context.conversation|~</text>
- </assertion>
-
- <assertion id="ie">
- <text>The container provides a built-in bean with bean type ~|javax.context.Conversation|, scope |@RequestScoped|, deployment type |@Standard| and binding |@Current|,~ named |javax.context.conversation|</text>
- </assertion>
-
- <assertion id="j">
- <text>If the conversation associated with the current JSF request is in the transient state at the end of a JSF request, it is destroyed, and the conversation context is also destroyed</text>
- </assertion>
-
- <assertion id="k">
- <text>If the conversation associated with the current JSF request is in the long-running state at the end of a JSF request, it is not destroyed</text>
- </assertion>
-
- <assertion id="l">
- <text>The long-running conversation context associated with a request that renders a JSF view is automatically propagated to any faces request (JSF form submission) that originates from that rendered page</text>
- </assertion>
-
- <assertion id="m">
- <text>The long-running conversation context associated with a request that results in a JSF redirect (via a navigation rule) is automatically propagated to the resulting non-faces request, and to any other subsequent request to the same URL. This is accomplished via use of a GET request parameter named cid containing the unique identifier of the conversation</text>
- </assertion>
-
- <assertion id="n">
- <text>The long-running conversation associated with a request may be propagated to any non-faces request via use of a GET request parameter named cid containing the unique identifier of the conversation. In this case, the application must manage this request parameter</text>
- </assertion>
-
- <assertion id="o">
- <text>When no conversation is propagated to a JSF request, the request is associated with a new transient conversation</text>
- </assertion>
-
- <assertion id="p">
- <text>All long-running conversations are scoped to a particular HTTP servlet session and may not cross session boundaries</text>
- </assertion>
-
- <assertion id="q">
- <text>When the HTTP servlet session is invalidated, all long-running conversation contexts created during the current session are destroyed</text>
- </assertion>
-
- <assertion id="r" testable="false">
- <text>The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to conserve resources</text>
- <note>In other words, this is unspecified</note>
- </assertion>
-
- <assertion id="s">
- <text>If the propagated conversation cannot be restored, the request is associated with a new transient conversation</text>
- </assertion>
-
- <assertion id="t" testable="false">
- <text>The method |Conversation.setTimeout()| is a hint to the container that a conversation should not be destroyed if it has been active within the last given interval in milliseconds</text>
- <note>Not required</note>
- </assertion>
-
- <assertion id="u" testable="false">
- <text>The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking or rejecting concurrent requests</text>
- <note>Cannot test as their as what happens is not well defined</note>
- </assertion>
- </section>
-
<section id="8.6" title="Context management for custom scopes">
<assertion id="a">
15 years, 7 months