Author: burton Date: Sun Feb 6 22:46:49 2005 New Revision: 151691 URL: http://svn.apache.org/viewcvs?view=rev&rev=151691 Log: tests for GUIDs
Added: jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestGuid.java Modified: jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestComments.java Modified: jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestComments.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestComments.java?view=diff&r1=151690&r2=151691 ============================================================================== --- jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestComments.java (original) +++ jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestComments.java Sun Feb 6 22:46:49 2005 @@ -33,7 +33,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a> * @version $Id: TestAtom.java 149187 2005-01-30 23:54:29Z burton $ */ -public class TestComments extends TestCase { +public class TestComments extends BaseTestCase { public TestComments( String name ) throws Exception { super( name ); @@ -42,16 +42,8 @@ public void test1() throws Exception { String resource = "file:tests/feeds/wordpress-comments.rss"; - - FeedParser parser = FeedParserFactory.newFeedParser(); - FeedParserListener listener = new CaptureOutputFeedParserListener(); - - ResourceRequest request = ResourceRequestFactory.getResourceRequest( resource ); - - parser.parse( listener, request.getInputStream(), resource ); - - String output = listener.toString(); + String output = captureOutputFromTest( resource ); if ( output.indexOf( "onComments: " ) == -1 ) throw new Exception(); Added: jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestGuid.java URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestGuid.java?view=auto&rev=151691 ============================================================================== --- jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestGuid.java (added) +++ jakarta/commons/sandbox/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestGuid.java Sun Feb 6 22:46:49 2005 @@ -0,0 +1,62 @@ +/* + * 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 junit.framework.*; + +import org.apache.commons.feedparser.*; +import org.apache.commons.feedparser.impl.*; +import org.apache.commons.feedparser.network.*; + +/** + * + * @author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a> + * @version $Id: TestAtom.java 149187 2005-01-30 23:54:29Z burton $ + */ +public class TestGuid extends BaseTestCase { + + public TestGuid( String name ) throws Exception { + super( name ); + } + + public void test1() throws Exception { + + String resource = "file:tests/feeds/rss-2.0-guid.rss"; + + String output = captureOutputFromTest( resource ); + + if ( output.indexOf( "onGUID: " ) == -1 ) + throw new Exception(); + + } + + public static void main( String[] args ) throws Exception { + + TestGuid test = new TestGuid( null ); + + //test.testGetWeblogLinkForResource(); + test.test1(); + + } + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]