use of com.zimbra.client.ZCalDataSource in project zm-mailbox by Zimbra.
the class TestDataSource method disabledTestCal.
// XXX bburtin: disabled test due to bug 37222 (unable to parse Google calendar).
public void disabledTestCal() throws Exception {
// Create folder.
ZMailbox mbox = TestUtil.getZMailbox(USER_NAME);
String parentId = Integer.toString(Mailbox.ID_FOLDER_USER_ROOT);
String urlString = "http://www.google.com/calendar/ical/k2kh7ncij3s05dog63g0o0n254%40group.calendar.google.com/public/basic.ics";
ZFolder folder;
try {
folder = mbox.createFolder(parentId, NAME_PREFIX + " testCal", ZFolder.View.appointment, null, null, urlString);
} catch (ServiceException e) {
assertEquals(ServiceException.RESOURCE_UNREACHABLE, e.getCode());
ZimbraLog.test.warn("Unable to test calendar data source for %s: %s", urlString, e.toString());
return;
}
// Get the data source that was implicitly created.
ZCalDataSource ds = (ZCalDataSource) getDataSource(mbox, folder.getId());
assertNotNull(ds);
// Test data source. If the test fails, skip validation so we don't
// get false positives when the feed is down or the test
// is running on a box that's not connected to the internet.
String error = mbox.testDataSource(ds);
if (error != null) {
ZimbraLog.test.warn("Unable to test iCal data source for %s: %s.", urlString, error);
return;
}
// Import data and confirm that the folder is not empty.
List<ZDataSource> list = new ArrayList<ZDataSource>();
list.add(ds);
mbox.importData(list);
waitForData(mbox, folder);
// Delete folder, import data, and make sure that the data source was deleted.
mbox.deleteFolder(folder.getId());
mbox.importData(list);
ds = (ZCalDataSource) getDataSource(mbox, folder.getId());
assertNull(ds);
}
Aggregations