Author: dolander Date: Sat Jan 8 08:23:24 2005 New Revision: 124658 URL: http://svn.apache.org/viewcvs?view=rev&rev=124658 Log: Clean up the IdMap tests. I added more descritpions and documentation to the tests in addition to additional JavaScript tests and results.
Added a test of the tagId in a Form without ScriptContainer support. Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/Controller.jpf incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/index.jsp incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapFormNoHtml.xml Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/form/index.jsp incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/genScopeId/index.jsp incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/htmlScopeId/index.jsp incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/id/index.jsp incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/scopeTest/index.jsp incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/style.css incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapForm.xml incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapGenScopeId.xml incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapHtmlScopeId.xml incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapId.xml incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapScopeId.xml Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java&r1=124657&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java Sat Jan 8 08:23:24 2005 @@ -288,8 +288,8 @@ if (_formSubmit) _form = getNearestForm(); - HttpServletResponse response = (HttpServletResponse) pageContext.getResponse(); - ServletContext ctxt = pageContext.getServletContext(); + //HttpServletResponse response = (HttpServletResponse) pageContext.getResponse(); + //ServletContext ctxt = pageContext.getServletContext(); JavaScriptUtils jsu = getJavaScriptUtils(request); // check the parameters that the user provided Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/form/index.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/form/index.jsp?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/form/index.jsp&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/form/index.jsp&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/form/index.jsp (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/form/index.jsp Sat Jan 8 08:23:24 2005 @@ -34,6 +34,13 @@ <netui:button type="submit" value="postForm"/> </netui:form> <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. Both + of the forms elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> <p id="javaOut"></p> </netui:body> <script language="JavaScript" type="text/JavaScript"> @@ -46,6 +53,22 @@ (document.getElementById(lookupIdByTagId("form",s)) == null) + "</b><br>"; val = val + "Form by name is null: <b>" + (document[lookupNameByTagId("form",s)] == null) + "</b><br>"; + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } p.innerHTML = val; </script> Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/Controller.jpf Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/Controller.jpf?view=auto&rev=124658 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/Controller.jpf Sat Jan 8 08:23:24 2005 @@ -0,0 +1,139 @@ +package idmap.formNoHtml; + +import javax.servlet.http.HttpSession; +import org.apache.beehive.netui.pageflow.FormData; +import org.apache.beehive.netui.pageflow.PageFlowController; +import org.apache.beehive.netui.pageflow.Forward; +import org.apache.beehive.netui.pageflow.annotations.Jpf; + +/** + * This is the default controller for a blank web application. + */ [EMAIL PROTECTED] +public class Controller extends PageFlowController +{ + private String[] _selectOptions = {"Option 1", "Option 2", "Option 3", "Option 4"}; + private Bean _bean = new Bean(); + + public Bean getBean() { + return _bean; + } + + public String[] getSelectOptions() { + return _selectOptions; + } + + @Jpf.Action( + forwards={ + @Jpf.Forward(name="index", path="index.jsp") + } + ) + protected Forward begin() + { + return new Forward("index"); + } + + + /** + * Callback that is invoked when this controller instance is created. + */ + protected void onCreate() + { + } + + /** + * Callback that is invoked when this controller instance is destroyed. + */ + protected void onDestroy(HttpSession session) + { + } + + + @Jpf.Action(forwards = { + @Jpf.Forward(name = "success", + path = "index.jsp") + }) + protected Forward postForm(Bean form) + { + _bean = form; + Forward forward = new Forward("success"); + return forward; + } + + public static class Bean extends FormData + { + private String text1; + + private String text2; + + private String text3; + + private boolean check1; + + private boolean check2; + + public String getText1() + { + return text1; + } + + public void setText1(String value) + { + text1 = value; + } + + public String getText2() + { + return text2; + } + + public void setText2(String value) + { + text2 = value; + } + + public String getText3() + { + return text3; + } + + public void setText3(String value) + { + text3 = value; + } + + public boolean isCheck1() + { + return check1; + } + + public void setCheck1(boolean value) + { + check1 = value; + } + + public boolean isCheck2() + { + return check2; + } + + public void setCheck2(boolean value) + { + check2 = value; + } + } +} + [EMAIL PROTECTED](value= {"<!-- This data is auto-generated. Hand-editing this section is not recommended. -->", +"<view-properties>", +"<pageflow-object id='pageflow:/idmap/simple/Controller.jpf'/>", +"<pageflow-object id='page:index.jsp'><property value='220' name='x'/><property value='100' name='y'/></pageflow-object>", +"<pageflow-object id='formbean:Bean'/>", +"<pageflow-object id='action:postForm.do#idmap.simple.Controller.Bean'><property name='x' value='340'/><property name='y' value='100'/></pageflow-object>", +"<pageflow-object id='forward:[EMAIL PROTECTED]:postForm.do#idmap.simple.Controller.Bean@'/>", +"<pageflow-object id='action-call:@page:[EMAIL PROTECTED]@action:postForm.do#idmap.simple.Controller.Bean@'><property name='elbowsX' value='256,280,280,304'/><property name='elbowsY' value='92,92,92,92'/><property name='fromPort' value='East_1'/><property name='toPort' value='West_1'/></pageflow-object>", +"<pageflow-object id='action:begin.do'><property value='80' name='x'/><property value='100' name='y'/></pageflow-object>", +"<pageflow-object id='forward:[EMAIL PROTECTED]:begin.do@'><property value='116,140,140,164' name='elbowsX'/><property value='92,92,92,92' name='elbowsY'/><property value='East_1' name='fromPort'/><property value='West_1' name='toPort'/><property value='index' name='label'/></pageflow-object>", +"</view-properties>" +}) +interface VIEW_PROPERTIES { } Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/index.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/index.jsp?view=auto&rev=124658 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/formNoHtml/index.jsp Sat Jan 8 08:23:24 2005 @@ -0,0 +1,76 @@ +<%@ page language="java" contentType="text/html;charset=UTF-8"%> +<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%> +<%@ taglib prefix="netui-data" uri="http://beehive.apache.org/netui/tags-databinding-1.0"%> +<%@ taglib prefix="netui-template" uri="http://beehive.apache.org/netui/tags-template-1.0"%> + + +<html> + <head> + <netui:base/> + </head> + <body> + <p style="color: green">Verify the output of a form with a tagId not found in + a ScriptContainer. The JavaScript should be output right after the form. + </p> + <netui:form tagId="form" action="postForm"> + <span id="scopeOneSpan" /> + <table> + <tr valign="top"> + <td>Check1:</td> + <td> + <netui:checkBox dataSource="actionForm.check1" /> + </td> + </tr> + <tr valign="top"> + <td>Check2:</td> + <td> + <netui:checkBox dataSource="actionForm.check2" /> + </td> + </tr> + </table> + <br> + <netui:button type="submit" value="postForm"/> + </netui:form> + <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. Both + of the forms elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> + <p id="javaOut"></p> + + <script language="JavaScript" type="text/JavaScript"> + + var p = document.getElementById("javaOut"); + var s = document.getElementById("scopeOneSpan"); + + var val = "<b>Document Access</b><br>"; + val = val + "Form by id is null: <b>" + + (document.getElementById(lookupIdByTagId("form",s)) == null) + "</b><br>"; + val = val + "Form by name is null: <b>" + + (document[lookupNameByTagId("form",s)] == null) + "</b><br>"; + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'"; + } + val = val + "<br>"; + } + + p.innerHTML = val; + </script> + </body> +</html> + + \ No newline at end of file Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/genScopeId/index.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/genScopeId/index.jsp?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/genScopeId/index.jsp&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/genScopeId/index.jsp&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/genScopeId/index.jsp (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/genScopeId/index.jsp Sat Jan 8 08:23:24 2005 @@ -37,6 +37,13 @@ </netui:form> </netui:scriptContainer> <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. All of the + elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> <p id="javaOut"></p> </netui:body> <script language="JavaScript" type="text/JavaScript"> @@ -47,6 +54,23 @@ var val = "<b>Document Access</b><br>"; val = val + "CheckBox 1 by id is null: <b>" + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; + val = val + "CheckBox 1 by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("check1",s)) == null) + "</b><br>"; + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } p.innerHTML = val; </script> Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/htmlScopeId/index.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/htmlScopeId/index.jsp?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/htmlScopeId/index.jsp&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/htmlScopeId/index.jsp&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/htmlScopeId/index.jsp (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/htmlScopeId/index.jsp Sat Jan 8 08:23:24 2005 @@ -2,8 +2,6 @@ <%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%> <%@ taglib prefix="netui-data" uri="http://beehive.apache.org/netui/tags-databinding-1.0"%> <%@ taglib prefix="netui-template" uri="http://beehive.apache.org/netui/tags-template-1.0"%> - - <netui:html generateScopeId="true"> <head> <netui:base/> @@ -33,18 +31,40 @@ <netui:button tagId="button" type="submit" value="postForm"/> </netui:form> <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. All of the + elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> <p id="javaOut"></p> </netui:body> <script language="JavaScript" type="text/JavaScript"> -// This method will walk the hierarchy from the pass element looking for a scopeId. -// The first scopeId found will be returned or the empty string if a scopeId is not found. - var p = document.getElementById("javaOut"); var s = document.getElementById("scopeOneSpan"); var val = "<b>Document Access</b><br>"; val = val + "CheckBox 1 by id is null: <b>" + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; + val = val + "CheckBox 1 by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("check1",s)) == null) + "</b><br>"; + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } p.innerHTML = val; </script> Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/id/index.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/id/index.jsp?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/id/index.jsp&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/id/index.jsp&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/id/index.jsp (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/id/index.jsp Sat Jan 8 08:23:24 2005 @@ -2,15 +2,18 @@ <%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%> <%@ taglib prefix="netui-data" uri="http://beehive.apache.org/netui/tags-databinding-1.0"%> <%@ taglib prefix="netui-template" uri="http://beehive.apache.org/netui/tags-template-1.0"%> - - <netui:html> <head> <netui:base/> </head> <netui:body> - + <p style="color: green">This is the base test of the tagId features. This + is a basic form that will contain a bunch of tagIds. These are then looked + up in JavaScript and the results are reported below. This has not ScriptContainer + scoping. + </p> <netui:form action="postForm"> + <span id="scopeOneSpan" /> <table> <tr valign="top"> <td>Text1:</td> @@ -19,13 +22,13 @@ </td> </tr> <tr valign="top"> - <td>Text2:</td> + <td>Select:</td> <td> <netui:select tagId="select" dataSource="actionForm.text2" optionsDataSource="${pageFlow.selectOptions}" /> </td> </tr> <tr valign="top"> - <td>Text3:</td> + <td>TextArea:</td> <td> <netui:textArea tagId="textArea" dataSource="actionForm.text3"></netui:textArea> </td> @@ -48,28 +51,64 @@ <netui:button tagId="button" type="submit" value="postForm"/> </netui:form> <hr> - - <div> - <br> - TextBox: - <netui:span value="${pageFlow.bean.text1}" defaultValue=" "/> - <br> - Select: - <netui:span value="${pageFlow.bean.text2}" defaultValue=" "/> - <br> - TextArea: - <netui:span value="${pageFlow.bean.text3}" defaultValue=" "/> - <br> - Check1: - <netui:span value="${pageFlow.bean.check1}" defaultValue=" "/> - <br> - Check2: - <netui:span value="${pageFlow.bean.check2}" defaultValue=" "/> - <br> - </div> + <p style="color: green"> + These sections that follow are generated through JavaScript. All of the + elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> + <p id="javaOut"></p> + </netui:body> + <script language="JavaScript" type="text/JavaScript"> + var p = document.getElementById("javaOut"); + var s = document.getElementById("scopeOneSpan"); + var val = "<b>Document Access</b><br>"; + val = val + "TextBox by id is null: <b>" + + (document.getElementById(lookupIdByTagId("textbox",s)) == null) + "</b><br>"; + val = val + "TextBox by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("textbox",s)) == null) + "</b><br>"; - </netui:body> + val = val + "Select by id is null: <b>" + + (document.getElementById(lookupIdByTagId("select",s)) == null) + "</b><br>"; + val = val + "Select by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("select",s)) == null) + "</b><br>"; + + val = val + "TextArea by id is null: <b>" + + (document.getElementById(lookupIdByTagId("textArea",s)) == null) + "</b><br>"; + val = val + "TextArea by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("textArea",s)) == null) + "</b><br>"; + + val = val + "CheckBox 1 by id is null: <b>" + + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; + val = val + "CheckBox 1 by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("check1",s)) == null) + "</b><br>"; + + val = val + "Button by id is null: <b>" + + (document.getElementById(lookupIdByTagId("button",s)) == null) + "</b><br>"; + val = val + "Button by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("button",s)) == null) + "</b><br>"; + + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } + + p.innerHTML = val; + </script> </netui:html> Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/scopeTest/index.jsp Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/scopeTest/index.jsp?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/scopeTest/index.jsp&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/scopeTest/index.jsp&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/scopeTest/index.jsp (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/scopeTest/index.jsp Sat Jan 8 08:23:24 2005 @@ -2,14 +2,15 @@ <%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%> <%@ taglib prefix="netui-data" uri="http://beehive.apache.org/netui/tags-databinding-1.0"%> <%@ taglib prefix="netui-template" uri="http://beehive.apache.org/netui/tags-template-1.0"%> - - <netui:html> <head> <netui:base/> </head> <netui:body> - + <p style="color: green">This verifies the getScopeId method works correctly. + This is test is the result of a reported bug where the call to getScopeId + failed an reported a error on the JavaScript Console. + </p> <netui:form action="postForm"> <span id="scopeOneSpan" /> <table> @@ -49,6 +50,11 @@ <netui:button tagId="button" type="submit" value="postForm"/> </netui:form> <hr> + <p style="color: green"> + Below are two calls, the first calls getScopeId directly. This should return + the empty string '' because there is no scope id. The second verifies + that we can find checkbox 1 by calling the lookup. + </p> <p id="javaOut"></p> </netui:body> <script language="JavaScript" type="text/JavaScript"> @@ -57,6 +63,8 @@ var s = document.getElementById("scopeOneSpan"); var val = "<b>Document Access</b><br>"; + val = val + "Call getScopeId: <b>'" + + getScopeId("check1",s) + "'</b><br>"; val = val + "CheckBox 1 by id is null: <b>" + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/style.css Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/style.css?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/style.css&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/style.css&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/style.css (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/index/style.css Sat Jan 8 08:23:24 2005 @@ -112,8 +112,8 @@ #netuiTestRecorder { position: absolute; - left:5px; - top: 468px; + left:620px; + top: 5px; width: 103px; background-color:#c0c0c0 !important; padding: 2pt 0pt 2pt 2pt !important; Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Sat Jan 8 08:23:24 2005 @@ -3096,6 +3096,21 @@ </features> </test> <test> + <name>IdMapFormNoHtml</name> + <description>Test of setting a tagId on a Form and looking it up without + a script container present.</description> + <webapp>coreWeb</webapp> + <categories> + <category>bvt</category> + <category>tags</category> + </categories> + <features> + <feature>JavaScript</feature> + <feature>Form</feature> + <feature>scopeId</feature> + </features> + </test> + <test> <name>IdMapGenScopeId</name> <description>Test of autogeneration of the scope id.</description> <webapp>coreWeb</webapp> Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapForm.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapForm.xml?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapForm.xml&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapForm.xml&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapForm.xml (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapForm.xml Sat Jan 8 08:23:24 2005 @@ -2,8 +2,8 @@ <ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> <ses:sessionName>IdMapForm</ses:sessionName> <ses:tester>Daryl</ses:tester> - <ses:startDate>07 Jan 2005, 11:00:59.499 AM MST</ses:startDate> - <ses:description>Basic test of the id map using a form</ses:description> + <ses:startDate>08 Jan 2005, 08:43:59.125 AM MST</ses:startDate> + <ses:description>Daryl</ses:description> <ses:tests> <ses:test> <ses:testNumber>1</ses:testNumber> @@ -18,11 +18,15 @@ <ses:cookies> <ses:cookie> <ses:name>JSESSIONID</ses:name> - <ses:value>93D8FE1612C808A3C47A9FAC6D4E1238</ses:value> + <ses:value>3676E41A39D93ECAB7A22971DD996B23</ses:value> </ses:cookie> </ses:cookies> <ses:headers> <ses:header> + <ses:name>---------------</ses:name> + <ses:value>------------</ses:value> + </ses:header> + <ses:header> <ses:name>accept</ses:name> <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> </ses:header> @@ -31,10 +35,6 @@ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> </ses:header> <ses:header> - <ses:name>accept-encoding</ses:name> - <ses:value>gzip,deflate</ses:value> - </ses:header> - <ses:header> <ses:name>accept-language</ses:name> <ses:value>en-us,en;q=0.5</ses:value> </ses:header> @@ -44,7 +44,7 @@ </ses:header> <ses:header> <ses:name>cookie</ses:name> - <ses:value>JSESSIONID=93D8FE1612C808A3C47A9FAC6D4E1238</ses:value> + <ses:value>$Version=0; JSESSIONID=3676E41A39D93ECAB7A22971DD996B23; $Path=/coreWeb</ses:value> </ses:header> <ses:header> <ses:name>host</ses:name> @@ -55,6 +55,10 @@ <ses:value>300</ses:value> </ses:header> <ses:header> + <ses:name>testrecorder.playback.testid</ses:name> + <ses:value>-2eb11a3b:10152f90f73:-7cea</ses:value> + </ses:header> + <ses:header> <ses:name>user-agent</ses:name> <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value> </ses:header> @@ -96,6 +100,13 @@ <input type="submit" value="postForm"> </form> <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. Both + of the forms elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> <p id="javaOut"></p> @@ -187,13 +198,35 @@ val = val + "Form by name is null: <b>" + (document[lookupNameByTagId("form",s)] == null) + "</b><br>"; + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } + p.innerHTML = val; </script> </div> </html></ses:responseBody> </ses:response> + <ses:testResults> + <ses:testStatus>fail</ses:testStatus> + </ses:testResults> </ses:test> </ses:tests> - <ses:endDate>07 Jan 2005, 11:01:04.118 AM MST</ses:endDate> + <ses:endDate>08 Jan 2005, 08:44:00.156 AM MST</ses:endDate> + <ses:sessionStatus>fail</ses:sessionStatus> <ses:testCount>1</ses:testCount> + <ses:passedCount>0</ses:passedCount> + <ses:failedCount>1</ses:failedCount> </ses:recorderSession> Added: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapFormNoHtml.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapFormNoHtml.xml?view=auto&rev=124658 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapFormNoHtml.xml Sat Jan 8 08:23:24 2005 @@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> + <ses:sessionName>IdMapFormNoHtml</ses:sessionName> + <ses:tester>Daryl</ses:tester> + <ses:startDate>08 Jan 2005, 07:26:55.265 AM MST</ses:startDate> + <ses:description>Verify that the tagId and lookup are correct when there is not Script containers for a form.</ses:description> + <ses:tests> + <ses:test> + <ses:testNumber>1</ses:testNumber> + <ses:request> + <ses:protocol>HTTP</ses:protocol> + <ses:protocolVersion>1.1</ses:protocolVersion> + <ses:host>localhost</ses:host> + <ses:port>8080</ses:port> + <ses:uri>/coreWeb/idmap/formNoHtml/Controller.jpf</ses:uri> + <ses:method>GET</ses:method> + <ses:parameters/> + <ses:cookies> + <ses:cookie> + <ses:name>JSESSIONID</ses:name> + <ses:value>887C73FE4DE23D482BB92DB5F74F1E8F</ses:value> + </ses:cookie> + </ses:cookies> + <ses:headers> + <ses:header> + <ses:name>---------------</ses:name> + <ses:value>------------</ses:value> + </ses:header> + <ses:header> + <ses:name>accept</ses:name> + <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-charset</ses:name> + <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> + </ses:header> + <ses:header> + <ses:name>accept-language</ses:name> + <ses:value>en-us,en;q=0.5</ses:value> + </ses:header> + <ses:header> + <ses:name>connection</ses:name> + <ses:value>keep-alive</ses:value> + </ses:header> + <ses:header> + <ses:name>cookie</ses:name> + <ses:value>JSESSIONID=887C73FE4DE23D482BB92DB5F74F1E8F</ses:value> + </ses:header> + <ses:header> + <ses:name>host</ses:name> + <ses:value>localhost:8080</ses:value> + </ses:header> + <ses:header> + <ses:name>keep-alive</ses:name> + <ses:value>300</ses:value> + </ses:header> + <ses:header> + <ses:name>user-agent</ses:name> + <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value> + </ses:header> + </ses:headers> + </ses:request> + <ses:response> + <ses:statusCode>200</ses:statusCode> + <ses:reason/> + <ses:responseBody><html> + <head> + <base href="http://localhost:8080/coreWeb/idmap/formNoHtml/index.jsp"> + </head> + <body> + <p style="color: green">Verify the output of a form with a tagId not found in + a ScriptContainer. The JavaScript should be output right after the form. + </p> + <form name="bean" id="form" action="/coreWeb/idmap/formNoHtml/postForm.do" method="post"> + <span id="scopeOneSpan" /> + <table> + <tr valign="top"> + <td>Check1:</td> + <td> + <input type="hidden" name="wlw-checkbox_key:{actionForm.check1}OldValue" value="false"><input type="checkbox" name="wlw-checkbox_key:{actionForm.check1}"> + </td> + </tr> + <tr valign="top"> + <td>Check2:</td> + <td> + <input type="hidden" name="wlw-checkbox_key:{actionForm.check2}OldValue" value="false"><input type="checkbox" name="wlw-checkbox_key:{actionForm.check2}"> + </td> + </tr> + </table> + <br> + <input type="submit" value="postForm"> + </form> + +<script language="JavaScript" type="text/JavaScript"> +<!-- +// Build the netui_names table to map the tagId attributes +// to the real id written into the HTML +if (netui_names == null) + var netui_names = new Object(); +netui_names.form="form" +// method which will return a real id for a tagId, +// the tag parameter will be used to find the scopeId for +// containers that may scope their ids +function getNetuiTagName(id, tag) +{ + var scopeId = getScopeId(tag); + if (scopeId == "") + return netui_names[id]; + else + return netui_names[scopeId + "__" + id]; +} + +// This method will walk the hierarchy from the pass element looking for a scopeId. +// The first scopeId found will be returned or the empty string if a scopeId is not found. +function getScopeId(tag) +{ + if (tag == null || tag.getAttribute == null) + return ""; + var attrVal = tag.getAttribute("netui:scopeId"); + if (attrVal != null) + return attrVal; + return getScopeId(tag.parentNode); +} + +--> +</script> + + + +<script language="JavaScript" type="text/JavaScript"> +<!-- + +// map tagId to "real name" +if (netui_tagIdMap == null) + var netui_tagIdMap = new Object(); +netui_tagIdMap.form="form" +// lookup by tagId to "real id" +function lookupIdByTagId(id, tag) +{ + var scopeId = getScopeId(tag); + if (scopeId == "") + return netui_tagIdMap[id]; + else + return netui_tagIdMap[scopeId + "__" + id]; +} + + +// map tagId to "real name" +if (netui_tagIdNameMap == null) + var netui_tagIdNameMap = new Object(); +netui_tagIdNameMap.form="bean" +// lookup by tagId to "real name" +function lookupNameByTagId(id, tag) +{ + var scopeId = getScopeId(tag); + if (scopeId == "") + return netui_tagIdNameMap[id]; + else + return netui_tagIdNameMap[scopeId + "__" + id]; +} + +--> +</script> + + + <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. Both + of the forms elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> + <p id="javaOut"></p> + + <script language="JavaScript" type="text/JavaScript"> + + var p = document.getElementById("javaOut"); + var s = document.getElementById("scopeOneSpan"); + + var val = "<b>Document Access</b><br>"; + val = val + "Form by id is null: <b>" + + (document.getElementById(lookupIdByTagId("form",s)) == null) + "</b><br>"; + val = val + "Form by name is null: <b>" + + (document[lookupNameByTagId("form",s)] == null) + "</b><br>"; + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'"; + } + val = val + "<br>"; + } + + p.innerHTML = val; + </script> + </body> +</html></ses:responseBody> + </ses:response> + </ses:test> + </ses:tests> + <ses:endDate>08 Jan 2005, 07:27:04.359 AM MST</ses:endDate> + <ses:testCount>1</ses:testCount> +</ses:recorderSession> \ No newline at end of file Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapGenScopeId.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapGenScopeId.xml?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapGenScopeId.xml&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapGenScopeId.xml&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapGenScopeId.xml (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapGenScopeId.xml Sat Jan 8 08:23:24 2005 @@ -2,7 +2,7 @@ <ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> <ses:sessionName>IdMapGenScopeId</ses:sessionName> <ses:tester>Daryl</ses:tester> - <ses:startDate>07 Jan 2005, 10:03:29.315 AM MST</ses:startDate> + <ses:startDate>08 Jan 2005, 08:44:01.562 AM MST</ses:startDate> <ses:description>Daryl</ses:description> <ses:tests> <ses:test> @@ -18,11 +18,15 @@ <ses:cookies> <ses:cookie> <ses:name>JSESSIONID</ses:name> - <ses:value>49DA30395513DA0529E6405B6D833A1F</ses:value> + <ses:value>3676E41A39D93ECAB7A22971DD996B23</ses:value> </ses:cookie> </ses:cookies> <ses:headers> <ses:header> + <ses:name>---------------</ses:name> + <ses:value>------------</ses:value> + </ses:header> + <ses:header> <ses:name>accept</ses:name> <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> </ses:header> @@ -31,10 +35,6 @@ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> </ses:header> <ses:header> - <ses:name>accept-encoding</ses:name> - <ses:value>gzip,deflate</ses:value> - </ses:header> - <ses:header> <ses:name>accept-language</ses:name> <ses:value>en-us,en;q=0.5</ses:value> </ses:header> @@ -44,7 +44,7 @@ </ses:header> <ses:header> <ses:name>cookie</ses:name> - <ses:value>$Version=0; JSESSIONID=49DA30395513DA0529E6405B6D833A1F; $Path=/coreWeb</ses:value> + <ses:value>$Version=0; JSESSIONID=3676E41A39D93ECAB7A22971DD996B23; $Path=/coreWeb</ses:value> </ses:header> <ses:header> <ses:name>host</ses:name> @@ -56,7 +56,7 @@ </ses:header> <ses:header> <ses:name>testrecorder.playback.testid</ses:name> - <ses:value>4366b091:1014e1da1c5:-7cea</ses:value> + <ses:value>-2eb11a3b:10152f90f73:-7ce6</ses:value> </ses:header> <ses:header> <ses:name>user-agent</ses:name> @@ -186,6 +186,13 @@ <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. All of the + elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> <p id="javaOut"></p> </body> <script language="JavaScript" type="text/JavaScript"> @@ -196,6 +203,23 @@ var val = "<b>Document Access</b><br>"; val = val + "CheckBox 1 by id is null: <b>" + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; + val = val + "CheckBox 1 by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("check1",s)) == null) + "</b><br>"; + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } p.innerHTML = val; </script> @@ -207,7 +231,7 @@ </ses:testResults> </ses:test> </ses:tests> - <ses:endDate>07 Jan 2005, 10:03:29.926 AM MST</ses:endDate> + <ses:endDate>08 Jan 2005, 08:44:02.515 AM MST</ses:endDate> <ses:sessionStatus>fail</ses:sessionStatus> <ses:testCount>1</ses:testCount> <ses:passedCount>0</ses:passedCount> Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapHtmlScopeId.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapHtmlScopeId.xml?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapHtmlScopeId.xml&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapHtmlScopeId.xml&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapHtmlScopeId.xml (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapHtmlScopeId.xml Sat Jan 8 08:23:24 2005 @@ -2,7 +2,7 @@ <ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> <ses:sessionName>IdMapHtmlScopeId</ses:sessionName> <ses:tester>Daryl</ses:tester> - <ses:startDate>07 Jan 2005, 10:03:29.946 AM MST</ses:startDate> + <ses:startDate>08 Jan 2005, 08:44:02.578 AM MST</ses:startDate> <ses:description>Daryl</ses:description> <ses:tests> <ses:test> @@ -18,11 +18,15 @@ <ses:cookies> <ses:cookie> <ses:name>JSESSIONID</ses:name> - <ses:value>49DA30395513DA0529E6405B6D833A1F</ses:value> + <ses:value>3676E41A39D93ECAB7A22971DD996B23</ses:value> </ses:cookie> </ses:cookies> <ses:headers> <ses:header> + <ses:name>---------------</ses:name> + <ses:value>------------</ses:value> + </ses:header> + <ses:header> <ses:name>accept</ses:name> <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> </ses:header> @@ -31,10 +35,6 @@ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> </ses:header> <ses:header> - <ses:name>accept-encoding</ses:name> - <ses:value>gzip,deflate</ses:value> - </ses:header> - <ses:header> <ses:name>accept-language</ses:name> <ses:value>en-us,en;q=0.5</ses:value> </ses:header> @@ -44,7 +44,7 @@ </ses:header> <ses:header> <ses:name>cookie</ses:name> - <ses:value>$Version=0; JSESSIONID=49DA30395513DA0529E6405B6D833A1F; $Path=/coreWeb</ses:value> + <ses:value>$Version=0; JSESSIONID=3676E41A39D93ECAB7A22971DD996B23; $Path=/coreWeb</ses:value> </ses:header> <ses:header> <ses:name>host</ses:name> @@ -56,7 +56,7 @@ </ses:header> <ses:header> <ses:name>testrecorder.playback.testid</ses:name> - <ses:value>4366b091:1014e1da1c5:-7ce8</ses:value> + <ses:value>-2eb11a3b:10152f90f73:-7ce4</ses:value> </ses:header> <ses:header> <ses:name>user-agent</ses:name> @@ -99,6 +99,13 @@ <input type="submit" id="n0.button" value="postForm"> </form> <hr> + <p style="color: green"> + These sections that follow are generated through JavaScript. All of the + elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> <p id="javaOut"></p> @@ -185,15 +192,30 @@ </body> <script language="JavaScript" type="text/JavaScript"> -// This method will walk the hierarchy from the pass element looking for a scopeId. -// The first scopeId found will be returned or the empty string if a scopeId is not found. - var p = document.getElementById("javaOut"); var s = document.getElementById("scopeOneSpan"); var val = "<b>Document Access</b><br>"; val = val + "CheckBox 1 by id is null: <b>" + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; + val = val + "CheckBox 1 by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("check1",s)) == null) + "</b><br>"; + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } p.innerHTML = val; </script> @@ -205,7 +227,7 @@ </ses:testResults> </ses:test> </ses:tests> - <ses:endDate>07 Jan 2005, 10:03:30.868 AM MST</ses:endDate> + <ses:endDate>08 Jan 2005, 08:44:03.484 AM MST</ses:endDate> <ses:sessionStatus>fail</ses:sessionStatus> <ses:testCount>1</ses:testCount> <ses:passedCount>0</ses:passedCount> Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapId.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapId.xml?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapId.xml&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapId.xml&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapId.xml (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapId.xml Sat Jan 8 08:23:24 2005 @@ -2,7 +2,7 @@ <ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> <ses:sessionName>IdMapId</ses:sessionName> <ses:tester>Daryl</ses:tester> - <ses:startDate>05 Jan 2005, 03:33:54.367 PM MST</ses:startDate> + <ses:startDate>08 Jan 2005, 08:44:03.546 AM MST</ses:startDate> <ses:description>Daryl</ses:description> <ses:tests> <ses:test> @@ -18,11 +18,15 @@ <ses:cookies> <ses:cookie> <ses:name>JSESSIONID</ses:name> - <ses:value>56BA56A09B762C1C84636272E60B0973</ses:value> + <ses:value>3676E41A39D93ECAB7A22971DD996B23</ses:value> </ses:cookie> </ses:cookies> <ses:headers> <ses:header> + <ses:name>---------------</ses:name> + <ses:value>------------</ses:value> + </ses:header> + <ses:header> <ses:name>accept</ses:name> <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> </ses:header> @@ -31,10 +35,6 @@ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> </ses:header> <ses:header> - <ses:name>accept-encoding</ses:name> - <ses:value>gzip,deflate</ses:value> - </ses:header> - <ses:header> <ses:name>accept-language</ses:name> <ses:value>en-us,en;q=0.5</ses:value> </ses:header> @@ -44,7 +44,7 @@ </ses:header> <ses:header> <ses:name>cookie</ses:name> - <ses:value>$Version=0; JSESSIONID=56BA56A09B762C1C84636272E60B0973; $Path=/coreWeb</ses:value> + <ses:value>$Version=0; JSESSIONID=3676E41A39D93ECAB7A22971DD996B23; $Path=/coreWeb</ses:value> </ses:header> <ses:header> <ses:name>host</ses:name> @@ -56,7 +56,7 @@ </ses:header> <ses:header> <ses:name>testrecorder.playback.testid</ses:name> - <ses:value>-43783df1:10144ff88e4:-7ce8</ses:value> + <ses:value>-2eb11a3b:10152f90f73:-7ce2</ses:value> </ses:header> <ses:header> <ses:name>user-agent</ses:name> @@ -75,8 +75,13 @@ <base href="http://localhost:8080/coreWeb/idmap/id/index.jsp"> </head> <body> - + <p style="color: green">This is the base test of the tagId features. This + is a basic form that will contain a bunch of tagIds. These are then looked + up in JavaScript and the results are reported below. This has not ScriptContainer + scoping. + </p> <form name="bean" action="/coreWeb/idmap/id/postForm.do" method="post"> + <span id="scopeOneSpan" /> <table> <tr valign="top"> <td>Text1:</td> @@ -85,7 +90,7 @@ </td> </tr> <tr valign="top"> - <td>Text2:</td> + <td>Select:</td> <td> <input type="hidden" name="wlw-select_key:{actionForm.text2}OldValue" value="true"> <select name="wlw-select_key:{actionForm.text2}" id="select"> @@ -96,7 +101,7 @@ </td> </tr> <tr valign="top"> - <td>Text3:</td> + <td>TextArea:</td> <td> <textarea name="{actionForm.text3}" id="textArea"></textarea> </td> @@ -119,27 +124,14 @@ <input type="submit" id="button" value="postForm"> </form> <hr> - - <div> - <br> - TextBox:&nbsp; - <span>&nbsp;</span> - <br> - Select:&nbsp; - <span>&nbsp;</span> - <br> - TextArea:&nbsp; - <span>&nbsp;</span> - <br> - Check1:&nbsp; - <span>false</span> - <br> - Check2:&nbsp; - <span>false</span> - <br> - </div> - - + <p style="color: green"> + These sections that follow are generated through JavaScript. All of the + elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> + <p id="javaOut"></p> <script language="JavaScript" type="text/JavaScript"> @@ -233,6 +225,55 @@ </script> </body> + <script language="JavaScript" type="text/JavaScript"> + var p = document.getElementById("javaOut"); + var s = document.getElementById("scopeOneSpan"); + + var val = "<b>Document Access</b><br>"; + val = val + "TextBox by id is null: <b>" + + (document.getElementById(lookupIdByTagId("textbox",s)) == null) + "</b><br>"; + val = val + "TextBox by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("textbox",s)) == null) + "</b><br>"; + + val = val + "Select by id is null: <b>" + + (document.getElementById(lookupIdByTagId("select",s)) == null) + "</b><br>"; + val = val + "Select by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("select",s)) == null) + "</b><br>"; + + val = val + "TextArea by id is null: <b>" + + (document.getElementById(lookupIdByTagId("textArea",s)) == null) + "</b><br>"; + val = val + "TextArea by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("textArea",s)) == null) + "</b><br>"; + + val = val + "CheckBox 1 by id is null: <b>" + + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; + val = val + "CheckBox 1 by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("check1",s)) == null) + "</b><br>"; + + val = val + "Button by id is null: <b>" + + (document.getElementById(lookupIdByTagId("button",s)) == null) + "</b><br>"; + val = val + "Button by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("button",s)) == null) + "</b><br>"; + + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } + + p.innerHTML = val; + </script> </html></ses:responseBody> </ses:response> @@ -286,11 +327,15 @@ <ses:cookies> <ses:cookie> <ses:name>JSESSIONID</ses:name> - <ses:value>56BA56A09B762C1C84636272E60B0973</ses:value> + <ses:value>3676E41A39D93ECAB7A22971DD996B23</ses:value> </ses:cookie> </ses:cookies> <ses:headers> <ses:header> + <ses:name>---------------</ses:name> + <ses:value>------------</ses:value> + </ses:header> + <ses:header> <ses:name>accept</ses:name> <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> </ses:header> @@ -299,10 +344,6 @@ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> </ses:header> <ses:header> - <ses:name>accept-encoding</ses:name> - <ses:value>gzip,deflate</ses:value> - </ses:header> - <ses:header> <ses:name>accept-language</ses:name> <ses:value>en-us,en;q=0.5</ses:value> </ses:header> @@ -320,7 +361,7 @@ </ses:header> <ses:header> <ses:name>cookie</ses:name> - <ses:value>$Version=0; JSESSIONID=56BA56A09B762C1C84636272E60B0973; $Path=/coreWeb</ses:value> + <ses:value>$Version=0; JSESSIONID=3676E41A39D93ECAB7A22971DD996B23; $Path=/coreWeb</ses:value> </ses:header> <ses:header> <ses:name>host</ses:name> @@ -332,7 +373,7 @@ </ses:header> <ses:header> <ses:name>testrecorder.playback.testid</ses:name> - <ses:value>-43783df1:10144ff88e4:-7ce8</ses:value> + <ses:value>-2eb11a3b:10152f90f73:-7ce2</ses:value> </ses:header> <ses:header> <ses:name>user-agent</ses:name> @@ -351,8 +392,13 @@ <base href="http://localhost:8080/coreWeb/idmap/id/index.jsp"> </head> <body> - + <p style="color: green">This is the base test of the tagId features. This + is a basic form that will contain a bunch of tagIds. These are then looked + up in JavaScript and the results are reported below. This has not ScriptContainer + scoping. + </p> <form name="bean" action="/coreWeb/idmap/id/postForm.do" method="post"> + <span id="scopeOneSpan" /> <table> <tr valign="top"> <td>Text1:</td> @@ -361,7 +407,7 @@ </td> </tr> <tr valign="top"> - <td>Text2:</td> + <td>Select:</td> <td> <input type="hidden" name="wlw-select_key:{actionForm.text2}OldValue" value="true"> <select name="wlw-select_key:{actionForm.text2}" id="select"> @@ -372,7 +418,7 @@ </td> </tr> <tr valign="top"> - <td>Text3:</td> + <td>TextArea:</td> <td> <textarea name="{actionForm.text3}" id="textArea">x</textarea> </td> @@ -395,27 +441,14 @@ <input type="submit" id="button" value="postForm"> </form> <hr> - - <div> - <br> - TextBox:&nbsp; - <span>x</span> - <br> - Select:&nbsp; - <span>Option 2</span> - <br> - TextArea:&nbsp; - <span>x</span> - <br> - Check1:&nbsp; - <span>true</span> - <br> - Check2:&nbsp; - <span>true</span> - <br> - </div> - - + <p style="color: green"> + These sections that follow are generated through JavaScript. All of the + elemenets should be found so the value should be + <b>false</b>. The following section contains a dump of the constructed + IdMap and IdName tables. These results should run on all browsers and + are not verified by the TestRecorder. + </p> + <p id="javaOut"></p> <script language="JavaScript" type="text/JavaScript"> @@ -509,6 +542,55 @@ </script> </body> + <script language="JavaScript" type="text/JavaScript"> + var p = document.getElementById("javaOut"); + var s = document.getElementById("scopeOneSpan"); + + var val = "<b>Document Access</b><br>"; + val = val + "TextBox by id is null: <b>" + + (document.getElementById(lookupIdByTagId("textbox",s)) == null) + "</b><br>"; + val = val + "TextBox by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("textbox",s)) == null) + "</b><br>"; + + val = val + "Select by id is null: <b>" + + (document.getElementById(lookupIdByTagId("select",s)) == null) + "</b><br>"; + val = val + "Select by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("select",s)) == null) + "</b><br>"; + + val = val + "TextArea by id is null: <b>" + + (document.getElementById(lookupIdByTagId("textArea",s)) == null) + "</b><br>"; + val = val + "TextArea by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("textArea",s)) == null) + "</b><br>"; + + val = val + "CheckBox 1 by id is null: <b>" + + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; + val = val + "CheckBox 1 by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("check1",s)) == null) + "</b><br>"; + + val = val + "Button by id is null: <b>" + + (document.getElementById(lookupIdByTagId("button",s)) == null) + "</b><br>"; + val = val + "Button by name is null: <b>" + + (document.getElementsByTagName(lookupNameByTagId("button",s)) == null) + "</b><br>"; + + + val = val + "<hr>"; + if (netui_tagIdMap != null) { + val = val + "<b>tagIdMap:</b><br>"; + for (var x in netui_tagIdMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdMap[x] + "'<br>"; + } + val = val + "<br>"; + } + if (netui_tagIdNameMap != null) { + val = val + "<b>tagIdNameMap:</b><br>"; + for (var x in netui_tagIdNameMap) { + val = val + "Name '" + x + "' value '" + netui_tagIdNameMap[x] + "'<br>"; + } + val = val + "<br>"; + } + + p.innerHTML = val; + </script> </html></ses:responseBody> </ses:response> @@ -517,7 +599,7 @@ </ses:testResults> </ses:test> </ses:tests> - <ses:endDate>05 Jan 2005, 03:33:54.998 PM MST</ses:endDate> + <ses:endDate>08 Jan 2005, 08:44:05.046 AM MST</ses:endDate> <ses:sessionStatus>fail</ses:sessionStatus> <ses:testCount>2</ses:testCount> <ses:passedCount>0</ses:passedCount> Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapScopeId.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapScopeId.xml?view=diff&rev=124658&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapScopeId.xml&r1=124657&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapScopeId.xml&r2=124658 ============================================================================== --- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapScopeId.xml (original) +++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapScopeId.xml Sat Jan 8 08:23:24 2005 @@ -2,7 +2,7 @@ <ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session"> <ses:sessionName>IdMapScopeId</ses:sessionName> <ses:tester>Daryl</ses:tester> - <ses:startDate>05 Jan 2005, 03:33:55.028 PM MST</ses:startDate> + <ses:startDate>08 Jan 2005, 08:44:05.125 AM MST</ses:startDate> <ses:description>Daryl</ses:description> <ses:tests> <ses:test> @@ -18,11 +18,15 @@ <ses:cookies> <ses:cookie> <ses:name>JSESSIONID</ses:name> - <ses:value>56BA56A09B762C1C84636272E60B0973</ses:value> + <ses:value>3676E41A39D93ECAB7A22971DD996B23</ses:value> </ses:cookie> </ses:cookies> <ses:headers> <ses:header> + <ses:name>---------------</ses:name> + <ses:value>------------</ses:value> + </ses:header> + <ses:header> <ses:name>accept</ses:name> <ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value> </ses:header> @@ -31,10 +35,6 @@ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value> </ses:header> <ses:header> - <ses:name>accept-encoding</ses:name> - <ses:value>gzip,deflate</ses:value> - </ses:header> - <ses:header> <ses:name>accept-language</ses:name> <ses:value>en-us,en;q=0.5</ses:value> </ses:header> @@ -44,7 +44,7 @@ </ses:header> <ses:header> <ses:name>cookie</ses:name> - <ses:value>$Version=0; JSESSIONID=56BA56A09B762C1C84636272E60B0973; $Path=/coreWeb</ses:value> + <ses:value>$Version=0; JSESSIONID=3676E41A39D93ECAB7A22971DD996B23; $Path=/coreWeb</ses:value> </ses:header> <ses:header> <ses:name>host</ses:name> @@ -56,7 +56,7 @@ </ses:header> <ses:header> <ses:name>testrecorder.playback.testid</ses:name> - <ses:value>-43783df1:10144ff88e4:-7ce5</ses:value> + <ses:value>-2eb11a3b:10152f90f73:-7cdf</ses:value> </ses:header> <ses:header> <ses:name>user-agent</ses:name> @@ -75,7 +75,10 @@ <base href="http://localhost:8080/coreWeb/idmap/scopeTest/index.jsp"> </head> <body> - + <p style="color: green">This verifies the getScopeId method works correctly. + This is test is the result of a reported bug where the call to getScopeId + failed an reported a error on the JavaScript Console. + </p> <form name="bean" action="/coreWeb/idmap/scopeTest/postForm.do" method="post"> <span id="scopeOneSpan" /> <table> @@ -120,6 +123,11 @@ <input type="submit" id="button" value="postForm"> </form> <hr> + <p style="color: green"> + Below are two calls, the first calls getScopeId directly. This should return + the empty string '' because there is no scope id. The second verifies + that we can find checkbox 1 by calling the lookup. + </p> <p id="javaOut"></p> @@ -220,6 +228,8 @@ var s = document.getElementById("scopeOneSpan"); var val = "<b>Document Access</b><br>"; + val = val + "Call getScopeId: <b>'" + + getScopeId("check1",s) + "'</b><br>"; val = val + "CheckBox 1 by id is null: <b>" + (document.getElementById(lookupIdByTagId("check1",s)) == null) + "</b><br>"; @@ -233,7 +243,7 @@ </ses:testResults> </ses:test> </ses:tests> - <ses:endDate>05 Jan 2005, 03:33:56.010 PM MST</ses:endDate> + <ses:endDate>08 Jan 2005, 08:44:06.093 AM MST</ses:endDate> <ses:sessionStatus>fail</ses:sessionStatus> <ses:testCount>1</ses:testCount> <ses:passedCount>0</ses:passedCount>
