01: /*
02: * Created on Jun 24, 2004
03: *
04: */
05: package com.sun.syndication.unittest;
06:
07: import com.sun.syndication.feed.synd.SyndEntry;
08:
09: import java.util.List;
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 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(),
39: "channel.description");
40: }
41:
42: public void testImageTitle() throws Exception {
43: assertProperty(getCachedSyndFeed().getImage().getTitle(),
44: "image.title");
45: }
46:
47: public void testImageUrl() throws Exception {
48: assertProperty(getCachedSyndFeed().getImage().getUrl(),
49: "image.url");
50: }
51:
52: public void testImageLink() throws Exception {
53: assertProperty(getCachedSyndFeed().getImage().getLink(),
54: "image.link");
55: }
56:
57: protected void _testItem(int i) throws Exception {
58: List items = getCachedSyndFeed().getEntries();
59: SyndEntry entry = (SyndEntry) items.get(i);
60: assertProperty(entry.getTitle(), "item[" + i + "].title");
61: assertProperty(entry.getLink(), "item[" + i + "].link");
62: }
63:
64: public void testItem0() throws Exception {
65: _testItem(0);
66: }
67:
68: public void testItem1() throws Exception {
69: _testItem(1);
70: }
71:
72: }
|