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