1 5 package com.sun.syndication.unittest; 6 7 import com.sun.syndication.feed.synd.SyndEntry; 8 import com.sun.syndication.io.impl.DateParser; 9 10 import java.util.List ; 11 import java.util.Date ; 12 13 17 public class TestSyndFeedRSS091N extends TestSyndFeedRSS090 { 18 19 public TestSyndFeedRSS091N() { 20 super("rss_0.91N", "rss_0.91N.xml"); 21 } 22 23 protected TestSyndFeedRSS091N(String type) { 24 super(type); 25 } 26 27 protected TestSyndFeedRSS091N(String feedType,String feedFileName) { 28 super(feedType,feedFileName); 29 } 30 31 public void testLanguage() throws Exception { 32 assertProperty(getCachedSyndFeed().getLanguage(),"channel.language"); 33 } 34 35 public void testCopyright() throws Exception { 36 assertProperty(getCachedSyndFeed().getCopyright(),"channel.copyright"); 37 } 38 39 public void testPublishedDate() throws Exception { 40 Date d = DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT"); 41 assertEquals(getCachedSyndFeed().getPublishedDate(),d); 42 } 43 44 public void testAuthor() throws Exception { 45 assertProperty(getCachedSyndFeed().getAuthor(),"channel.managingEditor"); 46 } 47 48 public void testImageTitle() throws Exception { 49 assertProperty(getCachedSyndFeed().getImage().getTitle(),"channel.image.title"); 50 } 51 52 public void testImageUrl() throws Exception { 53 assertProperty(getCachedSyndFeed().getImage().getUrl(),"channel.image.url"); 54 } 55 56 public void testImageLink() throws Exception { 57 assertProperty(getCachedSyndFeed().getImage().getLink(),"channel.image.link"); 58 } 59 60 public void testImageDescription() throws Exception { 61 assertProperty(getCachedSyndFeed().getImage().getDescription(),"channel.image.description"); 62 } 63 64 protected void _testItem(int i) throws Exception { 65 List items = getCachedSyndFeed().getEntries(); 66 SyndEntry entry = (SyndEntry) items.get(i); 67 assertProperty(entry.getTitle(),"channel.item["+i+"].title"); 68 assertProperty(entry.getLink(),"channel.item["+i+"].link"); 69 assertProperty(entry.getDescription().getValue(),"channel.item["+i+"].description"); 70 } 71 72 } 73 | Popular Tags |