1 5 6 package org.exoplatform.portlets.rss.test; 7 8 import java.util.*; 9 import java.io.InputStream ; 10 import java.net.URL ; 11 import org.exoplatform.portlets.rss.component.*; 12 import org.exoplatform.test.BasicTestCase; 13 14 24 public class TestRss extends BasicTestCase { 25 26 public TestRss(String name) { 27 super(name); 28 } 29 30 protected void setUp() throws Exception { 31 } 32 33 protected void tearDown() throws Exception { 34 } 35 36 protected int getTestNumber() { 37 return 1 ; 38 } 39 66 67 public void testRssChannel() throws Exception { 68 Channel channel = Channel.parse("http://headlines.internet.com/internetnews/fina-news/news.rss") ; 69 System.out.println("title : " + channel.getTitle()); 70 System.out.println("link : " + channel.getLink()); 71 System.out.println("Description : " + channel.getDescription()); 72 Item[] items = channel.getItems() ; 73 for (int i = 0; i < items.length ; i++) { 74 System.out.println("Title : " + items[i].getTitle()); 75 System.out.println("Description : " + items[i].getDescription()); 76 System.out.println("Link : " + items[i].getLink()); 77 78 } 79 } 80 81 public String getDescription() { 82 return "Test Rss" ; 83 } 84 } 85 86 | Popular Tags |