[CalendarServer-changes] [10030] CalDAVTester/branches/users/cdaboo/managed-attachments

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 14 14:11:17 PST 2012


Revision: 10030
          http://trac.calendarserver.org//changeset/10030
Author:   cdaboo at apple.com
Date:     2012-11-14 14:11:17 -0800 (Wed, 14 Nov 2012)
Log Message:
-----------
Attachment update test.

Modified Paths:
--------------
    CalDAVTester/branches/users/cdaboo/managed-attachments/scripts/tests/CalDAV/managed-attachments.xml

Added Paths:
-----------
    CalDAVTester/branches/users/cdaboo/managed-attachments/Resource/CalDAV/managedattachments/simple/3.txt

Added: CalDAVTester/branches/users/cdaboo/managed-attachments/Resource/CalDAV/managedattachments/simple/3.txt
===================================================================
--- CalDAVTester/branches/users/cdaboo/managed-attachments/Resource/CalDAV/managedattachments/simple/3.txt	                        (rev 0)
+++ CalDAVTester/branches/users/cdaboo/managed-attachments/Resource/CalDAV/managedattachments/simple/3.txt	2012-11-14 22:11:17 UTC (rev 10030)
@@ -0,0 +1,4 @@
+This is a text file being used
+as a test of managed attachment
+support in calendarserver.
+It has been updated.

Modified: CalDAVTester/branches/users/cdaboo/managed-attachments/scripts/tests/CalDAV/managed-attachments.xml
===================================================================
--- CalDAVTester/branches/users/cdaboo/managed-attachments/scripts/tests/CalDAV/managed-attachments.xml	2012-11-14 02:46:18 UTC (rev 10029)
+++ CalDAVTester/branches/users/cdaboo/managed-attachments/scripts/tests/CalDAV/managed-attachments.xml	2012-11-14 22:11:17 UTC (rev 10030)
@@ -586,6 +586,204 @@
 		</test>
 	</test-suite>
 
+	<test-suite name='Simple non-recurring, non-scheduled attachment processing with resource update'>
+		<test name='1' ignore='no'>
+			<description>PUT event</description>
+			<request end-delete='no'>
+				<method>PUT</method>
+				<ruri>$calendarpath1:/1.ics</ruri>
+				<data>
+					<content-type>text/calendar; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/managedattachments/simple/1.ics</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+			<request>
+				<method>GET</method>
+				<ruri>$calendarpath1:/1.ics</ruri>
+				<verify>
+					<callback>calendarDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/managedattachments/simple/1.ics</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>ETag</name>
+					<variable>$etag:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='2' ignore='no'>
+			<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>;MTAG=</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>
+				<grabheader>
+					<name>Cal-Managed-ID</name>
+					<variable>$managed-id:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='3' ignore='no'>
+			<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' ignore='no'>
+			<description>Add attachment</description>
+			<request>
+				<method>POST</method>
+				<ruri>$calendarpath1:/1.ics?action=attachment-update&amp;managed-id=$managed-id:</ruri>
+				<header>
+					<name>Content-Disposition</name>
+					<value>attachment;filename=test2.txt</value>
+				</header>
+				<header>
+					<name>Prefer</name>
+					<value>return-representation</value>
+				</header>
+				<data>
+					<content-type>text/plain</content-type>
+					<filepath>Resource/CalDAV/managedattachments/simple/3.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=test2.txt</value>
+						<value>;FMTTYPE=text/plain</value>
+						<value>;SIZE=</value>
+						<value>;MTAG=</value>
+						<value>;MANAGED-ID=$managed-id:</value>
+					</arg>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Cal-Managed-ID$$managed-id:</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='5' ignore='no'>
+			<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/3.txt</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='6' ignore='no'>
+			<description>Delete calendar data</description>
+			<request>
+				<method>DELETE</method>
+				<ruri>$calendarpath1:/1.ics</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='7' ignore='no'>
+			<description>Check for attachment</description>
+			<request>
+				<method>GET</method>
+				<ruri>$location:</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>404</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+
 	<end/>
 	
 </caldavtest>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121114/a10d479f/attachment.html>


More information about the calendarserver-changes mailing list