| <?xml version="1.0" encoding="utf-8"?> |
| |
| <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/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> |