[CalendarServer-changes] [5543] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 28 19:34:46 PDT 2010


Revision: 5543
          http://trac.macosforge.org/projects/calendarserver/changeset/5543
Author:   cdaboo at apple.com
Date:     2010-04-28 19:34:44 -0700 (Wed, 28 Apr 2010)
Log Message:
-----------
Test that sharee delete only removes the shared calendar.

Added Paths:
-----------
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/1.xml
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/2.xml
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/3.xml
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/4.xml
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/5.xml
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/6.xml
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/shareedelete/
    CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/shareedelete/1.ics
    CalDAVTester/trunk/scripts/tests/CalDAV/sharing-unshare.xml

Added: CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/1.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/1.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/1.xml	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<CS:share xmlns:D="DAV:" xmlns:CS="http://calendarserver.org/ns/">
+    <CS:set>
+        <D:href>mailto:user02 at example.com</D:href>
+        <CS:summary>My Shared Calendar</CS:summary>
+        <CS:read-write/>
+    </CS:set>
+</CS:share>

Added: CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/2.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/2.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/2.xml	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?><notification xmlns='http://calendarserver.org/ns/'>
+  <dtstamp></dtstamp>
+  <invite-notification shared-type='calendar'>
+    <uid></uid>
+    <href xmlns='DAV:'>/principals/__uids__/user02/</href>
+    <invite-noresponse/>
+    <access>
+      <read-write/>
+    </access>
+    <hosturl>
+      <href xmlns='DAV:'>/calendars/__uids__/user01/shared</href>
+    </hosturl>
+    <organizer>
+      <href xmlns='DAV:'>/principals/__uids__/user01/</href>
+    </organizer>
+    <summary>My Shared Calendar</summary>
+  </invite-notification>
+</notification>

Added: CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/3.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/3.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/3.xml	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<invite-reply xmlns='http://calendarserver.org/ns/'>
+  <href xmlns='DAV:'>/principals/__uids__/user02/</href>
+  <invite-accepted/>
+  <hosturl>
+    <href xmlns='DAV:'>/calendars/__uids__/user01/shared</href>
+  </hosturl>
+  <in-reply-to>$inviteuid:</in-reply-to>
+  <summary>The Shared Calendar</summary>
+</invite-reply>

Added: CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/4.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/4.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/4.xml	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:propfind xmlns:D="DAV:" xmlns:CS="http://calendarserver.org/ns/">
+<D:prop>
+<CS:invite/>
+</D:prop>
+</D:propfind>

Added: CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/5.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/5.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/5.xml	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,20 @@
+<?xml version='1.0' encoding='UTF-8'?><multistatus xmlns='DAV:'>
+  <response>
+    <href>/calendars/__uids__/user01/shared/</href>
+    <propstat>
+      <prop>
+        <invite xmlns='http://calendarserver.org/ns/'>
+          <user>
+            <uid></uid>
+            <href xmlns='DAV:'>/principals/__uids__/user02/</href>
+            <access>
+              <read-write/>
+            </access>
+            <invite-accepted/>
+          </user>
+        </invite>
+      </prop>
+      <status>HTTP/1.1 200 OK</status>
+    </propstat>
+  </response>
+</multistatus>

Added: CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/6.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/6.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/accept/6.xml	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?><notification xmlns='http://calendarserver.org/ns/'>
+  <dtstamp></dtstamp>
+  <invite-reply xmlns='http://calendarserver.org/ns/'>
+    <href xmlns='DAV:'>/principals/__uids__/user02/</href>
+    <invite-accepted/>
+    <hosturl>
+      <href xmlns='DAV:'>/calendars/__uids__/user01/shared</href>
+    </hosturl>
+    <in-reply-to>$inviteuid:</in-reply-to>
+    <summary>The Shared Calendar</summary>
+  </invite-reply>
+</notification>

Added: CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/shareedelete/1.ics
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/shareedelete/1.ics	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/sharing/unshare/shareedelete/1.ics	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,32 @@
+BEGIN:VCALENDAR
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+VERSION:2.0
+BEGIN:VTIMEZONE
+LAST-MODIFIED:20040110T032845Z
+TZID:US/Eastern
+BEGIN:DAYLIGHT
+DTSTART:20000404T020000
+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
+TZNAME:EDT
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+END:DAYLIGHT
+BEGIN:STANDARD
+DTSTART:20001026T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+TZNAME:EST
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTAMP:20051222T205953Z
+CREATED:20060101T150000Z
+DTSTART;TZID=US/Eastern:20060101T100000
+DURATION:PT1H
+SUMMARY:event 1
+UID:54E181BC7CCC373042B28842 at ninevah.local
+CATEGORIES:cool
+END:VEVENT
+END:VCALENDAR

Added: CalDAVTester/trunk/scripts/tests/CalDAV/sharing-unshare.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/sharing-unshare.xml	                        (rev 0)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/sharing-unshare.xml	2010-04-29 02:34:44 UTC (rev 5543)
@@ -0,0 +1,246 @@
+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2006-2010 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>
+	<description>Test calendar sharing unshare/delete behavior</description>
+
+	<require-feature>
+		<feature>caldav</feature>
+		<feature>shared-calendars</feature>
+	</require-feature>
+
+	<start>
+		<request user="$userid1:" pswd="$pswd1:">
+			<method>DELETEALL</method>
+			<ruri>$notificationpath1:/</ruri>
+		</request>
+		<request user="$userid2:" pswd="$pswd2:">
+			<method>DELETEALL</method>
+			<ruri>$notificationpath2:/</ruri>
+		</request>
+		<request end-delete="yes">
+			<method>MKCALENDAR</method>
+			<ruri>$pathprefix1:/shared/</ruri>
+			<data>
+				<content-type>text/xml; charset=utf-8</content-type>
+				<filepath>Resource/Common/MKCALENDAR/sharedcalendar.xml</filepath>
+			</data>
+			<verify>
+				<callback>statusCode</callback>
+			</verify>
+		</request>
+	</start>
+	
+	<test-suite name='Set up share'>
+		<test name='1' ignore='no'>
+			<description>POST invitation</description>
+			<request print-response='no'>
+				<method>POST</method>
+				<ruri>$pathprefix1:/shared/</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/sharing/unshare/accept/1.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='2'>
+			<description>Check Sharee notification collection</description>
+			<request user="$userid2:" pswd="$pswd2:" print-response='no'>
+				<method>WAITCOUNT 1</method>
+				<ruri>$notificationpath2:/</ruri>
+			</request>
+			<request user="$userid2:" pswd="$pswd2:" print-response='no'>
+				<method>GETNEW</method>
+				<ruri>$notificationpath2:/</ruri>
+				<verify>
+					<callback>xmlDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/sharing/unshare/accept/2.xml</value>
+					</arg>
+					<arg>
+						<name>filter</name>
+						<value>{http://calendarserver.org/ns/}dtstamp</value>
+						<value>{http://calendarserver.org/ns/}uid</value>
+					</arg>
+				</verify>
+				<grabelement>
+					<name>{http://calendarserver.org/ns/}invite-notification/{http://calendarserver.org/ns/}uid</name>
+					<variable>$inviteuid:</variable>
+				</grabelement>
+			</request>
+		</test>
+		<test name='3'>
+			<description>Sharee replies ACCEPTED</description>
+			<request user="$userid2:" pswd="$pswd2:" print-response='no'>
+				<method>POST</method>
+				<ruri>$pathprefix2:/</ruri>
+				<data substitutions='yes'>
+					<content-type>application/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/sharing/unshare/accept/3.xml</filepath>
+				</data>
+				<verify>
+					<callback>xmlDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/sharing/replies/accept/7.xml</value>
+					</arg>
+					<arg>
+						<name>filter</name>
+						<value>{DAV:}href</value>
+					</arg>
+				</verify>
+				<grabelement>
+					<name>{DAV:}href</name>
+					<variable>$shareecalendar:</variable>
+				</grabelement>
+			</request>
+		</test>
+		<test name='4' ignore='no'>
+			<description>Check accept status</description>
+			<request print-response='no'>
+				<method>PROPFIND</method>
+				<ruri>$pathprefix1:/shared/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>0</value>
+				</header>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/sharing/unshare/accept/4.xml</filepath>
+				</data>
+				<verify>
+					<callback>xmlDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/sharing/unshare/accept/5.xml</value>
+					</arg>
+					<arg>
+						<name>filter</name>
+						<value>{http://calendarserver.org/ns/}uid</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='5'>
+			<description>Check Sharer notification collection</description>
+			<request>
+				<method>WAITCOUNT 1</method>
+				<ruri>$notificationpath1:/</ruri>
+			</request>
+			<request print-response='no'>
+				<method>GETNEW</method>
+				<ruri>$notificationpath1:/</ruri>
+				<verify>
+					<callback>xmlDataMatch</callback>
+					<arg>
+						<name>filepath</name>
+						<value>Resource/CalDAV/sharing/unshare/accept/6.xml</value>
+					</arg>
+					<arg>
+						<name>filter</name>
+						<value>{http://calendarserver.org/ns/}dtstamp</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+	</test-suite>
+	
+	<test-suite name='Delete'>
+		<test name='1'>
+			<description>Sharer adds event</description>
+			<request print-response='no'>
+				<method>PUT</method>
+				<ruri>$pathprefix1:/shared/1.ics</ruri>
+				<data>
+					<content-type>text/calendar; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/sharing/unshare/shareedelete/1.ics</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='2' ignore='no'>
+			<description>Sharee deletes shared calendar</description>
+			<request user="$userid2:" pswd="$pswd2:" print-response='no'>
+				<method>DELETE</method>
+				<ruri>$shareecalendar:/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>infinity</value>
+				</header>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='3' ignore='no'>
+			<description>No more shared calendar</description>
+			<request user="$userid2:" pswd="$pswd2:" print-response='no'>
+				<method>PROPFIND</method>
+				<ruri>$shareecalendar:/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>0</value>
+				</header>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/Common/PROPFIND/resourcetype.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>404</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='4' ignore='no'>
+			<description>Sharer still has calendar data</description>
+			<request print-response='no'>
+				<method>PROPFIND</method>
+				<ruri>$pathprefix1:/shared/</ruri>
+				<header>
+					<name>Depth</name>
+					<value>1</value>
+				</header>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/Common/PROPFIND/count.xml</filepath>
+				</data>
+				<verify>
+					<callback>multistatusItems</callback>
+					<arg>
+						<name>count</name>
+						<value>1</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/20100428/e3a206ed/attachment-0001.html>


More information about the calendarserver-changes mailing list