Author: dolander
Date: Fri Jan 14 18:56:12 2005
New Revision: 125245

URL: http://svn.apache.org/viewcvs?view=rev&rev=125245
Log:
Add tests of the tagId support in the Tree


Added:
   incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/Controller.jpf
   incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/index.jsp
   incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/Controller.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/index.jsp
   incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/Controller.jpf
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/index.jsp
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTree.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml2.xml
Modified:
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/Controller.jpf
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/Controller.jpf?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/Controller.jpf
    Fri Jan 14 18:56:12 2005
@@ -0,0 +1,68 @@
+package idmap.tree;
+
+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;
+import org.apache.beehive.netui.tags.tree.TreeElement;
+
+/**
+ * This is the default controller for a blank web application.
+ */
[EMAIL PROTECTED]
+public class Controller extends PageFlowController
+{
+    TreeElement _tree = null;
+    public TreeElement getTree() {
+        return _tree;
+    }
+    public void setTree(TreeElement t) {
+       _tree = t;
+    }
+    
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("index");
+    }
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="success", navigateTo= Jpf.NavigateTo.currentPage)
+        }
+    )
+    protected Forward clearTree()
+    {
+       _tree = null;
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="success", navigateTo= Jpf.NavigateTo.currentPage)
+        }
+    )
+    protected Forward select()
+    {
+        return new Forward("success");
+    }
+
+    /**
+     * 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)
+    {
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/index.jsp
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/index.jsp?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/tree/index.jsp 
Fri Jan 14 18:56:12 2005
@@ -0,0 +1,42 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+
+<netui:html generateScopeId="true">
+    <head>
+        <netui:base/>
+    </head>
+    <netui:body>
+       <h4>Page One</h4>
+        <p style="color: green">This test sets the TagId on both a tree and an
+       item within it then accesses those nodes through the JavaScript lookup
+       methods.
+        </p>
+       <netui:anchor action="clearTree">Clear Tree</netui:anchor>&nbsp;
+       <hr>
+        <span id="scopeOneSpan" />
+        <netui:tree dataSource="pageFlow.tree" selectionAction="select" 
tagId="tree"
+               renderJavaScript="true">
+           <netui:treeItem expanded="true" 
tagId="item">Item-PageOne</netui:treeItem>
+        </netui:tree>
+       <hr>
+        <p style="color: green">Below we access the tree and item using the
+       lookup method.
+        </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 + "Tree by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("tree",s)) == null) + 
"</b><br>";
+    val = val + "Item by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("item",s)) == null) + 
"</b><br>";
+
+    p.innerHTML = val;
+    </script>
+</netui:html>
+
+  
\ No newline at end of file

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/Controller.jpf
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/Controller.jpf?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/Controller.jpf
      Fri Jan 14 18:56:12 2005
@@ -0,0 +1,68 @@
+package idmap.treeNoHtml;
+
+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;
+import org.apache.beehive.netui.tags.tree.TreeElement;
+
+/**
+ * This is the default controller for a blank web application.
+ */
[EMAIL PROTECTED]
+public class Controller extends PageFlowController
+{
+    TreeElement _tree = null;
+    public TreeElement getTree() {
+        return _tree;
+    }
+    public void setTree(TreeElement t) {
+       _tree = t;
+    }
+    
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("index");
+    }
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="success", navigateTo= Jpf.NavigateTo.currentPage)
+        }
+    )
+    protected Forward clearTree()
+    {
+       _tree = null;
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="success", navigateTo= Jpf.NavigateTo.currentPage)
+        }
+    )
+    protected Forward select()
+    {
+        return new Forward("success");
+    }
+
+    /**
+     * 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)
+    {
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/index.jsp
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/index.jsp?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml/index.jsp
   Fri Jan 14 18:56:12 2005
@@ -0,0 +1,39 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+
+<html>
+    <head>
+        <netui:base/>
+    </head>
+    <body>
+        <p style="color: green">This will test the result of generating 
JavaScript
+       from when it is on the tree itself.  The result should be the inline 
method
+       for looking up the tagId set on the tree.
+        </p>
+       <netui:anchor action="clearTree">Clear Tree</netui:anchor>&nbsp;
+       <hr>
+        <span id="scopeOneSpan" />
+        <netui:tree dataSource="pageFlow.tree" selectionAction="select" 
tagId="tree"
+               renderJavaScript="true">
+           <netui:treeItem expanded="true">Item-PageOne</netui:treeItem>
+        </netui:tree>
+       <hr>
+        <p style="color: green">Below we access the tree, the result should be
+       a <b>false</b>.
+        </p>
+        <p id="javaOut"></p>
+    </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 + "Tree by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("tree",s)) == null) + 
"</b><br>";
+
+    p.innerHTML = val;
+    </script>
+</html>
+
+  
\ No newline at end of file

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/Controller.jpf
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/Controller.jpf?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/Controller.jpf
     Fri Jan 14 18:56:12 2005
@@ -0,0 +1,68 @@
+package idmap.treeNoHtml2;
+
+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;
+import org.apache.beehive.netui.tags.tree.TreeElement;
+
+/**
+ * This is the default controller for a blank web application.
+ */
[EMAIL PROTECTED]
+public class Controller extends PageFlowController
+{
+    TreeElement _tree = null;
+    public TreeElement getTree() {
+        return _tree;
+    }
+    public void setTree(TreeElement t) {
+       _tree = t;
+    }
+    
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    protected Forward begin()
+    {
+        return new Forward("index");
+    }
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="success", navigateTo= Jpf.NavigateTo.currentPage)
+        }
+    )
+    protected Forward clearTree()
+    {
+       _tree = null;
+        return new Forward("success");
+    }
+
+    @Jpf.Action(
+        forwards={
+           @Jpf.Forward(name="success", navigateTo= Jpf.NavigateTo.currentPage)
+        }
+    )
+    protected Forward select()
+    {
+        return new Forward("success");
+    }
+
+    /**
+     * 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)
+    {
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/index.jsp
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/index.jsp?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/idmap/treeNoHtml2/index.jsp
  Fri Jan 14 18:56:12 2005
@@ -0,0 +1,37 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+
+<html>
+    <head>
+        <netui:base/>
+    </head>
+    <body>
+        <p style="color: green">This test will verify that a TreeItem will 
produce
+       the proper JavaScript when there are no scrip containers.
+        </p>
+       <netui:anchor action="clearTree">Clear Tree</netui:anchor>&nbsp;
+       <hr>
+        <span id="scopeOneSpan" />
+        <netui:tree dataSource="pageFlow.tree" selectionAction="select" 
tagId="tree">
+           <netui:treeItem expanded="true" 
tagId="item">Item-PageOne</netui:treeItem>
+        </netui:tree>
+       <hr>
+        <p style="color: green">Below we access the item using the
+       lookup method, the result should be <b>false</b>.
+        </p>
+        <p id="javaOut"></p>
+    </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 + "Item by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("item",s)) == null) + 
"</b><br>";
+
+    p.innerHTML = val;
+    </script>
+</html>
+
+  
\ No newline at end of file

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=125245&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r1=125244&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r2=125245
==============================================================================
--- 
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
   Fri Jan 14 18:56:12 2005
@@ -3233,6 +3233,45 @@
          </features>
       </test>
       <test>
+         <name>IdMapTree</name>
+         <description>Test of tagId inside of a tree</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>tags</category>
+         </categories>
+         <features>
+            <feature>JavaScript</feature>
+            <feature>Tree</feature>
+         </features>
+      </test>
+      <test>
+         <name>IdMapTreeNoHtml</name>
+         <description>Test of tagId inside of a tree without a 
ScriptContainer</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>tags</category>
+         </categories>
+         <features>
+            <feature>JavaScript</feature>
+            <feature>Tree</feature>
+         </features>
+      </test>
+      <test>
+         <name>IdMapTreeNoHtml2</name>
+         <description>Test of tagId inside of a tree without a 
ScriptContainer</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>tags</category>
+         </categories>
+         <features>
+            <feature>JavaScript</feature>
+            <feature>Tree</feature>
+         </features>
+      </test>
+      <test>
          <name>ImageAnchorActions</name>
          <description>Tests the bindability of the action attribute on an 
image anchor</description>
          <webapp>coreWeb</webapp>

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTree.xml
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTree.xml?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTree.xml 
    Fri Jan 14 18:56:12 2005
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>IdMapTree</ses:sessionName>
+   <ses:tester>Daryl</ses:tester>
+   <ses:startDate>14 Jan 2005, 06:43:11.911 PM MST</ses:startDate>
+   <ses:description>Verify tagId support in a tree.</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/tree/Controller.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>88588224A7922AA02FB2FD4D29C8CB2E</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <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-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>
+               <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=88588224A7922AA02FB2FD4D29C8CB2E</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><![CDATA[<!DOCTYPE HTML PUBLIC "//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en" netui:scopeId="n0">
+
+    <head>
+        <base href="http://localhost:8080/coreWeb/idmap/tree/index.jsp";>
+    </head>
+    <body>
+       <h4>Page One</h4>
+        <p style="color: green">This test sets the TagId on both a tree and an
+       item within it then accesses those nodes through the JavaScript lookup
+       methods.
+        </p>
+       <a href="/coreWeb/idmap/tree/clearTree.do">Clear Tree</a>&nbsp;
+       <hr>
+        <span id="scopeOneSpan" />
+        <div id="n0.tree">
+   <div id="n0.item">
+      <img src="/coreWeb/resources/images/linelastnode.gif" 
style="vertical-align:middle;" border="0" alt="">
+      <a 
href="/coreWeb/idmap/tree/select.do?netui_treeselected=0&netui_treeid=tree">&nbsp;<img
 src="/coreWeb/resources/images/folder_16_pad.gif" 
style="vertical-align:middle" border="0" alt="Tree 
Node">&nbsp;Item-PageOne&nbsp;</a>
+   </div>
+</div>
+
+       <hr>
+        <p style="color: green">Below we access the tree and item using the
+       lookup method.
+        </p>
+        <p id="javaOut"></p>
+    
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** This section contains functions typically run as events ****
+
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var scopeId = lookupScopeId(tag,".");
+   return (scopeId == "") ? id : scopeId + id;
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupScopeId(tag,sep)
+{
+   var val = "";
+   while (tag != null && tag.getAttribute != null) {
+      var attrVal = tag.getAttribute("netui:scopeId");
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+</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 + "Tree by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("tree",s)) == null) + 
"</b><br>";
+    val = val + "Item by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("item",s)) == null) + 
"</b><br>";
+
+    p.innerHTML = val;
+    </script>
+</div>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>14 Jan 2005, 06:43:23.197 PM MST</ses:endDate>
+   <ses:testCount>1</ses:testCount>
+</ses:recorderSession>
\ No newline at end of file

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml.xml
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml.xml?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml.xml
       Fri Jan 14 18:56:12 2005
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>IdMapTreeNoHtml</ses:sessionName>
+   <ses:tester>Daryl</ses:tester>
+   <ses:startDate>14 Jan 2005, 06:44:07.561 PM MST</ses:startDate>
+   <ses:description>Verify Tree tagId support outside of a 
ScriptContainer</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/treeNoHtml/Controller.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>88588224A7922AA02FB2FD4D29C8CB2E</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <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-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>
+               <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=88588224A7922AA02FB2FD4D29C8CB2E</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><![CDATA[<html>
+    <head>
+        <base href="http://localhost:8080/coreWeb/idmap/treeNoHtml/index.jsp";>
+    </head>
+    <body>
+        <p style="color: green">This will test the result of generating 
JavaScript
+       from when it is on the tree itself.  The result should be the inline 
method
+       for looking up the tagId set on the tree.
+        </p>
+       <a href="/coreWeb/idmap/treeNoHtml/clearTree.do">Clear Tree</a>&nbsp;
+       <hr>
+        <span id="scopeOneSpan" />
+        <div id="tree">
+   <div>
+      <img src="/coreWeb/resources/images/linelastnode.gif" 
style="vertical-align:middle;" border="0" alt="">
+      <a 
href="/coreWeb/idmap/treeNoHtml/select.do?netui_treeselected=0&netui_treeid=tree">&nbsp;<img
 src="/coreWeb/resources/images/folder_16_pad.gif" 
style="vertical-align:middle" border="0" alt="Tree 
Node">&nbsp;Item-PageOne&nbsp;</a>
+   </div>
+</div>
+
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var scopeId = lookupScopeId(tag,".");
+   return (scopeId == "") ? id : scopeId + id;
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupScopeId(tag,sep)
+{
+   var val = "";
+   while (tag != null && tag.getAttribute != null) {
+      var attrVal = tag.getAttribute("netui:scopeId");
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+
+-->
+</script>
+
+
+       <hr>
+        <p style="color: green">Below we access the tree, the result should be
+       a <b>false</b>.
+        </p>
+        <p id="javaOut"></p>
+    </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 + "Tree by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("tree",s)) == null) + 
"</b><br>";
+
+    p.innerHTML = val;
+    </script>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>14 Jan 2005, 06:44:15.342 PM MST</ses:endDate>
+   <ses:testCount>1</ses:testCount>
+</ses:recorderSession>
\ No newline at end of file

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml2.xml
Url: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml2.xml?view=auto&rev=125245
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/IdMapTreeNoHtml2.xml
      Fri Jan 14 18:56:12 2005
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>IdMapTreeNoHtml2</ses:sessionName>
+   <ses:tester>Daryl</ses:tester>
+   <ses:startDate>14 Jan 2005, 06:45:07.737 PM MST</ses:startDate>
+   <ses:description>Verify Tree tagId without a 
ScriptContainer</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/treeNoHtml2/Controller.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>88588224A7922AA02FB2FD4D29C8CB2E</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <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-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>
+               <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=88588224A7922AA02FB2FD4D29C8CB2E</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><![CDATA[<html>
+    <head>
+        <base href="http://localhost:8080/coreWeb/idmap/treeNoHtml2/index.jsp";>
+    </head>
+    <body>
+        <p style="color: green">This test will verify that a TreeItem will 
produce
+       the proper JavaScript when there are no scrip containers.
+        </p>
+       <a href="/coreWeb/idmap/treeNoHtml2/clearTree.do">Clear Tree</a>&nbsp;
+       <hr>
+        <span id="scopeOneSpan" />
+        <div>
+   <div id="item">
+
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var scopeId = lookupScopeId(tag,".");
+   return (scopeId == "") ? id : scopeId + id;
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupScopeId(tag,sep)
+{
+   var val = "";
+   while (tag != null && tag.getAttribute != null) {
+      var attrVal = tag.getAttribute("netui:scopeId");
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+
+-->
+</script>
+
+      <img src="/coreWeb/resources/images/linelastnode.gif" 
style="vertical-align:middle;" border="0" alt="">
+      <a 
href="/coreWeb/idmap/treeNoHtml2/select.do?netui_treeselected=0&netui_treeid=tree">&nbsp;<img
 src="/coreWeb/resources/images/folder_16_pad.gif" 
style="vertical-align:middle" border="0" alt="Tree 
Node">&nbsp;Item-PageOne&nbsp;</a>
+   </div>
+</div>
+
+       <hr>
+        <p style="color: green">Below we access the item using the
+       lookup method, the result should be <b>false</b>.
+        </p>
+        <p id="javaOut"></p>
+    </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 + "Item by id is null: <b>" +
+        (document.getElementById(lookupIdByTagId("item",s)) == null) + 
"</b><br>";
+
+    p.innerHTML = val;
+    </script>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>14 Jan 2005, 06:45:17.792 PM MST</ses:endDate>
+   <ses:testCount>1</ses:testCount>
+</ses:recorderSession>
\ No newline at end of file

Reply via email to