/Source/externals/GData/Source/Tests/GDataFeedTest.m
http://google-email-uploader-mac.googlecode.com/ · Objective C · 2212 lines · 1440 code · 472 blank · 300 comment · 25 complexity · d08856f41ab760b3b32aadb99534327a MD5 · raw file
Large files are truncated click here to view the full file
- /* Copyright (c) 2007 Google Inc.
- *
- * 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.
- */
- //
- // GDataFeedTest.m
- //
- #import "GData.h"
- #import "GDataFeedTest.h"
- #import "GDataElementsTest.h"
- #import "GDataEntryCalendarEvent.h"
- #import "GDataEntryYouTubeVideo.h"
- #import "GDataMapConstants.h"
- @implementation GDataFeedTest
- - (void)runTests:(TestKeyPathValues *)tests {
-
- // step through each feed test
- for (int testIndex = 0;
- tests[testIndex].str1 != nil;
- testIndex++) {
-
- // get the class of this feed and the path to the test file of xml data
- //
- // The class name may specify a service version, like GDataFeedCalendar/2.0,
- // and may have a "-ignoreUnknown" suffix indicating unknown elements should be
- // ignored, like GDataFeedCalendar-ignore/2.0
- NSString *className = tests[testIndex].str1;
- NSString *serviceVersion = nil;
- BOOL shouldIgnoreUnknowns = NO;
-
- NSArray *components = [className componentsSeparatedByString:@"/"];
- if ([components count] == 2) {
- className = [components objectAtIndex:0];
- serviceVersion = [components objectAtIndex:1];
- }
- if ([className hasSuffix:@"-ignoreUnknown"]) {
- shouldIgnoreUnknowns = YES;
- NSUInteger nameLen = [className length] - [@"-ignoreUnknown" length];
- className = [className substringToIndex:nameLen];
- }
-
- #ifdef GDATA_TARGET_NAMESPACE
- className = [NSString stringWithFormat:@"%s_%@",
- GDATA_TARGET_NAMESPACE_STRING, className];
- #endif
- Class gdataClass = NSClassFromString(className);
- STAssertNotNil(gdataClass, @"Cannot make class for class name: %@", className);
-
- NSString *feedPath = tests[testIndex].str2;
- NSData *data = [NSData dataWithContentsOfFile:feedPath];
- STAssertNotNil(data, @"Cannot read feed from %@", feedPath);
-
- // create the feed object
- GDataFeedBase *feed1 = nil;
- if ([gdataClass instancesRespondToSelector:@selector(initWithData:serviceVersion:)]) {
- feed1 = [[[gdataClass alloc] initWithData:data
- serviceVersion:serviceVersion
- shouldIgnoreUnknowns:shouldIgnoreUnknowns] autorelease];
- } else {
- // this "feed" isn't a proper feed, and might be an entry
- NSError *error = nil;
- NSXMLDocument *doc = [[[NSXMLDocument alloc] initWithData:data
- options:0
- error:&error] autorelease];
- STAssertNotNil(doc, @"Cannot allocate XML document for %@, error %@",
- feedPath, error);
- NSXMLElement* root = [doc rootElement];
- feed1 = [[[gdataClass alloc] initWithXMLElement:root
- parent:nil
- serviceVersion:serviceVersion
- surrogates:nil
- shouldIgnoreUnknowns:shouldIgnoreUnknowns] autorelease];
- }
-
- // copy the feed object
- GDataObject *feed1copy = [[feed1 copy] autorelease];
-
- STAssertTrue([feed1 isEqual:feed1copy], @"Failed copy feed (%@) from %@ to %@",
- feedPath, feed1, feed1copy);
- // make a new feed object we'll test against from XML generated by the copy
- NSXMLElement *outputXML = [feed1copy XMLElement];
-
- GDataFeedBase *feed2 = [[[gdataClass alloc] initWithXMLElement:outputXML
- parent:nil
- serviceVersion:serviceVersion
- surrogates:nil
- shouldIgnoreUnknowns:shouldIgnoreUnknowns] autorelease];
- STAssertTrue([feed2 isEqual:feed1copy], @"Failed for %@ using XML \n %@\n\nto convert\n %@ \nto\n %@",
- feedPath, outputXML, feed1copy, feed2);
- // generate a description; this can fire an exception for an invalid keyPath
- // in the description record list
- STAssertNotNil([feed2 description], @"Could not generate description for %@",
- feedPath);
-
- // step through all the key-value path tests
- while (1) {
-
- ++testIndex;
-
- NSString *keyPath = tests[testIndex].str1;
- NSString *expectedValue = tests[testIndex].str2;
-
- if (keyPath == nil || [keyPath length] == 0) break;
-
- #if GDATA_USES_LIBXML
- // skip the XMLStrings until we can normalize whitespace and closing
- // brackets and other minor differences
- if ([keyPath hasSuffix:@".XMLString"]) continue;
- #endif
- NSString *result = [GDataElementsTest valueInObject:feed2
- forKeyPathIncludingArrays:keyPath];
-
- // if the result wasn't a string but responds to stringValue, then
- // invoke that to get a string
- if ([expectedValue isKindOfClass:[NSString class]]
- && ![result isKindOfClass:[NSString class]]
- && [result respondsToSelector:@selector(stringValue)]) {
-
- result = [(id)result stringValue];
- }
-
- // we'll test for equality unless the expected result begins "hasPrefix:"
- // or "contains:"
- if ([expectedValue hasPrefix:@"hasPrefix:"]) {
- NSString *prefix = [expectedValue substringFromIndex:[@"hasPrefix:" length]];
- STAssertTrue([result hasPrefix:prefix], @"failed object %@ \n testing key path '%@' for prefix:\n %@ \n!= prefix:\n %@",
- feed2, keyPath, result, prefix);
-
- } else if ([expectedValue hasPrefix:@"contains:"]) {
-
- NSString *substring = [expectedValue substringFromIndex:[@"contains:" length]];
- NSRange range = [result rangeOfString:substring];
- STAssertTrue(result != nil && range.location != NSNotFound,
- @"failed object %@ \n testing key path '%@' for substring:\n %@ \n!= contains:\n %@",
- feed2, keyPath, result, substring);
- } else {
- #ifdef GDATA_TARGET_NAMESPACE
- // tests for class name need the prefix added
- if ([keyPath hasSuffix:@"className"]
- && [expectedValue hasPrefix:@"GData"]) {
- expectedValue = [NSString stringWithFormat:@"%s_%@",
- GDATA_TARGET_NAMESPACE_STRING, expectedValue];
- }
- #endif
- STAssertTrue(AreEqualOrBothNil(result, expectedValue), @"failed object %@ \n testing key path '%@'\n %@ \n!= \n %@",
- feed2, keyPath, result, expectedValue);
- }
- }
- }
- }
- - (void)testBooksFeed {
-
- //
- // Volumes Feed
- //
- TestKeyPathValues tests[] =
- {
- { @"GDataFeedVolume", @"Tests/FeedBooksVolumesTest1.xml" },
-
- // GDataFeedVolume paths
- { @"identifier", @"http://www.google.com/books/feeds/users/1728172424007912469/volumes" },
- { @"authors.0.name", @"1728172424007912469" },
-
- // GDataEntryVolume paths
- { @"entries.0.creators.0", @"Jim Davis" },
- { @"entries.0.dates.0", @"2006-01-31" },
- { @"entries.0.volumeDescriptions.0", @"contains:Pig Out" },
- { @"entries.0.embeddability", kGDataBooksNotEmbeddable },
- { @"entries.0.openAccess", kGDataBooksEnabled },
- { @"entries.0.formats.0", @"93 pages" },
- { @"entries.0.volumeIdentifiers.0", @"_PRJAAAACAAJ" },
- { @"entries.0.volumeIdentifiers.1", @"ISBN:0345464664" },
- { @"entries.0.publishers.0", @"Ballantine Books" },
- { @"entries.0.subjects.0", @"Humor" },
- { @"entries.0.volumeTitles.0", @"Garfield Pigs Out" },
- { @"entries.0.viewability", kGDataBooksViewNoPages },
- { @"entries.0.thumbnailLink.href", @"hasPrefix:http://bks2.books.google.com/books?id=_PRJAAAACAAJ" },
- { @"entries.0.previewLink.href", @"contains:id=_PRJAAAACAAJ&ie=ISO-8859-1" },
- { @"entries.0.infoLink.href", @"contains:id=_PRJAAAACAAJ&ie=ISO-8859-1" },
- { @"entries.0.rating.value", @"3" },
- { @"entries.0.rating.average", @"2" },
- { @"entries.0.review", @"Ageless? No way." },
- { @"entries.0.contentVersion", @"1.2beta5" },
- { @"", @"" },
- { nil, nil }
- };
-
- [self runTests:tests];
- }
- - (void)testCalendarFeed {
-
- TestKeyPathValues tests[] =
- {
- //
- // Calendar Feed
- //
- { @"GDataFeedCalendar/2.0", @"Tests/FeedCalendarTest1.xml" },
-
- // GDataFeedCalendar paths
- { @"title", @"Fred Flintstone's Calendar List" },
- { @"links.1.rel", kGDataLinkRelPost },
- { @"links.2.rel", @"self" },
- { @"authors.0.name", @"Fred Flintstone" },
- { @"authors.0.email", @"fred@gmail.com" },
- { @"generator.URI", @"http://www.google.com/calendar" },
- { @"generator.name", @"Google Calendar" },
- { @"generator.version", @"1.0" },
- { @"startIndex", @"1" },
- { @"itemsPerPage", @"3" },
- { @"ETag", @"Nofzeigeritznum" },
- { @"fieldSelection", @"@gd:*,link" },
-
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
-
- // GDataEntryCalendar paths
- { @"entries.0.identifier", @"http://www.google.com/calendar/feeds/test%40domain.net/test%40domain.net" },
- { @"entries.0.publishedDate.RFC3339String", @"2006-11-14T00:03:38Z" },
- { @"entries.0.updatedDate.RFC3339String", @"2006-11-09T00:16:10Z" },
- { @"entries.0.editedDate.RFC3339String", @"2006-11-09T00:16:15Z" },
- { @"entries.0.title", @"Fred Flintstone" },
- { @"entries.0.links.0.rel", @"alternate" },
- { @"entries.0.links.1.href", @"http://www.google.com/calendar/feeds/test%40domain.net/test%40domain.net" },
- { @"entries.0.authors.0.name", @"Fred Flintstone" },
- { @"entries.0.authors.0.email", @"fred@gmail.com" },
- { @"entries.0.isHidden", @"0" },
- { @"entries.0.timeZoneName", @"America/Los_Angeles" },
- { @"entries.0.timesCleaned", @"31" },
- { @"entries.0.color", @"#B1365F" },
- { @"entries.0.accessLevel", kGDataCalendarAccessOwner},
- { @"entries.0.overrideName", @"over-ride-name" },
- { @"entries.0.ETag", @"W/C04EQXc6fCp7ImA9WxZbGUU." },
- { @"entries.0.fieldSelection", @"@gd:*,title,gd:when" },
- { @"entries.1.locations.0", @"Joes Pub" },
- { @"entries.1.fieldSelection", nil },
- { @"entries.2.isSelected", @"0" },
- { @"entries.2.isHidden", @"1" },
-
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
-
-
- //
- // CalendarEvent Feed
- //
- { @"GDataFeedCalendarEvent", @"Tests/FeedCalendarEventTest1.xml" },
-
- // GDataFeedCalendarEvent paths
- { @"title", @"Fred Flintstone" },
- { @"subtitle", @"Fred Flintstone" },
- { @"links.0.rel", kGDataLinkRelFeed },
- { @"links.2.rel", @"self" },
- { @"authors.0.name", @"Fred Flintstone" },
- { @"authors.0.email", @"fred@gmail.com" },
- { @"identifier", @"http://www.google.com/calendar/feeds/test%40gmail.com/private/full" },
- { @"namespaces.gCal", kGDataNamespaceGCal },
-
- { @"generator.URI", @"http://www.google.com/calendar" },
- { @"generator.name", @"Google Calendar" },
- { @"generator.version", @"1.0" },
- { @"startIndex", @"1" },
- { @"itemsPerPage", @"100000" },
- { @"timeZoneName", @"America/Los_Angeles" },
- { @"timesCleaned", @"7" },
-
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
-
- // GDataEntryCalendarEvent paths
- { @"entries.0.identifier", @"contains:i12d4avieju0vogcga72aj3908" },
-
- { @"entries.0.publishedDate.RFC3339String", @"2006-10-27T22:48:14Z" },
- { @"entries.0.updatedDate.RFC3339String", @"2006-11-03T21:17:40Z" },
- { @"entries.0.title", @"3 days" },
- { @"entries.0.content", @"The description field" },
- { @"entries.0.links.0.title", @"alternate" },
- { @"entries.0.links.1.rel", @"self" },
- { @"entries.0.authors.0.name", @"Fred Flintstone" },
- { @"entries.0.authors.0.email", @"fred@gmail.com" },
- { @"entries.0.visibility", kGDataEventVisibilityDefault },
- { @"entries.0.comment.feedLink.href", @"contains:i12d4avieju0vogcga72aj3908/comments" },
- { @"entries.0.shouldSendEventNotifications", @"0" },
- { @"entries.0.isQuickAdd", @"0" },
- { @"entries.0.transparency", kGDataEventTransparencyOpaque },
- { @"entries.0.eventStatus", kGDataEventStatusConfirmed },
- { @"entries.0.participants.0.email", @"FredFlintstone@gmail.com" },
- { @"entries.0.participants.0.rel", kGDataWhoEventAttendee },
- { @"entries.0.participants.0.attendeeStatus", kGDataWhoAttendeeStatusDeclined },
- { @"entries.0.participants.1.numberOfAdditionalGuests", @"5" },
- { @"entries.0.participants.1.email", @"FredFlintstone@google.com" },
- { @"entries.0.participants.2.email", @"freg@gmail.com" },
- { @"entries.0.times.0.endTime.RFC3339String", @"2006-11-16" },
- { @"entries.0.times.0.reminders.0.minutes", @"10" },
- { @"entries.0.locations.0", @"The-where-field" },
- { @"entries.0.locations.0.rel", nil },
- { @"entries.0.sequenceNumber", @"2" },
- { @"entries.0.iCalUID", @"4A24A0FF-EA3A-4839-AA09-F4283CB6D345" },
- { @"entries.0.canGuestsModify", @"0" },
- { @"entries.0.canGuestsInviteOthers", @"0" },
- { @"entries.0.canGuestsSeeGuests", @"0" },
- { @"entries.0.canAnyoneAddSelf", @"0" },
- { @"entries.1.recurrence", @"hasPrefix:DTSTART;VALUE=DATE:20061120" },
- { @"entries.1.reminders.0.minutes", @"10" },
- { @"entries.1.isDeleted", @"0" },
- { @"entries.3.locations.0", @"Seattle" },
- { @"entries.3.isDeleted", @"1" },
- { @"entries.3.canGuestsModify", @"1" },
- { @"entries.3.canGuestsInviteOthers", @"1" },
- { @"entries.3.canGuestsSeeGuests", @"1" },
- { @"entries.3.canAnyoneAddSelf", @"1" },
-
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
-
- { @"", @"" }, // end of feed
- //
- // CalendarEvent Feed with no entries
- //
- { @"GDataFeedCalendarEvent", @"Tests/FeedCalendarEventTest0.xml" },
- // GDataFeedCalendarEvent paths
- { @"title", @"Fred Flintstone" },
- { @"subtitle", @"Fred Flintstone" },
- { @"links.0.rel", kGDataLinkRelFeed },
- { @"links.2.rel", @"self" },
- { @"authors.0.name", @"Fred Flintstone" },
- { @"authors.0.email", @"fred@gmail.com" },
- { @"identifier", @"http://www.google.com/calendar/feeds/test%40gmail.com/private/full" },
- { @"namespaces.gCal", kGDataNamespaceGCal },
- { @"generator.URI", @"http://www.google.com/calendar" },
- { @"generator.name", @"Google Calendar" },
- { @"generator.version", @"1.0" },
- { @"startIndex", @"1" },
- { @"itemsPerPage", @"100000" },
- { @"timeZoneName", @"America/Los_Angeles" },
- { @"timesCleaned", @"7" },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // GDataEntryCalendarEvent paths
- { @"entries.@count", @"0" },
- { @"", @"" }, // end of feed
- { nil, nil } // end of test array
- };
-
- [self runTests:tests];
- }
- - (void)testContactsFeed {
-
- TestKeyPathValues tests[] =
- {
- //
- // Contact Feed
- //
- { @"GDataFeedContact/2.0", @"Tests/FeedContactTest1.xml" },
-
- // GDataFeedContact paths
- { @"title", @"Contacts" },
- { @"categories.0.term", kGDataCategoryContact },
- { @"links.1.rel", kGDataLinkRelPost },
-
- { @"unknownAttributes.@count.stringValue", @"0" },
- { @"unknownChildren.@count.stringValue", @"0" },
-
- // GDataEntryContact paths
- // First entry is real; second entry is deleted
- { @"entries.0.identifier", @"contains:9cfaae9" },
- { @"entries.0.categories.0.term", kGDataCategoryContact },
- { @"entries.0.isDeleted", @"0" },
-
- { @"entries.0.primaryOrganization.orgName", @"Le Company" },
-
- { @"entries.0.organizations.0.orgName", @"Le Company" },
- { @"entries.0.organizations.0.orgTitle", @"Titularstuff" },
- { @"entries.0.organizations.0.label", nil },
- { @"entries.0.organizations.0.rel", kGDataContactOther },
- { @"entries.0.organizations.0.isPrimary", @"1" },
-
- { @"entries.0.organizations.1.orgName", @"Deadhead Associates" },
- { @"entries.0.organizations.1.orgTitle", @"Groupie" },
- { @"entries.0.organizations.1.label", @"DAz" },
- { @"entries.0.organizations.1.rel", nil },
- { @"entries.0.organizations.1.isPrimary", @"0" },
-
- { @"entries.0.primaryIMAddress.address", @"fooaimz" },
-
- { @"entries.0.IMAddresses.0.protocol", kGDataIMProtocolAIM },
- { @"entries.0.IMAddresses.0.address", @"fooaimz" },
- { @"entries.0.IMAddresses.0.label", @"werkz" },
- { @"entries.0.IMAddresses.0.isPrimary", @"1" },
-
- { @"entries.0.IMAddresses.1.protocol", kGDataIMProtocolMSN },
- { @"entries.0.IMAddresses.1.address", @"foomsn" },
- { @"entries.0.IMAddresses.1.label", nil },
- { @"entries.0.IMAddresses.1.rel", kGDataContactHome },
- { @"entries.0.IMAddresses.1.isPrimary", @"0" },
-
- { @"entries.0.IMAddresses.2.protocol", kGDataIMProtocolGoogleTalk },
- { @"entries.0.IMAddresses.2.address", @"foo@gmail.com" },
- { @"entries.0.IMAddresses.2.label", nil },
- { @"entries.0.IMAddresses.2.rel", kGDataContactOther },
- { @"entries.0.IMAddresses.2.isPrimary", @"0" },
-
- { @"entries.0.IMAddresses.3.protocol", kGDataIMProtocolJabber },
- { @"entries.0.IMAddresses.3.address", @"foo@jabber.org" },
- { @"entries.0.IMAddresses.3.label", @"jabz" },
- { @"entries.0.IMAddresses.3.rel", nil },
- { @"entries.0.IMAddresses.3.isPrimary", @"0" },
-
- { @"entries.0.primaryPhoneNumber.stringValue", @"123-4567" },
-
- { @"entries.0.phoneNumbers.0.stringValue", @"123-4567" },
- { @"entries.0.phoneNumbers.0.label", nil },
- { @"entries.0.phoneNumbers.0.rel", kGDataPhoneNumberMobile },
- { @"entries.0.phoneNumbers.0.isPrimary", @"1" },
-
- { @"entries.0.phoneNumbers.1.stringValue", @"333-1414" },
- { @"entries.0.phoneNumbers.1.label", @"shoefone" },
- { @"entries.0.phoneNumbers.1.rel", nil },
- { @"entries.0.phoneNumbers.1.isPrimary", @"0" },
-
- { @"entries.0.primaryPostalAddress.stringValue", @"123 Lane St" },
-
- { @"entries.0.postalAddresses.0.stringValue", @"123 Lane St" },
- { @"entries.0.postalAddresses.0.label", nil },
- { @"entries.0.postalAddresses.0.rel", kGDataContactHome },
- { @"entries.0.postalAddresses.0.isPrimary", @"1" },
-
- { @"entries.0.primaryEmailAddress.address", @"foo@bar.com" },
-
- { @"entries.0.emailAddresses.0.address", @"foo@bar.com" },
- { @"entries.0.emailAddresses.0.label", nil },
- { @"entries.0.emailAddresses.0.rel", kGDataContactHome },
- { @"entries.0.emailAddresses.0.isPrimary", @"1" },
-
- { @"entries.0.emailAddresses.1.address", @"2@bar.com" },
- { @"entries.0.emailAddresses.1.label", @"norzglie" },
- { @"entries.0.emailAddresses.1.rel", nil },
- { @"entries.0.emailAddresses.1.isPrimary", @"0" },
-
- { @"entries.0.groupMembershipInfos.0.href", @"http://www.google.com/m8/feeds/contactGroups/user@gmail.com/full/2" },
- { @"entries.0.groupMembershipInfos.0.isDeleted", @"1" },
-
- { @"entries.0.extendedProperties.0.name", @"com.mycompany.myprop" },
- { @"entries.0.extendedProperties.0.value", @"zoop" },
- { @"entries.0.extendedProperties.0.XMLValues", nil },
-
- { @"entries.0.extendedProperties.1.name", @"com.mycompany.myprop2" },
- { @"entries.0.extendedProperties.1.value", nil },
- { @"entries.0.extendedProperties.1.XMLValues.0.XMLString", @"<myXML><myChild attr=\"nerf\"></myChild></myXML>" },
- { @"entries.0.extendedProperties.1.unknownChildren.@count.stringValue", @"0" },
-
- { @"entries.1.identifier", @"contains:b001135" },
- { @"entries.1.categories.0.term", kGDataCategoryContact },
- { @"entries.1.isDeleted", @"1" },
-
- { @"entries.0.unknownAttributes.@count.stringValue", @"0" },
- { @"entries.0.unknownChildren.@count.stringValue", @"0" },
-
- { @"", @"" }, // end of feed
-
- //
- // Contact Feed with V3 elements
- //
- { @"GDataFeedContact/3.0", @"Tests/FeedContactTest2.xml" },
- // GDataFeedContact paths
- { @"title", @"Fred Flintstone's Contacts" },
- { @"categories.0.term", kGDataCategoryContact },
- { @"ETag", @"W/\"DkYHQHgzfCt7ImA9WxJREEU.\"" },
- { @"unknownAttributes.@count.stringValue", @"0" },
- { @"unknownChildren.@count.stringValue", @"0" },
- // GDataEntryContact paths
- { @"entries.0.identifier", @"contains:754fdf0c0db53ab3" },
- { @"entries.0.categories.0.term", kGDataCategoryContact },
- { @"entries.0.isDeleted", @"0" },
- { @"entries.0.ETag", @"\"Rno_eTVSLyt7ImA9WxJREEUORwc.\"" },
- { @"entries.0.editedDate.RFC3339String", @"2009-05-11T23:20:37Z" },
- { @"entries.0.primaryOrganization.orgName", @"Acme Corp." },
- { @"entries.0.organizations.0.orgName", @"Acme Corp." },
- { @"entries.0.organizations.0.orgTitle", nil },
- { @"entries.0.organizations.0.label", nil },
- { @"entries.0.organizations.0.rel", kGDataContactWork },
- { @"entries.0.organizations.0.isPrimary", @"1" },
- { @"entries.0.primaryIMAddress.address", nil },
- { @"entries.0.IMAddresses.0.protocol", kGDataIMProtocolGoogleTalk },
- { @"entries.0.IMAddresses.0.address", @"fredsim@example.com" },
- { @"entries.0.IMAddresses.0.label", @"main messaging addr" },
- { @"entries.0.IMAddresses.0.rel", nil },
- { @"entries.0.IMAddresses.0.isPrimary", @"0" },
- { @"entries.0.primaryPhoneNumber.stringValue", @"425-555-1234" },
- { @"entries.0.phoneNumbers.0.stringValue", @"425-555-1234" },
- { @"entries.0.phoneNumbers.0.label", @"Grand Central" },
- { @"entries.0.phoneNumbers.0.rel", nil },
- { @"entries.0.phoneNumbers.0.isPrimary", @"1" },
- { @"entries.0.phoneNumbers.1.stringValue", @"425-555-0000" },
- { @"entries.0.phoneNumbers.1.label", nil },
- { @"entries.0.phoneNumbers.1.rel", kGDataPhoneNumberCar },
- { @"entries.0.phoneNumbers.1.isPrimary", @"0" },
- { @"entries.0.primaryStructuredPostalAddress.street", @"301 Cobblestone Way" },
- { @"entries.0.structuredPostalAddresses.0.street", @"301 Cobblestone Way" },
- { @"entries.0.structuredPostalAddresses.0.postCode", @"12345" },
- { @"entries.0.structuredPostalAddresses.0.formattedAddress", @"301 Cobblestone Way\nBedrock, CA 12345\nUnited States" },
- { @"entries.0.structuredPostalAddresses.0.region", @"CA" },
- { @"entries.0.structuredPostalAddresses.0.countryName", @"United States" },
- { @"entries.0.structuredPostalAddresses.0.label", nil },
- { @"entries.0.structuredPostalAddresses.0.rel", kGDataContactHome },
- { @"entries.0.structuredPostalAddresses.0.isPrimary", @"1" },
- { @"entries.0.primaryEmailAddress.address", @"fred@example.com" },
- { @"entries.0.emailAddresses.0.address", @"fred@example.com" },
- { @"entries.0.emailAddresses.0.label", nil },
- { @"entries.0.emailAddresses.0.rel", kGDataContactHome },
- { @"entries.0.emailAddresses.0.isPrimary", @"1" },
- { @"entries.0.groupMembershipInfos.0.href", @"http://www.google.com/m8/feeds/groups/fredflintstone%40example.com/base/6" },
- { @"entries.0.groupMembershipInfos.0.isDeleted", @"0" },
- { @"entries.0.extendedProperties.0.name", @"fredprop" },
- { @"entries.0.extendedProperties.0.value", @"12345" },
- { @"entries.0.extendedProperties.0.XMLValues", nil },
- { @"entries.0.billingInformation", @"account overdue" },
- { @"entries.0.birthday", @"1990-12-01" },
- { @"entries.0.birthdayDate.timeIntervalSince1970", @"660052800" },
- { @"entries.0.calendarLinks.0.rel", nil },
- { @"entries.0.calendarLinks.0.label", @"full calendar" },
- { @"entries.0.calendarLinks.0.href", @"http://www.google.com/calendar/render" },
- { @"entries.0.primaryCalendarLink.label", @"full calendar" },
- { @"entries.0.directoryServer", @"dir server" },
- // { @"entries.0.events.0", @"" },
- { @"entries.0.externalIDs.0.label", @"ext id" },
- { @"entries.0.externalIDs.0.rel", nil },
- { @"entries.0.externalIDs.0.stringValue", @"54321" },
- { @"entries.0.gender", @"male" },
- { @"entries.0.hobbies.0.stringValue", @"gurgling" },
- { @"entries.0.initials", @"F.F." },
- { @"entries.0.jots.0.rel", kGDataContactJotHome },
- { @"entries.0.jots.0.stringValue", @"1248" },
- // { @"entries.0.languages.0", @"" },
- { @"entries.0.maidenName", @"Marshovitzky" },
- { @"entries.0.mileage", @"42 miles" },
- { @"entries.0.name.fullName", @"Fred Flintstone" },
- { @"entries.0.name.givenName", @"Fred" },
- { @"entries.0.name.familyName", @"Flintstone" },
- { @"entries.0.nickname", @"Rocks" },
- { @"entries.0.occupation", @"TV Personality" },
- { @"entries.0.priority", kGDataContactPriorityLow },
- { @"entries.0.relations.0.rel", kGDataContactRelationPartner },
- { @"entries.0.relations.0.label", nil },
- { @"entries.0.relations.0.stringValue", @"Wilma" },
- { @"entries.0.sensitivity", kGDataContactSensitivityNormal },
- { @"entries.0.shortName", @"Freddy" },
- { @"entries.0.subject", @"subject val" },
- { @"entries.0.userDefinedFields.0.key", @"Cat" },
- { @"entries.0.userDefinedFields.0.stringValue", @"Cheezeburger" },
- { @"entries.0.websiteLinks.0.href", @"http://example.com/site.html" },
- { @"entries.0.websiteLinks.0.rel", kGDataContactWebsiteLinkHomePage },
- { @"entries.0.websiteLinks.0.label", nil },
- { @"entries.0.websiteLinks.0.isPrimary", @"0" },
- { @"entries.0.where", @"The Quarry" },
- { @"entries.0.unknownAttributes.@count.stringValue", @"0" },
- { @"entries.0.unknownChildren.@count.stringValue", @"0" },
- { @"", @"" }, // end of feed
- { nil, nil } // end of test array
- };
- [self runTests:tests];
- }
- - (void)testSpreadsheetFeeds {
-
- TestKeyPathValues tests[] =
- {
- //
- // Spreadsheet feed (list of user's spreadsheets)
- //
- { @"GDataFeedSpreadsheet", @"Tests/FeedSpreadsheetTest1.xml" },
-
- // feed paths
- { @"identifier", @"http://spreadsheets.google.com/feeds/spreadsheets/private/full" },
- { @"links.2.href", @"http://spreadsheets.google.com/feeds/spreadsheets/private/full?tfe=" },
- { @"title", @"Available Spreadsheets - test@foo.net" },
-
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // entry paths
- // There is one entry
- { @"entries.0.identifier", @"http://spreadsheets.google.com/feeds/spreadsheets/private/full/o04181601172097104111.497668944883620000" },
- { @"entries.0.updatedDate.RFC3339String", @"2007-03-22T23:25:53Z" },
- { @"entries.0.categories.2.scheme", kGDataCategorySchemeSpreadsheet },
- { @"entries.0.categories.2.term", kGDataCategorySpreadsheet },
- { @"entries.0.title", @"My Test Spreadsheet" },
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"1" },
- { @"", @"" }, // end of feed
- // repeat the test, with unknown children turned off
- { @"GDataFeedSpreadsheet-ignoreUnknown", @"Tests/FeedSpreadsheetTest1.xml" },
- // feed paths
- { @"identifier", @"http://spreadsheets.google.com/feeds/spreadsheets/private/full" },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // entry paths
- // There is one entry
- { @"entries.0.identifier", @"http://spreadsheets.google.com/feeds/spreadsheets/private/full/o04181601172097104111.497668944883620000" },
- { @"entries.0.updatedDate.RFC3339String", @"2007-03-22T23:25:53Z" },
-
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
-
- { @"", @"" }, // end of feed
-
- //
- // Worksheet feed (list of a spreadsheet's worksheets)
- //
- { @"GDataFeedWorksheet", @"Tests/FeedSpreadsheetWorksheetTest1.xml" },
-
- // feed paths
- { @"identifier", @"http://spreadsheets.google.com/feeds/worksheets/o04181601172097104111.497668944883620000/private/full" },
- { @"links.2.href", @"http://spreadsheets.google.com/feeds/worksheets/o04181601172097104111.497668944883620000/private/full?tfe=" },
- { @"title", @"My Test Spreadsheet" },
- { @"authors.0.email", @"test@foo.net" },
-
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // entry paths
- // There is one entry
- { @"entries.0.identifier", @"http://spreadsheets.google.com/feeds/worksheets/o04181601172097104111.497668944883620000/private/full/od6" },
- { @"entries.0.updatedDate.RFC3339String", @"2007-03-22T23:28:50Z" },
- { @"entries.0.categories.0.scheme", kGDataCategorySchemeSpreadsheet },
- { @"entries.0.categories.0.term", kGDataCategoryWorksheet },
- { @"entries.0.title", @"Sheet1" },
- { @"entries.0.rowCount", @"100" },
- { @"entries.0.columnCount", @"20" },
-
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
-
- { @"", @"" }, // end of feed
-
- //
- // Cells feed (all of a worksheet's cells)
- //
- { @"GDataFeedSpreadsheetCell", @"Tests/FeedSpreadsheetCellsTest1.xml" },
-
- // feed paths
- { @"identifier", @"http://spreadsheets.google.com/feeds/cells/o04181601172097104111.497668944883620000/od6/private/full" },
- { @"links.0.href", @"http://spreadsheets.google.com/ccc?key=o04181601172097104111.497668944883620000" },
- { @"categories.0.scheme", kGDataCategorySchemeSpreadsheet },
- { @"categories.0.term", kGDataCategorySpreadsheetCell },
- { @"title", @"Sheet1" },
- { @"authors.0.email", @"test@foo.net" },
- { @"rowCount", @"100" },
- { @"columnCount", @"20" },
-
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // entry paths
- // The sheet looks like this (2 cols x 4 rows)
- // Fred Martha
- // =pi() =sin(A2)
- // =1.5*pi() =sin(A3)
- // =2.0*pi() =sin(A4)
-
- { @"entries.1.identifier", @"http://spreadsheets.google.com/feeds/cells/o04181601172097104111.497668944883620000/od6/private/full/R1C2" },
- { @"entries.1.updatedDate.RFC3339String", @"2007-03-22T23:28:50Z" },
- { @"entries.1.categories.0.scheme", kGDataCategorySchemeSpreadsheet },
- { @"entries.1.categories.0.term", kGDataCategorySpreadsheetCell },
- { @"entries.1.title", @"B1" },
- { @"entries.1.cell.column", @"2" },
- { @"entries.1.cell.row", @"1" },
- { @"entries.1.cell.inputString", @"Martha" },
- { @"entries.1.cell.numericValue", nil },
- { @"entries.1.cell.resultString", @"Martha" },
-
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- //
- // List feed (all of a worksheet as a list) which contains customElements
- //
-
- // feed paths
- { @"GDataFeedSpreadsheetList", @"Tests/FeedSpreadsheetListTest1.xml" },
- { @"identifier", @"http://spreadsheets.google.com/feeds/list/o04181601172097104111.497668944883620000/od6/private/full" },
- { @"links.0.href", @"http://spreadsheets.google.com/ccc?key=o04181601172097104111.497668944883620000" },
- { @"categories.0.scheme", kGDataCategorySchemeSpreadsheet },
- { @"categories.0.term", kGDataCategorySpreadsheetList },
- { @"title", @"Sheet1" },
- { @"authors.0.email", @"test@foo.net" },
-
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // entry paths
- { @"entries.1.customElementDictionary.fred", @"4.71238898038469" },
- { @"entries.1.customElementDictionary.martha", @"-1" },
-
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- //
- // Table feed
- //
- // feed paths
- { @"GDataFeedSpreadsheetTable", @"Tests/FeedSpreadsheetTableTest1.xml" },
- { @"identifier", @"http://spreadsheets.google.com/feeds/RRHuSwAKiaEGw526z3DVYw/tables" },
- { @"categories.0.scheme", kGDataCategoryScheme },
- { @"categories.0.term", kGDataCategorySpreadsheetTable },
- { @"title", @"Table of Doom" },
- { @"authors.0.email", @"fredflintstone@example.com" },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // entry paths
- { @"entries.0.content.sourceURI", @"http://spreadsheets.google.com/feeds/RRHuSwAKiaEGw526z3DVYw/records/1" },
- { @"entries.0.spreadsheetData.startIndex", @"4" },
- { @"entries.0.spreadsheetData.numberOfRows", @"3" },
- { @"entries.0.spreadsheetData.insertionMode", kGDataSpreadsheetModeInsert },
- { @"entries.0.spreadsheetData.columns.0.name", @"Column Beta" },
- { @"entries.0.spreadsheetData.columns.0.indexString", @"B" },
- { @"entries.0.spreadsheetHeader.row", @"3" },
- { @"entries.0.worksheetName", @"Sheet 1" },
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- //
- // Record feed
- //
- // feed paths
- { @"GDataFeedSpreadsheetRecord", @"Tests/FeedSpreadsheetRecordTest1.xml" },
- { @"identifier", @"http://spreadsheets.google.com/feeds/RRHuSwAKiaEGw526z3DVYw/records/1" },
- { @"categories.0.scheme", kGDataCategoryScheme },
- { @"categories.0.term", kGDataCategorySpreadsheetRecord },
- { @"title", @"Records of Doom" },
- { @"authors.0.email", @"fredflintstone@example.com" },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // entry paths
- { @"entries.0.content", @"Column Beta: clouds, Column Alpha: mars" },
- { @"entries.0.editLink.href", @"http://spreadsheets.google.com/feeds/RRHuSwAKiaEGw526z3DVYw/records/1/cn6ca" },
- { @"entries.0.fields.0.name", @"Column Beta" },
- { @"entries.0.fields.0.indexString", @"B" },
- { @"entries.0.fields.0.value", @"clouds" },
- { @"entries.0.fields.0.formula", @"3+something" },
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- { nil, nil } // end of test array
- };
- [self runTests:tests];
- }
- - (void)testAnalyticsFeeds {
- TestKeyPathValues tests[] =
- {
- //
- // Account feed
- //
- { @"GDataFeedAnalyticsAccount/2.0", @"Tests/FeedAnalyticsAccountTest1.xml" },
- // GDataFeedAnalyticsAccount paths
- { @"authors.0.name", @"Google Analytics" },
- { @"title", @"Profile list for fredflintstone@example.com" },
- { @"segments.0.name", @"All Visits" },
- { @"segments.0.analyticsID", @"gaid::-1" },
- { @"segments.0.definition", @"" },
- { @"segments.1.definition", @"ga:visitorType==New Visitor" },
- // GDataEntryAnalyticsAccount paths
- { @"entries.0.tableID", @"ga:7966084" },
- { @"entries.0.analyticsProperties.0.name", @"ga:accountId" },
- { @"entries.0.analyticsProperties.0.stringValue", @"8925159" },
- { @"entries.0.analyticsProperties.1.name", @"ga:accountName" },
- { @"entries.0.analyticsProperties.1.stringValue", @"example" },
- { @"entries.0.customVariables.0.index", @"3" },
- { @"entries.0.customVariables.0.name", @"User" },
- { @"entries.0.customVariables.0.scope", @"visitor" },
- { @"entries.0.goals.0.isActive", @"1" },
- { @"entries.0.goals.0.name", @"My Main Goal" },
- { @"entries.0.goals.0.number", @"1" },
- { @"entries.0.goals.0.value", @"1.100000023841858" },
- { @"entries.0.goals.0.destination.isCaseSensitive", @"0" },
- { @"entries.0.goals.0.destination.expression", @"/wiki/DocPage" },
- { @"entries.0.goals.0.destination.matchType", @"head" },
- { @"entries.0.goals.0.destination.isStep1Required", @"0" },
- { @"entries.0.goals.0.destination.steps.0.name", @"Wiki step" },
- { @"entries.0.goals.0.destination.steps.0.number", @"1" },
- { @"entries.0.goals.0.destination.steps.0.path", @"/wiki" },
- { @"entries.0.goals.0.engagement", nil },
- { @"", @"" }, // end of feed
- //
- // Data feed
- //
- { @"GDataFeedAnalyticsData/2.0", @"Tests/FeedAnalyticsDataTest1.xml" },
- // GDataFeedAnalyticsData paths
- { @"authors.0.name", @"Google Analytics" },
- { @"title", @"Google Analytics Data for Profile 7966084" },
- { @"startDateString", @"2009-05-18" },
- { @"endDateString", @"2009-05-20" },
- { @"aggregateGroup.metrics.0.confidenceInterval", @"0" },
- { @"aggregateGroup.metrics.0.name", @"ga:pageviews" },
- { @"aggregateGroup.metrics.0.type", kGDataMetricTypeInteger },
- { @"aggregateGroup.metrics.0.stringValue", @"12" },
- { @"aggregateGroup.metrics.0.doubleValue", @"12" },
- { @"dataSources.0.tableID", @"ga:7966084" },
- { @"dataSources.0.tableName", @"www.example.net" },
- { @"dataSources.0.analyticsProperties.0.name", @"ga:profileId" },
- { @"dataSources.0.analyticsProperties.0.stringValue", @"7966084" },
- { @"dataSources.0.analyticsPropertyWithNameAccountName.stringValue", @"example" },
- { @"segments.0.name", @"New Visitors" },
- { @"segments.0.analyticsID", @"gaid::-2" },
- { @"segments.0.definition", @"ga:visitorType==New Visitor" },
- // GDataEntryAnalyticsData paths
- { @"entries.0.title", @"ga:country=United States" },
- { @"entries.0.dimensions.0.name", @"ga:country" },
- { @"entries.0.dimensions.0.stringValue", @"United States" },
- { @"entries.0.dimensionWithNameCountry.stringValue", @"United States" },
- { @"entries.0.metrics.0.confidenceInterval", @"5.1" },
- { @"entries.0.metrics.0.name", @"ga:pageviews" },
- { @"entries.0.metrics.0.type", kGDataMetricTypeInteger },
- { @"entries.0.metrics.0.stringValue", @"37" },
- { @"entries.0.metrics.0.doubleValue", @"37" },
- { @"entries.0.metricWithNamePageviews.stringValue", @"37" },
- { @"", @"" }, // end of feed
- { nil, nil } // end of test array
- };
- [self runTests:tests];
- }
- - (void)testCodeSearchFeed {
-
- TestKeyPathValues tests[] =
- {
- //
- // Feed of a user's albums
- //
- { @"GDataFeedCodeSearch", @"Tests/FeedCodeSearchTest1.xml" },
-
- // GDataFeedCodeSearch paths
- { @"authors.0.name", @"Google Code Search" },
- { @"authors.0.URI", @"http://www.google.com/codesearch" },
- // GDataEntryCodeSearch paths
- { @"entries.0.package.name", @"http://ftp.funet.fi/pub/CPAN/src/perl-5.9.1.tar.gz" },
- { @"entries.0.package.URI", @"http://ftp.funet.fi/pub/CPAN/src/perl-5.9.1.tar.gz" },
- { @"entries.1.package.name", @"http://gentoo.osuosl.org/distfiles/Perl6-Pugs-6.2.12.tar.gz" },
- { @"entries.1.package.URI", @"http://gentoo.osuosl.org/distfiles/Perl6-Pugs-6.2.12.tar.gz" },
- { @"entries.1.file.name", @"Perl6-Pugs-6.2.12/t/subroutines/sub_named_params.t" },
- { @"entries.1.matches.0.lineNumberString", @"131" },
- { @"entries.1.matches.0.type", @"text/html" },
- { @"entries.1.matches.0", @"hasPrefix:<pre>my %fellowship" },
- { @"entries.1.matches.1.lineNumberString", @"132" },
- { @"entries.1.matches.1.type", @"text/html" },
- { @"entries.1.matches.1", @"hasPrefix:<pre>is(%fellowship<hobbit>" },
-
- { @"", @"" }, // end of feed
-
- { nil, nil } // end of test array
- };
-
- [self runTests:tests];
- }
- - (void)testPhotosFeeds {
-
- // TODO: test geoLocation once we have a good sample of it
-
- // Test a non-ASCII character and some html characters in a TextConstruct.
- // We'll allocate it dynamically since source code cannot contain non-ASCII.
- NSString *templateStr = @"Test %C Alb%Cm";
- NSString *photoAlbumName = [NSString stringWithFormat:templateStr,
- 0x262F, 0x00FC]; // yin yang, u with umlaut
-
- // Non-ascii photo description, includes the Wheel of Dharma
- NSString *photoDescriptionText = [NSString stringWithFormat:
- @"Caption for the car %C photo", 0x2638];
- TestKeyPathValues tests[] =
- {
- //
- // Feed of a user's albums
- //
- { @"GDataFeedPhotoUser", @"Tests/FeedPhotosUserAlbum1.xml" },
- // GDataFeedPhotosAlbum paths
- { @"username", @"TestdomainTestAccount" },
- { @"nickname", @"Greg" },
- { @"thumbnail", @"hasPrefix:http://lh3.google.com/image/TestdomainTestAccount" },
- { @"quotaLimit", @"1073741824" },
- { @"quotaUsed", @"108303" },
- { @"maxPhotosPerAlbum", @"500" },
- { @"categories.0.term", kGDataCategoryPhotosUser },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // GDataEntryPhotoAlbum paths
- { @"entries.0.categories.0.term", kGDataCategoryPhotosAlbum },
- { @"entries.0.mediaGroup.mediaTitle", photoAlbumName },
- { @"entries.0.mediaGroup.mediaDescription", @"Album description" },
- { @"entries.0.mediaGroup.mediaCredits.0", @"Greg" },
- { @"entries.0.mediaGroup.mediaContents.0.medium", @"image" },
- { @"entries.0.mediaGroup.mediaContents.0.type", @"image/jpeg" },
- { @"entries.0.mediaGroup.mediaContents.0.URLString", @"hasPrefix:http://lh5.google.com/image/TestdomainTestAccount" },
- { @"entries.0.mediaGroup.mediaThumbnails.0.height", @"160" },
- { @"entries.0.mediaGroup.mediaThumbnails.0.URLString", @"hasPrefix:http://lh5.google.com/image/TestdomainTestAccount" },
- { @"entries.0.GPhotoID", @"5067143575034336993" },
- { @"entries.0.access", @"public" },
- { @"entries.0.photosUsed", @"2" },
- { @"entries.0.commentCount", @"0" },
- { @"entries.0.bytesUsed", @"108303" },
- { @"entries.0.nickname", @"Greg" },
- { @"entries.0.photosLeft", @"498" },
- { @"entries.0.commentsEnabled", @"1" },
- { @"entries.0.location", @"Album Site" },
- { @"entries.0.timestamp.dateValue.timeIntervalSince1970", @"1179730800" },
- { @"entries.0.username", @"TestdomainTestAccount" },
- { @"entries.0.identifier", @"http://photos.googleapis.com/data/entry/api/user/TestdomainTestAccount/albumid/5067143575034336993" },
- { @"entries.0.title.type", @"text" },
- { @"entries.0.title", photoAlbumName },
- { @"entries.0.photoDescription", @"Album description" },
- { @"entries.0.rightsString", @"public" },
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- //
- // Feed of an album's photos
- //
- { @"GDataFeedPhotoAlbum/2.0", @"Tests/FeedPhotosAlbumPhoto1.xml" },
- // GDataFeedPhotoAlbum - feed paths
- { @"GPhotoID", @"5067143575034336993" },
- { @"access", @"public" },
- { @"photosUsed", @"2" },
- { @"commentCount", @"0" },
- { @"bytesUsed", @"108303" },
- { @"nickname", @"Greg" },
- { @"photosLeft", @"498" },
- { @"commentsEnabled", @"1" },
- { @"location", @"Album Site" },
- { @"timestamp.dateValue.timeIntervalSince1970", @"1179730800" },
- { @"username", @"TestdomainTestAccount" },
- { @"identifier", @"http://photos.googleapis.com/data/feed/api/user/test%40testdomain.net/albumid/5067143575034336993" },
- { @"title.type", @"text" },
- { @"title", photoAlbumName },
- { @"photoDescription", @"Album description" },
- { @"rights", @"public" },
- { @"categories.0.term", kGDataCategoryPhotosAlbum },
- { @"feedLink.href", @"contains:albumid/5067143575034336993" },
- { @"feedLink.rel", kGDataLinkRelFeed },
- { @"postLink.href", @"contains:albumid/5067143575034336993" },
- { @"postLink.rel", kGDataLinkRelPost },
- { @"alternateLink.href", @"contains:/TestAlbM" },
- { @"alternateLink.rel", @"alternate" },
- { @"selfLink.href", @"contains:test%40testdomain.net/albumid/5067143575034336993?start-index=1" },
- { @"selfLink.rel", @"self" },
- { @"firstEntry.GPhotoID", @"5067143579329304306" },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // GDataEntryPhoto - entry paths
- { @"entries.0.categories.0.term", kGDataCategoryPhotosPhoto },
- { @"entries.0.checksum", @"23512309abbs298" },
- { @"entries.0.GPhotoID", @"5067143579329304306" },
- { @"entries.0.albumID", @"5067143575034336993" },
- { @"entries.0.width", @"660" },
- { @"entries.0.height", @"433" },
- { @"entries.0.videoStatus", kGDataPhotoStatusReady },
- { @"entries.0.commentsEnabled", @"1" },
- { @"entries.0.size", @"87225" },
- { @"entries.0.commentCount", @"1" },
- { @"entries.0.timestamp.dateValue.timeIntervalSince1970", @"1179786301" },
- { @"entries.0.title", @"Car.jpg" },
- { @"entries.0.photoDescription", photoDescriptionText },
- { @"entries.0.content.sourceURI", @"http://lh3.google.com/image/TestdomainTestAccount/RlIcPQ_TFvI/AAAAAAAAAAs/3fvWtQLN3KI/Car.jpg" },
- { @"entries.0.content.type", @"image/jpeg" },
- { @"entries.0.mediaGroup.mediaTitle", @"Car.jpg" },
- { @"entries.0.mediaGroup.mediaDescription", photoDescriptionText },
- { @"entries.0.mediaGroup.mediaCredits.0", @"Greg" },
- { @"entries.0.mediaGroup.mediaContents.0.medium", @"image" },
- { @"entries.0.mediaGroup.mediaContents.0.type", @"image/jpeg" },
- { @"entries.0.mediaGroup.mediaContents.0.URLString", @"http://lh3.google.com/image/TestdomainTestAccount/RlIcPQ_TFvI/AAAAAAAAAAs/3fvWtQLN3KI/Car.jpg" },
- { @"entries.0.mediaGroup.mediaThumbnails.0.height", @"47" },
- { @"entries.0.mediaGroup.mediaThumbnails.0.width", @"72" },
- { @"entries.0.mediaGroup.mediaThumbnails.0.URLString", @"http://lh3.google.com/image/TestdomainTestAccount/RlIcPQ_TFvI/AAAAAAAAAAs/3fvWtQLN3KI/Car.jpg?imgmax=72" },
- { @"entries.0.mediaGroup.mediaKeywords", @"headlight, red car" },
- { @"entries.0.EXIFTags.tagDictionary.exposure", @"0.0080" },
- { @"entries.0.EXIFTags.tagDictionary.imageUniqueID", @"d8a9e8fd57a384d216f4b2a853d654fc" },
- { @"entries.0.editMediaLink.href", @"contains:5067143579329304306" },
- { @"entries.0.editMediaLink.type", @"image/jpeg" },
- { @"entries.0.alternateLink.href", @"contains:photo#5067143579329304306" },
- { @"entries.0.alternateLink.type", kGDataLinkTypeHTML },
- { @"entries.0.HTMLLink.href", @"contains:photo#5067143579329304306" },
- { @"entries.0.selfLink.href", @"contains:photoid/5067143579329304306" },
- { @"entries.0.selfLink.type", kGDataLinkTypeAtom },
- { @"entries.0.feedLink.href", @"contains:photoid/5067143579329304306" },
- { @"entries.0.feedLink.type", kGDataLinkTypeAtom },
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- //
- // Feed of a photo's comments
- //
- { @"GDataFeedPhoto/2.0", @"Tests/FeedPhotosPhotoComment1.xml" },
- // GDataFeedPhoto - feed paths
- { @"generator.URI", @"http://photos.google.com/" },
- { @"generator.name", @"Google Photos" },
- { @"generator.version", @"1.00" },
- { @"EXIFTags.tagDictionary.exposure", @"0.0080" },
- { @"categories.0.term", kGDataCategoryPhotosPhoto },
- { @"EXIFTags.tagDictionary.imageUniqueID", @"d8a9e8fd57a384d216f4b2a853d654fc" },
- { @"checksum", @"23512309abbs298" },
- { @"GPhotoID", @"5067143579329304306" },
- { @"albumID", @"5067143575034336993" },
- { @"width", @"660" },
- { @"height", @"433" },
- { @"commentsEnabled", @"1" },
- { @"size", @"87225" },
- { @"commentCount", @"1" },
- { @"timestamp.dateValue.timeIntervalSince1970", @"1179786301" },
- { @"title", @"Car.jpg" },
- { @"photoDescription", photoDescriptionText },
- { @"icon", @"http://lh3.google.com/image/TestdomainTestAccount/RlIcPQ_TFvI/AAAAAAAAAAs/3fvWtQLN3KI/Car.jpg?imgmax=288" },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // GDataEntryPhotoComment - entry paths
- { @"entries.0.photoID", @"5067143579329304306" },
- { @"entries.0.GPhotoID", @"5067146044640532244" },
- { @"entries.0.categories.0.term", kGDataCategoryPhotosComment },
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- //
- // Feed of a user's tags
- //
- // GDataFeedPhotoUser - feed paths
- { @"GDataFeedPhotoUser", @"Tests/FeedPhotosUserTag1.xml" },
- { @"username", @"TestdomainTestAccount" },
- { @"nickname", @"Greg" },
- { @"thumbnail", @"hasPrefix:http://lh3.google.com/image/TestdomainTestAccount" },
- { @"quotaLimit", @"1073741824" },
- { @"quotaUsed", @"108303" },
- { @"maxPhotosPerAlbum", @"500" },
- { @"categories.0.term", kGDataCategoryPhotosUser },
- { @"unknownAttributes.@count", @"0" },
- { @"unknownChildren.@count", @"0" },
- // GDataEntryPhotoTag - entry paths
-
- { @"entries.0.title", @"headlight" },
- { @"entries.0.photoDescription", @"headlight" },
- { @"entries.0.categories.0.term", kGDataCategoryPhotosTag },
- { @"entries.0.unknownAttributes.@count", @"0" },
- { @"entries.0.unknownChildren.@count", @"0" },
- { @"entries.1.title", @"red car" },
- { @"entries.1.photoDescription", @"red car" },
- { @"entries.1.categories.0.term", kGDataCategoryPhotosTag },
- { @"entries.1.unknownAttributes.@count", @"0" },
- { @"entries.1.unknownChildren.@count", @"0" },
- { @"", @"" }, // end of feed
- //
- // Feed of a user entry
- //
- // This is really a fake feed created by requesting just a single
- // user entry from the picasa server, using
- // GET http://photos.googleapis.com/data/entry/api/user/<username>
- //
-
- // GDataFeedPhotoUser - feed paths (none)
-
- // GDataEntryPhotoUser - entry paths
- { @"GDataFeedPhotoUser", @"Tests/FeedPhotosUserEntry1.xml" },
- { @"entries.0.nickname", @"Greg" },
- { @"entries.0.username", @"TestdomainTestAccount" },
- { @"entries.0.thumbnail", @"hasPrefix:http://lh3.google.com/image/TestdomainTestAccount/AAAAUbcFQeo" },
- { @"entries.0.identifier", @"http://photos.googleapis.com/data/entry/api/user/TestdomainTestAccount" },
- { @"entries.0.categories.0.term", kGDataCategoryPhotosUser },
-
- { @"entries.0.unknownAttributes.@count",…