1 5 package com.sun.syndication.unittest; 6 7 import com.sun.syndication.feed.synd.SyndEntry; 8 9 import java.util.List ; 10 11 15 public class TestSyndFeedRSS090 extends SyndFeedTest { 16 17 public TestSyndFeedRSS090() { 18 super("rss_0.9"); 19 } 20 21 protected TestSyndFeedRSS090(String type) { 22 super(type); 23 } 24 25 protected TestSyndFeedRSS090(String feedType,String feedFileName) { 26 super(feedType,feedFileName); 27 } 28 29 public void testTitle() throws Exception { 30 assertProperty(getCachedSyndFeed().getTitle(),"channel.title"); 31 } 32 33 public void testLink() throws Exception { 34 assertProperty( getCachedSyndFeed().getLink(),"channel.link"); 35 } 36 37 public void testDescription() throws Exception { 38 assertProperty(getCachedSyndFeed().getDescription(),"channel.description"); 39 } 40 41 public void testImageTitle() throws Exception { 42 assertProperty(getCachedSyndFeed().getImage().getTitle(),"image.title"); 43 } 44 45 public void testImageUrl() throws Exception { 46 assertProperty(getCachedSyndFeed().getImage().getUrl(),"image.url"); 47 } 48 49 public void testImageLink() throws Exception { 50 assertProperty(getCachedSyndFeed().getImage().getLink(),"image.link"); 51 } 52 53 protected void _testItem(int i) throws Exception { 54 List items = getCachedSyndFeed().getEntries(); 55 SyndEntry entry = (SyndEntry) items.get(i); 56 assertProperty(entry.getTitle(),"item["+i+"].title"); 57 assertProperty(entry.getLink(),"item["+i+"].link"); 58 } 59 60 public void testItem0() throws Exception { 61 _testItem(0); 62 } 63 64 public void testItem1() throws Exception { 65 _testItem(1); 66 } 67 68 } 69 | Popular Tags |