dev@javaserverfaces.java.net

Re: Review: Phase 1: changes to activate systests

From: Roger Kitain <Roger.Kitain_at_Sun.COM>
Date: Thu, 12 May 2005 17:57:40 -0400

r=rogerk

Jayashri Visvanathan wrote:

> M UIComponentClassicTagBase.java
> add back the the statement that was missed out during the merge.
>
> M conf/share/jsf_core.tld
> "type" attribute is not required for actionListener tag.
>
> M src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java
> clear DID_RENDER_SCRIPT attribute so that it is not persisted during
> state saving.
>
> M src/com/sun/faces/taglib/jsf_core/PhaseListenerTag.java
> check for UIComponentELTag instead of UIComponentTag which is
> deprecated.
>
> M src/javax/faces/Messages.properties
> M systest/build-tests.xml
> M systest/src/com/sun/faces/jsptest/JspIntegrationTestCase.java
> M systest/src/com/sun/faces/jsptest/ViewRootPhaseListenerTestCase.java
> M systest/web/TestElValidatorComponentSucceed.jsp
> M systest/web/jsp/jstl-import-02a.jsp
> M test/com/sun/faces/util/TestUtil_messages.java
> Activate more systests.
>
>------------------------------------------------------------------------
>
>Index: UIComponentClassicTagBase.java
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-api/src/javax/faces/webapp/UIComponentClassicTagBase.java,v
>retrieving revision 1.3
>diff -u -r1.3 UIComponentClassicTagBase.java
>--- UIComponentClassicTagBase.java 5 May 2005 20:51:13 -0000 1.3
>+++ UIComponentClassicTagBase.java 12 May 2005 21:50:59 -0000
>@@ -553,6 +553,7 @@
> }
> parentComponent.getAttributes().put(CURRENT_VIEW_ROOT,
> CURRENT_VIEW_ROOT);
>+ created = true;
> }
> else if (hasBinding()) {
> try {
>
>
>------------------------------------------------------------------------
>
>Index: conf/share/jsf_core.tld
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/conf/share/jsf_core.tld,v
>retrieving revision 1.49
>diff -u -r1.49 jsf_core.tld
>--- conf/share/jsf_core.tld 5 May 2005 20:51:18 -0000 1.49
>+++ conf/share/jsf_core.tld 12 May 2005 21:48:43 -0000
>@@ -74,7 +74,7 @@
> created and registered.
> </description>
> <name>type</name>
>- <required>true</required>
>+ <required>false</required>
> <deferred-value>
> <type>java.lang.String</type>
> </deferred-value>
>Index: src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java,v
>retrieving revision 1.28
>diff -u -r1.28 CommandLinkRenderer.java
>--- src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java 2 May 2005 12:49:57 -0000 1.28
>+++ src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java 12 May 2005 21:48:43 -0000
>@@ -166,7 +166,6 @@
> return;
> }
> String formClientId = uiform.getClientId(context);
>-
> //Write Anchor attributes
>
> //make link act as if it's a button using javascript
>@@ -320,6 +319,18 @@
>
> renderHiddenFieldsAndScriptIfNecessary(context, writer, component, fieldName);
>
>+ UIForm uiform = getMyForm(context, command);
>+ if ( uiform == null ) {
>+ if (log.isErrorEnabled()) {
>+ log.error("component " + component.getId() +
>+ " must be enclosed inside a form ");
>+ }
>+ return;
>+ }
>+ // DID_RENDER_SCRIPT needs to be reset, otherwise this attribute
>+ // will also be persisted which will cause the script to be not rendered
>+ // during postback.
>+ uiform.getAttributes().remove(DID_RENDER_SCRIPT);
> if (log.isTraceEnabled()) {
> log.trace("End encoding component " + component.getId());
> }
>Index: src/com/sun/faces/taglib/jsf_core/PhaseListenerTag.java
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/PhaseListenerTag.java,v
>retrieving revision 1.2
>diff -u -r1.2 PhaseListenerTag.java
>--- src/com/sun/faces/taglib/jsf_core/PhaseListenerTag.java 5 May 2005 20:51:26 -0000 1.2
>+++ src/com/sun/faces/taglib/jsf_core/PhaseListenerTag.java 12 May 2005 21:48:43 -0000
>@@ -15,7 +15,7 @@
> import javax.faces.component.UIViewRoot;
> import javax.faces.context.FacesContext;
> import javax.faces.event.PhaseListener;
>-import javax.faces.webapp.UIComponentTag;
>+import javax.faces.webapp.UIComponentELTag;
> import javax.servlet.jsp.JspException;
> import javax.servlet.jsp.tagext.TagSupport;
> import javax.servlet.jsp.tagext.Tag;
>@@ -94,10 +94,10 @@
>
> // find the viewTag
> Tag parent = this;
>- UIComponentTag tag = null;
>+ UIComponentELTag tag = null;
> while (null != (parent = parent.getParent())) {
>- if (parent instanceof UIComponentTag) {
>- tag = (UIComponentTag) parent;
>+ if (parent instanceof UIComponentELTag) {
>+ tag = (UIComponentELTag) parent;
> }
> }
>
>Index: src/javax/faces/Messages.properties
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/javax/faces/Messages.properties,v
>retrieving revision 1.25
>diff -u -r1.25 Messages.properties
>--- src/javax/faces/Messages.properties 5 May 2005 20:51:30 -0000 1.25
>+++ src/javax/faces/Messages.properties 12 May 2005 21:48:43 -0000
>@@ -182,7 +182,7 @@
> com.sun.faces.PHASE_ID_OUT_OF_BOUNDS=PhaseId out of bounds for id: ''{0}''.
> com.sun.faces.RENDERER_NOT_FOUND=Renderer not found for Renderer type: ''{0}''.
> com.sun.faces.REQUEST_VIEW_ALREADY_SET_ERROR=State Error: RequestView has already been set for this request.
>-com.sun.faces.SAVING_STATE_ERROR=Error while saving state in ''{0}'': ''{1}''.
>+com.sun.faces.SAVING_STATE_ERROR=Error while saving state.
> com.sun.faces.SUPPORTS_COMPONENT_ERROR=Argument Error: ''{0}'' is not supported for this renderer.
> com.sun.faces.TYPECONVERSION_ERROR=Conversion Error setting value ''{0}'' for ''{1}''.
> com.sun.faces.VALIDATION_COMMAND_ERROR=Validation error. ''{0}'' must have value or image attribute.
>Index: systest/build-tests.xml
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/systest/build-tests.xml,v
>retrieving revision 1.74
>diff -u -r1.74 build-tests.xml
>--- systest/build-tests.xml 10 May 2005 15:37:36 -0000 1.74
>+++ systest/build-tests.xml 12 May 2005 21:48:43 -0000
>@@ -229,13 +229,12 @@
> <sysproperty key="org.apache.commons.logging.simplelog.showdatetime"
> value="true"/>
> -->
>- <!-- PENDING (visvan) Fix tests in excludes -->
> <batchtest todir="${test.results.dir}">
> <fileset dir="${basedir}/build/WEB-INF/classes"
>- includes="com/sun/faces/jsptest/*TestCase.class"
>- excludes="com/sun/faces/jsptest/ViewRootPhaseListenerTestCase.class,
>- com/sun/faces/jsptest/JspIntegrationTestCase.class,com/sun/faces/jsptest/ConverterTestCase.class,
>- com/sun/faces/jsptest/ListenerTestCase.class,com/sun/faces/jsptest/ValidatorTestCase.class"/>
>+ includes="com/sun/faces/jsptest/*TestCase.class"
>+ excludes="com/sun/faces/jsptest/ListenerTestCase.class,
>+ com/sun/faces/jsptest/ValidatorTestCase.class,
>+ com/sun/faces/jsptest/ConverterTestCase.class"/>
> </batchtest>
>
> </junit>
>@@ -245,7 +244,7 @@
>
> <target name="test.path"
> description="Test Path Handling">
>- <!-- PENDING (visvan) Fix PathTestCase
>+
> <junit printsummary="yes" fork="yes"
> haltonfailure="yes" haltonerror="yes">
>
>@@ -257,13 +256,14 @@
> <sysproperty key="host" value="${host}"/>
> <sysproperty key="port" value="${port}"/>
> <sysproperty key="context.path" value="${context.path}"/>
>-
>+ <!-- PENDING (visvan) Fix PathTestCase -->
> <batchtest todir="${test.results.dir}">
> <fileset dir="${basedir}/build/WEB-INF/classes"
>- includes="com/sun/faces/pathtest/*TestCase.class,com/sun/faces/systest/NavigationTestCase.class"/>
>+ includes="com/sun/faces/pathtest/*TestCase.class"
>+ excludes="com/sun/faces/pathtest/PathTestCase.class"/>
> </batchtest>
>
>- </junit> -->
>+ </junit>
>
> </target>
>
>@@ -369,7 +369,7 @@
>
> <tester host="${host}" port="${port}" protocol="${protocol}"
> request="${context.path}/faces/listener.jsp"
>- status="500" failonerror="${failonerror}"/>
>+ status="200" failonerror="${failonerror}"/>
> </target>
>
> <target name="test.managed"
>@@ -480,11 +480,10 @@
> <tester host="${host}" port="${port}" protocol="${protocol}"
> request="${context.path}/faces/TestElValidatorComponentFail.jsp"
> status="500" failonerror="${failonerror}"/>
>-<!-- PENDING return to running
>+
> <tester host="${host}" port="${port}" protocol="${protocol}"
> request="${context.path}/faces/TestElValidatorComponentSucceed.jsp"
> status="200" failonerror="${failonerror}"/>
>- -->
>
> <tester host="${host}" port="${port}" protocol="${protocol}"
> request="${context.path}/faces/TestElValidatorIdFail.jsp"
>@@ -710,7 +709,7 @@
> </target>
> <target name="test.subview"
> description="Test subview tag">
>- <!--
>+
> <tester host="${host}" port="${port}" protocol="${protocol}"
> request="${context.path}/faces/subview01.jsp"
> recordGolden="${local.golden.path}/subview01.txt"
>@@ -730,7 +729,7 @@
> request="${context.path}/faces/subview04.jsp"
> recordGolden="${local.golden.path}/subview04.txt"
> golden="${golden.path}/subview04.txt" failonerror="${failonerror}"/>
>-
>+ <!-- c:forEach tests
> <tester host="${host}" port="${port}" protocol="${protocol}"
> request="${context.path}/faces/subview05.jsp"
> recordGolden="${local.golden.path}/subview05.txt"
>@@ -739,8 +738,8 @@
> <tester host="${host}" port="${port}" protocol="${protocol}"
> request="${context.path}/faces/subview06.jsp"
> recordGolden="${local.golden.path}/subview06.txt"
>- golden="${golden.path}/subview06.txt" failonerror="${failonerror}"/>
>--->
>+ golden="${golden.path}/subview06.txt" failonerror="${failonerror}"/> -->
>+
> </target>
>
> </project>
>Index: systest/src/com/sun/faces/jsptest/JspIntegrationTestCase.java
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/systest/src/com/sun/faces/jsptest/JspIntegrationTestCase.java,v
>retrieving revision 1.11
>diff -u -r1.11 JspIntegrationTestCase.java
>--- systest/src/com/sun/faces/jsptest/JspIntegrationTestCase.java 2 May 2005 19:27:10 -0000 1.11
>+++ systest/src/com/sun/faces/jsptest/JspIntegrationTestCase.java 12 May 2005 21:48:43 -0000
>@@ -80,19 +80,19 @@
> checkJspDynamic00();
> checkJspDynamic01("",
> "[A]{ } [Z]");
>- checkJspDynamic01("?mode=create&id=C1&value=[1]&javax.faces.ViewState=_id0",
>+ checkJspDynamic01("?mode=create&id=C1&value=[1]&javax.faces.ViewState=_id1",
> "[A]{ [1] } [Z]");
>- checkJspDynamic01("?mode=create&id=C2&value=[2]&javax.faces.ViewState=_id1",
>+ checkJspDynamic01("?mode=create&id=C2&value=[2]&javax.faces.ViewState=_id2",
> "[A]{ [1] [2] } [Z]");
>- checkJspDynamic01("?mode=create&id=C3&value=[3]&javax.faces.ViewState=_id2",
>+ checkJspDynamic01("?mode=create&id=C3&value=[3]&javax.faces.ViewState=_id3",
> "[A]{ [1] [2] [3] } [Z]");
>- checkJspDynamic01("?mode=delete&id=C2&javax.faces.ViewState=_id3",
>+ checkJspDynamic01("?mode=delete&id=C2&javax.faces.ViewState=_id4",
> "[A]{ [1] [3] } [Z]");
>
> checkJspDynamic00();
> client = new WebClient();
> checkJspDynamic01("",
>- "[A] { } [Z]");
>+ "[A]{ } [Z]");
>
> // Check with children that do not have ids
> /********** PENDING(edburns): pending resolution of 5040235
>@@ -254,7 +254,6 @@
> assertEquals("Correct page title",
> "jsp-dynamic-01", page.getTitleText());
> String bodyText = getBodyText(page);
>- System.out.println("bodyText " + bodyText);
> assertTrue("Correct body element",
> -1 != bodyText.indexOf(result));
>
>Index: systest/src/com/sun/faces/jsptest/ViewRootPhaseListenerTestCase.java
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/systest/src/com/sun/faces/jsptest/ViewRootPhaseListenerTestCase.java,v
>retrieving revision 1.1
>diff -u -r1.1 ViewRootPhaseListenerTestCase.java
>--- systest/src/com/sun/faces/jsptest/ViewRootPhaseListenerTestCase.java 8 Dec 2004 15:10:26 -0000 1.1
>+++ systest/src/com/sun/faces/jsptest/ViewRootPhaseListenerTestCase.java 12 May 2005 21:48:43 -0000
>@@ -124,7 +124,7 @@
>
> public void doTestListenerTagListeners(HtmlPage page) throws Exception {
>
>- assertTrue(-1 != page.asText().indexOf("beforePhaseEvent: ."));
>+ assertTrue(-1 != page.asText().indexOf("beforePhaseEvent: beforePhase: RENDER_RESPONSE 6."));
> assertTrue(-1 != page.asText().indexOf("afterPhaseEvent: ."));
>
> List list;
>Index: systest/web/TestElValidatorComponentSucceed.jsp
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/systest/web/TestElValidatorComponentSucceed.jsp,v
>retrieving revision 1.4
>diff -u -r1.4 TestElValidatorComponentSucceed.jsp
>--- systest/web/TestElValidatorComponentSucceed.jsp 4 Feb 2004 23:42:46 -0000 1.4
>+++ systest/web/TestElValidatorComponentSucceed.jsp 12 May 2005 21:48:43 -0000
>@@ -11,8 +11,13 @@
> </head>
> <body>
>
>+<%@ page contentType="text/html"
>+%><%@ page import="javax.faces.component.UICommand"
>+%>
>+
> <%
>- pageContext.setAttribute("ford", new String("harrison"), PageContext.REQUEST_SCOPE);
>+ UICommand command = new UICommand();
>+ pageContext.setAttribute("ford", command, PageContext.REQUEST_SCOPE);
> %>
>
> <h1>TLV commandButton, valid 'binding' expression</h1>
>Index: systest/web/jsp/jstl-import-02a.jsp
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/systest/web/jsp/jstl-import-02a.jsp,v
>retrieving revision 1.3
>diff -u -r1.3 jstl-import-02a.jsp
>--- systest/web/jsp/jstl-import-02a.jsp 4 Feb 2004 23:43:31 -0000 1.3
>+++ systest/web/jsp/jstl-import-02a.jsp 12 May 2005 21:48:44 -0000
>@@ -5,6 +5,6 @@
>
> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
>-<%-- <f:view> --%>
>+<f:subview id="view1">
> <h:outputText value="[B]"/>
>-<%-- </f:view> --%>
>+</f:subview>
>Index: test/com/sun/faces/util/TestUtil_messages.java
>===================================================================
>RCS file: /cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/util/TestUtil_messages.java,v
>retrieving revision 1.38
>diff -u -r1.38 TestUtil_messages.java
>--- test/com/sun/faces/util/TestUtil_messages.java 6 May 2005 22:02:11 -0000 1.38
>+++ test/com/sun/faces/util/TestUtil_messages.java 12 May 2005 21:48:44 -0000
>@@ -76,7 +76,7 @@
> {Util.ILLEGAL_CHARACTERS_ERROR_MESSAGE_ID, "0"},
> {Util.NOT_NESTED_IN_FACES_TAG_ERROR_MESSAGE_ID, "1"},
> {Util.NULL_BODY_CONTENT_ERROR_MESSAGE_ID, "1"},
>- {Util.SAVING_STATE_ERROR_MESSAGE_ID, "2"},
>+ {Util.SAVING_STATE_ERROR_MESSAGE_ID, "0"},
> {Util.RENDERER_NOT_FOUND_ERROR_MESSAGE_ID, "1"},
> {Util.MAXIMUM_EVENTS_REACHED_ERROR_MESSAGE_ID, "1"},
> {Util.NULL_CONFIGURATION_ERROR_MESSAGE_ID, "0"},
>
>