Removed warnings
Cleanup up test
This commit is contained in:
parent
6ac4408ddf
commit
2f93235e69
1 changed files with 8 additions and 27 deletions
|
@ -4,16 +4,13 @@
|
|||
*/
|
||||
package org.rometools.certiorem.hub;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.rometools.fetcher.impl.HashMapFeedInfoCache;
|
||||
import org.rometools.fetcher.impl.HttpURLFeedFetcher;
|
||||
|
@ -27,20 +24,9 @@ import com.sun.syndication.feed.synd.SyndFeed;
|
|||
*/
|
||||
public class DeltaSyndFeedInfoTest {
|
||||
|
||||
DeltaFeedInfoCache feedInfoCache;
|
||||
HttpURLFeedFetcher feedFetcher;
|
||||
SyndFeed feed;
|
||||
|
||||
public DeltaSyndFeedInfoTest() {
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() throws Exception {
|
||||
}
|
||||
private DeltaFeedInfoCache feedInfoCache;
|
||||
private HttpURLFeedFetcher feedFetcher;
|
||||
private SyndFeed feed;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
@ -48,31 +34,26 @@ public class DeltaSyndFeedInfoTest {
|
|||
feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getSyndFeed method, of class DeltaSyndFeedInfo.
|
||||
*/
|
||||
@Test
|
||||
public void testGetSyndFeed() throws Exception {
|
||||
System.out.println("getSyndFeed");
|
||||
|
||||
feed = feedFetcher.retrieveFeed(getFeedUrl());
|
||||
List<SyndEntry> entries = feed.getEntries();
|
||||
Assert.assertTrue(!entries.isEmpty());
|
||||
assertTrue(!entries.isEmpty());
|
||||
|
||||
// Fetch again and this time the entries should be empty as none have changed.
|
||||
feed = feedFetcher.retrieveFeed(getFeedUrl());
|
||||
entries = feed.getEntries();
|
||||
Assert.assertTrue(entries.isEmpty());
|
||||
assertTrue(entries.isEmpty());
|
||||
}
|
||||
|
||||
private URL getFeedUrl() throws IOException {
|
||||
final URL feedUrl = new URL("http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss");
|
||||
// URL feedUrl = new URL("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml");
|
||||
|
||||
return feedUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue