[CalendarServer-changes] [5453] CalDAVTester/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Fri Apr 9 10:54:29 PDT 2010
Revision: 5453
http://trac.macosforge.org/projects/calendarserver/changeset/5453
Author: cdaboo at apple.com
Date: 2010-04-09 10:54:28 -0700 (Fri, 09 Apr 2010)
Log Message:
-----------
Make sure CardDAV MKCOL is properly tested.
Added Paths:
-----------
CalDAVTester/trunk/Resource/CardDAV/mkcol/
CalDAVTester/trunk/Resource/CardDAV/mkcol/1.xml
CalDAVTester/trunk/Resource/CardDAV/mkcol/2.xml
CalDAVTester/trunk/Resource/Common/MKCOL/
CalDAVTester/trunk/Resource/Common/MKCOL/addressbook.xml
CalDAVTester/trunk/scripts/tests/CardDAV/mkcol.xml
Added: CalDAVTester/trunk/Resource/CardDAV/mkcol/1.xml
===================================================================
--- CalDAVTester/trunk/Resource/CardDAV/mkcol/1.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CardDAV/mkcol/1.xml 2010-04-09 17:54:28 UTC (rev 5453)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:mkcol xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
+<D:set>
+<D:prop>
+<D:resourcetype><D:collection/><C:addressbook/></D:resourcetype>
+<D:displayname>An Address Book</D:displayname>
+<C:addressbook-description xml:lang="en">First CardDAV address book.</C:addressbook-description>
+</D:prop>
+</D:set>
+</D:mkcol>
Added: CalDAVTester/trunk/Resource/CardDAV/mkcol/2.xml
===================================================================
--- CalDAVTester/trunk/Resource/CardDAV/mkcol/2.xml (rev 0)
+++ CalDAVTester/trunk/Resource/CardDAV/mkcol/2.xml 2010-04-09 17:54:28 UTC (rev 5453)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:mkcol xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
+<D:set>
+<D:prop>
+<D:resourcetype><D:collection/><C:addressbook/></D:resourcetype>
+<D:getetag>An Address Book</D:getetag>
+<D:displayname>An Address Book</D:displayname>
+<C:addressbook-description xml:lang="en">First CardDAV address book.</C:addressbook-description>
+</D:prop>
+</D:set>
+</D:mkcol>
Added: CalDAVTester/trunk/Resource/Common/MKCOL/addressbook.xml
===================================================================
--- CalDAVTester/trunk/Resource/Common/MKCOL/addressbook.xml (rev 0)
+++ CalDAVTester/trunk/Resource/Common/MKCOL/addressbook.xml 2010-04-09 17:54:28 UTC (rev 5453)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:mkcol xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
+<D:set>
+<D:prop>
+<D:resourcetype><D:collection/><C:addressbook/></D:resourcetype>
+</D:prop>
+</D:set>
+</D:mkcol>
Added: CalDAVTester/trunk/scripts/tests/CardDAV/mkcol.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/mkcol.xml (rev 0)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/mkcol.xml 2010-04-09 17:54:28 UTC (rev 5453)
@@ -0,0 +1,119 @@
+<?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>
+ <require-feature>
+ <feature>carddav</feature>
+ </require-feature>
+
+ <start/>
+
+ <test-suite name='MKCOL with body'>
+ <test name='1'>
+ <description>MKCOL with correct request body</description>
+ <request end-delete='yes'>
+ <method>MKCOL</method>
+ <ruri>$addressbookhome1:/adbktest1/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/mkcol/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>201</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <description>MKCOL with correct request body on existing resource</description>
+ <request>
+ <method>MKCOL</method>
+ <ruri>$addressbookhome1:/adbktest1/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/mkcol/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>prepostcondition</callback>
+ <arg>
+ <name>error</name>
+ <value>DAV:resource-must-be-null</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <description>MKCOL with incorrect request body</description>
+ <request end-delete='yes' print-response='no'>
+ <method>MKCOL</method>
+ <ruri>$addressbookhome1:/adbktest2/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/mkcol/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>badprops</name>
+ <value>DAV:resourcetype</value>
+ <value>DAV:getetag</value>
+ <value>DAV:displayname</value>
+ <value>urn:ietf:params:xml:ns:carddavaddressbook-description</value>
+ </arg>
+ </verify>
+ </request>
+ <request print-response='no'>
+ <method>GET</method>
+ <ruri>$addressbookhome1:/adbktest2/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>404</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>MKCOL with incorrect request body on existing resource</description>
+ <request>
+ <method>MKCOL</method>
+ <ruri>$addressbookhome1:/adbktest1/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CardDAV/mkcol/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>prepostcondition</callback>
+ <arg>
+ <name>error</name>
+ <value>DAV:resource-must-be-null</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/20100409/2a2a8f5c/attachment-0001.html>
More information about the calendarserver-changes
mailing list