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;
|
package org.rometools.certiorem.hub;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.rometools.fetcher.impl.HashMapFeedInfoCache;
|
import org.rometools.fetcher.impl.HashMapFeedInfoCache;
|
||||||
import org.rometools.fetcher.impl.HttpURLFeedFetcher;
|
import org.rometools.fetcher.impl.HttpURLFeedFetcher;
|
||||||
|
@ -27,20 +24,9 @@ import com.sun.syndication.feed.synd.SyndFeed;
|
||||||
*/
|
*/
|
||||||
public class DeltaSyndFeedInfoTest {
|
public class DeltaSyndFeedInfoTest {
|
||||||
|
|
||||||
DeltaFeedInfoCache feedInfoCache;
|
private DeltaFeedInfoCache feedInfoCache;
|
||||||
HttpURLFeedFetcher feedFetcher;
|
private HttpURLFeedFetcher feedFetcher;
|
||||||
SyndFeed feed;
|
private SyndFeed feed;
|
||||||
|
|
||||||
public DeltaSyndFeedInfoTest() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setUpClass() throws Exception {
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void tearDownClass() throws Exception {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
|
@ -48,31 +34,26 @@ public class DeltaSyndFeedInfoTest {
|
||||||
feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
|
feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
|
||||||
public void tearDown() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test of getSyndFeed method, of class DeltaSyndFeedInfo.
|
* Test of getSyndFeed method, of class DeltaSyndFeedInfo.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetSyndFeed() throws Exception {
|
public void testGetSyndFeed() throws Exception {
|
||||||
System.out.println("getSyndFeed");
|
|
||||||
|
|
||||||
feed = feedFetcher.retrieveFeed(getFeedUrl());
|
feed = feedFetcher.retrieveFeed(getFeedUrl());
|
||||||
List<SyndEntry> entries = feed.getEntries();
|
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.
|
// Fetch again and this time the entries should be empty as none have changed.
|
||||||
feed = feedFetcher.retrieveFeed(getFeedUrl());
|
feed = feedFetcher.retrieveFeed(getFeedUrl());
|
||||||
entries = feed.getEntries();
|
entries = feed.getEntries();
|
||||||
Assert.assertTrue(entries.isEmpty());
|
assertTrue(entries.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
private URL getFeedUrl() throws IOException {
|
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");
|
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");
|
// URL feedUrl = new URL("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml");
|
||||||
|
|
||||||
return feedUrl;
|
return feedUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue