Author: ekoneil
Date: Thu Sep  9 10:11:45 2004
New Revision: 43614

Added:
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/callMethod/TypeWithDoubleMethod.java
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/doublearray/
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/doublearray/doubleArray.jsp
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/userAttributes.jsp
   (contents, props changed)
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodDoubleArrayTest.xml
Removed:
   
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/choiceMethod/
Modified:
   incubator/beehive/trunk/netui/test/webapps/drt/build.xml
   
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
Log:
DRT cleanup.

Add a <netui-data:callMethod> tag test that passes an array of doubles to a 
method that sums them and returns the result to the calling JSP.

Delete an empty "choiceMethod" directory.

Fixup the build file so that the "playback" target works again after some 
recent test recorder changes which require that the webapp name be passed to 
the invoked TR target.

BB: self
DRT: NetUI pass / CallMethodDoubleArrayTest pass




Modified: incubator/beehive/trunk/netui/test/webapps/drt/build.xml
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/build.xml    (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/build.xml    Thu Sep  9 
10:11:45 2004
@@ -98,6 +98,7 @@
     <target name="playback" description="Playback a specified list of test 
recorder tests">
         <ant antfile="${test.dir}/ant/testRecorder.xml" target="playback" 
inheritAll="false">
             <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
+            <property name="playback.webapps" value="${webapp.name}"/>
         </ant>
     </target>
 
@@ -105,7 +106,7 @@
         <ant antfile="${test.dir}/ant/testRecorder.xml" 
target="suite.callback" inheritAll="false">
             <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
             <property name="suite.name" value="drt"/>
-            <property name="playback.webapps" value="coreWeb"/>
+            <property name="playback.webapps" value="${webapp.name}"/>
             <property name="waitfor.url" value="${webapp.waitfor.url}"/>
         </ant>
     </target>
@@ -114,7 +115,7 @@
         <ant antfile="${test.dir}/ant/testRecorder.xml" 
target="suite.callback" inheritAll="false">
             <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
             <property name="suite.name" value="bvt"/>
-            <property name="playback.webapps" value="coreWeb"/>
+            <property name="playback.webapps" value="${webapp.name}"/>
             <property name="waitfor.url" value="${webapp.waitfor.url}"/>
         </ant>
     </target>
@@ -125,7 +126,7 @@
             <property name="waitfor.url" value="${webapp.waitfor.url}"/>
             <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
             <property name="suite.name" value="drt"/>
-            <property name="playback.webapps" value="coreWeb"/>
+            <property name="playback.webapps" value="${webapp.name}"/>
             <property name="drt.mode" value="true"/>
         </ant>
     </target>
@@ -136,7 +137,7 @@
             <property name="waitfor.url" value="${webapp.waitfor.url}"/>
             <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
             <property name="suite.name" value="bvt"/>
-            <property name="playback.webapps" value="coreWeb"/>
+            <property name="playback.webapps" value="${webapp.name}"/>
             <property name="drt.mode" value="true"/>
         </ant>
     </target>
@@ -146,7 +147,7 @@
             <property name="testRecorder.config.name" 
value="${testRecorder.config.name}"/>
             <property name="suite.name" value="${suite.name}"/>
             <property name="waitfor.url" value="${webapp.waitfor.url}"/>
-            <property name="playback.webapps" value="coreWeb"/>
+            <property name="playback.webapps" value="${webapp.name}"/>
         </ant>
     </target>
 

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/callMethod/TypeWithDoubleMethod.java
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/databinding/callMethod/TypeWithDoubleMethod.java
 Thu Sep  9 10:11:45 2004
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package databinding.callMethod;
+
+public class TypeWithDoubleMethod
+{
+    public double sum(double[] doubleArray)
+    {
+        if(doubleArray == null || doubleArray.length == 0)
+            return 0;
+
+        double sum = 0.0;
+        for(int i = 0; i < doubleArray.length; i++)
+            sum += doubleArray[i];
+
+        return sum;
+    }
+}

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/doublearray/doubleArray.jsp
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/doublearray/doubleArray.jsp
   Thu Sep  9 10:11:45 2004
@@ -0,0 +1,40 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8" %>
+<%@ taglib uri="beehive-netui-tags-html.tld" prefix="netui"%>
+<%@ taglib uri="beehive-netui-tags-databinding.tld" prefix="netui-data"%>
+<netui:html>
+  <head>
+    <title>Double Sum Test</title>
+  </head>
+  <body>
+    <b>Double Sum Test</b>
+<%
+  databinding.callMethod.TypeWithDoubleMethod obj = new 
databinding.callMethod.TypeWithDoubleMethod();
+  request.setAttribute("doubleSumObject", obj);
+  pageContext.setAttribute("doubleArray", new double[] {1.0, 1.0, 1.0});
+%>
+<b>Sum the values in an array of doubles</b>
+<br/>
+<br/>
+<b>Data</b>
+<br/>
+<netui-data:repeater dataSource="pageScope.doubleArray">
+  <netui-data:repeaterHeader>
+    <table>
+  </netui-data:repeaterHeader>
+  <netui-data:repeaterItem>
+    <tr><td>&nbsp;</td></td><td>${container.item}</td></tr>
+  </netui-data:repeaterItem>
+  <netui-data:repeaterFooter>
+    <netui-data:callMethod object="${requestScope.doubleSumObject}" 
resultId="doubleSum" method="sum">
+      <netui-data:methodParameter value="${pageScope.doubleArray}"/>
+    </netui-data:callMethod>
+    <tr><td>Sum Total:</td>
+    <td>
+      <netui:span value="${pageScope.doubleSum}"/>
+    </td>
+    </tr>
+    </table>
+  </netui-data:repeaterFooter>
+</netui-data:repeater>
+</body>
+</netui:html>
\ No newline at end of file

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/userAttributes.jsp
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/datagrid/misc/userAttributes.jsp
 Thu Sep  9 10:11:45 2004
@@ -0,0 +1,32 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="beehive-netui-tags-html.tld" prefix="netui"%>
+<%@ taglib uri="beehive-netui-tags-databinding.tld" prefix="netui-data"%>
+<%@ taglib uri="beehive-netui-tags-template.tld" prefix="netui-template"%>
+<netui-template:template templatePage="../site/template.jsp">
+    <netui-template:setAttribute name="title" value="Basic Data Grid"/>
+    <netui-template:section name="body">
+    <script language="javascript">
+function doAlert(node, index)
+{
+  alert("hello from item: " + index);
+}
+    </script>
+    <p>
+    <%@ include file="../util/portfolioXmlBean.jsp" %>
+    <netui-data:dataGrid dataSource="pageScope.stocks" name="portfolio">
+        <netui-data:columns>
+            <netui-data:literalColumn headerText="Symbol" 
value="${container.item.symbol}" onClick="javascript:alert(this)">
+              <netui:attribute name="attr-test-symbol" 
value="${container.item.symbol}"/>                                         
+            </netui-data:literalColumn>
+            <netui-data:literalColumn headerText="Price" 
value="${container.item.price}">
+              <netui:attribute name="attr-onlyeven" value="${container.index % 
2 == 0 ? 'foo' : null}"/>
+              <netui:attribute name="attr-index" value="${container.index}"/>
+            </netui-data:literalColumn>
+            <netui-data:anchorColumn headerText="Web" 
href="${container.item.web}" value="${container.item.name}" 
onMouseOver="doAlert(this, ${container.index})">
+                <netui:parameter name="rowid" value="${container.index}"/>
+                <netui:parameter name="symbol" 
value="${container.item.symbol}"/>
+            </netui-data:anchorColumn>
+        </netui-data:columns>
+    </netui-data:dataGrid>
+    </netui-template:section>
+</netui-template:template>
\ No newline at end of file

Modified: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
==============================================================================
--- 
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 Sep  9 10:11:45 2004
@@ -1397,6 +1397,18 @@
          </features>
       </test>
       <test>
+         <name>CallMethodDoubleArrayTest</name>
+         <description>Test the callMethod tag invoking a method that takes a 
double array</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>databinding</category>
+         </categories>
+         <features>
+            <feature>CallMethod</feature>
+         </features>
+      </test>
+      <test>
          <name>CallMethodReturnNull</name>
          <description>Test the correct behavior of returning null from a 
callMethod tag</description>
          <webapp>coreWeb</webapp>

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodDoubleArrayTest.xml
==============================================================================
--- (empty file)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodDoubleArrayTest.xml
     Thu Sep  9 10:11:45 2004
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>CallMethodDoubleArrayTest</ses:sessionName>
+   <ses:tester>ekoneil</ses:tester>
+   <ses:startDate>09 Sep 2004, 10:46:24.941 AM MDT</ses:startDate>
+   <ses:description>Test the callMethod tag passing an array of doubles to a 
method that sums and returns the sum to the calling JSP.</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/databinding/callMethod/doublearray/doubleArray.jsp</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>98395C574A43B07C2C406BC41A4F670D</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=98395C574A43B07C2C406BC41A4F670D</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) Gecko/20040614 Firefox/0.9</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>Double Sum Test</title>
+  </head>
+  <body>
+    <b>Double Sum Test</b>
+
+<b>Sum the values in an array of doubles</b>
+<br/>
+<br/>
+<b>Data</b>
+<br/>
+
+    <table>
+  
+    <tr><td>&nbsp;</td></td><td>1.0</td></tr>
+  
+    <tr><td>&nbsp;</td></td><td>1.0</td></tr>
+  
+    <tr><td>&nbsp;</td></td><td>1.0</td></tr>
+  
+    
+    <tr><td>Sum Total:</td>
+    <td>
+      <span>3.0</span>
+    </td>
+    </tr>
+    </table>
+  
+</body>
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>09 Sep 2004, 10:46:28.527 AM MDT</ses:endDate>
+   <ses:testCount>1</ses:testCount>
+</ses:recorderSession>

Reply via email to