Fixed to match calshell overhaul; tests should also work with any provider now, not just caldav.

This commit is contained in:
dmose%mozilla.org 2004-12-27 20:24:30 +00:00
Родитель 4b3a7dad94
Коммит ff67b607f4
4 изменённых файлов: 61 добавлений и 45 удалений

Просмотреть файл

@ -1,49 +1,26 @@
// here's our event, ics-style
// create an event
var item = createItem();
const icsEvent = "BEGIN:VCALENDAR
PRODID:-//ORACLE//NONSGML CSDK 9.0.5 - CalDAVServlet 9.0.5//EN
VERSION:2.0
BEGIN:VEVENT
UID:uuid:1103314036911
ORGANIZER;X-ORACLE-GUID=E93594067928763EE0305794071A39A4;CN=Dan Mosedale:
mailto:dan.mosedale@oracle.com
SEQUENCE:0
DTSTAMP:20041223T032127Z
CREATED:20041217T200716Z
DTSTART:20041215T160000Z
DTEND:20041215T170000Z
X-ORACLE-EVENTINSTANCE-GUID:I1+1093+1+1+440626036
X-ORACLE-EVENT-GUID:E1+1093+1+440626036
X-ORACLE-EVENTTYPE:APPOINTMENT
TRANSP:OPAQUE
SUMMARY:monkey
STATUS:CONFIRMED
PRIORITY:0
CLASS:PUBLIC
ATTENDEE;X-ORACLE-PERSONAL-COMMENT-ISDIRTY=TRUE;X-ORACLE-SHOWASFREE=BUSY;
X-ORACLE-GUID=E93594067928763EE0305794071A39A4;CUTYPE=INDIVIDUAL;RSVP=FA
LSE;CN=Dan Mosedale;PARTSTAT=ACCEPTED:mailto:dan.mosedale@oracle.com
BEGIN:VALARM
TRIGGER:-P0DT0H10M0S
ACTION:DISPLAY
DESCRIPTION:monkey
END:VALARM
BEGIN:VALARM
TRIGGER:-P0DT0H10M0S
ACTION:AUDIO
END:VALARM
END:VEVENT
END:VCALENDAR
";
item.title = "Test Event";
// add it to the calendar
var newItem = addItem(item);
dump("newItem = " + newItem + "\n");
var cal = createInstance("@mozilla.org/calendar/calendar;1?type=caldav",
CI.calICalendar);
cal.uri = URLFromSpec(calendarUri);
// XXX what should happen to untyped item?
var listener = new calOpListener();
// XXX compare newItem to item
cal.getItem("20041119T052348Z-100040d-1-248609e9-Oracle", listener);
// get it from the calendar
var gottenItem = getItem(newItem.id);
dump("gottenItem = " + gottenItem + "\n");
if (!done)
runEventPump();
// XXX compare gottenItem to item
// delete it from the calendar
var deletedItem = deleteItem(gottenItem);
dump("deletedItem = " + deletedItem + "\n");
// XXX compare deletedItem to gottenItem
// XXX make sure getting and deleting again both fail

Просмотреть файл

@ -0,0 +1,37 @@
// create some events
var item1 = createItem();
item1.title = "Test Event 1";
var item2 = createItem();
item2.title = "Test Event 2";
// add them to the calendar
var newItem1 = addItem(item1);
dump("newItem1 = " + newItem1 + "\n");
var newItem2 = addItem(item2);
dump("newItem2 = " + newItem2 + "\n");
// XXX what should happen untyped items?
// XXX compare newItems to items
// get them from the calendar
var gottenItems = getItems(Ci.calICalendar.ITEM_FILTER_COMPLETED_ALL |
Ci.calICalendar.ITEM_FILTER_TYPE_EVENT, 0, null,
null);
dump("gottenItems = " + gottenItems + "\n");
// XXX compare gottenItem to item
// delete it from the calendar
var deletedItem1 = deleteItem(gottenItems[0]);
dump("deletedItem1 = " + deletedItem1 + "\n");
var deletedItem2 = deleteItem(gottenItems[1]);
dump("deletedItem2 = " + deletedItem2 + "\n");
// XXX compare deletedItem to gottenItem
// XXX make sure getting and deleting again both fail

Просмотреть файл

Просмотреть файл

@ -1,4 +1,6 @@
calendarType = "memory";
// init file for each test in this directory. executed in the xpcshell before
// starting each test
calendarUri = "http://this/doesn't/matter/on/memory/calendar/";
// create a memory calendar
createCal("memory");