burton 2004/08/13 14:53:57
Added: feedparser/src/java/org/apache/commons/feedparser/test
TestFeedLocator.java
Log:
... locate and unit testing
Revision Changes Path
1.1
jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/test/TestFeedLocator.java
Index: TestFeedLocator.java
===================================================================
/*
* Copyright 1999,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.feedparser.test;
import java.applet.*;
import java.util.*;
import java.io.*;
import java.net.*;
import java.security.*;
import org.apache.lucene.index.*;
import org.apache.lucene.search.*;
import org.apache.lucene.queryParser.*;
import org.apache.lucene.analysis.*;
import org.apache.lucene.analysis.standard.*;
import org.apache.lucene.document.*;
import org.peerfear.newsmonster.tools.*;
import org.peerfear.newsmonster.network.*;
import junit.framework.*;
import org.apache.commons.feedparser.*;
import org.apache.commons.feedparser.impl.*;
import org.apache.commons.feedparser.locate.*;
/**
*
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a>
* @version $Id: TestFeedLocator.java,v 1.1 2004/08/13 21:53:57 burton Exp $
*/
public class TestFeedLocator extends TestCase {
public TestFeedLocator( String name ) throws Exception {
super( name );
}
private void doTest( String resource ) throws Exception {
FeedList l = FeedLocator.locate( resource );
Iterator it = l.iterator();
if ( it.hasNext() == false ) {
throw new Exception( "NO LINKS FOUND" );
}
}
public void test1() throws Exception {
// doTest( "file:///projects/feedparser/tests/locate1.html" );
// doTest( "file:///projects/feedparser/tests/locate2.html" );
// doTest( "file:///projects/feedparser/tests/locate3.html" );
// doTest( "file:///projects/feedparser/tests/locate4.html" );
// doTest( "file:///projects/feedparser/tests/locate5.html" );
// doTest( "file:///projects/feedparser/tests/locate6.html" );
doTest( "file:///projects/feedparser/tests/locate7.html" );
}
public static void main( String[] args ) throws Exception {
TestFeedLocator test = new TestFeedLocator( null );
//test.testGetWeblogLinkForResource();
test.test1();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]