01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. The ASF licenses this file to You
04: * under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License. For additional information regarding
15: * copyright in this work, please see the NOTICE file in the top level
16: * directory of this distribution.
17: */
18:
19: package org.apache.roller.util;
20:
21: import junit.framework.Test;
22: import junit.framework.TestCase;
23: import junit.framework.TestSuite;
24:
25: /**
26: * Test linkback extractor.
27: */
28: public class LinkbackExtractorTest extends TestCase {
29:
30: /**
31: * Constructor for LinkbackExtractorTest.
32: * @param arg0
33: */
34: public LinkbackExtractorTest(String arg0) {
35: super (arg0);
36: }
37:
38: public static void main(String[] args) {
39: }
40:
41: /**
42: * @see TestCase#setUp()
43: */
44: protected void setUp() throws Exception {
45: super .setUp();
46: }
47:
48: /**
49: * @see TestCase#tearDown()
50: */
51: protected void tearDown() throws Exception {
52: super .tearDown();
53: }
54:
55: public void testLinkbackExtractor() throws Exception {
56: String[][] testrefs = new String[][] {
57: { "http://www.rollerweblogger.org/page/roller",
58: "http://staff.develop.com/halloway/weblog/2003/01/23.html" },
59: { "http://postneo.com/",
60: "http://www.rollerweblogger.org/page/roller/20030125" } };
61:
62: for (int i = 0; i < testrefs.length; i++) {
63: String refurl = testrefs[i][0];
64: String requrl = testrefs[i][1];
65: LinkbackExtractor le = new LinkbackExtractor(refurl, requrl);
66: System.out.println(le.getTitle());
67: System.out.println(le.getPermalink());
68: System.out.println(le.getExcerpt());
69: }
70: }
71:
72: public static Test suite() {
73: return new TestSuite(LinkbackExtractorTest.class);
74: }
75:
76: }
|