當前位置: 首頁>>代碼示例>>Java>>正文


Java AttachmentEntry.setUpdated方法代碼示例

本文整理匯總了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);
}
 
開發者ID:sih4sing5hong5,項目名稱:google-sites-liberation,代碼行數:34,代碼來源:PageExporterImplTest.java

示例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);
}
 
開發者ID:sih4sing5hong5,項目名稱:google-sites-liberation,代碼行數:81,代碼來源:PageExporterImplTest.java


注:本文中的com.google.gdata.data.sites.AttachmentEntry.setUpdated方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。