[CalendarServer-changes] [8406] CalDAVTester/trunk/scripts/tests

source_changes at macosforge.org source_changes at macosforge.org
Tue Dec 6 12:16:34 PST 2011


Revision: 8406
          http://trac.macosforge.org/projects/calendarserver/changeset/8406
Author:   cdaboo at apple.com
Date:     2011-12-06 12:16:33 -0800 (Tue, 06 Dec 2011)
Log Message:
-----------
Tests for etag and getlastmodified on home and home child collections.

Modified Paths:
--------------
    CalDAVTester/trunk/scripts/tests/CalDAV/get.xml
    CalDAVTester/trunk/scripts/tests/CardDAV/get.xml

Modified: CalDAVTester/trunk/scripts/tests/CalDAV/get.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/get.xml	2011-12-06 08:02:23 UTC (rev 8405)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/get.xml	2011-12-06 20:16:33 UTC (rev 8406)
@@ -106,6 +106,22 @@
 						<value>BEGIN:VEVENT</value>
 					</arg>
 				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag</value>
+						<value>Last-Modified</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified:</variable>
+				</grabheader>
 			</request>
 		</test>
 		<test name='2'>
@@ -120,6 +136,14 @@
 					<callback>statusCode</callback>
 				</verify>
 				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag</value>
+						<value>Last-Modified</value>
+					</arg>
+				</verify>
+				<verify>
 					<callback>dataString</callback>
 					<arg>
 						<name>contains</name>
@@ -133,6 +157,10 @@
 		</test>
 		<test name='3'>
 			<description>GET on calendar collection without multiple VTIMEZONEs</description>
+			<request>
+				<method>DELAY</method>
+				<ruri>1</ruri>
+			</request>
 			<request end-delete="yes">
 				<method>PUT</method>
 				<ruri>$calendarpath1:/2.ics</ruri>
@@ -157,6 +185,22 @@
 						<value>Resource/CalDAV/get/1.ics</value>
 					</arg>
 				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>ETag!$etag:</value>
+						<value>Last-Modified!$last-modified:</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag2:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified2:</variable>
+				</grabheader>
 			</request>
 		</test>
 		<test name='4'>
@@ -183,8 +227,184 @@
 				</verify>
 			</request>
 		</test>
+		<test name='5'>
+			<description>Conditional GET on calendar collection</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$calendarpath1:/</ruri>
+				<header>
+					<name>If-None-Match</name>
+					<value>$etag2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='6'>
+			<description>Conditional GET on calendar collection</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$calendarpath1:/</ruri>
+				<header>
+					<name>If-Modified-Since</name>
+					<value>$last-modified2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
 	</test-suite>
 	
+	<test-suite name='GET on home'>
+		<require-feature>
+			<feature>directory listing</feature>
+		</require-feature>
+		<test name='1'>
+			<description>GET on calendar home</description>
+			<request>
+				<method>GET</method>
+				<ruri>$calendarhome1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag</value>
+						<value>Last-Modified</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag1:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified1:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='2'>
+			<description>Create a calendar</description>
+			<request>
+				<method>DELAY</method>
+				<ruri>1</ruri>
+			</request>
+			<request end-delete="yes">
+				<method>MKCALENDAR</method>
+				<ruri>$calendarhome1:/testcal/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='3'>
+			<description>GET on calendar home, changed headers</description>
+			<request>
+				<method>GET</method>
+				<ruri>$calendarhome1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag!$etag1:</value>
+						<value>Last-Modified!$last-modified1:</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag2:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified2:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='4'>
+			<description>Conditional GET on calendar home</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$calendarhome1:/</ruri>
+				<header>
+					<name>If-None-Match</name>
+					<value>$etag2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='5'>
+			<description>Conditional GET on calendar home</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$calendarpath1:/</ruri>
+				<header>
+					<name>If-Modified-Since</name>
+					<value>$last-modified2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='6'>
+			<description>Delete a calendar</description>
+			<request>
+				<method>DELAY</method>
+				<ruri>1</ruri>
+			</request>
+			<request end-delete="yes">
+				<method>DELETE</method>
+				<ruri>$calendarhome1:/testcal/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='7'>
+			<description>GET on calendar home, changed headers</description>
+			<request>
+				<method>GET</method>
+				<ruri>$calendarhome1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag!$etag2:</value>
+						<value>Last-Modified!$last-modified2:</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+
 	<end/>
 	
 </caldavtest>

Modified: CalDAVTester/trunk/scripts/tests/CardDAV/get.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/get.xml	2011-12-06 08:02:23 UTC (rev 8405)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/get.xml	2011-12-06 20:16:33 UTC (rev 8406)
@@ -99,6 +99,281 @@
 			</request>
 		</test>
 	</test-suite>
+
+	<test-suite name='GET on collections'>
+		<require-feature>
+			<feature>directory listing</feature>
+		</require-feature>
+		<test name='1'>
+			<description>GET on addressbook collection</description>
+			<request>
+				<method>GET</method>
+				<ruri>$addressbookpath1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag</value>
+						<value>Last-Modified</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='2'>
+			<require-feature>
+				<feature>regular-collection</feature>
+			</require-feature>
+			<description>Get on regular collection</description>
+			<request>
+				<method>GET</method>
+				<ruri>$addressbookhome1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag</value>
+						<value>Last-Modified</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='3'>
+			<description>GET on addressbook collection</description>
+			<request>
+				<method>DELAY</method>
+				<ruri>1</ruri>
+			</request>
+			<request end-delete="yes">
+				<method>PUT</method>
+				<ruri>$addressbookpath1:/2.vcf</ruri>
+				<data>
+					<content-type>text/vcard; charset=utf-8</content-type>
+					<filepath>Resource/CardDAV/vcardput/2.vcf</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$addressbookpath1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>ETag!$etag:</value>
+						<value>Last-Modified!$last-modified:</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag2:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified2:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='5'>
+			<description>Conditional GET on addressbook collection</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$addressbookpath1:/</ruri>
+				<header>
+					<name>If-None-Match</name>
+					<value>$etag2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='6'>
+			<description>Conditional GET on addressbook collection</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$addressbookpath1:/</ruri>
+				<header>
+					<name>If-Modified-Since</name>
+					<value>$last-modified2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+	
+	<test-suite name='GET on home'>
+		<require-feature>
+			<feature>directory listing</feature>
+		</require-feature>
+		<test name='1'>
+			<description>GET on addressbook home</description>
+			<request>
+				<method>GET</method>
+				<ruri>$addressbookhome1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag</value>
+						<value>Last-Modified</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag1:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified1:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='2'>
+			<description>Create a addressbook</description>
+			<request>
+				<method>DELAY</method>
+				<ruri>1</ruri>
+			</request>
+			<request end-delete="yes">
+				<method>MKCOL</method>
+				<ruri>$addressbookhome1:/testadbk/</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/Common/MKCOL/addressbook.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='3'>
+			<description>GET on addressbook home, changed headers</description>
+			<request>
+				<method>GET</method>
+				<ruri>$addressbookhome1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag!$etag1:</value>
+						<value>Last-Modified!$last-modified1:</value>
+					</arg>
+				</verify>
+				<grabheader>
+					<name>Etag</name>
+					<variable>$etag2:</variable>
+				</grabheader>
+				<grabheader>
+					<name>Last-Modified</name>
+					<variable>$last-modified2:</variable>
+				</grabheader>
+			</request>
+		</test>
+		<test name='4'>
+			<description>Conditional GET on addressbook home</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$addressbookhome1:/</ruri>
+				<header>
+					<name>If-None-Match</name>
+					<value>$etag2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='5'>
+			<description>Conditional GET on addressbook home</description>
+			<request print-response="no">
+				<method>GET</method>
+				<ruri>$addressbookpath1:/</ruri>
+				<header>
+					<name>If-Modified-Since</name>
+					<value>$last-modified2:</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>304</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='6'>
+			<description>Delete a addressbook</description>
+			<request>
+				<method>DELAY</method>
+				<ruri>1</ruri>
+			</request>
+			<request end-delete="yes">
+				<method>DELETE</method>
+				<ruri>$addressbookhome1:/testadbk/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='7'>
+			<description>GET on addressbook home, changed headers</description>
+			<request>
+				<method>GET</method>
+				<ruri>$addressbookhome1:/</ruri>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+				<verify>
+					<callback>header</callback>
+					<arg>
+						<name>header</name>
+						<value>Etag!$etag2:</value>
+						<value>Last-Modified!$last-modified2:</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/20111206/6eae2991/attachment-0001.html>


More information about the calendarserver-changes mailing list