burton      2004/09/05 15:01:33

  Modified:    feedparser/src/java/org/apache/commons/feedparser/test
                        TestProbeLocator.java
  Log:
  ...
  
  Revision  Changes    Path
  1.4       +51 -1     
jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/test/TestProbeLocator.java
  
  Index: TestProbeLocator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/test/TestProbeLocator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestProbeLocator.java     5 Sep 2004 21:55:51 -0000       1.3
  +++ TestProbeLocator.java     5 Sep 2004 22:01:33 -0000       1.4
  @@ -852,6 +852,30 @@
           assertNotNull(rssFeed);
           assertEquals(rssFeed.type, FeedReference.RSS_MEDIA_TYPE);
           assertEquals(rssFeed.resource, "http://bamph.com/index.xml";);
  +
  +        // This site should have a single RSS feed
  +        resource = "http://bamph.com";;
  +        content = getContent(resource);
  +        assertNotNull(content);
  +        blogService = BlogServiceDiscovery.discover(resource, content);
  +        assertEquals(blogService, BlogService.UNKNOWN);
  +        list = new FeedList();
  +        ProbeLocator.locate(resource, content, list);
  +        assertEquals(list.size(), 1);
  +        feeds = (FeedReference[])list.toArray(new FeedReference[list.size()]);
  +        assertEquals(feeds.length, 1);
  +        assertEquals(feeds[0].method, FeedReference.METHOD_PROBE_DISCOVERY);
  +        assertNull(feeds[0].title, null);
  +        assertEquals(feeds[0].type, FeedReference.RSS_MEDIA_TYPE);
  +        assertEquals(feeds[0].resource, "http://bamph.com/index.xml";);
  +        /* test through the FeedLocator */
  +        list = FeedLocator.locate(resource);
  +        atomFeed = list.getAdAtomFeed();
  +        rssFeed = list.getAdRSSFeed();
  +        assertNull(atomFeed);
  +        assertNotNull(rssFeed);
  +        assertEquals(rssFeed.type, FeedReference.RSS_MEDIA_TYPE);
  +        assertEquals(rssFeed.resource, "http://bamph.com/index.xml";);
           BlogService blogService = null;
           FeedReference feeds[] = null;
           FeedReference rssFeed, atomFeed;
  @@ -1002,6 +1026,32 @@
           /* test through the FeedLocator */
           list = FeedLocator.locate(resource);
           atomFeed = list.getAdAtomFeed();
  +    public static void main( String[] args ) throws Exception {
  +
  +        TestProbeLocator test = new TestProbeLocator( null );
  +
  +        /*test.test( "http://xanga.com/home.aspx?user=joe";,
  +                   BlogService.XANGA,
  +                   1 );
  +
  +        test.test( "http://www.xanga.com/home.aspx?user=joe";,
  +                   BlogService.XANGA,
  +                   1 );*/
  +
  +        test.testBlogger();
  +        test.testLiveJournal();
  +        test.testDiaryLand();
  +        test.testMovableType();
  +        test.testXanga();
  +        test.testWordPress();
  +        test.testAOLJournal();
  +        test.testTypePad();
  +        test.testGreyMatter();
  +        test.testPMachine();
  +        test.testBlosxom();
  +        test.testRadioUserland();
  +        test.testTextPattern();
  +    }
           rssFeed = list.getAdRSSFeed();
           assertNull(atomFeed);
           assertNotNull(rssFeed);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to