1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
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 * <p>Test case for example.</p>
27 *
28 * @author Robert Burrell Donkin
29 * @version $Revision: 438373 $ $Date: 2006-08-30 06:17:21 +0100 (Wed, 30 Aug 2006) $
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 }