Weld SVN: r5409 - examples/trunk.
by weld-commitsï¼ lists.jboss.org
Author: dallen6
Date: 2010-01-09 13:55:00 -0500 (Sat, 09 Jan 2010)
New Revision: 5409
Modified:
examples/trunk/readme.txt
Log:
WELD-330
Modified: examples/trunk/readme.txt
===================================================================
--- examples/trunk/readme.txt 2010-01-09 15:35:16 UTC (rev 5408)
+++ examples/trunk/readme.txt 2010-01-09 18:55:00 UTC (rev 5409)
@@ -3,6 +3,7 @@
* jsf/numberguess (a war example for JSF)
* jsf/login (another war example for JSF)
* jsf/translator (an EJB example for JSF)
+* jsf/permalink (yet another war example for JSF)
* 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)
@@ -11,4 +12,4 @@
server supports Weld.
The examples and RI are explained in detail in the reference guide, including
-how to deploy the examples to JBoss 5, and how to deploy the examples to Tomcat
+how to deploy the examples to JBoss 6.0.x, and how to deploy the examples to Tomcat
14Â years, 12Â months
Weld SVN: r5408 - cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/inheritance.
by weld-commitsï¼ lists.jboss.org
Author: dallen6
Date: 2010-01-09 10:35:16 -0500 (Sat, 09 Jan 2010)
New Revision: 5408
Modified:
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/inheritance/beans.xml
Log:
CDITCK-90
Modified: cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/inheritance/beans.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/inheritance/beans.xml 2010-01-08 18:04:00 UTC (rev 5407)
+++ cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/stereotype/inheritance/beans.xml 2010-01-09 15:35:16 UTC (rev 5408)
@@ -1,5 +1,5 @@
<beans>
<alternatives>
- <class>org.jboss.jsr299.tck.tests.definition.stereotype.inheritance.NamedRequestPolicyStereotype</class>
+ <stereotype>org.jboss.jsr299.tck.tests.definition.stereotype.inheritance.NamedRequestPolicyStereotype</stereotype>
</alternatives>
</beans>
14Â years, 12Â months
Weld SVN: r5407 - core/trunk/impl/src/main/java/org/jboss/weld/bean.
by weld-commitsï¼ lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-08 13:04:00 -0500 (Fri, 08 Jan 2010)
New Revision: 5407
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
Log:
ws
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2010-01-08 17:52:33 UTC (rev 5406)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2010-01-08 18:04:00 UTC (rev 5407)
@@ -102,10 +102,10 @@
private List<Set<MethodInjectionPoint<?, ?>>> initializerMethods;
// Decorators
- private List<Decorator<?>> decorators;
- private Class<T> proxyClassForDecorators;
+ private List<Decorator<?>> decorators;
+ private Class<T> proxyClassForDecorators;
private final ThreadLocal<Integer> decoratorStackPosition;
- private final ThreadLocal<T> decoratedActualInstance = new ThreadLocal<T>();
+ private final ThreadLocal<T> decoratedActualInstance = new ThreadLocal<T>();
// Interceptors
private boolean hasSerializationOrInvocationInterceptorMethods;
15Â years
Weld SVN: r5406 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent.
by weld-commitsï¼ lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-08 12:52:33 -0500 (Fri, 08 Jan 2010)
New Revision: 5406
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java
Log:
Remove need for static, explictly clean up producer
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2010-01-08 17:28:11 UTC (rev 5405)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2010-01-08 17:52:33 UTC (rev 5406)
@@ -113,6 +113,7 @@
tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.getInstanceUsedForDisposal() != null;
assert SpiderProducer.getInstanceUsedForDisposal() != spiderProducer;
+ SpiderProducer.reset();
}
@Test(groups = { "contexts", "observerMethod" })
@@ -177,6 +178,7 @@
Tarantula tarantula = tarantulaBean.create(creationalContext);
assert tarantula != null;
assert SpiderProducer.isDependentContextActive();
+ SpiderProducer.reset();
}
@Test(groups = { "contexts", "producerField"})
@@ -203,6 +205,7 @@
SpiderProducer.reset();
tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.isDependentContextActive();
+ SpiderProducer.reset();
}
@Test(groups = { "contexts", "observerMethod" })
@@ -217,7 +220,6 @@
@SpecAssertion(section = "6.4", id = "g") // Dependent context is now always active
public void testContextIsActiveWhenEvaluatingElExpression()
{
- SensitiveFox.setManager(getCurrentManager());
String foxName = getCurrentConfiguration().getEl().evaluateMethodExpression("#{sensitiveFox.getName}", String.class, new Class[0], new Object[0]);
assert foxName != null;
assert SensitiveFox.isDependentContextActiveDuringEval();
@@ -227,7 +229,6 @@
@SpecAssertion(section = "6.4", id = "g") // Dependent context is now always active
public void testContextIsActiveDuringBeanCreation()
{
- SensitiveFox.setManager(getCurrentManager());
SensitiveFox fox1 = getInstanceByType(SensitiveFox.class);
assert fox1 != null;
assert fox1.isDependentContextActiveDuringCreate();
@@ -327,6 +328,7 @@
spiderInstance.ping();
assert SpiderProducer.isDestroyed();
assert Tarantula.isDestroyed();
+ SpiderProducer.reset();
}
@Test(groups = { "contexts", "producerField" })
@@ -360,6 +362,7 @@
tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.isDestroyed();
assert Fox.isDestroyed();
+ SpiderProducer.reset();
}
@Test(groups = { "contexts", "observerMethod" })
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java 2010-01-08 17:28:11 UTC (rev 5405)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java 2010-01-08 17:52:33 UTC (rev 5406)
@@ -3,6 +3,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
import javax.inject.Named;
@Dependent
@@ -10,15 +11,17 @@
@Default
public class SensitiveFox
{
- private static BeanManager beanManager;
+ private final BeanManager beanManager;
private boolean dependentContextActiveDuringCreate = false;
private static boolean dependentContextActiveDuringEval = false;
- public SensitiveFox()
+ @Inject
+ public SensitiveFox(BeanManager beanManager)
{
dependentContextActiveDuringCreate = beanManager.getContext(Dependent.class).isActive();
+ this.beanManager = beanManager;
}
public String getName()
@@ -40,9 +43,4 @@
return dependentContextActiveDuringEval;
}
- public static void setManager(BeanManager beanManager)
- {
- SensitiveFox.beanManager = beanManager;
- }
-
}
15Â years
Weld SVN: r5405 - doc/trunk/reference/en-US.
by weld-commitsï¼ lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2010-01-08 12:28:11 -0500 (Fri, 08 Jan 2010)
New Revision: 5405
Modified:
doc/trunk/reference/en-US/beans.xml
Log:
oops
Modified: doc/trunk/reference/en-US/beans.xml
===================================================================
--- doc/trunk/reference/en-US/beans.xml 2010-01-08 17:23:12 UTC (rev 5404)
+++ doc/trunk/reference/en-US/beans.xml 2010-01-08 17:28:11 UTC (rev 5405)
@@ -506,8 +506,8 @@
<note>
<para>
- According to this definition, JPA entities are managed beans. However, entities have their own special
- lifecycle, state and identity model and are usually instantiated by JPA or using <literal>new</literal>.
+ According to this definition, JPA entities are technically managed beans. However, entities have their own
+ special lifecycle, state and identity model and are usually instantiated by JPA or using <literal>new</literal>.
Therefore we don't recommend directly injecting an entity class. We especially recommend against assigning
a scope other than <literal>@Dependent</literal> to an entity class, since JPA is not able to persist
injected CDI proxies.
@@ -1022,10 +1022,10 @@
</section>
- -->
</section>
+ -->
<!--
vim:et:ts=3:sw=3:tw=120
-->
15Â years
Weld SVN: r5404 - doc/trunk/reference/en-US.
by weld-commitsï¼ lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2010-01-08 12:23:12 -0500 (Fri, 08 Jan 2010)
New Revision: 5404
Modified:
doc/trunk/reference/en-US/beans.xml
Log:
add note about entities
Modified: doc/trunk/reference/en-US/beans.xml
===================================================================
--- doc/trunk/reference/en-US/beans.xml 2010-01-08 17:22:21 UTC (rev 5403)
+++ doc/trunk/reference/en-US/beans.xml 2010-01-08 17:23:12 UTC (rev 5404)
@@ -367,7 +367,7 @@
We normally annotate a bean <literal>@Alternative</literal> only when there is some other
implementation of an interface it implements (or of any of its bean types). We can choose between
alternatives at deployment time by <emphasis>selecting</emphasis> an alternative in the CDI
- deployment descriptor <literal>META-INF/beans.xml</literal> of the JAR or Java EE module that uses
+ deployment descriptor <literal>META-INF/beans.xml</literal> of the jar or Java EE module that uses
it. Different modules can specify that they use different alternatives.
</para>
@@ -437,7 +437,7 @@
<para>
Interceptors are deployment-specific. (We don't need a <literal>TransactionInterceptor</literal> in our
unit tests!) By default, an interceptor is disabled. We can enable an interceptor using the CDI deployment
- descriptor <literal>META-INF/beans.xml</literal> of the JAR or Java EE module. This is also where we
+ descriptor <literal>META-INF/beans.xml</literal> of the jar or Java EE module. This is also where we
specify the interceptor ordering.
</para>
@@ -504,6 +504,16 @@
</blockquote>
+ <note>
+ <para>
+ According to this definition, JPA entities are managed beans. However, entities have their own special
+ lifecycle, state and identity model and are usually instantiated by JPA or using <literal>new</literal>.
+ Therefore we don't recommend directly injecting an entity class. We especially recommend against assigning
+ a scope other than <literal>@Dependent</literal> to an entity class, since JPA is not able to persist
+ injected CDI proxies.
+ </para>
+ </note>
+
<para>The unrestricted set of bean types for a managed bean contains the bean class, every superclass and all
interfaces it implements directly or indirectly.</para>
@@ -511,7 +521,7 @@
<para>Managed beans support the <literal>@PostConstruct</literal> and <literal>@PreDestroy</literal> lifecycle
callbacks.</para>
-
+
<para>
Session beans are also, technically, managed beans. However, since they have their own special lifecycle and
take advantage of additional enterprise services, the CDI specification considers them to be a different
@@ -753,7 +763,9 @@
</section>
</section>
-
+
+ <!--
+
<section id="bean-descriptor">
<title>The (minimal) bean descriptor</title>
@@ -797,8 +809,8 @@
</listitem>
<listitem>
<para>
- CDI does not define any special kind of module - CDI beans can be deployed in a library JAR, EJB JAR,
- WAR, RAR, or JVM classpath directory.
+ CDI does not define any special kind of module - CDI beans can be deployed in a library jar, EJB jar,
+ war, rar, or JVM classpath directory.
</para>
</listitem>
</itemizedlist>
@@ -1009,6 +1021,8 @@
</para>
</section>
+
+ -->
</section>
15Â years
Weld SVN: r5403 - doc/trunk/reference/en-US.
by weld-commitsï¼ lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2010-01-08 12:22:21 -0500 (Fri, 08 Jan 2010)
New Revision: 5403
Modified:
doc/trunk/reference/en-US/ee.xml
doc/trunk/reference/en-US/gettingstarted.xml
doc/trunk/reference/en-US/ri-spi.xml
doc/trunk/reference/en-US/weldexamples.xml
Log:
lowercase ear, jar, war
Modified: doc/trunk/reference/en-US/ee.xml
===================================================================
--- doc/trunk/reference/en-US/ee.xml 2010-01-08 17:05:29 UTC (rev 5402)
+++ doc/trunk/reference/en-US/ee.xml 2010-01-08 17:22:21 UTC (rev 5403)
@@ -263,11 +263,11 @@
<title>Packaging and deployment</title>
<para>
- CDI doesn't define any special deployment archive. You can package beans in JARs, EJB-JARs or WARs—any
+ CDI doesn't define any special deployment archive. You can package beans in jars, ejb jars or wars—any
deployment location in the application classpath. However, the archive must be a "bean archive". That means
each archive that contains beans <emphasis>must</emphasis> include a file named <literal>beans.xml</literal> in
the <literal>META-INF</literal> directory of the classpath or <literal>WEB-INF</literal> directory of the web
- root (for WAR archives). The file may be empty. Beans deployed in archives that do not have a
+ root (for war archives). The file may be empty. Beans deployed in archives that do not have a
<literal>beans.xml</literal> file will not be available for use in the application.
</para>
Modified: doc/trunk/reference/en-US/gettingstarted.xml
===================================================================
--- doc/trunk/reference/en-US/gettingstarted.xml 2010-01-08 17:05:29 UTC (rev 5402)
+++ doc/trunk/reference/en-US/gettingstarted.xml 2010-01-08 17:22:21 UTC (rev 5403)
@@ -6,10 +6,10 @@
<para>
Weld comes with two starter example applications, in addition to more specialized examples. The first,
- <literal>weld-numberguess</literal>, is a web (WAR) example containing only non-transactional managed beans.
+ <literal>weld-numberguess</literal>, is a web (war) example containing only non-transactional managed beans.
This example can be run on a wide range of servers, including JBoss AS, GlassFish, Apache Tomcat, Jetty, Google
App Engine, and any compliant Java EE 6 container. The second example, <literal>weld-translator</literal>, is
- an enterprise (EAR) example that contains session beans. This example must be run on JBoss AS 5.2, Glassfish 3.0
+ an enterprise (ear) example that contains session beans. This example must be run on JBoss AS 5.2, Glassfish 3.0
or any compliant Java EE 6 container.
</para>
@@ -42,10 +42,10 @@
<para>GlassFish 3.0,</para>
</listitem>
<listitem>
- <para>Apache Tomcat 6.0.x (WAR example only), or</para>
+ <para>Apache Tomcat 6.0.x (war example only), or</para>
</listitem>
<listitem>
- <para>Jetty 6.1.x (WAR example only)</para>
+ <para>Jetty 6.1.x (war example only)</para>
</listitem>
</itemizedlist>
</listitem>
@@ -63,14 +63,14 @@
<para>
In the next few sections, you'll be using the Ant command (<literal>ant</literal>) to invoke the Ant build script
- in each example to compile, assemble and deploy the example to JBoss AS and, for the WAR example, Apache Tomcat.
- You can also deploy the generated artifact (WAR or EAR) to any other container that supports Java EE 6, such as
+ in each example to compile, assemble and deploy the example to JBoss AS and, for the war example, Apache Tomcat.
+ You can also deploy the generated artifact (war or ear) to any other container that supports Java EE 6, such as
GlassFish 3.
</para>
<para>
If you have Maven installed, you can use the Maven command (<literal>mvn</literal>) to compile and assemble the
- standalone artifact (WAR or EAR) and, for the WAR example, run it in an embedded container.
+ standalone artifact (war or ear) and, for the war example, run it in an embedded container.
</para>
<para>The sections below cover the steps for deploying with both Ant and Maven in detail. Let's start with JBoss AS.</para>
@@ -197,8 +197,8 @@
<note>
<para>
- The translator uses session beans, which are packaged in an EJB module within an EAR. Java EE 6 will allow
- session beans to be deployed in WAR modules, but that's a topic for a later chapter.
+ The translator uses session beans, which are packaged in an EJB module within an ear. Java EE 6 will allow
+ session beans to be deployed in war modules, but that's a topic for a later chapter.
</para>
</note>
@@ -488,7 +488,7 @@
<para>
To run the <literal>weld-numberguess</literal> example on Jetty, switch to the example directory and execute
- the <literal>inplace</literal> goal of the Maven WAR plugin followed by the <literal>run</literal> goal of
+ the <literal>inplace</literal> goal of the Maven war plugin followed by the <literal>run</literal> goal of
the Maven Jetty plugin with the <literal>jetty</literal> profile enabled, as follows:
</para>
@@ -506,15 +506,15 @@
Any changes to assets in <literal>src/main/webapp</literal> take effect immediately. If a change to a webapp
configuration file is made, the application may automatically redeploy. The redeploy behavior can be fined-tuned
in the plugin configuration. If you make a change to a classpath resource, you need to execute a build and the
- <literal>inplace</literal> goal of the Maven WAR plugin, again with the <literal>jetty</literal> profile enabled.
+ <literal>inplace</literal> goal of the Maven war plugin, again with the <literal>jetty</literal> profile enabled.
</para>
<programlisting><![CDATA[$> mvn compile war:inplace -Pjetty]]></programlisting>
<para>
- The <literal>war:inplace</literal> goal copies the compiled classes and JARs inside <literal>src/main/webapp</literal>,
+ The <literal>war:inplace</literal> goal copies the compiled classes and jars inside <literal>src/main/webapp</literal>,
under <literal>WEB-INF/classes</literal> and <literal>WEB-INF/lib</literal>, respectively, mixing source and compiled
- files. However, the build does work around these temporary files by excluding them from the packaged WAR and cleaning
+ files. However, the build does work around these temporary files by excluding them from the packaged war and cleaning
them during the Maven clean phase.
</para>
Modified: doc/trunk/reference/en-US/ri-spi.xml
===================================================================
--- doc/trunk/reference/en-US/ri-spi.xml 2010-01-08 17:05:29 UTC (rev 5402)
+++ doc/trunk/reference/en-US/ri-spi.xml 2010-01-08 17:22:21 UTC (rev 5403)
@@ -57,7 +57,7 @@
<para>
An application is often comprised of a number of modules. For example, a Java EE deployment may contain a
- number of EJB modules (containing business logic) and WAR modules (containing the user interface). A
+ number of EJB modules (containing business logic) and war modules (containing the user interface). A
container may enforce certain <emphasis>accessibility</emphasis> rules which limit the visibility of classes
between modules. CDI allows these same rules to apply to bean and observer method resolution. As the
accessibility rules vary between containers, Weld requires the container to <emphasis>describe</emphasis>
@@ -335,7 +335,7 @@
<tip>
<para>
- Most Servlet contains use a classloader-per-WAR, this may provide
+ Most Servlet contains use a classloader-per-war, this may provide
a good way to identify the BDA in use for web requests.
</para>
</tip>
@@ -350,7 +350,7 @@
<term><literal>ServletServices.getBeanDeploymentArchive(ServletContext ctx)</literal></term>
<listitem>
<para>
- Identify the WAR in use. The <literal>ServletContext</literal> is provided for additional context.
+ Identify the war in use. The <literal>ServletContext</literal> is provided for additional context.
</para>
</listitem>
</varlistentry>
Modified: doc/trunk/reference/en-US/weldexamples.xml
===================================================================
--- doc/trunk/reference/en-US/weldexamples.xml 2010-01-08 17:05:29 UTC (rev 5402)
+++ doc/trunk/reference/en-US/weldexamples.xml 2010-01-08 17:22:21 UTC (rev 5403)
@@ -19,7 +19,7 @@
<para>
The numberguess example is comprised of a number of beans, configuration files and Facelets (JSF) views,
- packaged as a WAR module. Let's start by examining the configuration files.
+ packaged as a war module. Let's start by examining the configuration files.
</para>
<para>
@@ -62,7 +62,7 @@
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>weld-jsf-numberguess-war</display-name>
- <description>Weld JSF numberguess example (WAR)</description>
+ <description>Weld JSF numberguess example (war)</description>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
@@ -370,13 +370,13 @@
<para>
A couple of modifications must be made to the numberguess artifact in order to deploy it to Tomcat or Jetty.
First, Weld must be deployed as a Web Application library under <literal>WEB-INF/lib</literal> since the
- servlet container does not provide the CDI services. For your convenience we provide a single JAR suitable
+ servlet container does not provide the CDI services. For your convenience we provide a single jar suitable
for running Weld in any servlet container (including Jetty), <literal>weld-servlet.jar</literal>.
</para>
<tip>
<para>
- You must also include the JARs for JSF, EL, and the common annotations
+ You must also include the jars for JSF, EL, and the common annotations
(<literal>jsr250-api.jar</literal>), all of which are provided by the Java EE platform (a Java EE
application server). Are you starting to appreciate why a Java EE platform is worth using?
</para>
@@ -1142,19 +1142,19 @@
</para>
<para>
- The translator example is built as an EAR and contains EJBs. As a result, it's structure is more complex than
+ The translator example is built as an ear and contains EJBs. As a result, it's structure is more complex than
the numberguess example.
</para>
<note>
<para>
- Java EE 6, which bundles EJB 3.1, allows you to package EJBs in a WAR, which will make this structure much
- simpler! Still, there are other advantages of using an EAR.
+ Java EE 6, which bundles EJB 3.1, allows you to package EJBs in a war, which will make this structure much
+ simpler! Still, there are other advantages of using an ear.
</para>
</note>
<para>
- First, let's take a look at the EAR aggregator, which is located in the example's <literal>ear</literal> directory. Maven
+ First, let's take a look at the ear aggregator, which is located in the example's <literal>ear</literal> directory. Maven
automatically generates the <literal>application.xml</literal> for us from this plugin configuration:
</para>
@@ -1191,7 +1191,7 @@
http://java.sun.com/xml/ns/javaee/application_5.xsd">
<display-name>weld-jsf-translator-ear</display-name>
- <description>The Weld JSF translator example (EAR)</description>
+ <description>The Weld JSF translator example (ear)</description>
<module>
<web>
@@ -1206,7 +1206,7 @@
</tip>
<para>
- Next, lets look at the WAR, which is located in the example's <literal>war</literal> directory. Just as in the
+ Next, lets look at the war, which is located in the example's <literal>war</literal> directory. Just as in the
numberguess example, we have a <literal>faces-config.xml</literal> for JSF 2.0 and a <literal>web.xml</literal>
(to activate JSF) under WEB-INF, both sourced from <literal>src/main/webapp/WEB-INF</literal>.
</para>
15Â years
Weld SVN: r5402 - core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin.
by weld-commitsï¼ lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-08 12:05:29 -0500 (Fri, 08 Jan 2010)
New Revision: 5402
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java
Log:
reduce usage of inner classes
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java 2010-01-08 17:04:14 UTC (rev 5401)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java 2010-01-08 17:05:29 UTC (rev 5402)
@@ -29,7 +29,6 @@
import org.jboss.weld.event.EventImpl;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.manager.BeanManagerImpl;
-import org.jboss.weld.resolution.ResolvableTransformer;
import org.jboss.weld.util.collections.Arrays2;
public class EventBean extends AbstractFacadeBean<Event<?>>
@@ -39,8 +38,8 @@
private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(TYPE, Object.class);
private static final Annotation ANY = new AnyLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE);
+
public EventBean(BeanManagerImpl manager)
{
super(Event.class.getSimpleName(), manager);
15Â years
Weld SVN: r5401 - in core/trunk: impl/src/main/java/org/jboss/weld/bean and 7 other directories.
by weld-commitsï¼ lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-01-08 12:04:14 -0500 (Fri, 08 Jan 2010)
New Revision: 5401
Added:
core/trunk/impl/src/main/java/org/jboss/weld/ContainerState.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanTransform.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/CurrentActivity.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/DecoratorTransform.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/DummyInjectionPoint.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/InterceptorTransform.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/NamespaceTransform.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/ObserverMethodTransform.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/Transform.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/Container.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/ContainerStatusTest.java
Log:
reduce usage of inner classes
Modified: core/trunk/impl/src/main/java/org/jboss/weld/Container.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/Container.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/Container.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -41,52 +41,6 @@
public class Container
{
- /**
- * Container status
- * @author pmuir
- *
- */
- public enum Status
- {
- /**
- * The container has not been started
- */
- STOPPED(false),
- /**
- * The container is starting
- */
- STARTING(false),
- /**
- * The container has started and beans have been deployed
- */
- INITIALIZED(true),
- /**
- * The deployment has been validated
- */
- VALIDATED(true),
- /**
- * The container has been shutdown
- */
- SHUTDOWN(false);
-
- private Status(boolean available)
- {
- this.available = available;
- }
-
- final boolean available;
-
- /**
- * Whether the container is available for use
- *
- * @return
- */
- public boolean isAvailable()
- {
- return available;
- }
- }
-
private final static Singleton<Container> instance;
static
@@ -132,7 +86,7 @@
private final ServiceRegistry deploymentServices;
- private Status status = Status.STOPPED;
+ private ContainerState status = ContainerState.STOPPED;
public Container(BeanManagerImpl deploymentManager, ServiceRegistry deploymentServices)
{
@@ -230,12 +184,12 @@
}
}
- public Status getStatus()
+ public ContainerState getStatus()
{
return status;
}
- public void setStatus(Status status)
+ public void setStatus(ContainerState status)
{
this.status = status;
}
Added: core/trunk/impl/src/main/java/org/jboss/weld/ContainerState.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/ContainerState.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/ContainerState.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,47 @@
+package org.jboss.weld;
+
+/**
+ * Container status
+ * @author pmuir
+ *
+ */
+public enum ContainerState
+{
+ /**
+ * The container has not been started
+ */
+ STOPPED(false),
+ /**
+ * The container is starting
+ */
+ STARTING(false),
+ /**
+ * The container has started and beans have been deployed
+ */
+ INITIALIZED(true),
+ /**
+ * The deployment has been validated
+ */
+ VALIDATED(true),
+ /**
+ * The container has been shutdown
+ */
+ SHUTDOWN(false);
+
+ private ContainerState(boolean available)
+ {
+ this.available = available;
+ }
+
+ final boolean available;
+
+ /**
+ * Whether the container is available for use
+ *
+ * @return
+ */
+ public boolean isAvailable()
+ {
+ return available;
+ }
+}
\ No newline at end of file
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/ContainerState.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -60,6 +60,7 @@
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.manager.BeanManagerImpl;
+import org.jboss.weld.manager.DummyInjectionPoint;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Names;
@@ -248,7 +249,7 @@
throw new IllegalProductException(NON_SERIALIZABLE_PRODUCT_ERROR, getProducer());
}
InjectionPoint injectionPoint = manager.getCurrentInjectionPoint();
- if (injectionPoint == null || injectionPoint.equals(BeanManagerImpl.DUMMY_INJECTION_POINT))
+ if (injectionPoint == null || injectionPoint.equals(DummyInjectionPoint.INSTANCE))
{
return;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -30,19 +30,15 @@
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.manager.BeanManagerImpl;
-import org.jboss.weld.resolution.ResolvableTransformer;
import org.jboss.weld.util.collections.Arrays2;
public class InstanceBean extends AbstractFacadeBean<Instance<?>>
{
-
private static final Class<Instance<?>> INSTANCE_TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
private static final Class<Provider<?>> PROVIDER_TYPE = new TypeLiteral<Provider<?>>() {}.getRawType();
private static final Set<Type> DEFAULT_TYPES = Arrays2.<Type>asSet(INSTANCE_TYPE, PROVIDER_TYPE, Object.class);
private static final Any ANY = new AnyLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final ResolvableTransformer INSTANCE_TRANSFORMER = new FacadeBeanResolvableTransformer(INSTANCE_TYPE);
- public static final ResolvableTransformer PROVIDER_TRANSFORMER = new FacadeBeanResolvableTransformer(PROVIDER_TYPE);
public InstanceBean(BeanManagerImpl manager)
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -40,7 +40,7 @@
import org.jboss.weld.Container;
import org.jboss.weld.ContextualStoreImpl;
-import org.jboss.weld.Container.Status;
+import org.jboss.weld.ContainerState;
import org.jboss.weld.bean.builtin.BeanManagerBean;
import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.Environment;
@@ -288,7 +288,7 @@
this.deploymentManager = BeanManagerImpl.newRootManager("deployment", deploymentServices);
Container.initialize(deploymentManager, ServiceRegistries.unmodifiableServiceRegistry(deployment.getServices()));
- Container.instance().setStatus(Status.STARTING);
+ Container.instance().setStatus(ContainerState.STARTING);
createContexts();
initializeContexts();
@@ -381,7 +381,7 @@
// Re-read the deployment structure, this will be the physical structure, extensions, classes, and any beans added using addBean outside the physical structure
beanDeployments = deploymentVisitor.visit();
Container.instance().putBeanDeployments(beanDeployments);
- Container.instance().setStatus(Status.INITIALIZED);
+ Container.instance().setStatus(ContainerState.INITIALIZED);
}
return this;
}
@@ -406,7 +406,7 @@
synchronized (this)
{
// Register the managers so external requests can handle them
- Container.instance().setStatus(Status.VALIDATED);
+ Container.instance().setStatus(ContainerState.VALIDATED);
}
return this;
}
@@ -442,7 +442,7 @@
}
finally
{
- Container.instance().setStatus(Status.SHUTDOWN);
+ Container.instance().setStatus(ContainerState.SHUTDOWN);
Container.instance().deploymentServices().get(ContextLifecycle.class).endApplication();
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -28,7 +28,6 @@
import org.jboss.weld.bootstrap.api.Service;
import org.jboss.weld.ejb.spi.EjbDescriptor;
import org.jboss.weld.exceptions.ForbiddenStateException;
-import org.jboss.weld.exceptions.InvalidOperationException;
import com.google.common.base.Supplier;
import com.google.common.collect.Multimaps;
@@ -47,34 +46,7 @@
private final SetMultimap<Class<?>, String> ejbByClass;
- public static final EjbDescriptors EMPTY = new EjbDescriptors()
- {
- @Override
- public <T> void add(EjbDescriptor<T> ejbDescriptor)
- {
- throw new InvalidOperationException();
- }
-
- @Override
- public void addAll(Iterable<EjbDescriptor<?>> ejbDescriptors)
- {
- throw new InvalidOperationException();
- }
-
- @Override
- public void cleanup()
- {
- throw new InvalidOperationException();
- }
-
- @Override
- public void clear()
- {
- throw new InvalidOperationException();
- }
-
-
- };
+ public static final EjbDescriptors EMPTY = new EjbDescriptors();
/**
* Constructor
Modified: core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -37,7 +37,6 @@
import java.io.Serializable;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
@@ -60,7 +59,6 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.Decorator;
@@ -140,95 +138,7 @@
public class BeanManagerImpl implements WeldManager, Serializable
{
-
- private static class CurrentActivity
- {
-
- private final Context context;
- private final BeanManagerImpl manager;
-
- public CurrentActivity(Context context, BeanManagerImpl manager)
- {
- this.context = context;
- this.manager = manager;
- }
-
- public Context getContext()
- {
- return context;
- }
-
- public BeanManagerImpl getManager()
- {
- return manager;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof CurrentActivity)
- {
- return this.getContext().equals(((CurrentActivity) obj).getContext());
- }
- else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode()
- {
- return getContext().hashCode();
- }
-
- @Override
- public String toString()
- {
- return getContext() + " -> " + getManager();
- }
- }
-
private static final long serialVersionUID = 3021562879133838561L;
-
- public static final InjectionPoint DUMMY_INJECTION_POINT = new InjectionPoint()
- {
-
- public boolean isTransient()
- {
- return true;
- }
-
- public boolean isDelegate()
- {
- return false;
- }
-
- public Type getType()
- {
- return InjectionPoint.class;
- }
-
- public Set<Annotation> getQualifiers()
- {
- return Collections.emptySet();
- }
-
- public Member getMember()
- {
- return null;
- }
-
- public Bean<?> getBean()
- {
- return null;
- }
-
- public Annotated getAnnotated()
- {
- return null;
- }
- };
/*
* Application scoped services
@@ -486,11 +396,11 @@
// TODO Currently we build the accessible bean list on the fly, we need to set it in stone once bootstrap is finished...
- Transform<Bean<?>> beanTransform = new Transform.BeanTransform(this);
+ Transform<Bean<?>> beanTransform = new BeanTransform(this);
this.beanResolver = new TypeSafeBeanResolver<Bean<?>>(this, createDynamicAccessibleIterable(beanTransform));
- this.decoratorResolver = new TypeSafeDecoratorResolver(this, createDynamicAccessibleIterable(Transform.DECORATOR_BEAN));
- this.interceptorResolver = new TypeSafeInterceptorResolver(this, createDynamicAccessibleIterable(Transform.INTERCEPTOR_BEAN));
- this.observerResolver = new TypeSafeObserverResolver(this, createDynamicAccessibleIterable(Transform.EVENT_OBSERVER));
+ this.decoratorResolver = new TypeSafeDecoratorResolver(this, createDynamicAccessibleIterable(new DecoratorTransform()));
+ this.interceptorResolver = new TypeSafeInterceptorResolver(this, createDynamicAccessibleIterable(new InterceptorTransform()));
+ this.observerResolver = new TypeSafeObserverResolver(this, createDynamicAccessibleIterable(new ObserverMethodTransform()));
this.nameBasedResolver = new NameBasedResolver(this, createDynamicAccessibleIterable(beanTransform));
this.weldELResolver = new WeldELResolver(this);
this.childActivities = new CopyOnWriteArraySet<BeanManagerImpl>();
@@ -551,78 +461,6 @@
return Iterables.concat(iterable);
}
- private static interface Transform<T>
- {
-
- public static class BeanTransform implements Transform<Bean<?>>
- {
-
- private final BeanManagerImpl declaringBeanManager;
-
- public BeanTransform(BeanManagerImpl declaringBeanManager)
- {
- this.declaringBeanManager = declaringBeanManager;
- }
-
- public Iterable<Bean<?>> transform(BeanManagerImpl beanManager)
- {
- // New beans and built in beans aren't resolvable transitively
- if (beanManager.equals(declaringBeanManager))
- {
- return beanManager.getBeans();
- }
- else
- {
- return beanManager.getTransitiveBeans();
- }
- }
-
- };
-
- public static Transform<Decorator<?>> DECORATOR_BEAN = new Transform<Decorator<?>>()
- {
-
- public Iterable<Decorator<?>> transform(BeanManagerImpl beanManager)
- {
- return beanManager.getDecorators();
- }
-
- };
-
- public static Transform<Interceptor<?>> INTERCEPTOR_BEAN = new Transform<Interceptor<?>>()
- {
-
- public Iterable<Interceptor<?>> transform(BeanManagerImpl beanManager)
- {
- return beanManager.getInterceptors();
- }
-
- };
-
- public static Transform<ObserverMethod<?>> EVENT_OBSERVER = new Transform<ObserverMethod<?>>()
- {
-
- public Iterable<ObserverMethod<?>> transform(BeanManagerImpl beanManager)
- {
- return beanManager.getObservers();
- }
-
- };
-
- public static Transform<String> NAMESPACE = new Transform<String>()
- {
-
- public Iterable<String> transform(BeanManagerImpl beanManager)
- {
- return beanManager.getNamespaces();
- }
-
- };
-
- public Iterable<T> transform(BeanManagerImpl beanManager);
-
- }
-
public void addAccessibleBeanManager(BeanManagerImpl accessibleBeanManager)
{
accessibleManagers.add(accessibleBeanManager);
@@ -860,7 +698,7 @@
return Collections.unmodifiableList(beans);
}
- private List<Bean<?>> getTransitiveBeans()
+ List<Bean<?>> getTransitiveBeans()
{
return Collections.unmodifiableList(transitiveBeans);
}
@@ -877,7 +715,7 @@
public Iterable<Bean<?>> getAccessibleBeans()
{
- return createDynamicAccessibleIterable(new Transform.BeanTransform(this));
+ return createDynamicAccessibleIterable(new BeanTransform(this));
}
public void addContext(Context context)
@@ -1301,12 +1139,12 @@
public void pushDummyInjectionPoint()
{
- currentInjectionPoint.get().push(DUMMY_INJECTION_POINT);
+ currentInjectionPoint.get().push(DummyInjectionPoint.INSTANCE);
}
public void popDummyInjectionPoint()
{
- if (!currentInjectionPoint.get().isEmpty() && DUMMY_INJECTION_POINT.equals(currentInjectionPoint.get().peek()))
+ if (!currentInjectionPoint.get().isEmpty() && DummyInjectionPoint.INSTANCE.equals(currentInjectionPoint.get().peek()))
{
currentInjectionPoint.get().pop();
}
@@ -1350,7 +1188,7 @@
public Iterable<String> getAccessibleNamespaces()
{
// TODO Cache this
- return createDynamicAccessibleIterable(Transform.NAMESPACE);
+ return createDynamicAccessibleIterable(new NamespaceTransform());
}
private Set<CurrentActivity> getCurrentActivities()
@@ -1378,7 +1216,7 @@
// TODO I don't like this lazy init
if (rootNamespace == null)
{
- rootNamespace = new Namespace(createDynamicAccessibleIterable(Transform.NAMESPACE));
+ rootNamespace = new Namespace(createDynamicAccessibleIterable(new NamespaceTransform()));
}
return rootNamespace;
}
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanTransform.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanTransform.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanTransform.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,31 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+import javax.enterprise.inject.spi.Bean;
+
+public class BeanTransform implements Transform<Bean<?>>
+{
+
+ private final BeanManagerImpl declaringBeanManager;
+
+ public BeanTransform(BeanManagerImpl declaringBeanManager)
+ {
+ this.declaringBeanManager = declaringBeanManager;
+ }
+
+ public Iterable<Bean<?>> transform(BeanManagerImpl beanManager)
+ {
+ // New beans and built in beans aren't resolvable transitively
+ if (beanManager.equals(declaringBeanManager))
+ {
+ return beanManager.getBeans();
+ }
+ else
+ {
+ return beanManager.getTransitiveBeans();
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanTransform.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/CurrentActivity.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/CurrentActivity.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/CurrentActivity.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,54 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+import javax.enterprise.context.spi.Context;
+
+class CurrentActivity
+{
+
+ private final Context context;
+ private final BeanManagerImpl manager;
+
+ public CurrentActivity(Context context, BeanManagerImpl manager)
+ {
+ this.context = context;
+ this.manager = manager;
+ }
+
+ public Context getContext()
+ {
+ return context;
+ }
+
+ public BeanManagerImpl getManager()
+ {
+ return manager;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CurrentActivity)
+ {
+ return this.getContext().equals(((CurrentActivity) obj).getContext());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getContext().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getContext() + " -> " + getManager();
+ }
+}
\ No newline at end of file
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/CurrentActivity.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/DecoratorTransform.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/DecoratorTransform.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/DecoratorTransform.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+import javax.enterprise.inject.spi.Decorator;
+
+class DecoratorTransform implements Transform<Decorator<?>>
+{
+
+ public Iterable<Decorator<?>> transform(BeanManagerImpl beanManager)
+ {
+ return beanManager.getDecorators();
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/DecoratorTransform.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/DummyInjectionPoint.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/DummyInjectionPoint.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/DummyInjectionPoint.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,56 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+public class DummyInjectionPoint implements InjectionPoint
+{
+
+ public static final DummyInjectionPoint INSTANCE = new DummyInjectionPoint();
+
+ public boolean isTransient()
+ {
+ return true;
+ }
+
+ public boolean isDelegate()
+ {
+ return false;
+ }
+
+ public Type getType()
+ {
+ return InjectionPoint.class;
+ }
+
+ public Set<Annotation> getQualifiers()
+ {
+ return Collections.emptySet();
+ }
+
+ public Member getMember()
+ {
+ return null;
+ }
+
+ public Bean<?> getBean()
+ {
+ return null;
+ }
+
+ public Annotated getAnnotated()
+ {
+ return null;
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/DummyInjectionPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/InterceptorTransform.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/InterceptorTransform.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/InterceptorTransform.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+import javax.enterprise.inject.spi.Interceptor;
+
+class InterceptorTransform implements Transform<Interceptor<?>>
+{
+
+ public Iterable<Interceptor<?>> transform(BeanManagerImpl beanManager)
+ {
+ return beanManager.getInterceptors();
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/InterceptorTransform.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/NamespaceTransform.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/NamespaceTransform.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/NamespaceTransform.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,14 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+class NamespaceTransform implements Transform<String>
+{
+
+ public Iterable<String> transform(BeanManagerImpl beanManager)
+ {
+ return beanManager.getNamespaces();
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/NamespaceTransform.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/ObserverMethodTransform.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/ObserverMethodTransform.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/ObserverMethodTransform.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,16 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+import javax.enterprise.inject.spi.ObserverMethod;
+
+class ObserverMethodTransform implements Transform<ObserverMethod<?>>
+{
+
+ public Iterable<ObserverMethod<?>> transform(BeanManagerImpl beanManager)
+ {
+ return beanManager.getObservers();
+ }
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/ObserverMethodTransform.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/impl/src/main/java/org/jboss/weld/manager/Transform.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/Transform.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/Transform.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -0,0 +1,11 @@
+/**
+ *
+ */
+package org.jboss.weld.manager;
+
+interface Transform<T>
+{
+
+ public Iterable<T> transform(BeanManagerImpl beanManager);
+
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/manager/Transform.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -21,10 +21,13 @@
import java.util.Set;
import java.util.concurrent.Callable;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.util.TypeLiteral;
+import javax.inject.Provider;
-import org.jboss.weld.bean.builtin.EventBean;
-import org.jboss.weld.bean.builtin.InstanceBean;
+import org.jboss.weld.bean.builtin.FacadeBeanResolvableTransformer;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.collections.ConcurrentCache;
@@ -36,26 +39,25 @@
*/
public class TypeSafeBeanResolver<T extends Bean<?>> extends TypeSafeResolver<Resolvable, T>
{
+
+ private static final Class<Instance<?>> INSTANCE_TYPE = new TypeLiteral<Instance<?>>() {}.getRawType();
+ private static final Class<Provider<?>> PROVIDER_TYPE = new TypeLiteral<Provider<?>>() {}.getRawType();
+ private static final Class<Event<?>> EVENT_TYPE = new TypeLiteral<Event<?>>() {}.getRawType();
- public static final Set<ResolvableTransformer> TRANSFORMERS;
-
+ private final Set<ResolvableTransformer> transformers;
private final BeanManagerImpl manager;
private final ConcurrentCache<Set<?>, Set<Bean<?>>> disambiguatedBeans;
-
- static
- {
- TRANSFORMERS = new HashSet<ResolvableTransformer>();
- TRANSFORMERS.add(EventBean.TRANSFORMER);
- TRANSFORMERS.add(InstanceBean.INSTANCE_TRANSFORMER);
- TRANSFORMERS.add(InstanceBean.PROVIDER_TRANSFORMER);
- TRANSFORMERS.add(new NewResolvableTransformer());
- }
public TypeSafeBeanResolver(BeanManagerImpl manager, Iterable<T> beans)
{
super(beans);
this.manager = manager;
this.disambiguatedBeans = new ConcurrentCache<Set<?>, Set<Bean<?>>>();
+ transformers = new HashSet<ResolvableTransformer>();
+ transformers.add(new FacadeBeanResolvableTransformer(EVENT_TYPE));
+ transformers.add(new FacadeBeanResolvableTransformer(INSTANCE_TYPE));
+ transformers.add(new FacadeBeanResolvableTransformer(PROVIDER_TYPE));
+ transformers.add(new NewResolvableTransformer());
}
@Override
@@ -81,7 +83,7 @@
@Override
protected Iterable<ResolvableTransformer> getTransformers()
{
- return TRANSFORMERS;
+ return transformers;
}
@Override
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -57,7 +57,7 @@
/**
* "Not found" enumeration value.
*/
- public enum DummyEnum
+ public static enum DummyEnum
{
DUMMY_VALUE
}
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/ContainerStatusTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/ContainerStatusTest.java 2010-01-08 14:23:49 UTC (rev 5400)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/bootstrap/ContainerStatusTest.java 2010-01-08 17:04:14 UTC (rev 5401)
@@ -1,7 +1,7 @@
package org.jboss.weld.tests.unit.bootstrap;
import org.jboss.weld.Container;
-import org.jboss.weld.Container.Status;
+import org.jboss.weld.ContainerState;
import org.jboss.weld.mock.MockServletLifecycle;
import org.jboss.weld.mock.TestContainer;
import org.testng.annotations.Test;
@@ -16,16 +16,16 @@
assert !Container.available();
container.getLifecycle().initialize();
assert !Container.available();
- assert Container.instance().getStatus().equals(Status.STARTING);
+ assert Container.instance().getStatus().equals(ContainerState.STARTING);
container.getLifecycle().getBootstrap().startInitialization();
assert !Container.available();
- assert Container.instance().getStatus().equals(Status.STARTING);
+ assert Container.instance().getStatus().equals(ContainerState.STARTING);
container.getLifecycle().getBootstrap().deployBeans();
assert Container.available();
- assert Container.instance().getStatus().equals(Status.INITIALIZED);
+ assert Container.instance().getStatus().equals(ContainerState.INITIALIZED);
container.getLifecycle().getBootstrap().validateBeans().endInitialization();
assert Container.available();
- assert Container.instance().getStatus().equals(Status.VALIDATED);
+ assert Container.instance().getStatus().equals(ContainerState.VALIDATED);
container.stopContainer();
assert !Container.available();
}
15Â years
Weld SVN: r5400 - in core/trunk/tests/src/test: java/org/jboss/weld/tests/contexts/errorpage and 3 other directories.
by weld-commitsï¼ lists.jboss.org
Author: dallen6
Date: 2010-01-08 09:23:49 -0500 (Fri, 08 Jan 2010)
New Revision: 5400
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/ErrorPageTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Rain.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Storm.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/.faces-config.xml.jsfdia
core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/error.jsf
core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/faces-config.xml
core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/storm.jsf
core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/web.xml
Log:
WELD-29 test case
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/ErrorPageTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/ErrorPageTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/ErrorPageTest.java 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.tests.contexts.errorpage;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlDivision;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+
+/**
+ * <p>This test was mostly developed to test the scenario related to WELD-29. Essentially
+ * a JSF action throws an exception, and the error page is then rendered during which
+ * all relevant scopes for CDI are tested.</p>
+ *
+ * @author David Allen
+ *
+ */
+@Artifact(addCurrentPackage=false)
+(a)Classes({Storm.class})
+@IntegrationTest(runLocally=true)
+@Resources({
+ @Resource(destination=WarArtifactDescriptor.WEB_XML_DESTINATION, source="web.xml"),
+ @Resource(destination="storm.jspx", source="storm.jsf"),
+ @Resource(destination="error.jspx", source="error.jsf"),
+ @Resource(destination="/WEB-INF/faces-config.xml", source="faces-config.xml")
+})
+public class ErrorPageTest extends AbstractWeldTest
+{
+ @Test(description = "WELD-29", groups = { "broken" })
+ public void testActionMethodExceptionDoesNotDestroyContext() throws Exception
+ {
+ WebClient client = new WebClient();
+ client.setThrowExceptionOnFailingStatusCode(false);
+
+ HtmlPage page = client.getPage(getPath("/storm.jsf"));
+ HtmlSubmitInput disasterButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "disasterButton");
+ page = disasterButton.click();
+ assert "Application Error".equals(page.getTitleText());
+ HtmlDivision conversationValue = getFirstMatchingElement(page, HtmlDivision.class, "conversation");
+ assert conversationValue.asText().equals("0");
+ HtmlDivision requestValue = getFirstMatchingElement(page, HtmlDivision.class, "request");
+ assert requestValue.asText().equals("medium");
+ }
+
+ protected <T> Set<T> getElements(HtmlElement rootElement, Class<T> elementClass)
+ {
+ Set<T> result = new HashSet<T>();
+
+ for (HtmlElement element : rootElement.getAllHtmlChildElements())
+ {
+ result.addAll(getElements(element, elementClass));
+ }
+
+ if (elementClass.isInstance(rootElement))
+ {
+ result.add(elementClass.cast(rootElement));
+ }
+ return result;
+
+ }
+
+ protected <T extends HtmlElement> T getFirstMatchingElement(HtmlPage page, Class<T> elementClass, String id)
+ {
+
+ Set<T> inputs = getElements(page.getBody(), elementClass);
+ for (T input : inputs)
+ {
+ if (input.getId().contains(id))
+ {
+ return input;
+ }
+ }
+ return null;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/ErrorPageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Rain.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Rain.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Rain.java 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,12 @@
+package org.jboss.weld.tests.contexts.errorpage;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+public class Rain
+{
+ public String getSeverityLevel()
+ {
+ return "medium";
+ }
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Rain.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Storm.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Storm.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Storm.java 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,44 @@
+package org.jboss.weld.tests.contexts.errorpage;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.ConversationScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named
+@ConversationScoped
+public class Storm implements Serializable
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1513633490356967202L;
+
+ @Inject Conversation conversation;
+
+ private String strength = "0";
+
+ public void beginConversation()
+ {
+ conversation.begin();
+ }
+
+ public void disaster()
+ {
+ throw new RuntimeException("Storm is a disaster");
+ }
+
+ public String getStrength()
+ {
+ return strength;
+ }
+
+ public void setStrength(String strength)
+ {
+ this.strength = strength;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/errorpage/Storm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/.faces-config.xml.jsfdia
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/.faces-config.xml.jsfdia (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/.faces-config.xml.jsfdia 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS model-entity="JSFProcess"/>
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/error.jsf
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/error.jsf (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/error.jsf 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns="http://www.w3.org/1999/xhtml"
+ version="2.0">
+ <jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+ <jsp:directive.page contentType="text/html"/>
+ <html>
+ <head>
+ <title>Application Error</title>
+ </head>
+ <body>
+ <h1>Application Error</h1>
+ <p>The following error occurred while processing the request:</p>
+
+ <div id="request">${rain.serverityLevel}</div>
+ <div id="conversation">${storm.strength}</div>
+
+ </body>
+ </html>
+</jsp:root>
+
Property changes on: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/error.jsf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/faces-config.xml
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/faces-config.xml (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/faces-config.xml 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+</faces-config>
Property changes on: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/storm.jsf
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/storm.jsf (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/storm.jsf 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns="http://www.w3.org/1999/xhtml"
+ version="2.0">
+ <jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+ <jsp:directive.page contentType="text/html"/>
+ <html>
+ <head>
+ </head>
+ <body>
+ <f:view>
+ <h:form id="form">
+ <h:inputText value="#{storm.strength}" id="stormStrength" />
+ <h:commandButton action="#{storm.beginConversation}" value="Begin" id="beginConversationButton"/>
+ <h:commandButton action="#{storm.disaster}" value="Disaster" id="disasterButton"/>
+ </h:form>
+ </f:view>
+ </body>
+ </html>
+</jsp:root>
\ No newline at end of file
Property changes on: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/storm.jsf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/web.xml
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/web.xml (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/web.xml 2010-01-08 14:23:49 UTC (rev 5400)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <display-name>JSR-299 RI Core Tests</display-name>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.jspx</param-value>
+ </context-param>
+ <!-- JSF -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>Conversation Status Servlet</servlet-name>
+ <servlet-class>org.jboss.jsr299.tck.tests.context.conversation.client.ConversationStatusServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Conversation Status Servlet</servlet-name>
+ <url-pattern>/conversation-status</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+ <error-page>
+ <exception-type>java.lang.Exception</exception-type>
+ <location>/error.jspx</location>
+ </error-page>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Property changes on: core/trunk/tests/src/test/resources/org/jboss/weld/tests/contexts/errorpage/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15Â years