1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.betwixt.examples.rss;
20
21 import java.io.File;
22
23 import org.apache.commons.betwixt.AbstractTestCase;
24
25
26
27
28
29
30
31
32 public class TestRSS extends AbstractTestCase {
33
34 public TestRSS(String testName) {
35 super(testName);
36 }
37
38 public void testPrintTextSummary() throws Exception {
39 RSSApplication rssApplication = new RSSApplication();
40 File file = new File(
41 getTestFile("src/test/org/apache/commons/betwixt/examples/rss/rss-example.xml"));
42 String output = rssApplication.plainTextSummary(file);
43 String expected = "channel: MozillaZine\n" +
44 "url: http://www.mozillazine.org\n" +
45 "copyright: Public Domain\n\n" +
46 "title: Java2 in Navigator 5?\n" +
47 "link: http://www.mozillazine.org/talkback.html?article=607\n" +
48 "description: Will Java2 be an integrated part of Navigator 5? " +
49 "Read more about it in this discussion...\n\n" +
50 "title: Communicator 4.61 Out\n" +
51 "link: http://www.mozillazine.org/talkback.html?article=606\n" +
52 "description: The latest version of Communicator is now " +
53 "available. It includes security enhancements " +
54 "and various bug fixes.\n\n" +
55 "title: Mozilla Dispenses with Old, Proprietary DOM\n" +
56 "link: http://www.mozillazine.org/talkback.html?article=604\n" +
57 "description: \n\n" +
58 "title: The Animation Contest is Now Closed\n" +
59 "link: http://www.mozillazine.org/talkback.html?article=603\n" +
60 "description: \n";
61 assertEquals(output, expected);
62 }
63 }