01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: 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: 438373 $ $Date: 2006-08-30 06:17:21 +0100 (Wed, 30 Aug 2006) $
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: }
|