[CalendarServer-changes] [14866] CalDAVTester/trunk/scripts/tests/CalDAV/trash-sync-report.xml
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jun 1 16:20:47 PDT 2015
Revision: 14866
http://trac.calendarserver.org//changeset/14866
Author: sagen at apple.com
Date: 2015-06-01 16:20:47 -0700 (Mon, 01 Jun 2015)
Log Message:
-----------
Test sync-token changes when trashing and recovering
Added Paths:
-----------
CalDAVTester/trunk/scripts/tests/CalDAV/trash-sync-report.xml
Added: CalDAVTester/trunk/scripts/tests/CalDAV/trash-sync-report.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/trash-sync-report.xml (rev 0)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/trash-sync-report.xml 2015-06-01 23:20:47 UTC (rev 14866)
@@ -0,0 +1,177 @@
+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2006-2015 Apple Inc. All rights reserved.
+
+ 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.
+ -->
+
+<caldavtest ignore-all="no">
+ <description>Test trash-collection support on the server</description>
+
+ <require-feature>
+ <feature>caldav</feature>
+ <feature>trash-collection</feature>
+ <feature>sync-report</feature>
+ </require-feature>
+
+ <start>
+ <request>
+ <method>POST</method>
+ <ruri>$calendarhome1:/?action=emptytrash</ruri>
+ </request>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/1.txt</filepath>
+ </data>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/2.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/2.txt</filepath>
+ </data>
+ </request>
+ </start>
+
+ <test-suite name='Trashing and recovering results in sync report changes'>
+
+ <test name='1'>
+ <description>calendar collection depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+
+ <test name='2'>
+ <description>Delete resource</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar1/2.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+
+ <test name='3'>
+ <description>Sync token change after trashing</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+
+ <test name='4'>
+ <description>Recover trash</description>
+ <request>
+ <method>POST</method>
+ <ruri>$calendarhome1:/?action=recovertrash&mode=event&id=all</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+
+ <test name='5'>
+ <description>Sync token change after trash recovery</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+
+ </test-suite>
+
+ <end>
+ <request user="$useradmin:" pswd="$pswdadmin:">
+ <method>DELETEALL</method>
+ <ruri>$notificationpath1:/</ruri>
+ </request>
+ </end>
+
+</caldavtest>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150601/338bf50a/attachment-0001.html>
More information about the calendarserver-changes
mailing list