KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > syndication > unittest > TestSyndFeedRSS090


1 /*
2  * Created on Jun 24, 2004
3  *
4  */

5 package com.sun.syndication.unittest;
6
7 import com.sun.syndication.feed.synd.SyndEntry;
8
9 import java.util.List JavaDoc;
10
11 /**
12  * @author pat
13  *
14  */

15 public class TestSyndFeedRSS090 extends SyndFeedTest {
16
17     public TestSyndFeedRSS090() {
18         super("rss_0.9");
19     }
20
21     protected TestSyndFeedRSS090(String JavaDoc type) {
22         super(type);
23     }
24
25     protected TestSyndFeedRSS090(String JavaDoc feedType,String JavaDoc feedFileName) {
26         super(feedType,feedFileName);
27     }
28
29     public void testTitle() throws Exception JavaDoc {
30         assertProperty(getCachedSyndFeed().getTitle(),"channel.title");
31     }
32
33     public void testLink() throws Exception JavaDoc {
34         assertProperty( getCachedSyndFeed().getLink(),"channel.link");
35     }
36
37     public void testDescription() throws Exception JavaDoc {
38         assertProperty(getCachedSyndFeed().getDescription(),"channel.description");
39     }
40
41     public void testImageTitle() throws Exception JavaDoc {
42         assertProperty(getCachedSyndFeed().getImage().getTitle(),"image.title");
43     }
44
45     public void testImageUrl() throws Exception JavaDoc {
46         assertProperty(getCachedSyndFeed().getImage().getUrl(),"image.url");
47     }
48
49     public void testImageLink() throws Exception JavaDoc {
50         assertProperty(getCachedSyndFeed().getImage().getLink(),"image.link");
51     }
52
53     protected void _testItem(int i) throws Exception JavaDoc {
54         List JavaDoc 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 JavaDoc {
61         _testItem(0);
62     }
63
64     public void testItem1() throws Exception JavaDoc {
65         _testItem(1);
66     }
67
68 }
69
Popular Tags