Author: alexsmirnov
Date: 2008-11-11 21:11:00 -0500 (Tue, 11 Nov 2008)
New Revision: 11098
Added:
trunk/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
Removed:
trunk/framework/jsf-test/src/main/java/org/richfaces/collections/base/
trunk/framework/jsf-test/src/main/java/org/richfaces/collections/collect/
trunk/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml
Modified:
trunk/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
trunk/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
Log:
Fix teste with JSF 1.2
Modified:
trunk/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
===================================================================
---
trunk/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2008-11-12
01:28:07 UTC (rev 11097)
+++
trunk/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2008-11-12
02:11:00 UTC (rev 11098)
@@ -70,8 +70,6 @@
facesServer.addServlet("*.jsf", new FacesServlet());
facesServer.addResource("/WEB-INF/web.xml",
"org/richfaces/test/web.xml");
- facesServer.addResource("/WEB-INF/faces-config.xml",
- "org/richfaces/test/faces-config.xml");
facesServer.addInitParameter(
StateManager.STATE_SAVING_METHOD_PARAM_NAME,
StateManager.STATE_SAVING_METHOD_SERVER);
Modified:
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
===================================================================
---
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2008-11-12
01:28:07 UTC (rev 11097)
+++
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2008-11-12
02:11:00 UTC (rev 11098)
@@ -7,6 +7,7 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
@@ -17,15 +18,8 @@
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
-import javax.servlet.ServletRequestListener;
-import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import org.richfaces.collections.collect.ImmutableCollection;
-import org.richfaces.collections.collect.ImmutableList;
-import org.richfaces.collections.collect.Multimap;
-import org.richfaces.collections.collect.Multimaps;
import org.richfaces.test.ServerLogger;
/**
@@ -255,7 +249,7 @@
* @see javax.servlet.ServletRequest#getCharacterEncoding()
*/
public String getCharacterEncoding() {
- return UTF8;
+ return characterEncoding;
}
/*
@@ -324,7 +318,7 @@
return Locale.US;
}
- private final ImmutableCollection<Locale> locales = ImmutableList.of(
+ private Collection<Locale> locales = Arrays.asList(
Locale.US, Locale.GERMANY);
/*
@@ -337,7 +331,7 @@
return Collections.enumeration(locales);
}
- private String characterEncoding;
+ private String characterEncoding = UTF8;
/*
* (non-Javadoc)
Modified:
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
===================================================================
---
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2008-11-12
01:28:07 UTC (rev 11097)
+++
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2008-11-12
02:11:00 UTC (rev 11098)
@@ -17,6 +17,7 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.httpclient.HttpStatus;
+import org.junit.internal.matchers.SubstringMatcher;
import org.richfaces.test.ServerLogger;
/**
@@ -399,7 +400,19 @@
* @see javax.servlet.ServletResponse#setContentType(java.lang.String)
*/
public void setContentType(String type) {
- contentType = type;
+ if(null == type){
+ throw new NullPointerException();
+ }
+ int i = type.indexOf(';');
+ if(i>=0){
+ contentType = type.substring(0, i).trim();
+ i=type.lastIndexOf('=');
+ if(i>=0){
+ setCharacterEncoding(type.substring(i+1).trim());
+ }
+ } else {
+ contentType = type;
+ }
}
/*
Deleted: trunk/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml
===================================================================
---
trunk/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml 2008-11-12
01:28:07 UTC (rev 11097)
+++
trunk/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml 2008-11-12
02:11:00 UTC (rev 11098)
@@ -1,68 +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_1_2.xsd"
- version="1.2">
- <!-- 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: trunk/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
===================================================================
---
trunk/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-12
01:28:07 UTC (rev 11097)
+++
trunk/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-12
02:11:00 UTC (rev 11098)
@@ -49,6 +49,8 @@
@Override
protected void setupWebContent(StagingServer facesServer) {
+ facesServer.addResource("/WEB-INF/faces-config.xml",
+ "org/richfaces/test/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");
Added: trunk/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
===================================================================
--- trunk/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
(rev 0)
+++
trunk/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml 2008-11-12
02:11:00 UTC (rev 11098)
@@ -0,0 +1,72 @@
+<?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_1_2.xsd"
+ version="1.2">
+ <application>
+ <!-- Enables Facelets -->
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+ <!-- 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:
trunk/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain