blob: c98b92e31c675723df7fe5c4014bffe7d87df718 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<project name="webdav-test" default="webdav-step3">
<group id="default">
<property name="usetidy" value="true"/>
</group>
<target name="webdav-step3">
<property name="step3.samples" value="${anteater.env.cocoon}/samples/blocks/webdav"/>
<property name="step3.newTitle" value="Title changed by anteater step3 test"/>
<echo>samples=${samples}</echo>
<!-- testing basic TraversableGenerator functionality -->
<httpRequest href="${step3.samples}/step1/repo/"
useTidy="false"
description="Test the 'step1' sample">
<namespace prefix="collection" uri="http://apache.org/cocoon/collection/1.0"/>
<match>
<xpath select="/collection:collection/collection:resource/@name" value="contentA.xml"/>
</match>
</httpRequest>
<!-- check contents of contentB.xml -->
<httpRequest href="${step3.samples}/step3/repo/dir2/contentB.xml"
description="Test the 'step3' sample">
<match>
<xpath select="/html/body/form/p/input[@name='title']/@value" pattern="Content B"/>
<xpath select="/html/body/form/p/textarea" pattern="First Paragraph"/>
<xpath select="/html/body/form/p/textarea" pattern="Second Paragraph"/>
<xpath select="/html/body/form/@action" assign="action"/>
</match>
</httpRequest>
<!-- change contents of contentB.xml -->
<httpRequest href="${anteater.env.cocoon}${action}"
useTidy="false"
description="Test the 'step3' sample">
<parameter name="title" value="${step3.newTitle}"/>
<parameter name="para" value="test2"/>
<parameter name="para" value="test2"/>
<match>
<xpath select="/page/sourceResult/execution" value="success"/>
</match>
</httpRequest>
<!-- check changes -->
<httpRequest href="${step3.samples}/step3/repo/dir2/contentB.xml"
description="Test the 'step3' sample">
<match>
<xpath select="/html/body/form/p/input[@name='title']/@value" pattern="${step3.newTitle}"/>
<xpath select="/html/body/form/p/textarea" pattern="test2"/>
<xpath select="/html/body/form/@action" assign="action"/>
</match>
</httpRequest>
<!-- undo changes -->
<httpRequest href="${anteater.env.cocoon}${action}"
useTidy="false"
description="Test the 'step3' sample">
<parameter name="title" value="Content B"/>
<parameter name="para" value="First Paragraph"/>
<parameter name="para" value="Second Paragraph"/>
<match>
<xpath select="/page/sourceResult/execution" value="success"/>
</match>
</httpRequest>
<!-- check success of undo -->
<!--
on my macosx system this sometimes fails, but if I check the URL with
a browser right after the test it is ok. Timing or cache problem?
-->
<httpRequest href="${step3.samples}/step3/repo/dir2/contentB.xml"
description="Test the 'step3' sample">
<match>
<xpath select="/html/body/form/p/input[@name='title']/@value" pattern="Content B"/>
<xpath select="/html/body/form/p/textarea" pattern="First Paragraph"/>
<xpath select="/html/body/form/p/textarea" pattern="Second Paragraph"/>
<xpath select="/html/body/form/@action" assign="action"/>
</match>
</httpRequest>
</target>
</project>