Author: alexsmirnov
Date: 2008-11-13 17:34:03 -0500 (Thu, 13 Nov 2008)
New Revision: 11157
Added:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspFactory.java
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/WEB-INF/
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/WEB-INF/faces-config.xml
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/SimpleAjaxTest.java
branches/jsf2.0/tests/ajax/src/test/resources/org/
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/test/
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/test/ajax/
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/test/ajax/logging.properties
Removed:
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
Modified:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/logging.properties
branches/jsf2.0/tests/ajax/pom.xml
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
Log:
JSF 2.0 ajax test started.
Modified:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2008-11-13
20:09:50 UTC (rev 11156)
+++
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2008-11-13
22:34:03 UTC (rev 11157)
@@ -37,16 +37,15 @@
private ClassLoader contextClassLoader;
protected StagingServer facesServer;
-
+
protected StagingConnection connection;
-
+
protected FacesContext facesContext;
protected Lifecycle lifecycle;
protected Application application;
-
/**
* @throws java.lang.Exception
*/
@@ -55,8 +54,8 @@
contextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(
this.getClass().getClassLoader());
- InputStream stream = this.getClass()
- .getResourceAsStream("logging.properties");
+ InputStream stream = this.getClass().getResourceAsStream(
+ "logging.properties");
if (null != stream) {
try {
LogManager.getLogManager().readConfiguration(stream);
@@ -75,6 +74,13 @@
setupFacesListener();
setupWebContent();
facesServer.init();
+ ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder
+ .getFactory(FactoryFinder.APPLICATION_FACTORY);
+ application = applicationFactory.getApplication();
+ LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder
+ .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ lifecycle = lifecycleFactory
+ .getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
}
/**
@@ -101,7 +107,8 @@
} catch (ClassNotFoundException e1) {
throw new TestException("No JSF listeners have been found", e1);
} catch (Exception e2) {
- throw new TestException("Error instantiate MyFaces listener", e2);
+ throw new TestException("Error instantiate MyFaces listener",
+ e2);
}
} catch (Exception e) {
throw new TestException("Error instantiate JSF RI listener", e);
@@ -113,24 +120,25 @@
* @throws InstantiationException
* @throws IllegalAccessException
*/
- protected void setupFacesServlet() {
- ServletContainer facesServletContainer = new ServletContainer("*.jsf", new
FacesServlet());
+ protected void setupFacesServlet() {
+ ServletContainer facesServletContainer = new ServletContainer("*.jsf",
+ new FacesServlet());
facesServletContainer.setName("Faces Servlet");
try {
// Check for an ajax4jsf filter.
Class<? extends Filter> ajaxFilterClass = contextClassLoader
- .loadClass("org.ajax4jsf.Filter")
- .asSubclass(Filter.class);
+ .loadClass("org.ajax4jsf.Filter").asSubclass(Filter.class);
Filter ajaxFilter = ajaxFilterClass.newInstance();
- FilterContainer filterContainer = new
FilterContainer(ajaxFilter,facesServletContainer);
+ FilterContainer filterContainer = new FilterContainer(ajaxFilter,
+ facesServletContainer);
filterContainer.setName("ajax4jsf");
facesServer.addResource("/WEB-INF/web.xml",
- "org/richfaces/test/ajax-web.xml");
+ "org/richfaces/test/ajax-web.xml");
facesServer.addServlet(filterContainer);
} catch (ClassNotFoundException e) {
// No Richfaces filter, uses servlet directly.
facesServer.addResource("/WEB-INF/web.xml",
- "org/richfaces/test/web.xml");
+ "org/richfaces/test/web.xml");
facesServer.addServlet(facesServletContainer);
} catch (Exception e) {
throw new TestException(e);
@@ -143,7 +151,7 @@
}
protected void setupMyFaces() {
- // Do nothing by default.
+ // Do nothing by default.
}
protected void setupSunFaces() {
@@ -151,31 +159,34 @@
facesServer.addInitParameter("com.sun.faces.verifyObjects",
"true");
}
- protected void setupWebContent(){
-
+ protected void setupWebContent() {
+
}
-
-
protected void setupFacesRequest() throws Exception {
- connection = facesServer.getConnection(new
URL("http://localhost/index.jsf"));
+ connection = facesServer.getConnection(new URL(
+ "http://localhost/test.jsf"));
setupConnection(connection);
connection.start();
- ApplicationFactory applicationFactory = (ApplicationFactory)
FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
- application = applicationFactory.getApplication();
- LifecycleFactory lifecycleFactory = (LifecycleFactory)
FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
- lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
- FacesContextFactory facesContextFactory = (FacesContextFactory)
FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
- facesContext = facesContextFactory.getFacesContext(facesServer.getContext(),
connection.getRequest(), connection.getResponse(), lifecycle);
- facesContext.setViewRoot(setupView());
+ FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder
+ .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
+ facesContext = facesContextFactory.getFacesContext(facesServer
+ .getContext(), connection.getRequest(), connection
+ .getResponse(), lifecycle);
+ UIViewRoot viewRoot = setupView();
+ if (null != viewRoot) {
+ facesContext.setViewRoot(viewRoot);
+ }
}
-
+
protected UIViewRoot setupView() {
- return null;
+ UIViewRoot viewRoot = (UIViewRoot)
application.createComponent(UIViewRoot.COMPONENT_TYPE);
+ viewRoot.setViewId("/test.xhtml");
+ return viewRoot;
}
protected void setupConnection(StagingConnection connection) {
-
+
}
/**
@@ -183,12 +194,12 @@
*/
@After
public void tearDownServer() throws Exception {
- if(null != facesContext){
+ if (null != facesContext) {
facesContext.release();
facesContext = null;
}
- if(null != connection){
- if(!connection.isFinished()){
+ if (null != connection) {
+ if (!connection.isFinished()) {
connection.finish();
}
connection = null;
Modified:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java 2008-11-13
20:09:50 UTC (rev 11156)
+++
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java 2008-11-13
22:34:03 UTC (rev 11157)
@@ -25,6 +25,7 @@
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
+import javax.servlet.jsp.JspFactory;
import org.richfaces.test.staging.ClasspathServerResource;
import org.richfaces.test.staging.RequestChain;
@@ -32,6 +33,7 @@
import org.richfaces.test.staging.ServerResourcePath;
import org.richfaces.test.staging.ServerResourcesDirectory;
import org.richfaces.test.staging.ServletContainer;
+import org.richfaces.test.staging.StaggingJspFactory;
import org.richfaces.test.staging.StagingHttpSession;
import org.richfaces.test.staging.StagingServletContext;
import org.richfaces.test.staging.StaticServlet;
@@ -228,6 +230,8 @@
public void init() {
// Create context.
this.context = new LocalContext();
+ // Create Jsp factory
+ JspFactory.setDefaultFactory(new StaggingJspFactory());
// Create init parameters
context.addInitParameters(initParameters);
// Inform listeners
@@ -274,7 +278,10 @@
for (RequestChain servlet : servlets) {
servlet.destroy();
}
- defaultServlet.destroy();
+ defaultServlet.destroy();
+ // Create Jsp factory
+ JspFactory.setDefaultFactory(null);
+
}
public StagingConnection getConnection(URL url) {
Added:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java
(rev 0)
+++
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java 2008-11-13
22:34:03 UTC (rev 11157)
@@ -0,0 +1,47 @@
+/**
+ *
+ */
+package org.richfaces.test.staging;
+
+import javax.el.ELContextListener;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.servlet.jsp.JspApplicationContext;
+
+import com.sun.el.ExpressionFactoryImpl;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StaggingJspApplicationContext implements JspApplicationContext {
+
+ private final ExpressionFactory expressionFactory ;
+
+ public StaggingJspApplicationContext() {
+ expressionFactory = ExpressionFactory.newInstance();
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.servlet.jsp.JspApplicationContext#addELContextListener(javax.el.ELContextListener)
+ */
+ public void addELContextListener(ELContextListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspApplicationContext#addELResolver(javax.el.ELResolver)
+ */
+ public void addELResolver(ELResolver resolver) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspApplicationContext#getExpressionFactory()
+ */
+ public ExpressionFactory getExpressionFactory() {
+ return expressionFactory;
+ }
+
+}
Property changes on:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspApplicationContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspFactory.java
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspFactory.java
(rev 0)
+++
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspFactory.java 2008-11-13
22:34:03 UTC (rev 11157)
@@ -0,0 +1,73 @@
+/**
+ *
+ */
+package org.richfaces.test.staging;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.jsp.JspApplicationContext;
+import javax.servlet.jsp.JspEngineInfo;
+import javax.servlet.jsp.JspFactory;
+import javax.servlet.jsp.PageContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StaggingJspFactory extends JspFactory {
+
+ private static final JspEngineInfo engineInfo = new JspEngineInfo(){
+
+
+ @Override
+ public String getSpecificationVersion() {
+ return "2.1";
+ }
+
+ };
+
+ private final JspApplicationContext context;
+
+ public StaggingJspFactory() {
+ this.context = new StaggingJspApplicationContext();
+ }
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspFactory#getEngineInfo()
+ */
+ @Override
+ public JspEngineInfo getEngineInfo() {
+ // TODO Auto-generated method stub
+ return engineInfo;
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.servlet.jsp.JspFactory#getJspApplicationContext(javax.servlet.ServletContext)
+ */
+ @Override
+ public JspApplicationContext getJspApplicationContext(ServletContext context) {
+ return this.context;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspFactory#getPageContext(javax.servlet.Servlet,
javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.String, boolean,
int, boolean)
+ */
+ @Override
+ public PageContext getPageContext(Servlet servlet, ServletRequest request,
+ ServletResponse response, String errorPageURL,
+ boolean needsSession, int buffer, boolean autoflush) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.jsp.JspFactory#releasePageContext(javax.servlet.jsp.PageContext)
+ */
+ @Override
+ public void releasePageContext(PageContext pc) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StaggingJspFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-13
20:09:50 UTC (rev 11156)
+++
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-13
22:34:03 UTC (rev 11157)
@@ -49,7 +49,7 @@
@Override
protected void setupWebContent() {
- facesServer.addResource("/WEB-INF/faces-config.xml",
"org/richfaces/test/faces-config.xml");
+ facesServer.addResource("/WEB-INF/faces-config.xml",
"org/richfaces/test/WEB-INF/faces-config.xml");
facesServer.addResource("/hello.xhtml",
"org/richfaces/test/hello.xhtml");
facesServer.addResource("/response.xhtml",
"org/richfaces/test/response.xhtml");
facesServer.addResource("/wave.med.gif",
"org/richfaces/test/wave.med.gif");
Copied:
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/WEB-INF/faces-config.xml
(from rev 11126,
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml)
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/WEB-INF/faces-config.xml
(rev 0)
+++
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/WEB-INF/faces-config.xml 2008-11-13
22:34:03 UTC (rev 11157)
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License").
You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+<faces-config
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"
+ version="2.0">
+
+ <!-- our NumberBean we created before -->
+ <managed-bean>
+ <managed-bean-name>HelloBean</managed-bean-name>
+
<managed-bean-class>org.richfaces.test.HelloBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <!-- going from guess.xhtml to response.xhtml -->
+ <navigation-rule>
+ <from-view-id>/hello.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/response.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- going from response.xhtml to guess.xhtml -->
+ <navigation-rule>
+ <from-view-id>/response.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/hello.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
Property changes on:
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml 2008-11-13
20:09:50 UTC (rev 11156)
+++
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml 2008-11-13
22:34:03 UTC (rev 11157)
@@ -1,69 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<!--
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License").
You
- may not use this file except in compliance with the License. You can obtain
- a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
- or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
-
- When distributing the software, include this License Header Notice in each
- file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- Sun designates this particular file as subject to the "Classpath" exception
- as provided by Sun in the GPL Version 2 section of the License file that
- accompanied this code. If applicable, add the following below the License
- Header, with the fields enclosed by brackets [] replaced by your own
- identifying information: "Portions Copyrighted [year]
- [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
--->
-
-<faces-config
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"
- version="2.0">
-
- <!-- our NumberBean we created before -->
- <managed-bean>
- <managed-bean-name>HelloBean</managed-bean-name>
-
<managed-bean-class>org.richfaces.test.HelloBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <!-- going from guess.xhtml to response.xhtml -->
- <navigation-rule>
- <from-view-id>/hello.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/response.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <!-- going from response.xhtml to guess.xhtml -->
- <navigation-rule>
- <from-view-id>/response.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/hello.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
-
-</faces-config>
Modified:
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/logging.properties
===================================================================
---
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/logging.properties 2008-11-13
20:09:50 UTC (rev 11156)
+++
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/logging.properties 2008-11-13
22:34:03 UTC (rev 11157)
@@ -18,4 +18,6 @@
org.ajax4jsf.context.level=ALL
javax.enterprise.resource.webcontainer.jsf.level=ALL
org.richfaces.level=ALL
+com.gargoylesoftware.htmlunit.level=ALL
+
\ No newline at end of file
Modified: branches/jsf2.0/tests/ajax/pom.xml
===================================================================
--- branches/jsf2.0/tests/ajax/pom.xml 2008-11-13 20:09:50 UTC (rev 11156)
+++ branches/jsf2.0/tests/ajax/pom.xml 2008-11-13 22:34:03 UTC (rev 11157)
@@ -17,6 +17,9 @@
<testResource>
<directory>src/main/webapp</directory>
</testResource>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
</testResources>
<finalName>ajax</finalName>
<plugins>
@@ -59,5 +62,22 @@
</plugins>
</build>
<dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.0-b05</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jvnet.wagon-svn</groupId>
+ <artifactId>wagon-svn</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>mojarra-jsf-impl</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml 2008-11-13
20:09:50 UTC (rev 11156)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml 2008-11-13
22:34:03 UTC (rev 11157)
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<faces-config
-
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"
- version="1.2">
-
+<faces-config
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"
+ version="2.0">
+<managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>declarativeajax.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+</managed-bean>
</faces-config>
Modified: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml 2008-11-13 20:09:50 UTC
(rev 11156)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml 2008-11-13 22:34:03 UTC
(rev 11157)
@@ -1,7 +1,95 @@
<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License").
You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
<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" >
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name></display-name>
+ <description></description>
+
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+ <!--
+
+ This mapping identifies a jsp page as having JSF content. If a
+ request comes to the server for foo.faces, the container will
+ send the request to the FacesServlet, which will expect a
+ corresponding foo.jsp page to exist containing the content.
+
+ -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
</web-app>
Deleted: branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
===================================================================
---
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java 2008-11-13
20:09:50 UTC (rev 11156)
+++
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java 2008-11-13
22:34:03 UTC (rev 11157)
@@ -1,50 +0,0 @@
-/**
- *
- */
-package org.richfaces.test;
-
-import static org.junit.Assert.*;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-/**
- * @author asmirnov
- *
- */
-public class SimpleAjaxTest extends AbstractFacesTest {
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- }
-
- @Override
- protected void setupWebContent() {
- facesServer.addResource("/WEB-INF/faces-config.xml",
"/WEB-INF/faces-config.xml");
- facesServer.addResource("/index.jsp", "/index.jsp");
- facesServer.addResource("/home.xhtml", "/home.xhtml");
- facesServer.addResource("/resources/stylesheet.css",
"/resources/stylesheet.css");
- facesServer.addResource("/resources/anim-star-bkgrnd.gif",
"/resources/anim-star-bkgrnd.gif");
- }
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void testRequest() throws Exception {
- WebClient webClient = new LocalWebClient(facesServer);
- HtmlPage page = webClient.getPage("http://localhost/hello.jsf");
- System.out.println(page.asXml());
-
- }
-}
Copied:
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/SimpleAjaxTest.java (from
rev 11126,
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java)
===================================================================
--- branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/SimpleAjaxTest.java
(rev 0)
+++
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/SimpleAjaxTest.java 2008-11-13
22:34:03 UTC (rev 11157)
@@ -0,0 +1,62 @@
+/**
+ *
+ */
+package org.richfaces.test.ajax;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.test.AbstractFacesTest;
+import org.richfaces.test.LocalWebClient;
+
+import com.gargoylesoftware.htmlunit.BrowserVersion;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+import declarativeajax.Bean;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class SimpleAjaxTest extends AbstractFacesTest {
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @Override
+ protected void setupWebContent() {
+ facesServer.addResource("/WEB-INF/faces-config.xml",
"WEB-INF/faces-config.xml");
+ facesServer.addResource("/home.xhtml", "home.xhtml");
+ facesServer.addResource("/resources/stylesheet.css",
"resources/stylesheet.css");
+ facesServer.addResource("/resources/anim-star-bkgrnd.gif",
"resources/anim-star-bkgrnd.gif");
+ }
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testRequest() throws Exception {
+ WebClient webClient = new LocalWebClient(facesServer,BrowserVersion.FIREFOX_3);
+ webClient.setThrowExceptionOnScriptError(false);
+ HtmlPage page = webClient.getPage("http://localhost/home.jsf");
+ System.out.println(page.asXml());
+
+ }
+
+ @Test
+ public void BeanTest() throws Exception {
+ setupFacesRequest();
+ Bean bean = application.evaluateExpressionGet(facesContext, "#{bean}",
Bean.class);
+ assertNotNull(bean);
+ }
+}
Property changes on:
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/ajax/SimpleAjaxTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/test/ajax/logging.properties
===================================================================
---
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/test/ajax/logging.properties
(rev 0)
+++
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/test/ajax/logging.properties 2008-11-13
22:34:03 UTC (rev 11157)
@@ -0,0 +1,22 @@
+handlers java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+java.util.logging.ConsoleHandler.level ALL
+java.util.logging.ConsoleHandler.formatter java.util.logging.SimpleFormatter
+
+facelets.level=ALL
+com.sun.faces.level=ALL
+javax.faces.level=ALL
+org.apache.myfaces.level=INFO
+org.ajax4jsf.io.level=ERROR
+org.ajax4jsf.webapp.level=ALL
+org.ajax4jsf.application.level=ALL
+org.ajax4jsf.context.level=ALL
+javax.enterprise.resource.webcontainer.jsf.level=ALL
+org.richfaces.level=ALL
+com.gargoylesoftware.htmlunit.level=ALL
+
\ No newline at end of file
Property changes on:
branches/jsf2.0/tests/ajax/src/test/resources/org/richfaces/test/ajax/logging.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain