KickJava   Java API By Example, From Geeks To Geeks.

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


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 import com.sun.syndication.io.impl.DateParser;
9
10 import java.util.List JavaDoc;
11 import java.util.Date JavaDoc;
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 JavaDoc type) {
24         super(type);
25     }
26
27     protected TestSyndFeedRSS091N(String JavaDoc feedType,String JavaDoc feedFileName) {
28         super(feedType,feedFileName);
29     }
30
31     public void testLanguage() throws Exception JavaDoc {
32         assertProperty(getCachedSyndFeed().getLanguage(),"channel.language");
33     }
34
35     public void testCopyright() throws Exception JavaDoc {
36         assertProperty(getCachedSyndFeed().getCopyright(),"channel.copyright");
37     }
38
39     public void testPublishedDate() throws Exception JavaDoc {
40         Date JavaDoc d = DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT");
41         assertEquals(getCachedSyndFeed().getPublishedDate(),d);
42     }
43
44     public void testAuthor() throws Exception JavaDoc {
45         assertProperty(getCachedSyndFeed().getAuthor(),"channel.managingEditor");
46     }
47
48     public void testImageTitle() throws Exception JavaDoc {
49         assertProperty(getCachedSyndFeed().getImage().getTitle(),"channel.image.title");
50     }
51
52     public void testImageUrl() throws Exception JavaDoc {
53         assertProperty(getCachedSyndFeed().getImage().getUrl(),"channel.image.url");
54     }
55
56     public void testImageLink() throws Exception JavaDoc {
57         assertProperty(getCachedSyndFeed().getImage().getLink(),"channel.image.link");
58     }
59
60     public void testImageDescription() throws Exception JavaDoc {
61         assertProperty(getCachedSyndFeed().getImage().getDescription(),"channel.image.description");
62     }
63
64     protected void _testItem(int i) throws Exception JavaDoc {
65         List JavaDoc 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