1 4 package com.openedit.blog; 5 6 import java.util.Date ; 7 import java.util.List ; 8 9 import org.openedit.blog.modules.BlogModule; 10 11 import com.openedit.BaseTestCase; 12 import com.openedit.WebPageRequest; 13 14 public class PageCommentTest extends BaseTestCase 15 { 16 17 public PageCommentTest(String inName) 18 { 19 super( inName); 20 } 21 22 public void testComment() throws Exception 23 { 24 BlogModule blogmodule = (BlogModule)getBean("BlogModule"); 25 WebPageRequest req = getFixture().createPageRequest("/index.html"); 28 String name = req.getPage().getProperty("blogarchivename"); 29 assertEquals("DynamicBlogArchive",name); 30 Blog blog = blogmodule.getBlog(req); 32 BlogEntry entry = blog.getEntry("/sub/link.html"); 33 assertNotNull(entry); 34 35 List list = entry.getComments(); 36 assertNotNull(list); 37 38 Comment comment = new Comment(); 39 comment.setAuthor("admin"); 40 comment.setContent("This is a test"); 41 comment.setId("dsdfdfdfdf"); 42 comment.setDateTime(new Date ()); 43 comment.setVisible(true); 44 45 entry.addComment(comment); 46 47 48 49 50 } 51 52 } 53 | Popular Tags |