1 26 27 29 package de.nava.informa.impl.basic; 30 31 import java.net.MalformedURLException ; 32 import java.net.URL ; 33 34 import de.nava.informa.core.ChannelBuilderIF; 35 import de.nava.informa.core.ChannelIF; 36 import de.nava.informa.core.ItemIF; 37 import de.nava.informa.utils.InformaTestCase; 38 39 public class TestChannelBuilder extends InformaTestCase { 40 41 public TestChannelBuilder(String testname) { 42 super("TestChannelBuilder", testname); 43 } 44 45 public void testCreateChannel() { 46 ChannelBuilderIF builder = new ChannelBuilder(); 47 ChannelIF chA = builder.createChannel("myChannel"); 48 assertEquals("myChannel", chA.getTitle()); 49 } 50 51 public void testCreateItem() throws MalformedURLException { 52 ChannelBuilderIF builder = new ChannelBuilder(); 53 ChannelIF chA = builder.createChannel("myChannel"); 54 ItemIF itA = builder.createItem(chA, "first item", "descr of item", 55 new URL ("http://sf.net/projects/informa")); 56 itA.setCreator("TestChannelBuilder"); 57 assertEquals("first item", itA.getTitle()); 58 itA = null; 59 ItemIF itB = (ItemIF) chA.getItems().iterator().next(); 61 assertEquals("first item", itB.getTitle()); 62 assertEquals("TestChannelBuilder", itB.getCreator()); 63 } 64 65 } 66 | Popular Tags |