本文整理汇总了Java中com.google.gdata.data.sites.AttachmentEntry.setUpdated方法的典型用法代码示例。如果您正苦于以下问题:Java AttachmentEntry.setUpdated方法的具体用法?Java AttachmentEntry.setUpdated怎么用?Java AttachmentEntry.setUpdated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gdata.data.sites.AttachmentEntry
的用法示例。
在下文中一共展示了AttachmentEntry.setUpdated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFileCabinetExport
import com.google.gdata.data.sites.AttachmentEntry; //导入方法依赖的package包/类
@Test
public void testFileCabinetExport() throws IOException {
final FileCabinetPageEntry entry = new FileCabinetPageEntry();
entry.setId("entry");
entry.setTitle(new PlainTextConstruct("entry"));
final AttachmentEntry attachment1 = new AttachmentEntry();
attachment1.setId("attachment1");
attachment1.setUpdated(DateTime.parseDateTime("2009-08-06T16:08:12.107Z"));
EntryUtils.setParentId(attachment1, entry.getId());
final AttachmentEntry attachment2 = new AttachmentEntry();
attachment2.setId("attachment2");
attachment2.setUpdated(DateTime.parseDateTime("2009-08-06T16:26:57.019Z"));
EntryUtils.setParentId(attachment2, entry.getId());
entryStore.addEntry(entry);
entryStore.addEntry(attachment1);
entryStore.addEntry(attachment2);
final List<BaseContentEntry<?>> attachments = Lists.newArrayList();
attachments.add(attachment2);
attachments.add(attachment1);
context.checking(new Expectations() {{
oneOf (titleRenderer).renderTitle(entry);
will(returnValue(new XmlElement("div")));
oneOf (contentRenderer).renderContent(entry, false);
will(returnValue(new XmlElement("div")));
oneOf (fileCabinetRenderer).renderFileCabinet(with(equal(attachments)));
will(returnValue(new XmlElement("div")));
}});
exporter.exportPage(entry, entryStore, out, false);
}
示例2: testNormalExport
import com.google.gdata.data.sites.AttachmentEntry; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testNormalExport() throws IOException {
final BasePageEntry<?> grandparent = new WebPageEntry();
grandparent.setId("grandparent");
grandparent.setTitle(new PlainTextConstruct("grandparent"));
grandparent.setPageName(new PageName("grandparent"));
final BasePageEntry<?> parent = new WebPageEntry();
parent.setId("parent");
EntryUtils.setParentId(parent, grandparent.getId());
final BasePageEntry<?> entry = new WebPageEntry();
entry.setId("entry");
entry.setTitle(new PlainTextConstruct("entry"));
EntryUtils.setParentId(entry, parent.getId());
final BasePageEntry<?> subpage1 = new WebPageEntry();
subpage1.setId("subpage1");
subpage1.setTitle(new PlainTextConstruct("subpage1"));
EntryUtils.setParentId(subpage1, entry.getId());
final BasePageEntry<?> subpage2 = new WebPageEntry();
subpage2.setId("subpage2");
subpage2.setTitle(new PlainTextConstruct("subpage2"));
EntryUtils.setParentId(subpage2, entry.getId());
final AttachmentEntry attachment1 = new AttachmentEntry();
attachment1.setId("attachment1");
attachment1.setUpdated(DateTime.parseDateTime("2009-08-06T16:08:12.107Z"));
EntryUtils.setParentId(attachment1, entry.getId());
final AttachmentEntry attachment2 = new AttachmentEntry();
attachment2.setId("attachment2");
attachment2.setUpdated(DateTime.parseDateTime("2009-08-06T16:26:57.019Z"));
EntryUtils.setParentId(attachment2, entry.getId());
final CommentEntry comment1 = new CommentEntry();
comment1.setId("comment1");
comment1.setUpdated(DateTime.parseDateTime("2009-08-06T16:08:12.107Z"));
EntryUtils.setParentId(comment1, entry.getId());
final CommentEntry comment2 = new CommentEntry();
comment2.setId("comment2");
comment2.setUpdated(DateTime.parseDateTime("2009-08-06T16:26:57.019Z"));
EntryUtils.setParentId(comment2, entry.getId());
entryStore.addEntry(grandparent);
entryStore.addEntry(parent);
entryStore.addEntry(entry);
entryStore.addEntry(subpage1);
entryStore.addEntry(subpage2);
entryStore.addEntry(attachment1);
entryStore.addEntry(attachment2);
entryStore.addEntry(comment1);
entryStore.addEntry(comment2);
final List<BasePageEntry<?>> ancestors = Lists.newArrayList();
ancestors.add(grandparent);
ancestors.add(parent);
final List<BasePageEntry<?>> subpages = Lists.newArrayList();
subpages.add(subpage1);
subpages.add(subpage2);
final List<BaseContentEntry<?>> attachments = Lists.newArrayList();
attachments.add(attachment2);
attachments.add(attachment1);
final List<CommentEntry> comments = Lists.newArrayList();
comments.add(comment2);
comments.add(comment1);
context.checking(new Expectations() {{
oneOf (ancestorLinksRenderer).renderAncestorLinks(
with(equal(ancestors)));
will(returnValue(new XmlElement("div")));
oneOf (titleRenderer).renderTitle(entry);
will(returnValue(new XmlElement("div")));
oneOf (contentRenderer).renderContent(entry, false);
will(returnValue(new XmlElement("div")));
oneOf (subpageLinksRenderer).renderSubpageLinks(with(equal(subpages)));
will(returnValue(new XmlElement("div")));
oneOf (attachmentsRenderer).renderAttachments(with(equal(attachments)));
will(returnValue(new XmlElement("div")));
oneOf (commentsRenderer).renderComments(with(equal(comments)));
will(returnValue(new XmlElement("div")));
}});
exporter.exportPage(entry, entryStore, out, false);
}