Author: dolander
Date: Thu Mar 31 13:24:59 2005
New Revision: 159642

URL: http://svn.apache.org/viewcvs?view=rev&rev=159642
Log:
Add a BVT for Jira 461


Added:
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/Controller.jpf
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/index.jsp
    incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J461.xml
    incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J480.xml
Modified:
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/Controller.jpf
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/Controller.jpf?view=auto&rev=159642
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/Controller.jpf 
(added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/Controller.jpf 
Thu Mar 31 13:24:59 2005
@@ -0,0 +1,100 @@
+package bugs.j461;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.tags.tree.TreeElement;
+
[EMAIL PROTECTED] (
+   simpleActions={
+      @Jpf.SimpleAction(name="begin", path="index.jsp"),
+      @Jpf.SimpleAction(name="postback", navigateTo=Jpf.NavigateTo.currentPage)
+   }
+)
+
+public class Controller extends PageFlowController
+{
+   
+   /**
+    * A tree containing the list of products to browse.
+    */
+    private TreeElement productTree;
+    
+       //public TreeElement childTree;
+       
+
+    public TreeElement getProductTree(){
+        return this.productTree;
+    }
+    
+    public void setProductTree(TreeElement productTree){
+       this.productTree = productTree;
+    }
+
+   protected void onCreate() {
+      makeTree();
+       
+   }
+
+/**
+ * This is an action that puts the name of the node selected into the
+ * request so that it may be used on the page. 
+ * The response is always back to the current page.
+ * If a tree node has been selected, 
+ * then an attribute with name 'productName' is put into the request.
+ */
+
[EMAIL PROTECTED]( forwards={
+   @Jpf.Forward( name="success", navigateTo=Jpf.NavigateTo.currentPage )
+} )
+public Forward select() {
+   // the node name is provided in the parameter list; I want the label
+   return new Forward( "success" );
+}
+
+
+    @Jpf.Action(forwards = {
+        @Jpf.Forward(name = "success",
+                     path = "index.jsp")
+    })
+    protected Forward newAction1()
+    {
+        Forward forward = new Forward("success");
+        return forward;
+    }
+
+       public void makeTree() {
+               productTree = new TreeElement("Root Node",true);
+               productTree.addChild(0, new TreeElement("CHILDNODE",false));
+               //productTree.removeChild(0);
+       }
+
+
+
+       public void reset(){
+               makeTree();
+       }
+     @Jpf.Action(forwards = {
+        @Jpf.Forward(name = "success", navigateTo=Jpf.NavigateTo.currentPage)
+    })
+    protected Forward resetTree()
+    {
+               reset();
+               return new Forward("success");
+       }
+
+       public void removeaKid(){
+               productTree.removeChild(0);
+       }
+     @Jpf.Action(forwards = {
+        @Jpf.Forward(name = "success", navigateTo=Jpf.NavigateTo.currentPage)
+    })
+    protected Forward removeKid()
+    {
+               removeaKid();
+               return new Forward("success");
+       }
+
+
+
+}
+

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/index.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/index.jsp?view=auto&rev=159642
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/index.jsp 
(added)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/bugs/j461/index.jsp 
Thu Mar 31 13:24:59 2005
@@ -0,0 +1,20 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"; 
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0"; prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"; 
prefix="netui-template"%>
+<netui:html>
+    <head>
+        <title>
+            Netui Tree - Tree Creation - basic pageFlow tree
+        </title>
+    </head>
+    <netui:body>
+               <netui:anchor action="resetTree">Reset </netui:anchor><BR />
+               <netui:anchor action="removeKid">REMOVE CHILD 
</netui:anchor><br/>
+
+       <p>
+               <netui:tree dataSource="pageFlow.productTree" 
selectionAction="select" tagId="tree1"/>
+               
+       </p>
+       </netui:body>
+</netui: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&r1=159641&r2=159642
==============================================================================
--- 
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
 Thu Mar 31 13:24:59 2005
@@ -4230,6 +4230,15 @@
          </categories>
       </test>
       <test>
+         <name>J461</name>
+         <description>Remove child on a treeElement.</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>jiriBugs</category>
+         </categories>
+      </test>
+      <test>
          <name>J475</name>
          <description>Verification that the lookup Javascript works inside of 
a table.</description>
          <webapp>coreWeb</webapp>

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J461.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J461.xml?view=auto&rev=159642
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J461.xml 
(added)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J461.xml 
Thu Mar 31 13:24:59 2005
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>J461</ses:sessionName>
+   <ses:tester>Daryl</ses:tester>
+   <ses:startDate>31 Mar 2005, 02:03:16.323 PM MST</ses:startDate>
+   <ses:description>TreeElement remove child was not working.</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/bugs/j461/Controller.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>96B74836C8E977AF080785160E8E0C9E</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=96B74836C8E977AF080785160E8E0C9E</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">
+
+    <head>
+        <title>
+            Netui Tree - Tree Creation - basic pageFlow tree
+        </title>
+    </head>
+    <body>
+               <a href="/coreWeb/bugs/j461/resetTree.do">Reset</a><BR />
+               <a href="/coreWeb/bugs/j461/removeKid.do">REMOVE CHILD</a><br/>
+
+       <p>
+               <div>
+   <div>
+      <a 
href="/coreWeb/bugs/j461/select.do?netui_treenode=0&netui_treeid=tree1"><img 
src="/coreWeb/resources/beehive/version1/images/lastNodeExpanded.gif" 
style="vertical-align:bottom;" border="0" alt="Collapse Tree Element"></a>
+      <a 
href="/coreWeb/bugs/j461/select.do?netui_treeselected=0&netui_treeid=tree1" 
style="text-decoration: none">&nbsp;<img 
src="/coreWeb/resources/beehive/version1/images/folder.gif" 
style="vertical-align:text-top" border="0" alt="Root Node">&nbsp;Root 
Node&nbsp;</a>
+   </div>
+   <div>
+      <img src="/coreWeb/resources/beehive/version1/images/spacer.gif" 
width="16px" border="0" alt="">
+      <img src="/coreWeb/resources/beehive/version1/images/lastLineJoin.gif" 
style="vertical-align:bottom;" border="0" alt="">
+      <a 
href="/coreWeb/bugs/j461/select.do?netui_treeselected=0.0&netui_treeid=tree1" 
style="text-decoration: none">&nbsp;<img 
src="/coreWeb/resources/beehive/version1/images/folder.gif" 
style="vertical-align:text-top" border="0" 
alt="CHILDNODE">&nbsp;CHILDNODE&nbsp;</a>
+   </div>
+</div>
+
+               
+       </p>
+       </body>
+
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>2</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/bugs/j461/removeKid.do</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>96B74836C8E977AF080785160E8E0C9E</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=96B74836C8E977AF080785160E8E0C9E</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>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/bugs/j461/Controller.jpf</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">
+
+    <head>
+        <title>
+            Netui Tree - Tree Creation - basic pageFlow tree
+        </title>
+    </head>
+    <body>
+               <a href="/coreWeb/bugs/j461/resetTree.do">Reset</a><BR />
+               <a href="/coreWeb/bugs/j461/removeKid.do">REMOVE CHILD</a><br/>
+
+       <p>
+               <div>
+   <div>
+      <img src="/coreWeb/resources/beehive/version1/images/lastLineJoin.gif" 
style="vertical-align:bottom;" border="0" alt="">
+      <a 
href="/coreWeb/bugs/j461/select.do?netui_treeselected=0&netui_treeid=tree1" 
style="text-decoration: none">&nbsp;<img 
src="/coreWeb/resources/beehive/version1/images/folder.gif" 
style="vertical-align:text-top" border="0" alt="Root Node">&nbsp;Root 
Node&nbsp;</a>
+   </div>
+</div>
+
+               
+       </p>
+       </body>
+
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>31 Mar 2005, 02:03:24.244 PM MST</ses:endDate>
+   <ses:testCount>2</ses:testCount>
+</ses:recorderSession>
\ No newline at end of file

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J480.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J480.xml?view=auto&rev=159642
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J480.xml 
(added)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J480.xml 
Thu Mar 31 13:24:59 2005
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>J480</ses:sessionName>
+   <ses:tester>Daryl</ses:tester>
+   <ses:startDate>30 Mar 2005, 01:21:06.307 PM MST</ses:startDate>
+   <ses:description>Verify the generation of tagId to id within the context of 
a tag file</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/bugs/j480/Controller.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>1C4621CAB97B34E2E3A08D6A27C002E6</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=1C4621CAB97B34E2E3A08D6A27C002E6</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>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+&lt;html lang="en">
+
+&lt;head>&lt;title>Test Tag File&lt;/title>&lt;/head>
+&lt;body>
+   &lt;div netui:idScope="n0" >
+      
+&lt;script>
+    function testClick (element)
+    {
+        var value = lookupIdByTagId ("123", element);
+
+        alert ("real value: " + document.getElementById (value));
+    }
+&lt;/script>
+
+&lt;div netui:idScope="n1" >
+    &lt;input type="hidden" id="n0.n1.123" name="{pageFlow.foo}" value="foo">
+    &lt;button onClick="testClick (this);">
+        click me!
+    &lt;/button>
+&lt;/div>&lt;script language="JavaScript" type="text/JavaScript">
+&lt;!--
+
+// **** Start the NetUI Framework Generated 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.n1__123="{pageFlow.foo}"
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+   var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.n1___123="{pageFlow.foo}"
+
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+   var idScope = getScopeId(tag);
+   if (idScope == "")
+      return netui_names[id];
+   else
+      return netui_names[idScope  + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a 
idScope.
+// The first idScope found will be returned or the empty string if a idScope 
is not found.
+function getScopeId(tag)
+{
+   if (tag == null || tag.getAttribute == null)
+      return "";
+   var attrVal = tag.getAttribute("netui:idScope");
+   if (attrVal != null)
+      return attrVal;
+   return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,".");
+   return (idScope == "") ? id : idScope + id;
+}
+
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+   var idScope = lookupIdScope(tag,"_");
+   if (idScope == "")
+      return netui_tagIdNameMap[id];
+   else
+      return netui_tagIdNameMap[idScope  + "__" + id];
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+   var val = "";
+   if (sep == null) sep = "";
+   while (tag != null &amp;&amp; tag.getAttribute != null) {
+      try {
+         var attrVal = tag.getAttribute("netui:idScope");
+      } catch (e) { /* ignore, in IE6 calling on a table results in an 
exception */ }
+      if (attrVal != null)
+         val = attrVal + sep + val;
+      tag = tag.parentNode;
+   }
+   return val;
+}
+-->
+&lt;/script>
+
+
+
+
+   &lt;/div>
+&lt;/body>
+
+&lt;/html></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>30 Mar 2005, 01:21:15.571 PM MST</ses:endDate>
+   <ses:testCount>1</ses:testCount>
+</ses:recorderSession>
\ No newline at end of file


Reply via email to