@Test public void testNoDataEntries() throws Exception { List<RssFeedEntry> entries = new ArrayList<>(); SyndFeed feed = generator.generateFeed( "Test Feed", "The test feed from Archiva.", entries ); assertNull( feed ); }
public SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries ) { if( dataEntries.size() == 0 ) { log.debug( "No updates found, feed not generated." ); return null; } SyndFeed feed = new SyndFeedImpl(); feed.setTitle( title ); feed.setDescription( description ); feed.setLanguage( DEFAULT_LANGUAGE ); feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() ); feed.setFeedType( DEFAULT_FEEDTYPE ); feed.setEntries( getEntries( dataEntries ) ); log.debug( "Finished generating the feed \'{}\'.", title ); return feed; }
RssFeedGenerator { public SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries ) { if( dataEntries.size() == 0 ) { log.debug( "No updates found, feed not generated." ); return null; } SyndFeed feed = new SyndFeedImpl(); feed.setTitle( title ); feed.setDescription( description ); feed.setLanguage( DEFAULT_LANGUAGE ); feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() ); feed.setFeedType( DEFAULT_FEEDTYPE ); feed.setEntries( getEntries( dataEntries ) ); log.debug( "Finished generating the feed \'{}\'.", title ); return feed; } }
RssFeedGenerator { public SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries ) { if( dataEntries.size() == 0 ) { log.debug( "No updates found, feed not generated." ); return null; } SyndFeed feed = new SyndFeedImpl(); feed.setTitle( title ); feed.setDescription( description ); feed.setLanguage( DEFAULT_LANGUAGE ); feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() ); feed.setFeedType( DEFAULT_FEEDTYPE ); feed.setEntries( getEntries( dataEntries ) ); log.debug( "Finished generating the feed \'{}\'.", title ); return feed; }  }
RssFeedGenerator { public SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries ) { if( dataEntries.size() == 0 ) { log.debug( "No updates found, feed not generated." ); return null; } SyndFeed feed = new SyndFeedImpl(); feed.setTitle( title ); feed.setDescription( description ); feed.setLanguage( DEFAULT_LANGUAGE ); feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() ); feed.setFeedType( DEFAULT_FEEDTYPE ); feed.setEntries( getEntries( dataEntries ) ); log.debug( "Finished generating the feed \'{}\'.", title ); return feed; }  SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries ); }
RssFeedGenerator { public SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries ) { if( dataEntries.size() == 0 ) { log.debug( "No updates found, feed not generated." ); return null; } SyndFeed feed = new SyndFeedImpl(); feed.setTitle( title ); feed.setDescription( description ); feed.setLanguage( DEFAULT_LANGUAGE ); feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() ); feed.setFeedType( DEFAULT_FEEDTYPE ); feed.setEntries( getEntries( dataEntries ) ); log.debug( "Finished generating the feed \'{}\'.", title ); return feed; }  SyndFeed generateFeed( String title, String description, List<RssFeedEntry> dataEntries ); static String DEFAULT_FEEDTYPE; static String DEFAULT_LANGUAGE; }