[webbeans-commits] Webbeans SVN: r3319 - tck/trunk/doc/reference/en-US.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-28 15:41:58 -0400 (Tue, 28 Jul 2009)
New Revision: 3319
Modified:
tck/trunk/doc/reference/en-US/Book_Preface.xml
tck/trunk/doc/reference/en-US/configuration.xml
tck/trunk/doc/reference/en-US/executing.xml
tck/trunk/doc/reference/en-US/installation.xml
tck/trunk/doc/reference/en-US/introduction.xml
Log:
minor revisions
Modified: tck/trunk/doc/reference/en-US/Book_Preface.xml
===================================================================
--- tck/trunk/doc/reference/en-US/Book_Preface.xml 2009-07-28 19:32:32 UTC (rev 3318)
+++ tck/trunk/doc/reference/en-US/Book_Preface.xml 2009-07-28 19:41:58 UTC (rev 3319)
@@ -18,8 +18,7 @@
<para>
The CDI TCK is provide under the
- <ulink url="http://www.apache.org/licenses/LICENSE-2.0">Apache Public License 2.0</ulink>
- .
+ <ulink url="http://www.apache.org/licenses/LICENSE-2.0">Apache Public License 2.0</ulink>.
</para>
<section id="target-audience">
@@ -50,8 +49,7 @@
EE technology specification 1.0 (JSR-299). Information about the
specification, including links to the specification documents, can be
found on the
- <ulink url="http://jcp.org/en/jsr/detail?id=299">JSR-299 JCP page</ulink>
- .
+ <ulink url="http://jcp.org/en/jsr/detail?id=299">JSR-299 JCP page</ulink>.
</para>
<para>
Before running the tests in the CDI TCK, read and become
@@ -71,8 +69,8 @@
and
<xref linkend="test-harness-introduction" />
completely for the necessary background information about the TCK and
- the Test Harness purpose. Once you have reviewed that material, perform
- the steps outlined in the remaining chapters.
+ the JBoss Test Harness, respectively. Once you have reviewed that
+ material, perform the steps outlined in the remaining chapters.
</para>
<itemizedlist>
<listitem>
@@ -88,9 +86,9 @@
<listitem>
<para>
<xref linkend="installation" />
- explains where to obtain the required software and how to install
- it. It covers both the primary TCK components as well as tools
- useful for troubleshooting tests.
+ explains where to obtain the required software for the CDI TCK
+ and how to install it. It covers both the primary TCK components
+ as well as tools useful for troubleshooting tests.
</para>
</listitem>
<listitem>
@@ -139,8 +137,8 @@
includes excerpts from the JBoss Test Harness Reference Guide.
How to configure the JBoss Test Harness as it relates to the CDI
TCK is presented in
- <xref linkend="configuration" />
- however to aid in debugging or configuring the TCK in your
+ <xref linkend="configuration" />.
+ However, to aid in debugging or configuring the TCK in your
environment, you may want to read in more detail how to use the
JBoss Test Harness.
</para>
Modified: tck/trunk/doc/reference/en-US/configuration.xml
===================================================================
--- tck/trunk/doc/reference/en-US/configuration.xml 2009-07-28 19:32:32 UTC (rev 3318)
+++ tck/trunk/doc/reference/en-US/configuration.xml 2009-07-28 19:41:58 UTC (rev 3319)
@@ -26,13 +26,13 @@
</para>
<para>
System properties and/or the resource
- <code>META-INF/jboss-test-harness.properties</code>
- , a Java properties file, are used to configure the JBoss Test Harness.
+ <code>META-INF/jboss-test-harness.properties</code>,
+ a Java properties file, are used to configure the JBoss Test Harness.
You can read more about configuring the JBoss Test Harness in
- <xref linkend="test-harness-properties" />
+ <xref linkend="test-harness-properties" />.
</para>
<para>
- You should set the following properties
+ You should set the following properties:
</para>
<table frame="all">
<title />
@@ -94,7 +94,7 @@
<entry>
You should use the
<literal>ServletTestLauncher</literal>
- for Java EE6 and Java EE6 Web Profile.
+ for Java EE 6 and Java EE 6 Web Profile.
</entry>
</row>
</tbody>
@@ -102,8 +102,8 @@
</table>
<para>
To run the full TCK you must additionally implement
- <literal>org.jboss.testharness.spi.Containers</literal>
- , which handles deploying the test artifact to the container. An
+ <literal>org.jboss.testharness.spi.Containers</literal>,
+ which handles deploying the test artifact to the container. An
implementations of this API is already available for JBoss AS 5.1.
Therefore, you only need to implement this part of the porting package
if you wish to use another container.
@@ -161,8 +161,8 @@
</itemizedlist>
<para>
- Complete JavaDoc describing the requirements for implementation is
- provided.
+ Please consult the JavaDoc for these interfaces for the implementation
+ requirements.
</para>
</section>
@@ -170,12 +170,11 @@
<section>
<title>Configuring TestNG to execute the TCK</title>
<para>
- The JBoss Test Harness is built on top of TestNG, and it is TestNG that
- is responsible for selecting the tests to execute, the order of
- execution, and reporting the results. Detailed TestNG documentation can
- be found at
- <ulink url="http://testng.org/doc/documentation-main.html">testng.org</ulink>
- .
+ The JBoss Test Harness is built atop TestNG, and it's TestNG that is
+ responsible for selecting the tests to execute, the order of
+ execution, and reporting the results. Detailed TestNG documentation
+ can be found at <ulink
+ url="http://testng.org/doc/documentation-main.html">testng.org</ulink>.
</para>
<para>
The
@@ -184,15 +183,15 @@
(described by the TestNG documenation as "with a
<literal>testng.xml</literal>
file") unmodified for an implementation to pass the TCK. This file also
- allows test to be excluded from a run:
+ allows tests to be excluded from a run:
</para>
- <programlisting><![CDATA[<suite name="JSR-299 TCK" verbose="2" >
- <test name="JSR-299 TCK" >
+ <programlisting><![CDATA[<suite name="JSR-299 TCK" verbose="2">
+ <test name="JSR-299 TCK">
...
<classes>
<class name="org.jboss.jsr299.tck.tests.context.application.ApplicationContextTest">
<methods>
- <exclude name=" testApplicationScopeActiveDuringServiceMethod" />
+ <exclude name="testApplicationScopeActiveDuringServiceMethod"/>
</methods>
</class>
</classes>
@@ -201,8 +200,8 @@
</suite>]]></programlisting>
<para>
- TestNG provides extensive reporting information; depending on the
- build tool or IDE you use the reporting will take a different format.
+ TestNG provides extensive reporting information. Depending on the
+ build tool or IDE you use, the reporting will take a different format.
Please consult the TestNG documentation and the tool documentation for
more information.
</para>
@@ -211,12 +210,12 @@
<section>
<title>Configuring your build environment to execute the TCK</title>
<para>
- It is beyond the scope of this guide to describe in how to set up your
+ It's beyond the scope of this guide to describe in how to set up your
build environment to run the TCK. The JBoss Test Harness guide
- describes how to Web Beans uses Maven 2 to execute the CDI TCK. See
- <xref linkend="testsuite-runner" />
- . The TestNG provides extensive information on launching TestNG using
- the Java, ant, Eclipse or IntellJ IDEA.
+ describes how Web Beans uses Maven 2 to execute the CDI TCK. See
+ <xref linkend="testsuite-runner" />. The TestNG documentation provides
+ extensive information on launching TestNG using the Java, Ant, Eclipse
+ or IntellJ IDEA.
</para>
</section>
Modified: tck/trunk/doc/reference/en-US/executing.xml
===================================================================
--- tck/trunk/doc/reference/en-US/executing.xml 2009-07-28 19:32:32 UTC (rev 3318)
+++ tck/trunk/doc/reference/en-US/executing.xml 2009-07-28 19:41:58 UTC (rev 3319)
@@ -56,8 +56,7 @@
<para>
To execute the test suite using in-container mode with the JBoss TCK
runner, you first have to setup JBoss AS as described in
- <xref linkend="tck-in-jboss-as" />
- .
+ <xref linkend="tck-in-jboss-as" />.
</para>
<para>
Then, execute the TCK runner:
@@ -82,8 +81,7 @@
server automatically by setting the
<literal>org.jboss.testharness.container.forceRestart</literal>
to
- <literal>true</literal>
- .
+ <literal>true</literal>.
</para>
<para>
The in-container mode uses the
@@ -129,8 +127,7 @@
</para>
<para>
You can read more about this in
- <xref linkend="dumping-test-artifacts" />
- .
+ <xref linkend="dumping-test-artifacts" />.
</para>
</section>
</chapter>
Modified: tck/trunk/doc/reference/en-US/installation.xml
===================================================================
--- tck/trunk/doc/reference/en-US/installation.xml 2009-07-28 19:32:32 UTC (rev 3318)
+++ tck/trunk/doc/reference/en-US/installation.xml 2009-07-28 19:41:58 UTC (rev 3319)
@@ -15,28 +15,25 @@
which contains the TCK artifacts (the test suite binary and source,
porting package API binary and source, the test suite descriptor, the
audit source and report) in
- <code>/artifacts</code>
- , the TCK library dependencies in
+ <code>/artifacts</code>, the TCK library dependencies in
<code>/lib</code>
and documentation in
- <code>/lib</code>
- .
+ <code>/lib</code>.
</para>
<para>
You can also download the currnet source code from
- <ulink url="http://anonsvn.jboss.org/repos/webbeans/tck/trunk">JBoss SVN repository</ulink>
- .
+ <ulink url="http://anonsvn.jboss.org/repos/webbeans/tck/trunk">JBoss SVN repository</ulink>.
</para>
<para>
The TCK project is available in the JBoss Maven 2 repository as
- <code>org.jboss.jsr299.tck:jsr299-tck-impl</code>
- ; the POM defines all dependencies required to run the TCK.
+ <code>org.jboss.jsr299.tck:jsr299-tck-impl</code>; the POM defines all
+ dependencies required to run the TCK.
</para>
<para>
Executing the TCK requires a Java EE 5 or better runtime environment
(i.e., application server), to which the test artifacts are deployed
- and invoked. The TCK does not depend on any particular Java EE
- implementation.
+ and the individual tests are invoked. The TCK does not depend on any
+ particular Java EE implementation.
</para>
<para>
The JSR-299: Contexts and Dependency Injection for Java EE 1.0
@@ -106,8 +103,8 @@
<literal>@Artifact</literal>
annotation on the class). All test methods (i.e., methods annotated
with
- <literal>@Test</literal>
- ) in the test class are run in the application, meaning bean discovery
+ <literal>@Test</literal>)
+ in the test class are run in the application, meaning bean discovery
occurs exactly once per artifact and the same BeanManager is used by
each test method in the class.
</para>
@@ -134,8 +131,7 @@
<listitem>
<para>
First, you should download JBoss AS 5.1 from the JBoss AS
- <ulink url="http://jboss.org/jbossas/downloads">project page</ulink>
- .
+ <ulink url="http://jboss.org/jbossas/downloads">project page</ulink>.
</para>
</listitem>
<listitem>
@@ -203,8 +199,7 @@
TestNG will report, via Maven, the outcome of the run, and
report
any failures on the console. Details can be found in
- <code>target/surefire-reports/TestSuite.txt</code>
- .
+ <code>target/surefire-reports/TestSuite.txt</code>.
</para>
</listitem>
</itemizedlist>
@@ -212,34 +207,56 @@
</tip>
</section>
<section id="eclipse-plugins">
- <title>Eclipse plugins</title>
+ <title>Eclipse Plugins</title>
<para>
- Eclipse, or any other IDE, is not required to execute or pass the
- TCK. However an implementor may wish to execute tests in an IDE to aid
+ Eclipse, or any other IDE, is not required to execute or pass the TCK.
+ However an implementor may wish to execute tests in an IDE to aid
debugging the tests. This section introduces two essential Eclipse
- plugins and points you to resources explaining how to install them.
+ plugins, TestNG and Maven 2, and points you to resources explaining
+ how to install them.
</para>
+ <section id="eclipse-testng-plugin">
+ <title>TestNG Plugin</title>
+ <para>
+ The TCK is built on the JBoss Test Harness, which is in turn built on
+ TestNG. Therefore, having the TestNG plugin installed in Eclipse is
+ essential. Instructions for using the TestNG update site to add the
+ TestNG plugin to Eclipse are provided on the TestNG
+ <ulink url="http://testng.org/doc/download.html">download page</ulink>.
+ You can find a tutorial that explains how to use the TestNG plugin on
+ the TestNG
+ <ulink url="http://testng.org/doc/eclipse.html">Eclipse page</ulink>.
+ </para>
+ </section>
+ <section id="m2eclipse-plugin">
+ <title>Maven 2 Plugin (m2eclipse)</title>
+ <para>
+ Another useful plugin is m2eclipse. Both the TCK project and Web Beans
+ are use Maven 2. Therefore, to work with these projects in Eclipse, you
+ may wish to have native support for Maven 2 projects, which the m2eclipse
+ plugin provides. Instructions for using the m2eclipse update site to
+ add the m2eclipse plugin to Eclipse are provided on the m2eclipse home
+ page. For more, read the m2eclipse
+ <ulink url="http://www.sonatype.com/books/m2eclipse-book/reference">reference guide</ulink>.
+ </para>
+ <para>
+ m2eclipse is still a rather young project dealing with a complex
+ domain and you may run into problems using it. If that is the case,
+ you can alternatively use the Eclipse plugin for Maven 2 to
+ generate native Eclipse projects from Maven 2 projects.
+ </para>
+ <para>
+ If you have Maven 2 installed, you have everything you need. Just
+ execute the following command from any Maven 2 project to produce
+ the Eclipse project files.
+ </para>
+ <programlisting>mvn eclipse:eclipse</programlisting>
+ </section>
<para>
- The TCK is built on the JBoss Test Harness, which is in turn built on
- TestNG. Therefore, having the TestNG plugin installed in Eclipse is
- essential. Instructions for using the TestNG update site to add the
- TestNG plugin to Eclipse are provided on the TestNG
- <ulink url="http://testng.org/doc/download.html">download page</ulink>
- .
- You can find a tutorial that explains how to use the TestNG plugin on
- the TestNG
- <ulink url="http://testng.org/doc/eclipse.html">Eclipse page</ulink>
- .
+ Again, the Eclipse plugins are not required to execute the TCK, but
+ can be very helpful when validating an implementation against the TCK
+ test suite and especially when using the modules from the Web Beans
+ project.
</para>
- <para>
- Another useful plugin is m2eclipse. Both the TCK project and Web Beans
- are use Maven 2. Therefore, to work with these projects in Eclipse, you
- may wish to have support for Maven 2 project, which the m2eclipse
- plugin provides. Instructions for using the m2eclipse update site to
- add the m2eclipse plugin to Eclipse are provided on the m2eclipse home
- page. For more, read the m2eclipse
- <ulink url="http://www.sonatype.com/books/m2eclipse-book/reference">reference guide</ulink>
- .
- </para>
</section>
</chapter>
Modified: tck/trunk/doc/reference/en-US/introduction.xml
===================================================================
--- tck/trunk/doc/reference/en-US/introduction.xml 2009-07-28 19:32:32 UTC (rev 3318)
+++ tck/trunk/doc/reference/en-US/introduction.xml 2009-07-28 19:41:58 UTC (rev 3319)
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ ]>
<chapter id="introduction">
- <title>Introduction</title>
+ <title>Introduction (CDI TCK)</title>
<para>
This chapter explains the purpose of a TCK and identifies the
@@ -20,23 +20,31 @@
</para>
<para>
The tests in the TCK are derived from assertions in the written
- specification document. The assertions materialize as a suite of
- automated tests that collectively validate whether an implementation
- complies with the aforementioned assertions, and in turn the
- specification. For a particular implementation to be certified, all of
- the required tests must pass (the provided test suite must be run
- unmodified).
+ specification document. The assertions are itemized in an XML
+ document, where they each get assigned a unique identifier, and
+ materialize as a suite of automated tests that collectively validate
+ whether an implementation complies with the aforementioned assertions,
+ and in turn the specification. For a particular implementation to be
+ certified, all of the required tests must pass (i.e., the provided
+ test suite must be run unmodified).
</para>
<para>
- A TCK is entirely implementation agnostic. Ideally, it should
- validate assertions by consulting the specficiation's public API.
- However, when the information returned by the public API is not
- low-level enough to validate the assertion, the implementation must be
- consulted directly. In this case, the TCK provides an independent API
- as part of a porting package which must also be implemented. Section
- 1.3.4 introduces the porting package and section 4.1 covers the
- requirements for implementing it.
+ A TCK is entirely implementation agnostic. Ideally, it should validate
+ assertions by consulting the specficiation's public API. However, when
+ the information returned by the public API is not low-level enough to
+ validate the assertion, the implementation must be consulted directly.
+ In this case, the TCK provides an independent API as part of a porting
+ package that enables this transparency. The porting package must be
+ implemented for each CDI implementation. Section 1.3.4 introduces the
+ porting package and section 4.1 covers the requirements for
+ implementing it.
</para>
+ <note>
+ <para>
+ Sun Microsystems, Inc. will implement the porting package for the
+ CDI RI and test the CDI RI on the Java EE Reference Implementation.
+ </para>
+ </note>
</section>
<section>
<title>Compatibility Testing</title>
@@ -111,12 +119,12 @@
<title>About the CDI TCK</title>
<para>
- The CDI TCK is designed as a portable, configurable and automated
- test suite for verifying the compatibility of an implementation of the
+ The CDI TCK is designed as a portable, configurable and automated test
+ suite for verifying the compatibility of an implementation of the
JSR-299: Contexts and Dependency Injection for Java EE specification.
- The test suite is built on TestNG and provides a series of extensions
+ The test suite is built atop TestNG and provides a series of extensions
that allow runtime packaging and deployment of JEE artifacts for
- in-container testing.
+ in-container testing (JBoss Test Harness).
</para>
<note>
<para>
@@ -150,7 +158,8 @@
- Software requirements for a CDI implementation are itemized
in section 1.2, "Relationship to other specifications" in the
CDI specification, with details provided throughout the
- specification.
+ specification. Generally, the CDI specification targets the
+ Java EE 6 platform and is aligned with its specifications.
</para>
</listitem>
<listitem>
@@ -165,10 +174,10 @@
<para>
<emphasis role="bold">JBoss Test Harness</emphasis>
- The CDI TCK requires version 1.0.0 of the JBoss Test
- Harness. The Harness is based on TestNG 5.x. You can read more
- about the harness in
- <xref linkend="test-harness" />
- .
+ Harness. The Harness is based on TestNG 5.x
+ (<ulink url="http://testng.org">http://testng.org</ulink>).
+ You can read more about the harness in
+ <xref linkend="test-harness" />.
</para>
</listitem>
<listitem>
@@ -176,7 +185,7 @@
<emphasis role="bold">Porting Package</emphasis>
- An implementation of SPIs that are required for the test
suite to run the in-container tests and at times extend the
- CDI 1.0 API to provide extra information to the TCK
+ CDI 1.0 API to provide extra information to the TCK.
</para>
</listitem>
<listitem>
@@ -194,10 +203,7 @@
of the CDI specification is the Sun Java Platform, Enterprise
Edition (Java EE) 6 reference implementation (RI). See details
at Java EE 6
- (
- <ulink url="http://java.sun.com/javaee/6/docs/api/">http://java.sun.com/javaee/6/docs/api/
- </ulink>
- ).
+ (<ulink url="http://java.sun.com/javaee/6/docs/api/">http://java.sun.com/javaee/6/docs/api/</ulink>).
</para>
</listitem>
</itemizedlist>
@@ -215,10 +221,10 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">TestNG 5.9</emphasis>
- , the testing framework on which the JBoss Test Harness is
- based and which provides the extension points for selecting an
- executing the tests in the test suite.
+ <emphasis role="bold">TestNG 5.9</emphasis>, the testing
+ framework on which the JBoss Test Harness is based and which
+ provides the extension points for selecting an executing the
+ tests in the test suite.
</para>
</listitem>
<listitem>
@@ -230,10 +236,10 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">The test suite</emphasis>
- , which is a collection of TestNG tests, the TestNG test suite
- descriptor and supplemental resources that configure CDI and
- other software components.
+ <emphasis role="bold">The test suite</emphasis>, which is a
+ collection of TestNG tests, the TestNG test suite descriptor
+ and supplemental resources that configure CDI and other
+ software components.
</para>
</listitem>
<listitem>
@@ -241,7 +247,7 @@
<emphasis role="bold">The TCK audit</emphasis>
is used to list out the assertions identified in the CDI
specification. It matches the assertions to testcases in the
- test suite and produces a coverage report.
+ test suite by unique identifier and produces a coverage report.
</para>
<para>
The audit document is provided along with the TCK; at least
@@ -260,15 +266,16 @@
</para>
</listitem>
</itemizedlist>
- <para>
- The CDI TCK has been tested with the following:
- </para>
<note>
<para>
- Sun Microsystems Inc. will implement the porting package and
- test the CDI RI on the Java EE Reference Implementation
+ Sun Microsystems, Inc. will implement the porting package for the
+ CDI RI and test the CDI RI on the Java EE Reference
+ Implementation.
</para>
</note>
+ <para>
+ The CDI TCK has been tested with the following:
+ </para>
<itemizedlist>
<listitem>
<para>JBoss AS 5.1.0.GA</para>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3318 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: util and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-28 15:32:32 -0400 (Tue, 28 Jul 2009)
New Revision: 3318
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
Log:
WBRI-292
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-07-28 17:50:13 UTC (rev 3317)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-07-28 19:32:32 UTC (rev 3318)
@@ -175,7 +175,7 @@
{
field.setAccessible(true);
}
- WBField<?> annotatedField = new WBFieldImpl<Object>(field, this, classTransformer);
+ WBField<?> annotatedField = WBFieldImpl.of(field, this, classTransformer);
this.fields.add(annotatedField);
if (c == rawType)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-07-28 17:50:13 UTC (rev 3317)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-07-28 19:32:32 UTC (rev 3318)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.introspector.jlr;
+import static org.jboss.webbeans.util.Reflections.ensureAccessible;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -69,7 +71,7 @@
public static <T> WBConstructor<T> of(Constructor<T> constructor, WBType<T> declaringClass, ClassTransformer classTransformer)
{
- return new WBConstructorImpl<T>(constructor, declaringClass, classTransformer);
+ return new WBConstructorImpl<T>(ensureAccessible(constructor), declaringClass, classTransformer);
}
/**
@@ -80,7 +82,7 @@
* @param constructor The constructor method
* @param declaringClass The declaring class
*/
- protected WBConstructorImpl(Constructor<T> constructor, WBType<T> declaringClass, ClassTransformer classTransformer)
+ private WBConstructorImpl(Constructor<T> constructor, WBType<T> declaringClass, ClassTransformer classTransformer)
{
super(AnnotationStore.of(constructor, classTransformer.getTypeStore()), constructor, constructor.getDeclaringClass(), constructor.getDeclaringClass());
this.constructor = constructor;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java 2009-07-28 17:50:13 UTC (rev 3317)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java 2009-07-28 19:32:32 UTC (rev 3318)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.introspector.jlr;
+import static org.jboss.webbeans.util.Reflections.ensureAccessible;
+
import java.lang.reflect.Field;
import org.jboss.webbeans.introspector.AnnotationStore;
@@ -45,6 +47,11 @@
// Cached string representation
private String toString;
+ public static <T> WBFieldImpl<T> of(Field field, WBType<?> declaringClass, ClassTransformer classTransformer)
+ {
+ return new WBFieldImpl<T>(ensureAccessible(field), declaringClass, classTransformer);
+ }
+
/**
* Constructor
*
@@ -54,11 +61,10 @@
* @param field The actual field
* @param declaringClass The abstraction of the declaring class
*/
- protected WBFieldImpl(Field field, WBType<?> declaringClass, ClassTransformer classTransformer)
+ private WBFieldImpl(Field field, WBType<?> declaringClass, ClassTransformer classTransformer)
{
super(AnnotationStore.of(field, classTransformer.getTypeStore()), field, (Class<T>) field.getType(), field.getGenericType());
this.field = field;
- field.setAccessible(true);
this.declaringClass = declaringClass;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-07-28 17:50:13 UTC (rev 3317)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-07-28 19:32:32 UTC (rev 3318)
@@ -16,6 +16,8 @@
*/
package org.jboss.webbeans.introspector.jlr;
+import static org.jboss.webbeans.util.Reflections.ensureAccessible;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -74,7 +76,7 @@
public static <T> WBMethodImpl<T> of(Method method, WBType<?> declaringClass, ClassTransformer classTransformer)
{
- return new WBMethodImpl<T>(method, declaringClass, classTransformer);
+ return new WBMethodImpl<T>(ensureAccessible(method), declaringClass, classTransformer);
}
/**
@@ -87,11 +89,10 @@
* @param declaringClass The declaring class abstraction
*/
@SuppressWarnings("unchecked")
- protected WBMethodImpl(Method method, WBType<?> declaringClass, ClassTransformer classTransformer)
+ private WBMethodImpl(Method method, WBType<?> declaringClass, ClassTransformer classTransformer)
{
super(AnnotationStore.of(method, classTransformer.getTypeStore()), method, (Class<T>) method.getReturnType(), method.getGenericReturnType());
this.method = method;
- this.method.setAccessible(true);
this.declaringClass = declaringClass;
this.parameters = new ArrayList<WBParameter<?>>();
this.annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<? extends Annotation>, Collection<WBParameter<?>>>(), new Supplier< List<WBParameter<?>>>()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-07-28 17:50:13 UTC (rev 3317)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-07-28 19:32:32 UTC (rev 3318)
@@ -686,5 +686,32 @@
{
return clazz.isPrimitive() || Serializable.class.isAssignableFrom(clazz);
}
+
+ public static Field ensureAccessible(Field field)
+ {
+ if (!field.isAccessible() && !field.getDeclaringClass().getPackage().getName().startsWith("java.util"))
+ {
+ field.setAccessible(true);
+ }
+ return field;
+ }
+
+ public static Method ensureAccessible(Method method)
+ {
+ if (!method.isAccessible() && !method.getDeclaringClass().getPackage().getName().startsWith("java.util"))
+ {
+ method.setAccessible(true);
+ }
+ return method;
+ }
+
+ public static <T> Constructor<T> ensureAccessible(Constructor<T> constructor)
+ {
+ if (!constructor.isAccessible() && !constructor.getDeclaringClass().getPackage().getName().startsWith("java.util"))
+ {
+ constructor.setAccessible(true);
+ }
+ return constructor;
+ }
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3317 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-28 13:50:13 -0400 (Tue, 28 Jul 2009)
New Revision: 3317
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
Log:
fix intermittent failure
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Cloud.java 2009-07-28 17:50:13 UTC (rev 3317)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.event.observer.resolve;
+
+import javax.enterprise.event.Observes;
+
+class Cloud
+{
+ public void allocateNewDisk(@Observes DiskSpaceEvent event)
+ {
+ }
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java 2009-07-28 16:27:30 UTC (rev 3316)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/Heater.java 2009-07-28 17:50:13 UTC (rev 3317)
@@ -1,32 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.observer.resolve;
-
-import javax.enterprise.event.Observes;
-
-public class Heater
-{
- private Temperature target;
-
- private boolean on = false;
-
- public void setTargetTemperature(Temperature target)
- {
- this.target = target;
- }
-
- public void temperatureChanged(@Observes Temperature temperature)
- {
- if (on && temperature.getDegrees() > target.getDegrees())
- {
- on = false;
- }
- else if (!on && temperature.getDegrees() <= target.getDegrees())
- {
- on = true;
- }
- }
-
- public boolean isOn()
- {
- return on;
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-07-28 16:27:30 UTC (rev 3316)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java 2009-07-28 17:50:13 UTC (rev 3317)
@@ -25,7 +25,7 @@
@SpecAssertion(section = "10.4", id = "e")
public void testMultipleObserverMethodsForSameEventPermissible()
{
- assert getCurrentManager().resolveObserverMethods(new Temperature(0)).size() == 2;
+ assert getCurrentManager().resolveObserverMethods(new DiskSpaceEvent()).size() == 2;
}
@Test(groups = { "events" })
@@ -33,7 +33,7 @@
public void testMultipleObserverMethodsOnBeanPermissible()
{
assert getCurrentManager().resolveObserverMethods(new BatteryEvent()).size() == 1;
- assert getCurrentManager().resolveObserverMethods(new DiskSpaceEvent()).size() == 1;
+ assert getCurrentManager().resolveObserverMethods(new DiskSpaceEvent()).size() == 2;
}
@Test(groups = { "events" })
@@ -41,9 +41,9 @@
public void testMethodWithParameterAnnotatedWithObservesRegistersObserverMethod() throws SecurityException, NoSuchMethodException
{
Set<ObserverMethod<?, Temperature>> temperatureObservers = getCurrentManager().resolveObserverMethods(new Temperature(0d));
- assert temperatureObservers.size() > 1;
+ assert temperatureObservers.size() == 1;
ObserverMethod<?, Temperature> temperatureObserver = temperatureObservers.iterator().next();
- assert temperatureObserver.getBean().getBeanClass().equals(AirConditioner.class);
+ assert temperatureObserver.getBean() == getUniqueBean(AirConditioner.class);
assert temperatureObserver.getObservedType().equals(Temperature.class);
Method method = AirConditioner.class.getMethod("temperatureChanged", Temperature.class);
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3316 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/extensions and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-28 12:27:30 -0400 (Tue, 28 Jul 2009)
New Revision: 3316
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/DerivedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingTypeLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/SimpleBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/TameLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectableReferenceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectionPoint.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AnnotatedInjectionField.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/DerivedInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/InjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/SimpleBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/AnnotatedInjectionField.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/InjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/SimpleBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectableReferenceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectionPoint.java
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Added TCK tests for 11.3.2 and 11.3.4
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Tests related to obtaining beans by their type from the bean manager.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@SpecVersion("20090625")
+public class BeanByTypeTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.4", id = "aa"),
+ @SpecAssertion(section = "11.3.4", id = "b")
+ })
+ public void testGetBeans()
+ {
+ Set<Bean<?>> beans = getCurrentManager().getBeans(SimpleBean.class);
+ assert beans.size() == 1;
+ assert beans.iterator().next().getBeanClass().equals(SimpleBean.class);
+ }
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.4", id = "c")
+ })
+ public void testNoBindingImpliesCurrent()
+ {
+ Set<Bean<?>> beans = getCurrentManager().getBeans(SimpleBean.class);
+ assert beans.size() == 1;
+ assert beans.iterator().next().getBindings().contains(new CurrentLiteral());
+ }
+
+ @Test(groups = "broken", expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.4", id = "da")
+ })
+ public void testTypeVariable()
+ {
+ //TODO Not sure how to get a type variable passed here
+ getCurrentManager().getBeans(getType(new SimpleBean()));
+ }
+
+ private <T> Type getType(T object)
+ {
+ return object.getClass();
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.4", id = "e")
+ })
+ public void testSameBindingTwice()
+ {
+ getCurrentManager().getBeans(SimpleBean.class, new TameLiteral(), new TameLiteral());
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.4", id = "f")
+ })
+ public void testNonBindingType()
+ {
+ getCurrentManager().getBeans(SimpleBean.class, new NonBindingTypeLiteral());
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/DerivedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/DerivedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/DerivedBean.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+
+@Tame
+class DerivedBean extends SimpleBean
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/DerivedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingType.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@interface NonBindingType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingTypeLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingTypeLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingTypeLiteral.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+public class NonBindingTypeLiteral extends AnnotationLiteral<NonBindingType> implements NonBindingType
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/NonBindingTypeLiteral.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/SimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/SimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/SimpleBean.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+
+class SimpleBean
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/SimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/Tame.java (from rev 3314, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/Tame.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/Tame.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/TameLiteral.java (from rev 3314, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/TameAnnotationLiteral.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/TameLiteral.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/TameLiteral.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.extensions.bean.bytype;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class TameLiteral extends AnnotationLiteral<Tame> implements Tame
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectableReferenceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectableReferenceTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectableReferenceTest.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.ambiguous;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Tests a custom injection point that resolves to two different bean instances
+ * which should always result in an exception.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@SpecVersion("20090625")
+public class AmbiguousInjectableReferenceTest extends AbstractJSR299Test
+{
+ @SuppressWarnings("unchecked")
+ @Test(expectedExceptions = AmbiguousResolutionException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.2", id = "bc")
+ })
+ public void testUnsatisfiedReference()
+ {
+ Bean<SimpleBean> bean = this.getBeans(SimpleBean.class).iterator().next();
+ AmbiguousInjectionPoint injectionPoint = new AmbiguousInjectionPoint(bean);
+ CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext((Bean<SimpleBean>)injectionPoint.getBean());
+ getCurrentManager().getInjectableReference(injectionPoint, creationalContext);
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectableReferenceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectionPoint.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectionPoint.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectionPoint.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,65 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.ambiguous;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.jsr299.tck.literals.AnyLiteral;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+
+public class AmbiguousInjectionPoint implements InjectionPoint
+{
+ private final Bean<SimpleBean> bean;
+ private final Set<Annotation> bindings = new HashSet<Annotation>();
+
+ public AmbiguousInjectionPoint(Bean<SimpleBean> bean)
+ {
+ this.bean = bean;
+ bindings.add(new CurrentLiteral());
+ bindings.add(new AnyLiteral());
+ }
+
+ public Annotated getAnnotated()
+ {
+ return new AnnotatedInjectionField(this);
+ }
+
+ public Bean<?> getBean()
+ {
+ return bean;
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return bindings;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Member getMember()
+ {
+ return ((AnnotatedField<SimpleBean>)getAnnotated()).getJavaMember();
+ }
+
+ public Type getType()
+ {
+ return InjectedBean.class;
+ }
+
+ public boolean isDelegate()
+ {
+ return false;
+ }
+
+ public boolean isTransient()
+ {
+ return false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AmbiguousInjectionPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AnnotatedInjectionField.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AnnotatedInjectionField.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AnnotatedInjectionField.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,75 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.ambiguous;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+class AnnotatedInjectionField implements AnnotatedField<InjectedBean>
+{
+
+ private final InjectionPoint injectionPoint;
+
+ public AnnotatedInjectionField(InjectionPoint injectionPoint)
+ {
+ this.injectionPoint = injectionPoint;
+ }
+
+ public Field getJavaMember()
+ {
+ try
+ {
+ return SimpleBean.class.getDeclaredField("injectedBean");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to get field for injectedBean", e);
+ }
+ }
+
+ public AnnotatedType<InjectedBean> getDeclaringType()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isStatic()
+ {
+ return false;
+ }
+
+ public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Type getBaseType()
+ {
+ // TODO Auto-generated method stub
+ return InjectedBean.class;
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/AnnotatedInjectionField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/DerivedInjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/DerivedInjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/DerivedInjectedBean.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.ambiguous;
+
+
+class DerivedInjectedBean extends InjectedBean
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/DerivedInjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/InjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/InjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/InjectedBean.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.ambiguous;
+
+class InjectedBean
+{
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/InjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/SimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/SimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/SimpleBean.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.ambiguous;
+
+
+class SimpleBean
+{
+ private InjectedBean injectedBean;
+
+ public InjectedBean getInjectedBean()
+ {
+ return injectedBean;
+ }
+
+ public void setInjectedBean(InjectedBean injectedBean)
+ {
+ this.injectedBean = injectedBean;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/ambiguous/SimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/AnnotatedInjectionField.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/AnnotatedInjectionField.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/AnnotatedInjectionField.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,75 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.unresolved;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+class AnnotatedInjectionField implements AnnotatedField<InjectedBean>
+{
+
+ private final InjectionPoint injectionPoint;
+
+ public AnnotatedInjectionField(InjectionPoint injectionPoint)
+ {
+ this.injectionPoint = injectionPoint;
+ }
+
+ public Field getJavaMember()
+ {
+ try
+ {
+ return SimpleBean.class.getDeclaredField("injectedBean");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to get field for injectedBean", e);
+ }
+ }
+
+ public AnnotatedType<InjectedBean> getDeclaringType()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isStatic()
+ {
+ return false;
+ }
+
+ public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Type getBaseType()
+ {
+ // TODO Auto-generated method stub
+ return InjectedBean.class;
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/AnnotatedInjectionField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/InjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/InjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/InjectedBean.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.unresolved;
+
+class InjectedBean
+{
+ public InjectedBean(String name)
+ {
+
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/InjectedBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/SimpleBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/SimpleBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/SimpleBean.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.unresolved;
+
+
+class SimpleBean
+{
+ private InjectedBean injectedBean;
+
+ public InjectedBean getInjectedBean()
+ {
+ return injectedBean;
+ }
+
+ public void setInjectedBean(InjectedBean injectedBean)
+ {
+ this.injectedBean = injectedBean;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/SimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectableReferenceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectableReferenceTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectableReferenceTest.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.unresolved;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Tests retrieving an injectable reference for a bean which cannot be
+ * resolved.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@SpecVersion("20090625")
+public class UnsatisfiedInjectableReferenceTest extends AbstractJSR299Test
+{
+ @SuppressWarnings("unchecked")
+ @Test(expectedExceptions = UnsatisfiedResolutionException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "11.3.2", id = "bb")
+ })
+ public void testUnsatisfiedReference()
+ {
+ Bean<SimpleBean> bean = this.getBeans(SimpleBean.class).iterator().next();
+ UnsatisfiedInjectionPoint injectionPoint = new UnsatisfiedInjectionPoint(bean);
+ CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext((Bean<SimpleBean>)injectionPoint.getBean());
+ getCurrentManager().getInjectableReference(injectionPoint, creationalContext);
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectableReferenceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectionPoint.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectionPoint.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectionPoint.java 2009-07-28 16:27:30 UTC (rev 3316)
@@ -0,0 +1,66 @@
+package org.jboss.jsr299.tck.tests.lookup.injectionpoint.broken.reference.unresolved;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.jsr299.tck.literals.AnyLiteral;
+import org.jboss.jsr299.tck.literals.CurrentLiteral;
+
+public class UnsatisfiedInjectionPoint implements InjectionPoint
+{
+
+ private final Bean<SimpleBean> bean;
+ private final Set<Annotation> bindings = new HashSet<Annotation>();
+
+ public UnsatisfiedInjectionPoint(Bean<SimpleBean> beanWithInjectionPoint)
+ {
+ this.bean = beanWithInjectionPoint;
+ bindings.add(new CurrentLiteral());
+ bindings.add(new AnyLiteral());
+ }
+
+ public Annotated getAnnotated()
+ {
+ return new AnnotatedInjectionField(this);
+ }
+
+ public Bean<?> getBean()
+ {
+ return bean;
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return bindings;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Member getMember()
+ {
+ return ((AnnotatedField<SimpleBean>)getAnnotated()).getJavaMember();
+ }
+
+ public Type getType()
+ {
+ return InjectedBean.class;
+ }
+
+ public boolean isDelegate()
+ {
+ return false;
+ }
+
+ public boolean isTransient()
+ {
+ return false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/reference/unresolved/UnsatisfiedInjectionPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-28 15:56:32 UTC (rev 3315)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-28 16:27:30 UTC (rev 3316)
@@ -4271,6 +4271,7 @@
<assertion id="c">
<text>Implementations of |Bean| usually maintain a reference to an instance of |BeanManager|. When the |Bean| implementation performs dependency injection, it must obtain the contextual instances to inject by calling |BeanManager.getInjectableReference()|, passing an instance of |InjectionPoint| that represents the injection point and the instance of |CreationalContext| that was passed to |Bean.create()|.</text>
+ <note>This cannot be well tested at the moment.</note>
</assertion>
</section>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3315 - ri/trunk/impl/src/main/java/org/jboss/webbeans/event and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-28 11:56:32 -0400 (Tue, 28 Jul 2009)
New Revision: 3315
Modified:
extensions/trunk/se/pom.xml
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java
Log:
WBRI-314
Modified: extensions/trunk/se/pom.xml
===================================================================
--- extensions/trunk/se/pom.xml 2009-07-28 13:24:13 UTC (rev 3314)
+++ extensions/trunk/se/pom.xml 2009-07-28 15:56:32 UTC (rev 3315)
@@ -54,22 +54,21 @@
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.jta</groupId>
+ <artifactId>transaction-api</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.webbeans</groupId>
- <artifactId>webbeans-logger</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.webbeans</groupId>
<artifactId>webbeans-core</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
</dependencies>
<scm>
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-07-28 13:24:13 UTC (rev 3314)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-07-28 15:56:32 UTC (rev 3315)
@@ -16,11 +16,13 @@
*/
package org.jboss.webbeans.event;
+import javax.enterprise.event.Observes;
import javax.enterprise.event.TransactionPhase;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -42,7 +44,7 @@
public static <X, T> ObserverMethodImpl<X, T> create(WBMethod<?> method, RIBean<?> declaringBean, BeanManagerImpl manager)
{
ObserverMethodImpl<X, T> result = null;
- TransactionPhase transactionPhase = TransactionalObserverMethodImpl.getTransactionalPhase(method);
+ TransactionPhase transactionPhase = getTransactionalPhase(method);
if (manager.getServices().contains(TransactionServices.class) && !transactionPhase.equals(TransactionPhase.IN_PROGRESS))
{
result = new TransactionalObserverMethodImpl<X, T>(method, declaringBean, transactionPhase, manager);
@@ -54,4 +56,16 @@
result.initialize();
return result;
}
+
+ /**
+ * Tests an observer method to see if it is transactional.
+ *
+ * @param observer The observer method
+ * @return true if the observer method is annotated as transactional
+ */
+ public static TransactionPhase getTransactionalPhase(WBMethod<?> observer)
+ {
+ WBParameter<?> parameter = observer.getAnnotatedParameters(Observes.class).iterator().next();
+ return parameter.getAnnotationStore().getAnnotation(Observes.class).during();
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java 2009-07-28 13:24:13 UTC (rev 3314)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverMethodImpl.java 2009-07-28 15:56:32 UTC (rev 3315)
@@ -16,14 +16,12 @@
*/
package org.jboss.webbeans.event;
-import javax.enterprise.event.Observes;
import javax.enterprise.event.TransactionPhase;
import javax.transaction.Synchronization;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.introspector.WBMethod;
-import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -32,17 +30,6 @@
*/
class TransactionalObserverMethodImpl<X, T> extends ObserverMethodImpl<X, T>
{
- /**
- * Tests an observer method to see if it is transactional.
- *
- * @param observer The observer method
- * @return true if the observer method is annotated as transactional
- */
- public static TransactionPhase getTransactionalPhase(WBMethod<?> observer)
- {
- WBParameter<?> parameter = observer.getAnnotatedParameters(Observes.class).iterator().next();
- return parameter.getAnnotationStore().getAnnotation(Observes.class).during();
- }
/**
* Creates a new instance of a transactional observer method implicit object.
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3314 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-28 09:24:13 -0400 (Tue, 28 Jul 2009)
New Revision: 3314
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
Log:
Reassigned 2.5 a)
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-07-28 13:07:36 UTC (rev 3313)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-07-28 13:24:13 UTC (rev 3314)
@@ -33,10 +33,7 @@
{
@Test(groups="ri-broken")
- @SpecAssertions({
- @SpecAssertion(section="5.8", id="c"),
- @SpecAssertion(section="2.5", id="a")
- })
+ @SpecAssertion(section="2.5", id="a")
//WBRI-322
public void testQualifiedNameLookup()
{
@@ -62,10 +59,13 @@
}
@Test(groups = "el")
- @SpecAssertion(section="5.8", id="bc")
+ @SpecAssertions({
+ @SpecAssertion(section="5.8", id="bc"),
+ @SpecAssertion(section="2.5", id="a")
+ })
public void testELResolverReturnsContextualInstance() {
Salmon salmon = getInstanceByType(Salmon.class);
salmon.setAge(3);
- assert getCurrentConfiguration().getEl().evaluateValueExpression("#{salmon}", Salmon.class).getAge() == 3;
+ assert getCurrentConfiguration().getEl().evaluateValueExpression("#{salmon.age}", Integer.class) == 3;
}
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3313 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el: integration and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-28 09:07:36 -0400 (Tue, 28 Jul 2009)
New Revision: 3313
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/integration/IntegrationWithUnifiedELTest.java
Log:
Link tests to JIRA
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-07-28 13:03:47 UTC (rev 3312)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-07-28 13:07:36 UTC (rev 3313)
@@ -16,7 +16,6 @@
*/
package org.jboss.jsr299.tck.tests.lookup.el;
-import javax.enterprise.context.Conversation;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.spi.Bean;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/integration/IntegrationWithUnifiedELTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/integration/IntegrationWithUnifiedELTest.java 2009-07-28 13:03:47 UTC (rev 3312)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/integration/IntegrationWithUnifiedELTest.java 2009-07-28 13:07:36 UTC (rev 3313)
@@ -50,7 +50,7 @@
@Test(groups = { "ri-broken", "el" } )
@SpecAssertion(section = "5.8", id = "aba")
- //WBRI-322
+ //WBRI-323
public void testELResolverRegisteredWithServletContainer() throws Exception
{
WebClient webclient = new WebClient();
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3312 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-28 09:03:47 -0400 (Tue, 28 Jul 2009)
New Revision: 3312
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Counter.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
Log:
Rewritten test for 5.8 c)
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Counter.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Counter.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Counter.java 2009-07-28 13:03:47 UTC (rev 3312)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.lookup.el;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+class Counter
+{
+ private int count = 0;
+
+ public void add() {
+ count++;
+ }
+
+ public int getCount() {
+ return count;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java 2009-07-28 13:03:47 UTC (rev 3312)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.lookup.el;
+
+import javax.enterprise.inject.Initializer;
+import javax.enterprise.inject.Named;
+
+@Named
+class Game
+{
+ @Initializer
+ public void initialize(Counter counter) {
+ counter.add();
+ }
+
+ public boolean getValue() {
+ return true;
+ }
+}
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-07-28 12:58:17 UTC (rev 3311)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-07-28 13:03:47 UTC (rev 3312)
@@ -33,15 +33,16 @@
public class ResolutionByNameTest extends AbstractJSR299Test
{
- @Test(groups="rewrite")
+ @Test(groups="ri-broken")
@SpecAssertions({
@SpecAssertion(section="5.8", id="c"),
@SpecAssertion(section="2.5", id="a")
})
+ //WBRI-322
public void testQualifiedNameLookup()
{
- assert getCurrentConfiguration().getEl().evaluateValueExpression("#{javax.enterprise.context.conversation}", Conversation.class) != null;
- assert getCurrentConfiguration().getEl().evaluateValueExpression("#{javax.enterprise.context.conversation}", Conversation.class) instanceof Conversation;
+ assert getCurrentConfiguration().getEl().evaluateValueExpression("#{(game.value and game.value) ? game.value : false}", Boolean.class);
+ assert getInstanceByType(Counter.class).getCount() == 1;
}
@Test(groups = "beanLifecycle")
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3311 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-28 08:58:17 -0400 (Tue, 28 Jul 2009)
New Revision: 3311
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
Log:
Fixed a copied test that was not modified correctly.
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-28 11:58:46 UTC (rev 3310)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-07-28 12:58:17 UTC (rev 3311)
@@ -192,10 +192,10 @@
@SpecAssertion(section = "11.1.3", id = "g")
public void testInstanceOfBeanForEveryEnabledObserverMethod()
{
- assert getCurrentManager().resolveObserverMethods(new StockPrice()).iterator().next().getTransactionPhase().equals(TransactionPhase.IN_PROGRESS);
- assert getCurrentManager().resolveObserverMethods(new DisobedientDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.BEFORE_COMPLETION);
- assert getCurrentManager().resolveObserverMethods(new ShowDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_COMPLETION);
- assert getCurrentManager().resolveObserverMethods(new SmallDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_FAILURE);
- assert getCurrentManager().resolveObserverMethods(new LargeDog()).iterator().next().getTransactionPhase().equals(TransactionPhase.AFTER_SUCCESS);
+ assert !getCurrentManager().resolveObserverMethods(new StockPrice()).isEmpty();
+ assert !getCurrentManager().resolveObserverMethods(new DisobedientDog()).isEmpty();
+ assert !getCurrentManager().resolveObserverMethods(new ShowDog()).isEmpty();
+ assert !getCurrentManager().resolveObserverMethods(new SmallDog()).isEmpty();
+ assert !getCurrentManager().resolveObserverMethods(new LargeDog()).isEmpty();
}
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3310 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating: broken15 and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-07-28 07:58:46 -0400 (Tue, 28 Jul 2009)
New Revision: 3310
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/UnderwaterCity.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Interceptor_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Kokkola_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/NonSerializableTest.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/City.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
Log:
more passivation tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/City.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/City.java 2009-07-28 09:12:16 UTC (rev 3309)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/City.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.context.passivating;
-class City
+class City
{
public void ping() {
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityDecorator.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Any;
+
+@Decorator
+class CityDecorator implements CityInterface, Serializable
+{
+ @Decorates @Any CityInterface city;
+
+ public void foo()
+ {
+ city.foo();
+ }
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java 2009-07-28 09:12:16 UTC (rev 3309)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Kokkola2.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import java.io.Serializable;
-
-import javax.enterprise.context.SessionScoped;
-import javax.interceptor.Interceptors;
-
-@SuppressWarnings("serial")
-@SessionScoped
-(a)Interceptors(KokkolaInterceptor2.class)
-public class Kokkola2 implements Serializable
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java 2009-07-28 09:12:16 UTC (rev 3309)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -5,6 +5,7 @@
import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
+@SuppressWarnings("serial")
public class KokkolaInterceptor implements Serializable
{
@AroundInvoke
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java 2009-07-28 09:12:16 UTC (rev 3309)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/KokkolaInterceptor2.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -1,14 +0,0 @@
-package org.jboss.jsr299.tck.tests.context.passivating;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-public class KokkolaInterceptor2
-{
- @AroundInvoke
- public Object intercept(InvocationContext context)
- {
- // do nothing
- return null;
- }
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-28 09:12:16 UTC (rev 3309)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -6,16 +6,13 @@
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.impl.MockCreationalContext;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
@@ -50,12 +47,12 @@
assert !beans.isEmpty();
}
- @Test(groups = { "contexts", "passivation", "ri-broken"})
- @SpecAssertion(section = "6.6.1", id = "bb")
- public void testManagedBeanWithNonSerializableInterceptorClassNotOK()
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "6.6.1", id = "bc")
+ public void testManagedBeanWithSerializableDecoratorOK()
{
- Set<Bean<Kokkola2>> beans = getBeans(Kokkola2.class);
- assert beans.isEmpty();
+ Set<Bean<CityDecorator>> beans = getBeans(CityDecorator.class);
+ assert !beans.isEmpty();
}
@Test @SpecAssertion(section="6.6.2", id = "c")
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/UnderwaterCity.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/UnderwaterCity.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/UnderwaterCity.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+class UnderwaterCity implements CityInterface
+{
+
+ public void foo()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Interceptor_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Interceptor_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Interceptor_Broken.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken15;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+class Interceptor_Broken
+{
+ @AroundInvoke
+ public Object intercept(InvocationContext context) throws Exception
+ {
+ return context.proceed();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Kokkola_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Kokkola_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/Kokkola_Broken.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken15;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+import javax.interceptor.Interceptors;
+
+@SuppressWarnings("serial")
+@SessionScoped
+(a)Interceptors(Interceptor_Broken.class)
+class Kokkola_Broken implements Serializable
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/NonSerializableTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/NonSerializableTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken15/NonSerializableTest.java 2009-07-28 11:58:46 UTC (rev 3310)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken15;
+
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.testng.annotations.Test;
+
+public class NonSerializableTest
+{
+ @Test(groups = { "contexts", "passivation", "ri-broken"})
+ @SpecAssertion(section = "6.6.1", id = "bb")
+ public void testManagedBeanWithNonSerializableInterceptorClassNotOK()
+ {
+ assert false;
+ }
+}
15 years, 4 months