1 26 27 29 package de.nava.informa.search; 30 31 import java.io.IOException ; 32 import java.net.MalformedURLException ; 33 import java.net.URL ; 34 import java.util.ArrayList ; 35 import java.util.Collection ; 36 37 import de.nava.informa.core.ItemIF; 38 import de.nava.informa.impl.basic.Item; 39 import de.nava.informa.utils.InformaTestCase; 40 41 public class TestChannelIndexer extends InformaTestCase { 42 43 public TestChannelIndexer(String name) { 44 super("TestChannelIndexer", name); 45 } 46 47 public void testIndexItems() throws MalformedURLException , IOException { 48 Collection items = new ArrayList (); 49 ItemIF itemA = new Item("Java 1.5 out", "Long awaited...", 50 new URL ("http://example.org/1234")); 51 items.add(itemA); 52 ItemIF itemB = new Item("XML virus found", "All about it here.", 53 new URL ("http://example.org/2345")); 54 items.add(itemB); 55 assertEquals(2, items.size()); 56 ChannelIndexer indexer = new ChannelIndexer(getIndexDir()); 57 indexer.indexItems(true, items); 58 assertEquals(getIndexDir(), indexer.getIndexDir()); 59 assertEquals(2, indexer.getNrOfIndexedItems()); 60 } 61 62 64 } 65 | Popular Tags |