[CalendarServer-changes] [15551] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 25 15:05:51 PDT 2016


Revision: 15551
          http://trac.calendarserver.org//changeset/15551
Author:   cdaboo at apple.com
Date:     2016-04-25 15:05:51 -0700 (Mon, 25 Apr 2016)
Log Message:
-----------
Test that managed attachment parameters are restored if the client inadvertently removes them.

Modified Paths:
--------------
    CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml

Added Paths:
-----------
    CalDAVTester/trunk/Resource/CalDAV/managedattachments/simple/10.ics

Added: CalDAVTester/trunk/Resource/CalDAV/managedattachments/simple/10.ics
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/managedattachments/simple/10.ics	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/managedattachments/simple/10.ics	2016-04-25 22:05:51 UTC (rev 15551)
@@ -0,0 +1,12 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Example Inc.//Example Calendar//EN
+BEGIN:VEVENT
+UID:$uid1:
+DTSTART:$now.year.1:0101T120000Z
+DURATION:P1DT
+DTSTAMP:20051222T205953Z
+SUMMARY:event 1
+ATTACH:$attach1:
+END:VEVENT
+END:VCALENDAR

Modified: CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml	2016-04-22 19:24:01 UTC (rev 15550)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/managed-attachments.xml	2016-04-25 22:05:51 UTC (rev 15551)
@@ -2610,6 +2610,189 @@
 		</test>
 	</test-suite>
 
+	<test-suite name='Simple non-recurring, non-scheduled add attachment update trying to remove parameters'>
+		<test name='1'>
+			<description>PUT event</description>
+			<request end-delete='no'>
+				<method>PUT</method>
+				<ruri>$calendarpath1:/1.ics</ruri>
+				<header>
+					<name>Prefer</name>
+					<value>return=representation</value>
+				</header>
+				<data>
+					<content-type>text/calendar; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/managedattachments/simple/1.ics</filepath>
+				</data>
+				<verify>
+					<callback>calendarDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/managedattachments/simple/1.ics</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>ETag</name>
+					<variable>$etag1:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='2'>
+			<description>Add attachment</description>
+			<request>
+				<method>POST</method>
+				<ruri>$calendarpath1:/1.ics?action=attachment-add</ruri>
+				<header>
+					<name>Content-Disposition</name>
+					<value>attachment;filename=test.txt</value>
+				</header>
+				<header>
+					<name>Prefer</name>
+					<value>return=representation</value>
+				</header>
+				<data>
+					<content-type>text/plain</content-type>
+					<filepath>Resource/CalDAV/managedattachments/simple/2.txt</filepath>
+				</data>
+				<verify>
+					<callback>calendarDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/managedattachments/simple/1.ics</value>
+					</arg>
+					<arg>
+						<name>filter</name>
+						<value>ATTACH</value>
+					</arg>
+				</verify>
+				<verify>
+					<callback>dataString</callback>
+					<arg>
+						<name>unwrap</name>
+						<value/>
+					</arg>
+					<arg>
+						<name>contains</name>
+						<value>ATTACH</value>
+						<value>;FILENAME=test.txt</value>
+						<value>;FMTTYPE=text/plain</value>
+						<value>;SIZE=</value>
+						<value>;MANAGED-ID=</value>
+					</arg>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Cal-Managed-ID</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Location</name>
+					<variable>$location:</variable>
+				</grabheader>
+				<grabcalproperty>
+					<name>VEVENT/ATTACH</name>
+					<variable>$attach1:</variable>
+				</grabcalproperty>
+				<grabcalparameter>
+					<name>VEVENT/ATTACH/MANAGED-ID</name>
+					<variable>$managed_id1:</variable>
+				</grabcalparameter>
+				<grabcalparameter>
+					<name>VEVENT/ATTACH/FILENAME</name>
+					<variable>$filename1:</variable>
+				</grabcalparameter>
+				<grabcalparameter>
+					<name>VEVENT/ATTACH/FMTTYPE</name>
+					<variable>$fmttype1:</variable>
+				</grabcalparameter>
+				<grabcalparameter>
+					<name>VEVENT/ATTACH/SIZE</name>
+					<variable>$size1:</variable>
+				</grabcalparameter>
+			</request>
+		</test>
+		<test name='3'>
+			<description>Check for attachment</description>
+			<request>
+				<method>GET</method>
+				<ruri>$location:</ruri>
+				<verify>
+					<callback>dataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='4'>
+			<description>PUT update other event to remove parameters</description>
+			<request end-delete='no'>
+				<method>PUT</method>
+				<ruri>$calendarpath1:/1.ics</ruri>
+				<header>
+					<name>Prefer</name>
+					<value>return=representation</value>
+				</header>
+				<data>
+					<content-type>text/calendar; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/managedattachments/simple/10.ics</filepath>
+				</data>
+				<verify>
+					<callback>calendarDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/managedattachments/simple/8.ics</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='5'>
+			<description>Check for attachment</description>
+			<request>
+				<method>GET</method>
+				<ruri>$attach1:</ruri>
+				<verify>
+					<callback>dataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/managedattachments/simple/2.txt</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='6'>
+			<description>Delete original calendar data</description>
+			<request>
+				<method>DELETE</method>
+				<ruri>$calendarpath1:/1.ics</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='7'>
+			<exclude-feature>
+				<feature>trash-collection</feature>
+			</exclude-feature>
+			<description>Check for attachment</description>
+			<request>
+				<method>GET</method>
+				<ruri>$location:</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+
+
 	<end/>
 
 </caldavtest>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160425/2a7bc299/attachment.html>


More information about the calendarserver-changes mailing list