[jboss-cvs] JBossAS SVN: r95059 - in trunk: component-matrix and 21 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 16 23:32:55 EDT 2009
Author: smcgowan at redhat.com
Date: 2009-10-16 23:32:54 -0400 (Fri, 16 Oct 2009)
New Revision: 95059
Added:
trunk/testsuite/imports/sections/weld.xml
trunk/testsuite/src/main/org/jboss/test/deployers/weld/
trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/
trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Game.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Generator.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/MaxNumber.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Random.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/
trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldExampleTest.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldNumberguessExampleUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslatorExampleUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceParser.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceTranslator.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TextTranslator.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/Translator.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorController.java
trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorControllerBean.java
trunk/testsuite/src/resources/deployers/weld/
trunk/testsuite/src/resources/deployers/weld/numberguess/
trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/
trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/beans.xml
trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/faces-config.xml
trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/web.xml
trunk/testsuite/src/resources/deployers/weld/numberguess/home.xhtml
trunk/testsuite/src/resources/deployers/weld/numberguess/index.html
trunk/testsuite/src/resources/deployers/weld/numberguess/template.xhtml
trunk/testsuite/src/resources/deployers/weld/translator/
trunk/testsuite/src/resources/deployers/weld/translator/META-INF/
trunk/testsuite/src/resources/deployers/weld/translator/META-INF/application.xml
trunk/testsuite/src/resources/deployers/weld/translator/ejb/
trunk/testsuite/src/resources/deployers/weld/translator/ejb/META-INF/
trunk/testsuite/src/resources/deployers/weld/translator/ejb/META-INF/beans.xml
trunk/testsuite/src/resources/deployers/weld/translator/war/
trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/
trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/faces-config.xml
trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/lib/
trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/lib/el-ri-1.2.jar
trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/lib/jsf-facelets-1.1.15.B1.jar
trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/web.xml
trunk/testsuite/src/resources/deployers/weld/translator/war/home.xhtml
trunk/testsuite/src/resources/deployers/weld/translator/war/index.html
trunk/testsuite/src/resources/deployers/weld/translator/war/template.xhtml
Modified:
trunk/build/build.xml
trunk/build/pom.xml
trunk/component-matrix/pom.xml
trunk/server/pom.xml
trunk/testsuite/build.xml
trunk/testsuite/imports/test-jars.xml
Log:
JBAS-7263, JBAS-7266 - Add WELD APIs and Integration Tests
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2009-10-16 23:56:07 UTC (rev 95058)
+++ trunk/build/build.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -405,18 +405,21 @@
<include name="asm.jar"/>
<include name="cglib-2.1.1.jar"/>
<include name="jcl-over-slf4j.jar"/>
+ <include name="cdi-api.jar"/>
<include name="concurrent.jar"/>
<include name="ejb3-persistence.jar"/>
<include name="hibernate-annotations.jar"/>
<include name="hibernate-commons-annotations.jar"/>
<include name="hibernate-core.jar"/>
<include name="hibernate-validator.jar"/>
+ <include name="javax.inject.jar"/>
<include name="jboss-annotations-ejb3.jar"/>
<include name="jboss-auth.jar"/>
<include name="jboss-appclient.jar"/>
<include name="jboss-common*.jar"/>
<include name="jboss-ejb3-ext-api.jar"/>
<include name="jboss-logging*.jar"/>
+ <include name="jboss-interceptor-api.jar"/>
<include name="slf4j-api.jar"/>
<include name="slf4j-jboss-logging.jar"/>
<include name="jboss-deployment.jar"/>
@@ -439,6 +442,7 @@
<include name="jbossjts.jar"/>
<include name="jbossjts-integration.jar"/>
<include name="jbossjts-jacorb.jar"/>
+ <include name="weld-api.jar"/>
<!-- client excludes -->
<exclude name="jbossws-native-client.jar"/>
<exclude name="${jbossall.client.filename}"/>
@@ -2002,6 +2006,7 @@
<fileset refid="org.hibernate:hibernate-entitymanager:jar"/>
<fileset refid="org.hibernate:hibernate-annotations:jar"/>
<fileset refid="org.hibernate:hibernate-validator:jar"/>
+ <fileset refid="org.jboss.interceptor:jboss-interceptor-api:jar"/>
<fileset refid="org.jboss.jpa:jboss-jpa-deployers:jar"/>
<fileset refid="org.jboss.jpa:jboss-jpa-impl:jar"/>
<fileset refid="org.jboss.jpa:jboss-jpa-spi:jar"/>
@@ -2010,6 +2015,8 @@
<fileset refid="org.jboss.aspects:jboss-security-aspects:jar"/>
<fileset refid="org.jboss.aspects:jboss-transaction-aspects:jar"/>
<fileset refid="bcel:bcel:jar"/>
+ <fileset refid="javax.enterprise:cdi-api:jar"/>
+ <fileset refid="javax.inject:javax.inject:jar"/>
<fileset refid="javax.mail:mail:jar"/>
<fileset refid="javax.validation:validation-api:jar"/>
<fileset refid="jboss.messaging:jboss-messaging:jar"/>
@@ -2020,6 +2027,7 @@
<fileset refid="jboss.web:el-api:jar"/>
<fileset refid="jboss.web:jsp-api:jar"/>
<fileset refid="jboss.web:servlet-api:jar"/>
+ <fileset refid="org.jboss.weld:weld-api:jar"/>
<mapper refid="remove-versions" />
</copy>
@@ -2107,7 +2115,10 @@
<fileset refid="org.apache:xmlsec:jar"/>
<fileset refid="wsdl4j:wsdl4j:jar"/>
<fileset refid="javassist:javassist:jar"/>
+ <fileset refid="javax.enterprise:cdi-api:jar"/>
+ <fileset refid="javax.inject:javax.inject:jar"/>
<fileset refid="org.jboss:jboss-common-core:jar"/>
+ <fileset refid="org.jboss.interceptor:jboss-interceptor-api:jar"/>
<fileset refid="org.jboss.logging:jboss-logging-spi:jar"/>
<fileset refid="org.jboss.logging:jboss-logging-jdk:jar"/>
<fileset refid="org.jboss.logging:jboss-logging-log4j:jar"/>
@@ -2189,6 +2200,7 @@
<fileset refid="stax:stax-api:jar"/>
<fileset refid="org.codehaus.jettison:jettison:jar"/>
<fileset refid="org.jboss.netty:netty:jar"/>
+ <fileset refid="org.jboss.weld:weld-api:jar"/>
<mapper refid="remove-versions" />
</copy>
<!--
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2009-10-16 23:56:07 UTC (rev 95058)
+++ trunk/build/pom.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -241,6 +241,14 @@
<artifactId>resources</artifactId>
</dependency>
<dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ <dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
@@ -387,6 +395,10 @@
<classifier>client</classifier>
</dependency>
<dependency>
+ <groupId>org.jboss.interceptor</groupId>
+ <artifactId>jboss-interceptor-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-javaee</artifactId>
</dependency>
@@ -462,6 +474,10 @@
<type>zip</type>
</dependency>
<dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-client</artifactId>
</dependency>
Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml 2009-10-16 23:56:07 UTC (rev 95058)
+++ trunk/component-matrix/pom.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -122,6 +122,7 @@
<version.sun.jaxb>2.1.9</version.sun.jaxb>
<version.webbeans.integration>5.2.0.Beta2</version.webbeans.integration>
<version.xdoclet>1.2.3</version.xdoclet>
+ <version.weld.api>1.0-CR1</version.weld.api>
<version.spring.integration>1.0.0.CR2</version.spring.integration>
</properties>
@@ -1913,13 +1914,13 @@
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-javaee</artifactId>
- <version>5.0.1${version.suffix.org.jboss.javaee}</version>
+ <version>5.2.0.Beta1</version>
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-ejb-api</artifactId>
- <version>3.0.0${version.suffix.org.jboss.javaee}</version>
+ <version>3.0.0${version.suffix.org.jboss.javaee}_SP1</version>
</dependency>
<dependency>
@@ -1959,6 +1960,30 @@
</dependency>
<dependency>
+ <groupId>org.jboss.interceptor</groupId>
+ <artifactId>jboss-interceptor-api</artifactId>
+ <version>3.1.0-CR1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <version>${version.weld.api}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-api</artifactId>
+ <version>${version.weld.api}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.jpa</groupId>
<artifactId>jboss-jpa-deployers</artifactId>
<version>${version.org.jboss.jpa.deployers}</version>
Modified: trunk/server/pom.xml
===================================================================
--- trunk/server/pom.xml 2009-10-16 23:56:07 UTC (rev 95058)
+++ trunk/server/pom.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -345,6 +345,11 @@
</dependency>
<dependency>
+ <groupId>org.jboss.interceptor</groupId>
+ <artifactId>jboss-interceptor-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml 2009-10-16 23:56:07 UTC (rev 95058)
+++ trunk/testsuite/build.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -228,6 +228,8 @@
<fileset refid="jacorb:idl_g:jar"/>
<fileset refid="jacorb:jacorb:jar"/>
<fileset refid="jacorb:jacorb_g:jar"/>
+ <fileset refid="javax.enterprise:cdi-api:jar"/>
+ <fileset refid="javax.inject:javax.inject:jar"/>
<fileset refid="org.jboss.cache:jbosscache-core:jar"/>
<fileset refid="org.jboss.cache:jbosscache-pojo:jar"/>
<fileset refid="jgroups:jgroups:jar"/>
@@ -274,6 +276,7 @@
<fileset refid="org.hibernate:ejb3-persistence:jar"/>
<fileset refid="org.hibernate:hibernate-annotations:jar"/>
<fileset refid="org.hibernate:hibernate-entitymanager:jar"/>
+ <fileset refid="org.jboss.interceptor:jboss-interceptor-api:jar"/>
<fileset refid="org.jboss.ws:jbossws-common:jar"/>
<fileset refid="org.jboss.ws:jbossws-framework:jar"/>
<fileset refid="org.jboss.ws:jbossws-spi:jar"/>
@@ -1081,7 +1084,7 @@
<patternset id="profileservice.includes">
<include name="org/jboss/test/profileservice/test/*TestCase.class"/>
<include name="org/jboss/test/profileservice/override/test/*TestCase.class"/>
- <!-- deployers + seam -->
+ <!-- deployers + seam + weld -->
<include name="org/jboss/test/deployers/test/*UnitTestCase.class"/>
<include name="org/jboss/test/deployers/client/test/*UnitTestCase.class"/>
<include name="org/jboss/test/deployers/ear/test/*UnitTestCase.class"/>
@@ -1092,11 +1095,12 @@
<include name="org/jboss/test/deployers/jbas2904/test/*UnitTestCase.class"/>
<include name="org/jboss/test/deployers/seam/test/*UnitTestCase.class"/>
<include name="org/jboss/test/deployers/spaces/test/*UnitTestCase.class"/>
+ <include name="org/jboss/test/deployers/weld/test/*UnitTestCase.class"/>
</patternset>
<patternset id="profileservice.excludes">
<exclude name="org/jboss/test/profileservice/test/*TestCase.class"/>
<exclude name="org/jboss/test/profileservice/override/test/*TestCase.class"/>
- <!-- deployers + seam -->
+ <!-- deployers + seam + weld -->
<exclude name="org/jboss/test/deployers/test/*UnitTestCase.class"/>
<exclude name="org/jboss/test/deployers/client/test/*UnitTestCase.class"/>
<exclude name="org/jboss/test/deployers/ear/test/*UnitTestCase.class"/>
@@ -1107,6 +1111,7 @@
<exclude name="org/jboss/test/deployers/jbas2904/test/*UnitTestCase.class"/>
<exclude name="org/jboss/test/deployers/seam/test/*UnitTestCase.class"/>
<exclude name="org/jboss/test/deployers/spaces/test/*UnitTestCase.class"/>
+ <exclude name="org/jboss/test/deployers/weld/test/*UnitTestCase.class"/>
</patternset>
<patternset id="profileservice.restart.includes">
<!-- include target for persisted admin changes -->
Added: trunk/testsuite/imports/sections/weld.xml
===================================================================
--- trunk/testsuite/imports/sections/weld.xml (rev 0)
+++ trunk/testsuite/imports/sections/weld.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,65 @@
+<project name="tests-weld-jars">
+
+ <target name="translator" depends="compile">
+ <mkdir dir="${build.lib}" />
+
+ <jar destfile="${build.lib}/weld-translator.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/deployers/weld/translator/ejb/**"/>
+ </fileset>
+ <fileset dir="${source.resources}/deployers/weld/translator/ejb">
+ <include name="META-INF/beans.xml"/>
+ </fileset>
+ </jar>
+
+ <war warfile="${build.lib}/weld-translator.war"
+ webxml="${source.resources}/deployers/weld/translator/war/WEB-INF/web.xml">
+ <webinf dir="${source.resources}/deployers/weld/translator/war/WEB-INF">
+ <include name="faces-config.xml"/>
+ <include name="beans.xml"/>
+ <include name="lib/**"/>
+ </webinf>
+ <fileset dir="${source.resources}/deployers/weld/translator/war/">
+ <include name="home.xhtml"/>
+ <include name="index.html"/>
+ <include name="template.xhtml"/>
+ </fileset>
+ </war>
+
+ <jar destfile="${build.lib}/weld-translator.ear">
+ <fileset dir="${build.lib}">
+ <include name="weld-translator.jar"/>
+ <include name="weld-translator.war"/>
+ </fileset>
+ <fileset dir="${source.resources}/deployers/weld/translator">
+ <include name="META-INF/application.xml"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="numberguess" depends="compile">
+ <mkdir dir="${build.lib}" />
+
+ <war warfile="${build.lib}/weld-numberguess.war"
+ webxml="${source.resources}/deployers/weld/numberguess/WEB-INF/web.xml">
+ <webinf dir="${source.resources}/deployers/weld/numberguess/WEB-INF">
+ <include name="faces-config.xml"/>
+ <include name="beans.xml"/>
+ </webinf>
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/deployers/weld/numberguess/**"/>
+ </classes>
+ <fileset dir="${source.resources}/deployers/weld/numberguess/">
+ <include name="home.xhtml"/>
+ <include name="index.html"/>
+ <include name="template.xhtml"/>
+ </fileset>
+ </war>
+
+ </target>
+
+ <target name="_jars-weld" depends="numberguess, translator">
+ <mkdir dir="${build.lib}" />
+ </target>
+
+</project>
Modified: trunk/testsuite/imports/test-jars.xml
===================================================================
--- trunk/testsuite/imports/test-jars.xml 2009-10-16 23:56:07 UTC (rev 95058)
+++ trunk/testsuite/imports/test-jars.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -78,6 +78,7 @@
<import file="sections/tx.xml"/>
<import file="sections/util.xml"/>
<import file="sections/web.xml"/>
+ <import file="sections/weld.xml"/>
<import file="sections/webservice.xml"/>
<import file="sections/ws.xml"/>
<import file="sections/xa.xml"/>
@@ -176,6 +177,7 @@
_jars-util,
_jars-web,
_jars-webservice,
+ _jars-weld,
_jars-ws,
_jars-xa,
_jars-xslt,
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Game.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Game.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Game.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,114 @@
+package org.jboss.test.deployers.weld.numberguess;
+
+
+import java.io.Serializable;
+
+import javax.inject.Named;
+import javax.inject.Inject;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Instance;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+
+ at Named
+ at SessionScoped
+public class Game implements Serializable
+{
+ private int number;
+ private int guess;
+ private int smallest;
+
+ @MaxNumber @Inject
+ private int maxNumber;
+
+ private int biggest;
+ private int remainingGuesses;
+
+ @Random @Inject Instance<Integer> randomNumber;
+
+ public Game()
+ {
+ }
+
+ public int getNumber()
+ {
+ return number;
+ }
+
+ public int getGuess()
+ {
+ return guess;
+ }
+
+ public void setGuess(int guess)
+ {
+ this.guess = guess;
+ }
+
+ public int getSmallest()
+ {
+ return smallest;
+ }
+
+ public int getBiggest()
+ {
+ return biggest;
+ }
+
+ public int getRemainingGuesses()
+ {
+ return remainingGuesses;
+ }
+
+ public String check() throws InterruptedException
+ {
+ if (guess>number)
+ {
+ biggest = guess - 1;
+ }
+ if (guess<number)
+ {
+ smallest = guess + 1;
+ }
+ if (guess == number)
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Correct!"));
+ }
+ remainingGuesses--;
+ return null;
+ }
+
+ @PostConstruct
+ public void reset()
+ {
+ this.smallest = 0;
+ this.guess = 0;
+ this.remainingGuesses = 10;
+ this.biggest = maxNumber;
+ this.number = randomNumber.get();
+ }
+
+ public void validateNumberRange(FacesContext context, UIComponent toValidate, Object value)
+ {
+ int input = (Integer) value;
+
+ if (remainingGuesses <= 0)
+ {
+ FacesMessage message = new FacesMessage("No guesses left!");
+ context.addMessage(toValidate.getClientId(context), message);
+ ((UIInput)toValidate).setValid(false);
+ return;
+ }
+
+ if (input < smallest || input > biggest)
+ {
+ ((UIInput)toValidate).setValid(false);
+
+ FacesMessage message = new FacesMessage("Invalid guess");
+ context.addMessage(toValidate.getClientId(context), message);
+ }
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Generator.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Generator.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Generator.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,33 @@
+package org.jboss.test.deployers.weld.numberguess;
+
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+
+ at ApplicationScoped
+public class Generator implements Serializable
+{
+
+ private static final long serialVersionUID = -7213673465118041882L;
+
+ private java.util.Random random = new java.util.Random( System.currentTimeMillis() );
+
+ private int maxNumber = 100;
+
+ java.util.Random getRandom()
+ {
+ return random;
+ }
+
+ @Produces @Random int next() {
+ return getRandom().nextInt(maxNumber);
+ }
+
+ @Produces @MaxNumber int getMaxNumber()
+ {
+ return maxNumber;
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/MaxNumber.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/MaxNumber.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/MaxNumber.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,23 @@
+package org.jboss.test.deployers.weld.numberguess;
+
+
+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.inject.Qualifier;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at Qualifier
+public @interface MaxNumber
+{
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Random.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Random.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/numberguess/Random.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,23 @@
+package org.jboss.test.deployers.weld.numberguess;
+
+
+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.inject.Qualifier;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at Qualifier
+public @interface Random
+{
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldExampleTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldExampleTest.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldExampleTest.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,199 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.weld.test;
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Test;
+import org.jboss.test.deployers.AbstractDeploymentTest;
+import org.jboss.test.util.web.HttpUtils;
+
+/**
+ * Test WELD Examples
+*/
+
+public abstract class WeldExampleTest extends AbstractDeploymentTest
+{
+ // Example libs
+ public static final String WB = "weld-";
+ public static final String simpleName = "weld-%1$s";
+ public static final String exampleName = simpleName;
+ public static final String exampleEar = exampleName + ".ear";
+ public static final String exampleJar = exampleName + ".jar";
+ public static final String exampleWar = exampleName + ".war";
+ public static final String exampleDS = exampleName + "-ds.xml";
+
+
+ protected enum Type
+ {
+ EAR(exampleEar),
+ JAR(exampleJar),
+ WAR(exampleWar);
+
+ private String format;
+
+ Type(String format)
+ {
+ this.format = format;
+ }
+
+ public String getFormat()
+ {
+ return format;
+ }
+ }
+
+ private boolean testExpected;
+ private boolean useAuthentification;
+ private String username;
+ private String password;
+
+ protected WeldExampleTest(String test)
+ {
+ super(test);
+ }
+
+ protected static Test deploy(Class clazz) throws Exception
+ {
+ return deploy(clazz, true);
+ }
+
+ protected static Test deploy(Class clazz, boolean includeDS) throws Exception
+ {
+ return deploy(clazz, includeDS, Type.EAR);
+ }
+
+ protected static Test deploy(Class clazz, boolean includeDS, Type type) throws Exception
+ {
+ String name = getExampleName(clazz);
+ String deployments = String.format(type.getFormat(), name);
+ return getManagedDeployment(clazz, deployments);
+ }
+
+ protected static String getExampleName(Class clazz)
+ {
+ String className = clazz.getSimpleName();
+ int start = "Weld".length();
+ int end = "ExampleUnitTestCase".length();
+ int length = className.length();
+ return className.substring(start, length - end).toLowerCase();
+ }
+
+ /**
+ * Return type.
+ * Use EAR by default.
+ *
+ * @return
+ */
+ protected Type getType()
+ {
+ return Type.EAR;
+ }
+
+ protected String getExampleName()
+ {
+ return getExampleName(getClass());
+ }
+
+ protected String getTopLevelDeployment(String exampleName)
+ {
+ return String.format(getType().getFormat(), exampleName);
+ }
+
+ public void testExample() throws Exception
+ {
+ String exampleName = getExampleName();
+ log.info("Testing Weld " + exampleName + " example.");
+ String topLevelDeployment = getTopLevelDeployment(exampleName);
+
+ assertTrue(isDeployed(topLevelDeployment));
+
+ if (testExpected)
+ {
+ final Set<String> expected = getExpectedDeployments(topLevelDeployment, exampleName);
+ assertDeployed(topLevelDeployment, expected);
+ }
+
+ URL testURL = getBaseURL();
+ log.info("Accessing test URL: " + testURL);
+ HttpUtils.accessURL(testURL);
+ }
+
+ protected String getBaseURLString()
+ {
+ if (useAuthentification)
+ {
+ if (username != null && password != null)
+ return HttpUtils.getBaseURL(username, password);
+ else
+ return HttpUtils.getBaseURL();
+ }
+ return HttpUtils.getBaseURLNoAuth();
+ }
+
+ protected String getWebContextFormat()
+ {
+ return simpleName;
+ }
+
+ protected String getWebContextName()
+ {
+ return String.format(getWebContextFormat(), getExampleName());
+ }
+
+ protected URL getBaseURL() throws Exception
+ {
+ String example = getWebContextName();
+ return new URL(getBaseURLString() + example);
+ }
+
+ protected Set<String> getExpectedDeployments(String topLevelDeployment, String exampleName)
+ {
+ final Set<String> expected = new HashSet<String>();
+ expected.add(topLevelDeployment);
+ expected.add(String.format(exampleJar, exampleName));
+ expected.add(String.format(exampleWar, exampleName));
+ return expected;
+ }
+
+ public void setTestExpected(boolean testExpected)
+ {
+ this.testExpected = testExpected;
+ }
+
+ public void setUseAuthentification(boolean useAuthentification)
+ {
+ this.useAuthentification = useAuthentification;
+ }
+
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldNumberguessExampleUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldNumberguessExampleUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldNumberguessExampleUnitTestCase.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.weld.test;
+
+import junit.framework.Test;
+
+/**
+ * Test WELD Numberguess example.
+ *
+ */
+public class WeldNumberguessExampleUnitTestCase extends WeldExampleTest
+{
+ public WeldNumberguessExampleUnitTestCase(String test)
+ {
+ super(test);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return deploy(WeldNumberguessExampleUnitTestCase.class, false, Type.WAR);
+ }
+
+ protected Type getType()
+ {
+ return Type.WAR;
+ }
+
+ protected String getWebContextFormat()
+ {
+ return exampleName;
+ }
+
+}
+
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslatorExampleUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslatorExampleUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/test/WeldTranslatorExampleUnitTestCase.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.weld.test;
+
+import junit.framework.Test;
+
+/**
+ * Test WELD Translator example.
+ *
+ */
+public class WeldTranslatorExampleUnitTestCase extends WeldExampleTest
+{
+ public WeldTranslatorExampleUnitTestCase(String test)
+ {
+ super(test);
+ setTestExpected(true);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return deploy(WeldTranslatorExampleUnitTestCase.class, false);
+ }
+}
+
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceParser.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceParser.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceParser.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,14 @@
+package org.jboss.test.deployers.weld.translator.ejb;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class SentenceParser
+{
+
+ public List<String> parse(String text)
+ {
+ return Arrays.asList( text.split("[.?]") );
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceTranslator.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceTranslator.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/SentenceTranslator.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,15 @@
+package org.jboss.test.deployers.weld.translator.ejb;
+
+
+import javax.ejb.Stateless;
+
+ at Stateless
+public class SentenceTranslator implements Translator
+{
+
+ public String translate(String sentence)
+ {
+ return "Lorem ipsum dolor sit amet";
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TextTranslator.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TextTranslator.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TextTranslator.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,31 @@
+package org.jboss.test.deployers.weld.translator.ejb;
+
+
+import java.io.Serializable;
+
+import javax.ejb.EJB;
+import javax.inject.Inject;
+
+public class TextTranslator implements Serializable
+{
+ private SentenceParser sentenceParser;
+
+ @EJB Translator translator;
+
+ @Inject
+ TextTranslator(SentenceParser sentenceParser)
+ {
+ this.sentenceParser = sentenceParser;
+ }
+
+ public String translate(String text)
+ {
+ StringBuilder sb = new StringBuilder();
+ for (String sentence: sentenceParser.parse(text))
+ {
+ sb.append(translator.translate(sentence)).append(". ");
+ }
+ return sb.toString().trim();
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/Translator.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/Translator.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/Translator.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,12 @@
+package org.jboss.test.deployers.weld.translator.ejb;
+
+
+import javax.ejb.Local;
+
+ at Local
+public interface Translator
+{
+
+ public String translate(String sentence);
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorController.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorController.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorController.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,17 @@
+package org.jboss.test.deployers.weld.translator.ejb;
+
+
+public interface TranslatorController
+{
+
+ public String getText();
+
+ public void setText(String text);
+
+ public void translate();
+
+ public String getTranslatedText();
+
+ public void remove();
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorControllerBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorControllerBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/weld/translator/ejb/TranslatorControllerBean.java 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,47 @@
+package org.jboss.test.deployers.weld.translator.ejb;
+
+import javax.inject.Named;
+import javax.enterprise.context.RequestScoped;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Inject;
+
+ at Stateful
+ at RequestScoped
+ at Named("translator")
+public class TranslatorControllerBean implements TranslatorController
+{
+
+ @Inject TextTranslator translator;
+
+ private String inputText;
+
+ private String translatedText;
+
+ public String getText()
+ {
+ return inputText;
+ }
+
+ public void setText(String text)
+ {
+ this.inputText = text;
+ }
+
+ public void translate()
+ {
+ translatedText = translator.translate(inputText);
+ }
+
+ public String getTranslatedText()
+ {
+ return translatedText;
+ }
+
+ @Remove
+ public void remove()
+ {
+
+ }
+
+}
Added: trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/beans.xml
===================================================================
Added: trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/faces-config.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/faces-config.xml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/faces-config.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<faces-config version="2.0"
+ 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_2.0.xsd">
+
+</faces-config>
\ No newline at end of file
Added: trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/numberguess/WEB-INF/web.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,26 @@
+<?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>Web Beans Numberguess example</display-name>
+
+ <!-- JSF -->
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: trunk/testsuite/src/resources/deployers/weld/numberguess/home.xhtml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/numberguess/home.xhtml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/numberguess/home.xhtml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <ui:composition template="template.xhtml">
+ <ui:define name="content">
+ <h1>Guess a number...</h1>
+ <h:form id="NumberGuessMain">
+ <div style="color: red">
+ <h:messages id="messages" globalOnly="false"/>
+ <h:outputText id="Higher" value="Higher!" rendered="#{game.number gt game.guess and game.guess ne 0}"/>
+ <h:outputText id="Lower" value="Lower!" rendered="#{game.number lt game.guess and game.guess ne 0}"/>
+ </div>
+
+ <div>
+ I'm thinking of a number between #{game.smallest} and #{game.biggest}. You have #{game.remainingGuesses} guesses.
+ </div>
+
+ <div>
+ Your guess:
+ <h:inputText id="inputGuess" value="#{game.guess}" required="true" size="3" disabled="#{game.number eq game.guess}"
+ validator="#{game.validateNumberRange}">
+ </h:inputText>
+ <h:commandButton id="GuessButton" value="Guess" action="#{game.check}" disabled="#{game.number eq game.guess}"/>
+ </div>
+ <div>
+ <h:commandButton id="RestartButton" value="Reset" action="#{game.reset}" immediate="true" />
+ </div>
+ </h:form>
+ </ui:define>
+ </ui:composition>
+</html>
Added: trunk/testsuite/src/resources/deployers/weld/numberguess/index.html
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/numberguess/index.html (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/numberguess/index.html 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=home.jsf">
+</head>
+</html>
\ No newline at end of file
Added: trunk/testsuite/src/resources/deployers/weld/numberguess/template.xhtml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/numberguess/template.xhtml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/numberguess/template.xhtml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Numberguess</title>
+ <link href="style/main.css" rel="stylesheet" type="text/css"/>
+ <ui:insert name="head"/>
+</head>
+
+<body>
+
+ <div id="container">
+ <div id="header">
+
+ </div>
+
+ <div id="sidebar">
+
+ </div>
+
+ <div id="content">
+ <ui:insert name="content"/>
+ </div>
+
+ <br style="clear:both"/>
+ </div>
+
+</body>
+</html>
+
Added: trunk/testsuite/src/resources/deployers/weld/translator/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/translator/META-INF/application.xml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/translator/META-INF/application.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+
+<application 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/application_5.xsd"
+ version="5">
+
+ <display-name>weld-translator-ear</display-name>
+ <module>
+ <web>
+ <web-uri>weld-translator.war</web-uri>
+ <context-root>/weld-translator</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>weld-translator.jar</ejb>
+ </module>
+</application>
Added: trunk/testsuite/src/resources/deployers/weld/translator/ejb/META-INF/beans.xml
===================================================================
Added: trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/faces-config.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/faces-config.xml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/faces-config.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<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">
+
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
Added: trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/lib/el-ri-1.2.jar
===================================================================
(Binary files differ)
Property changes on: trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/lib/el-ri-1.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/lib/jsf-facelets-1.1.15.B1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/lib/jsf-facelets-1.1.15.B1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/web.xml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/translator/war/WEB-INF/web.xml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,32 @@
+<?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>WELD Numberguess example</display-name>
+
+ <!-- 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-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: trunk/testsuite/src/resources/deployers/weld/translator/war/home.xhtml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/translator/war/home.xhtml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/translator/war/home.xhtml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <ui:composition template="template.xhtml">
+ <ui:define name="content">
+ <h1>Translate your text into Latin!</h1>
+ <h:form id="NumberGuessMain">
+
+ <table>
+ <tr align="center" style="font-weight: bold" >
+ <td>
+ Your text
+ </td>
+ <td>
+ Translation
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:inputTextarea id="text" value="#{translator.text}" required="true" rows="5" cols="80" />
+ </td>
+ <td>
+ <h:outputText value="#{translator.translatedText}" />
+ </td>
+ </tr>
+ </table>
+ <div>
+ <h:commandButton id="button" value="Translate" action="#{translator.translate}"/>
+ </div>
+
+
+ </h:form>
+ </ui:define>
+ </ui:composition>
+</html>
Added: trunk/testsuite/src/resources/deployers/weld/translator/war/index.html
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/translator/war/index.html (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/translator/war/index.html 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=home.jsf">
+</head>
+</html>
\ No newline at end of file
Added: trunk/testsuite/src/resources/deployers/weld/translator/war/template.xhtml
===================================================================
--- trunk/testsuite/src/resources/deployers/weld/translator/war/template.xhtml (rev 0)
+++ trunk/testsuite/src/resources/deployers/weld/translator/war/template.xhtml 2009-10-17 03:32:54 UTC (rev 95059)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Translator</title>
+ <link href="style/main.css" rel="stylesheet" type="text/css"/>
+ <ui:insert name="head"/>
+</head>
+
+<body>
+
+ <div id="container">
+ <div id="header">
+
+ </div>
+
+ <div id="sidebar">
+
+ </div>
+
+ <div id="content">
+ <ui:insert name="content"/>
+ </div>
+
+ <br style="clear:both"/>
+ </div>
+
+</body>
+</html>
+
More information about the jboss-cvs-commits
mailing list