1 16 17 package org.roller.util.rome; 18 19 import java.net.URL ; 20 21 import junit.framework.Test; 22 import junit.framework.TestCase; 23 import junit.framework.TestSuite; 24 25 import org.roller.business.FileManagerTest; 26 import org.roller.util.rome.DiskFeedInfoCache; 27 import com.sun.syndication.fetcher.impl.SyndFeedInfo; 28 29 32 public class DiskFeedInfoCacheTest extends TestCase 33 { 34 public static void main(String [] args) 35 { 36 junit.textui.TestRunner.run(DiskFeedInfoCacheTest.class); 37 } 38 39 public void testCache() throws Exception 40 { 41 URL url = new URL ("http://cnn.com"); 42 SyndFeedInfo info = new SyndFeedInfo(); 43 info.setUrl(url); 44 45 DiskFeedInfoCache cache = new DiskFeedInfoCache("./cache"); 46 cache.setFeedInfo(info.getUrl(), info); 47 48 SyndFeedInfo info2 = cache.getFeedInfo(url); 49 assertNotNull(info2); 50 assertEquals(url, info2.getUrl()); 51 } 52 53 public static Test suite() 54 { 55 return new TestSuite(DiskFeedInfoCacheTest.class); 56 57 } 58 } 59 | Popular Tags |