You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bd...@apache.org on 2005/10/20 10:52:58 UTC

svn commit: r326868 - in /cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action: ./ explain-test.xml flow.js sitemap.xmap somefile.xml

Author: bdelacretaz
Date: Thu Oct 20 01:52:51 2005
New Revision: 326868

URL: http://svn.apache.org/viewcvs?rev=326868&view=rev
Log:
forgot to commit this, it's for Bug36872HttpHeaderActionTestCase

Added:
    cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/
    cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/explain-test.xml
    cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/flow.js
    cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/sitemap.xmap
    cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/somefile.xml

Added: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/explain-test.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/explain-test.xml?rev=326868&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/explain-test.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/explain-test.xml Thu Oct 20 01:52:51 2005
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-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.
+-->
+
+<!-- $Id: explain-test.xml 230817 2005-08-08 16:48:30Z sylvain $ -->
+
+<page>
+    <title>HttpHeaderAction test</title>
+    <content>
+        <para>
+        		Verify that the HttpHeaderAction is able to set headers from
+        		mounted and internal requests.
+        </para>
+        <para>
+        		See also <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36872">bugzilla 36872</a>
+        </para>
+        <para>
+            Test links:
+            <ul>
+                <li><link href="mounted-sitemap">set header from mounted sitemap</link></li>
+                <li><link href="internal-request">set header from an internal request (without flowscript)</link></li>
+                <li><link href="internal-request-flow">set header from an internal request (via flowscript)</link></li>
+            </ul>
+        </para>
+    </content>
+</page>
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/flow.js
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/flow.js?rev=326868&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/flow.js (added)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/flow.js Thu Oct 20 01:52:51 2005
@@ -0,0 +1,3 @@
+function callInternalRequestHelper() {
+  cocoon.sendPage("internal-request-helper/from-internal-request-flow");
+}
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/sitemap.xmap?rev=326868&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/sitemap.xmap (added)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/sitemap.xmap Thu Oct 20 01:52:51 2005
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-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.
+-->
+
+<!-- $Id: sitemap.xmap 230817 2005-08-08 16:48:30Z sylvain $ -->
+
+<map:sitemap
+  xmlns:map="http://apache.org/cocoon/sitemap/1.0" >
+  
+  <map:flow language="javascript">
+    <map:script src="flow.js"/>
+  </map:flow>
+  
+  <map:pipelines>
+    
+    <map:pipeline>
+      <!-- this sitemap will be mounted, so this is not a top-level request -->
+      <map:match pattern="mounted-sitemap">
+        <map:act type="set-header">
+          <map:parameter name="X-HttpHeaderActionTest" value="from-mounted-sitemap"/>
+        </map:act>
+        <map:generate src="somefile.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+	
+	  <!-- test with an internal request -->	      
+      <map:match pattern="internal-request">
+        <map:generate src="cocoon:/internal-request-helper/from-internal-request"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+	  <!-- test with an internal request, called by a flowscript -->	      
+      <map:match pattern="internal-request-flow">
+        <map:call function="callInternalRequestHelper"/>
+      </map:match>
+      
+      <map:match pattern="internal-request-helper/*">
+        <map:act type="set-header">
+          <map:parameter name="X-HttpHeaderActionTest" value="{1}"/>
+        </map:act>
+        <map:generate src="somefile.xml"/>
+        <map:serialize type="xml"/>
+      </map:match>
+      
+    </map:pipeline>
+  </map:pipelines>
+</map:sitemap>
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/somefile.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/somefile.xml?rev=326868&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/somefile.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/http-header-action/somefile.xml Thu Oct 20 01:52:51 2005
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<http-headers-action-test>
+	The contents of this file are not interesting, what you want to
+	test is the presence and value of the X-HttpHeaderActionTest header.
+</http-headers-action-test>