servletContextStore;
+ try {
+ servletContextStoreField = FactoryFinder.class.getDeclaredField("servletContextStore");
+ servletContextStoreField.setAccessible(true);
+ servletContextStore = (ThreadLocal) servletContextStoreField.get(null);
+ servletContextStore.set(sc);
+ } catch (NoSuchFieldException nsfe) {
+ if (LOGGER.isLoggable(Level.FINE)) {
+ LOGGER.log(Level.FINE, "Unable to find private field named 'servletContextStore' in javax.faces.FactoryFinder.");
+ }
+ } catch (Exception e) {
+ if (LOGGER.isLoggable(Level.SEVERE)) {
+ LOGGER.log(Level.SEVERE, e.toString(), e);
+ }
+ servletContextStoreField = null;
+ }
+
+
+ }
+
+
/**
* Process an incoming request, and create the
* corresponding response according to the following
Index: jsf-api/build.xml
===================================================================
--- jsf-api/build.xml (revision 8854)
+++ jsf-api/build.xml (working copy)
@@ -878,7 +878,7 @@
logging.config.file="${api.test.results.dir}/test-logging.properties">
+ includes="javax/faces/component/UIViewRootTestCase.class"/>
Index: jsf-ri/systest/src/com/sun/faces/htmlunit/SimpleTesterTestCase.java
===================================================================
--- jsf-ri/systest/src/com/sun/faces/htmlunit/SimpleTesterTestCase.java (revision 8854)
+++ jsf-ri/systest/src/com/sun/faces/htmlunit/SimpleTesterTestCase.java (working copy)
@@ -90,6 +90,7 @@
private void doRegexp(String text) throws Exception {
if (null != regexp && 0 < regexp.length()) {
+ System.out.println("text: " + text + "regexp: " + regexp);
assertTrue(text.matches(regexp));
}
Index: jsf-ri/systest/build-tests.xml
===================================================================
--- jsf-ri/systest/build-tests.xml (revision 8854)
+++ jsf-ri/systest/build-tests.xml (working copy)
@@ -1108,10 +1108,10 @@
regexp="(?s).*/renderkit01.jsp PASSED.*"/>
+ regexp="(?s).*/renderkit02.jsp\\s*PASSED.*"/>
+ regexp="(?s).*This\s*IS\s*A\s*SIMPLE\s*LABEL\s*FROM\s*THE\s*CUSTOM\s*RENDERER.*/renderkit03.jsp\s*PASSED.*"/>
Index: jsf-ri/systest/build.xml
===================================================================
--- jsf-ri/systest/build.xml (revision 8854)
+++ jsf-ri/systest/build.xml (working copy)
@@ -224,7 +224,7 @@
-
+
Index: jsf-ri/systest-per-webapp/replace-lifecycle/src/java/com/sun/faces/systest/SimplePhaseListener.java
===================================================================
--- jsf-ri/systest-per-webapp/replace-lifecycle/src/java/com/sun/faces/systest/SimplePhaseListener.java (revision 8854)
+++ jsf-ri/systest-per-webapp/replace-lifecycle/src/java/com/sun/faces/systest/SimplePhaseListener.java (working copy)
@@ -43,6 +43,7 @@
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
+import java.util.Map;
public class SimplePhaseListener implements PhaseListener {
@@ -57,8 +58,12 @@
public void beforePhase(PhaseEvent event) {
- event.getFacesContext().getExternalContext().getRequestMap().put("beforePhase",
- "beforePhase");
+ Map requestMap =
+ event.getFacesContext().getExternalContext().getRequestMap();
+ String message = requestMap.containsKey("beforePhase") ?
+ requestMap.get("beforePhase").toString() : "";
+ requestMap.put("beforePhase",
+ message + " beforePhase");
event.getFacesContext().getExternalContext().getRequestMap().put("lifecycleImpl",
event.getSource());
}
Index: jsf-ri/systest-per-webapp/replace-lifecycle/src/java/com/sun/faces/systest/ReplaceLifecycleTestCase.java
===================================================================
--- jsf-ri/systest-per-webapp/replace-lifecycle/src/java/com/sun/faces/systest/ReplaceLifecycleTestCase.java (revision 8854)
+++ jsf-ri/systest-per-webapp/replace-lifecycle/src/java/com/sun/faces/systest/ReplaceLifecycleTestCase.java (working copy)
@@ -128,7 +128,10 @@
public void testReplaceLifecycle() throws Exception {
HtmlPage page = getPage("/faces/test.jsp");
- assertTrue(-1 != page.asText().indexOf("beforePhase"));
+ String pageText = page.asText();
+ assertTrue(-1 != pageText.indexOf("beforePhase"));
+ // Ensure the phaseListener is only called once.
+ assertTrue(!pageText.matches("(?s).*beforePhase.*beforePhase.*"));
}
Index: build.xml
===================================================================
--- build.xml (revision 8854)
+++ build.xml (working copy)
@@ -400,6 +400,8 @@
+
+
Index: lib/jsf-extensions-test-time.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream