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: import com.sun.syndication.io.impl.DateParser;
09:
10: import java.util.List;
11: import java.util.Date;
12:
13: /**
14: * @author pat
15: *
16: */
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(),
33: "channel.language");
34: }
35:
36: public void testCopyright() throws Exception {
37: assertProperty(getCachedSyndFeed().getCopyright(),
38: "channel.copyright");
39: }
40:
41: public void testPublishedDate() throws Exception {
42: Date d = DateParser
43: .parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT");
44: assertEquals(getCachedSyndFeed().getPublishedDate(), d);
45: }
46:
47: public void testAuthor() throws Exception {
48: assertProperty(getCachedSyndFeed().getAuthor(),
49: "channel.managingEditor");
50: }
51:
52: public void testImageTitle() throws Exception {
53: assertProperty(getCachedSyndFeed().getImage().getTitle(),
54: "channel.image.title");
55: }
56:
57: public void testImageUrl() throws Exception {
58: assertProperty(getCachedSyndFeed().getImage().getUrl(),
59: "channel.image.url");
60: }
61:
62: public void testImageLink() throws Exception {
63: assertProperty(getCachedSyndFeed().getImage().getLink(),
64: "channel.image.link");
65: }
66:
67: public void testImageDescription() throws Exception {
68: assertProperty(getCachedSyndFeed().getImage().getDescription(),
69: "channel.image.description");
70: }
71:
72: protected void _testItem(int i) throws Exception {
73: List items = getCachedSyndFeed().getEntries();
74: SyndEntry entry = (SyndEntry) items.get(i);
75: assertProperty(entry.getTitle(), "channel.item[" + i
76: + "].title");
77: assertProperty(entry.getLink(), "channel.item[" + i + "].link");
78: assertProperty(entry.getDescription().getValue(),
79: "channel.item[" + i + "].description");
80: }
81:
82: }
|