You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/05/20 22:04:18 UTC
svn commit: r171146 - in /incubator/beehive/trunk/netui:
src/tags-databinding/org/apache/beehive/netui/tags/databinding/invoke/
test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/
test/webapps/drt/testRecorder/config/ test/webapps/drt/testRecorder/tests/
Author: ekoneil
Date: Fri May 20 13:04:17 2005
New Revision: 171146
URL: http://svn.apache.org/viewcvs?rev=171146&view=rev
Log:
Partial fix for JIRA 749.
This change adds rtexprvalue="true" for the MethodParameter tag and adds a BVT to make sure that "null" is passable to a method call.
BB: self
BVT: NetUI pass
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/j749.jsp (with props)
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodJ749.xml (with props)
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/invoke/MethodParameter.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/Controller.jpf
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/simpleTest.jsp
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
Modified: incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/invoke/MethodParameter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/invoke/MethodParameter.java?rev=171146&r1=171145&r2=171146&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/invoke/MethodParameter.java (original)
+++ incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/invoke/MethodParameter.java Fri May 20 13:04:17 2005
@@ -228,7 +228,7 @@
* will be passed.
* @jsptagref.attributedescription Boolean. Determines if the parameter passed to the method is null.
* @jsptagref.attributesyntaxvalue <i>boolean_passNullValue</i>
- * @netui:attribute required="false"
+ * @netui:attribute required="false" rtexprvalue="true"
*/
public void setNull(boolean isNull) {
_isNull = isNull;
Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/Controller.jpf
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/Controller.jpf?rev=171146&r1=171145&r2=171146&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/Controller.jpf (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/Controller.jpf Fri May 20 13:04:17 2005
@@ -17,47 +17,44 @@
*/
package databinding.callMethod.callPageFlow;
-// java imports
-import org.apache.beehive.netui.pageflow.annotations.Jpf;
-import java.io.Serializable;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-// internal imports
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
import org.apache.beehive.netui.pageflow.PageFlowController;
import org.apache.beehive.netui.pageflow.Forward;
-// external imports
-
/**
*
*/
-@Jpf.Controller
+@Jpf.Controller()
public class Controller
- extends PageFlowController
-{
- private String defaultText = "Some Default Text";
+ extends PageFlowController {
+
+ private String _defaultText = "Some Default Text";
+ private Cart _cart = null;
- private Cart cart = null;
+ public String nullTest(Object object) {
+ if(object == null)
+ return "SUCCESS";
+ else return "FAILURE";
+ }
- public String getDefaultText()
- {
- return defaultText;
+ public String getDefaultText() {
+ return _defaultText;
}
- public String echo(String echo)
- {
+ public String echo(String echo) {
return echo;
}
- public Cart getCart()
- {
- return cart;
+ public Cart getCart() {
+ return _cart;
}
- public Double sumCartItems(List items)
- {
+ public Double sumCartItems(List items) {
if(items == null) return new Double(0);
double sum = 0;
@@ -70,36 +67,16 @@
return new Double(sum);
}
- /**
- * @jpf:action
- * @jpf:forward name="SumTest" path="sumTest.jsp"
- */
- @Jpf.Action(
- forwards = {
- @Jpf.Forward(
- name = "SumTest",
- path = "sumTest.jsp")
- })
- public Forward SumTest()
- {
- if(cart == null)
- cart = initCart();
+ @Jpf.Action(forwards = {@Jpf.Forward(name = "SumTest",path = "sumTest.jsp")})
+ public Forward SumTest() {
+ if(_cart == null)
+ _cart = initCart();
return new Forward("SumTest");
}
- /**
- * @jpf:action
- * @jpf:forward name="SimpleTest" path="simpleTest.jsp"
- */
- @Jpf.Action(
- forwards = {
- @Jpf.Forward(
- name = "SimpleTest",
- path = "simpleTest.jsp")
- })
- public Forward SimpleTest()
- {
+ @Jpf.Action(forwards = {@Jpf.Forward(name = "SimpleTest",path = "simpleTest.jsp")})
+ public Forward SimpleTest() {
return new Forward("SimpleTest");
}
@@ -107,20 +84,13 @@
* @jpf:action
* @jpf:forward name="index" path="index.jsp"
*/
- @Jpf.Action(
- forwards = {
- @Jpf.Forward(
- name = "index",
- path = "index.jsp")
- })
- public Forward begin()
- {
- cart = initCart();
+ @Jpf.Action(forwards = {@Jpf.Forward(name = "index", path = "index.jsp")})
+ public Forward begin() {
+ _cart = initCart();
return new Forward("index");
}
- private Cart initCart()
- {
+ private Cart initCart() {
Cart c = new Cart();
c.addItem(new LineItem("Product A", 3, 9.95, 1, true));
c.addItem(new LineItem("Product C", 2, 19.95, 2, false));
@@ -134,32 +104,28 @@
}
public static class Cart
- implements Serializable
- {
+ implements Serializable {
+
private List items = null;
- public void addItem(LineItem item)
- {
+ public void addItem(LineItem item) {
if(items == null) items = new ArrayList();
items.add(item);
}
- public List getLineItemList()
- {
+ public List getLineItemList() {
return items;
}
- public LineItem[] getLineItemArray()
- {
+ public LineItem[] getLineItemArray() {
if(items == null) return null;
else return (LineItem[])items.toArray();
}
}
public static class LineItem
- implements Serializable
- {
+ implements Serializable {
public static final int NOT_SHIPPED = 1;
public static final int IN_TRANSIT = 2;
public static final int ARRIVED = 3;
@@ -171,8 +137,7 @@
private int shipState = NOT_SHIPPED;
private boolean inStock = false;
- public LineItem(String name, int quantity, double price, int shipState, boolean inStock)
- {
+ public LineItem(String name, int quantity, double price, int shipState, boolean inStock) {
this.name = name;
this.quantity = quantity;
this.price = price;
Added: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/j749.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/j749.jsp?rev=171146&view=auto
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/j749.jsp (added)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/j749.jsp Fri May 20 13:04:17 2005
@@ -0,0 +1,25 @@
+<%@ page language="java" %>
+<%@ 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"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+ <head>
+ <title>Simple JSP -> JPF Test</title>
+ </head>
+ <body>
+ <b>Call Page Flow Tests</b><br/>
+ <netui-data:callPageFlow resultId="value" method="nullTest">
+ <netui-data:methodParameter value="${pageScope.noSuchValue}" null="${pageScope.noSuchValue == null}"/>
+ </netui-data:callPageFlow>
+ <br/>
+ <br/>
+ Test result: <netui:span value="${pageScope.value}"/><br/>
+ <br/>
+ <br/>
+<%--
+ <netui-data:callPageFlow resultId="value" method="nullTest">
+ <netui-data:methodParameter value="${pageScope.noSuchValue}"/>
+ </netui-data:callPageFlow>
+--%>
+ </body>
+</html>
Propchange: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/j749.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/simpleTest.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/simpleTest.jsp?rev=171146&r1=171145&r2=171146&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/simpleTest.jsp (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/callMethod/callPageFlow/simpleTest.jsp Fri May 20 13:04:17 2005
@@ -23,4 +23,4 @@
<br/>
<netui:anchor action="begin">Home</netui:anchor>
</body>
-</html>
+</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?rev=171146&r1=171145&r2=171146&view=diff
==============================================================================
--- 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 May 20 13:04:17 2005
@@ -1642,6 +1642,19 @@
</features>
</test>
<test>
+ <name>CallMethodJ749</name>
+ <description>Test callMethod tag when used to pass null arguments to a method</description>
+ <webapp>coreWeb</webapp>
+ <categories>
+ <category>bvt</category>
+ <category>bvt.struts11</category>
+ <category>databinding</category>
+ </categories>
+ <features>
+ <feature>CallMethod</feature>
+ </features>
+ </test>
+ <test>
<name>CallMethodMethodTest</name>
<description>Test the callMethod tag invoking 0/1/+ arg methods on a Java class and on a control</description>
<webapp>coreWeb</webapp>
Added: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodJ749.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodJ749.xml?rev=171146&view=auto
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodJ749.xml (added)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodJ749.xml Fri May 20 13:04:17 2005
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
+ <ses:sessionName>CallMethodJ749</ses:sessionName>
+ <ses:tester>ekoneil</ses:tester>
+ <ses:startDate>20 May 2005, 01:03:20.662 PM MDT</ses:startDate>
+ <ses:description>Call method test ensuring that a method can be invoked which takes a null value. This is a partial fix for JIRA 749.</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/callPageFlow/j749.jsp</ses:uri>
+ <ses:method>GET</ses:method>
+ <ses:parameters/>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>70737929709572D6D994A75E3B90ECAF</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=70737929709572D6D994A75E3B90ECAF</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.7) Gecko/20050414 Firefox/1.0.3</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">
+<html>
+ <head>
+ <title>Simple JSP -> JPF Test</title>
+ </head>
+ <body>
+ <b>Call Page Flow Tests</b><br/>
+
+ <br/>
+ <br/>
+ Test result: <span>SUCCESS</span><br/>
+ <br/>
+ <br/>
+
+ </body>
+</html>]]></ses:responseBody>
+ </ses:response>
+ </ses:test>
+ </ses:tests>
+ <ses:endDate>20 May 2005, 01:03:26.420 PM MDT</ses:endDate>
+ <ses:testCount>1</ses:testCount>
+</ses:recorderSession>
\ No newline at end of file
Propchange: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CallMethodJ749.xml
------------------------------------------------------------------------------
svn:eol-style = native