[jboss-cvs] JBossAS SVN: r82133 - in trunk/testsuite: src/main/org/jboss/test/jsf/managed and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 9 04:27:17 EST 2008
Author: emuckenhuber
Date: 2008-12-09 04:27:17 -0500 (Tue, 09 Dec 2008)
New Revision: 82133
Added:
trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleLocal.java
trunk/testsuite/src/resources/web/jsfinjection/WEB-INF/alternate-injection-provider.xml
Modified:
trunk/testsuite/imports/sections/jsf.xml
trunk/testsuite/src/main/org/jboss/test/jsf/managed/SimpleManagedBean.java
trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleStatelessBean.java
trunk/testsuite/src/main/org/jboss/test/web/test/JSFInjectionUnitTestCase.java
trunk/testsuite/src/resources/web/jsfinjection/META-INF/application.xml
trunk/testsuite/src/resources/web/jsfinjection/simple.jsp
Log:
test alternate injection provider
Modified: trunk/testsuite/imports/sections/jsf.xml
===================================================================
--- trunk/testsuite/imports/sections/jsf.xml 2008-12-09 08:47:42 UTC (rev 82132)
+++ trunk/testsuite/imports/sections/jsf.xml 2008-12-09 09:27:17 UTC (rev 82133)
@@ -94,15 +94,31 @@
</classes>
<webinf dir="${build.resources}/web/jsfinjection/WEB-INF">
- <include name="**/*"/>
+ <include name="faces-config.xml"/>
</webinf>
</war>
+
+ <war destfile="${build.lib}/jbosstest-alternate-jsf-injection.war"
+ webxml="${build.resources}/web/jsfinjection/WEB-INF/alternate-injection-provider.xml">
+ <fileset dir="${build.resources}/web/jsfinjection">
+ <include name="**/*.jsp"/>
+ </fileset>
+
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/jsf/managed/**"/>
+ </classes>
+
+ <webinf dir="${build.resources}/web/jsfinjection/WEB-INF">
+ <include name="faces-config.xml"/>
+ </webinf>
+ </war>
<ear earfile="${build.lib}/jbosstest-jsf-injection.ear"
appxml="${build.resources}/web/jsfinjection/META-INF/application.xml">
<fileset dir="${build.lib}">
<include name="jbosstest-jsf-ejbs.jar"/>
<include name="jbosstest-jsf-injection.war"/>
+ <include name="jbosstest-alternate-jsf-injection.war"/>
</fileset>
</ear>
Modified: trunk/testsuite/src/main/org/jboss/test/jsf/managed/SimpleManagedBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jsf/managed/SimpleManagedBean.java 2008-12-09 08:47:42 UTC (rev 82132)
+++ trunk/testsuite/src/main/org/jboss/test/jsf/managed/SimpleManagedBean.java 2008-12-09 09:27:17 UTC (rev 82133)
@@ -27,6 +27,7 @@
import javax.ejb.EJB;
import javax.faces.FacesException;
+import org.jboss.test.web.ejb3.SimpleLocal;
import org.jboss.test.web.ejb3.SimpleStateful;
import org.jboss.test.web.ejb3.SimpleStateless;
@@ -43,6 +44,9 @@
@EJB
private SimpleStateless simplestateless;
+ @EJB
+ SimpleLocal simpleLocal;
+
@Resource(name = "url/Injection", mappedName = "http://jboss.org")
private java.net.URL url;
@@ -84,5 +88,18 @@
return true;
}
+ /**
+ * Test the injected SimpleLocal.
+ *
+ * @throws Exception
+ */
+ public boolean getTestSimpleLocal() throws Exception
+ {
+ if(simpleLocal == null)
+ throw new FacesException("simpleLocal is null.");
+
+ return simpleLocal.testLocal();
+ }
+
}
Added: trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleLocal.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleLocal.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleLocal.java 2008-12-09 09:27:17 UTC (rev 82133)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.web.ejb3;
+
+import javax.ejb.Local;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at Local
+public interface SimpleLocal
+{
+
+ boolean testLocal();
+
+}
+
Modified: trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleStatelessBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleStatelessBean.java 2008-12-09 08:47:42 UTC (rev 82132)
+++ trunk/testsuite/src/main/org/jboss/test/web/ejb3/SimpleStatelessBean.java 2008-12-09 09:27:17 UTC (rev 82133)
@@ -28,7 +28,7 @@
* @version $Revision$
*/
@Stateless
-public class SimpleStatelessBean implements SimpleStateless
+public class SimpleStatelessBean implements SimpleStateless, SimpleLocal
{
public boolean doSomething()
@@ -36,5 +36,10 @@
return true;
}
+ public boolean testLocal()
+ {
+ return true;
+ }
+
}
Modified: trunk/testsuite/src/main/org/jboss/test/web/test/JSFInjectionUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/web/test/JSFInjectionUnitTestCase.java 2008-12-09 08:47:42 UTC (rev 82132)
+++ trunk/testsuite/src/main/org/jboss/test/web/test/JSFInjectionUnitTestCase.java 2008-12-09 09:27:17 UTC (rev 82133)
@@ -56,6 +56,18 @@
HttpUtils.accessURL(url);
}
+ public void testAlternateJSF() throws Exception
+ {
+ URL url = new URL(baseURL+"alternate-jsf-injection/simple.jsf");
+ HttpUtils.accessURL(url);
+ }
+
+ public void testAlternameENCJSF() throws Exception
+ {
+ URL url = new URL(baseURL+"alternate-jsf-injection/enc.jsf");
+ HttpUtils.accessURL(url);
+ }
+
/**
* Setup the test suite.
*/
Modified: trunk/testsuite/src/resources/web/jsfinjection/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/web/jsfinjection/META-INF/application.xml 2008-12-09 08:47:42 UTC (rev 82132)
+++ trunk/testsuite/src/resources/web/jsfinjection/META-INF/application.xml 2008-12-09 09:27:17 UTC (rev 82133)
@@ -16,5 +16,11 @@
<context-root>/jsfinjection</context-root>
</web>
</module>
+ <module>
+ <web>
+ <web-uri>jbosstest-alternate-jsf-injection.war</web-uri>
+ <context-root>/alternate-jsf-injection</context-root>
+ </web>
+ </module>
</application>
Added: trunk/testsuite/src/resources/web/jsfinjection/WEB-INF/alternate-injection-provider.xml
===================================================================
--- trunk/testsuite/src/resources/web/jsfinjection/WEB-INF/alternate-injection-provider.xml (rev 0)
+++ trunk/testsuite/src/resources/web/jsfinjection/WEB-INF/alternate-injection-provider.xml 2008-12-09 09:27:17 UTC (rev 82133)
@@ -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/j2ee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>javax.faces.FacesServlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>javax.faces.FacesServlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <!-- test alternate jsf injection provider -->
+ <context-param>
+ <param-name>com.sun.faces.injectionProvider</param-name>
+ <param-value>org.jboss.web.jsf.integration.injection.JBossScanningInjectionProvider</param-value>
+ </context-param>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Modified: trunk/testsuite/src/resources/web/jsfinjection/simple.jsp
===================================================================
--- trunk/testsuite/src/resources/web/jsfinjection/simple.jsp 2008-12-09 08:47:42 UTC (rev 82132)
+++ trunk/testsuite/src/resources/web/jsfinjection/simple.jsp 2008-12-09 09:27:17 UTC (rev 82133)
@@ -17,6 +17,8 @@
<h:outputText rendered="#{simpleManagedBean.testStatelessBean}" value="testStatelessBean is ok" />
<br/>
<h:outputText rendered="#{simpleManagedBean.testURL}" value="testURL is ok" />
+ <br/>
+ <h:outputText rendered="#{simpleManagedBean.testSimpleLocal}" value="testSimpleLocal is ok" />
</f:view>
</body>
</html>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list