You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by do...@apache.org on 2006/02/17 23:31:56 UTC

svn commit: r378643 - in /beehive/trunk/netui/test/webapps/drt: testRecorder/config/testRecorder-tests.xml testRecorder/tests/ActionResponse.xml web/miniTests/actionResponse/ web/miniTests/actionResponse/Controller.java

Author: dolander
Date: Fri Feb 17 14:31:55 2006
New Revision: 378643

URL: http://svn.apache.org/viewcvs?rev=378643&view=rev
Log:
Add a test that writes the response from the action and then returns null for the forward.


Added:
    beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ActionResponse.xml   (with props)
    beehive/trunk/netui/test/webapps/drt/web/miniTests/actionResponse/
    beehive/trunk/netui/test/webapps/drt/web/miniTests/actionResponse/Controller.java   (with props)
Modified:
    beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml

Modified: beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?rev=378643&r1=378642&r2=378643&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Fri Feb 17 14:31:55 2006
@@ -229,6 +229,18 @@
          </features>
       </test>
       <test>
+         <name>ActionResponse</name>
+         <description>Write directly to the response in the an Action and then return null.</description>
+         <webapp>coreWeb</webapp>
+         <categories>
+            <category>bvt</category>
+            <category>corePageFlow</category>
+         </categories>
+         <features>
+            <feature>Actions</feature>
+         </features>
+      </test>
+      <test>
          <name>AddExpressionMessages</name>
          <description>Test of using ExpressionMessage (or FlowController.addValidationErrorExpression) to add explicit strings or expressions as validation messages.</description>
          <webapp>coreWeb</webapp>

Added: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ActionResponse.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ActionResponse.xml?rev=378643&view=auto
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ActionResponse.xml (added)
+++ beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ActionResponse.xml Fri Feb 17 14:31:55 2006
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<recorderSession xmlns="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
+<sessionName>ActionResponse</sessionName>
+<tester>Daryl</tester>
+<startDate>17 Feb 2006, 02:54:41.723 PM MST</startDate>
+<description>Write directly to the response from the action.</description>
+<tests>
+<test>
+<testNumber>1</testNumber>
+<request>
+<protocol>HTTP</protocol>
+<protocolVersion>1.1</protocolVersion>
+<host>localhost</host>
+<port>8080</port>
+<uri>/coreWeb/miniTests/actionResponse/Controller.jpf</uri>
+<method>GET</method>
+<parameters>
+</parameters>
+<cookies>
+<cookie>
+<name>JSESSIONID</name>
+<value>D0F2E428451E7FBF771C1265A7BC5EFA</value>
+</cookie>
+</cookies>
+<headers>
+<header>
+<name>---------------</name>
+<value>----- -------</value>
+</header>
+<header>
+<name>accept</name>
+<value>image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*</value>
+</header>
+<header>
+<name>accept-language</name>
+<value>en-us</value>
+</header>
+<header>
+<name>connection</name>
+<value>Keep-Alive</value>
+</header>
+<header>
+<name>cookie</name>
+<value>JSESSIONID=D0F2E428451E7FBF771C1265A7BC5EFA</value>
+</header>
+<header>
+<name>host</name>
+<value>localhost:8080</value>
+</header>
+<header>
+<name>user-agent</name>
+<value>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1)</value>
+</header>
+</headers>
+</request>
+<response>
+<statusCode>200</statusCode>
+<reason></reason>
+<responseBody>
+<![CDATA[<html><body>Hi There</body></html>]]>
+</responseBody>
+</response>
+</test>
+</tests>
+<endDate>17 Feb 2006, 02:54:47.622 PM MST</endDate>
+<testCount>1</testCount>
+</recorderSession>

Propchange: beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ActionResponse.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/test/webapps/drt/web/miniTests/actionResponse/Controller.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/web/miniTests/actionResponse/Controller.java?rev=378643&view=auto
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/miniTests/actionResponse/Controller.java (added)
+++ beehive/trunk/netui/test/webapps/drt/web/miniTests/actionResponse/Controller.java Fri Feb 17 14:31:55 2006
@@ -0,0 +1,45 @@
+/*
+ * 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 miniTests.actionResponse;
+
+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.struts.action.ActionForm;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import javax.servlet.http.HttpServletResponse;
+
+@Jpf.Controller
+public class Controller extends PageFlowController
+{
+
+    @Jpf.Action(
+    )
+    protected Forward begin()
+    {
+	try {
+	    HttpServletResponse resp = getResponse();
+	    resp.setContentType( "text/html;charset=UTF-8" );
+	    resp.getWriter().println("<html><body>Hi There</body></html>");
+	}
+	catch (java.io.IOException ignore) {}
+	return null;
+    }
+}

Propchange: beehive/trunk/netui/test/webapps/drt/web/miniTests/actionResponse/Controller.java
------------------------------------------------------------------------------
    svn:eol-style = native