KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > util > LinkbackExtractorTest


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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 org.apache.roller.ui.authoring.struts.actions.BookmarksActionTest;
22
23 import junit.framework.Test;
24 import junit.framework.TestCase;
25 import junit.framework.TestSuite;
26
27 /**
28  * @author davidj
29  */

30 public class LinkbackExtractorTest extends TestCase
31 {
32     /**
33      * Constructor for LinkbackExtractorTest.
34      * @param arg0
35      */

36     public LinkbackExtractorTest(String JavaDoc arg0)
37     {
38         super(arg0);
39     }
40
41     public static void main(String JavaDoc[] args)
42     {
43     }
44
45     /**
46      * @see TestCase#setUp()
47      */

48     protected void setUp() throws Exception JavaDoc
49     {
50         super.setUp();
51     }
52
53     /**
54      * @see TestCase#tearDown()
55      */

56     protected void tearDown() throws Exception JavaDoc
57     {
58         super.tearDown();
59     }
60
61     public void testLinkbackExtractor() throws Exception JavaDoc
62     {
63         String JavaDoc[][] testrefs = new String JavaDoc[][]
64         {
65             {
66                 "http://www.rollerweblogger.org/page/roller",
67                 "http://staff.develop.com/halloway/weblog/2003/01/23.html"
68             },
69             {
70                 "http://postneo.com/",
71                 "http://www.rollerweblogger.org/page/roller/20030125"
72             }
73         };
74         
75         for ( int i=0; i<testrefs.length; i++ )
76         {
77             String JavaDoc refurl = testrefs[i][0];
78             String JavaDoc requrl = testrefs[i][1];
79             LinkbackExtractor le = new LinkbackExtractor(refurl,requrl);
80             System.out.println(le.getTitle());
81             System.out.println(le.getPermalink());
82             System.out.println(le.getExcerpt());
83         }
84     }
85
86     public static Test suite()
87     {
88         return new TestSuite(LinkbackExtractorTest.class);
89     }
90 }
91
Popular Tags