1 37 package net.sourceforge.cruisecontrol.publishers.rss; 38 39 import java.util.Date ; 40 41 import junit.framework.TestCase; 42 import net.sourceforge.cruisecontrol.testutil.TestUtil; 43 import net.sourceforge.cruisecontrol.util.DateUtil; 44 import net.sourceforge.cruisecontrol.util.XMLLogHelper; 45 46 import org.jdom.Element; 47 48 51 public class CruiseControlItemTest extends TestCase { 52 53 private XMLLogHelper successLogHelper; 54 55 protected XMLLogHelper createLogHelper(boolean success, boolean lastBuildSuccess) { 56 Element cruisecontrolElement = TestUtil.createElement(success, lastBuildSuccess); 57 58 return new XMLLogHelper(cruisecontrolElement); 59 } 60 61 public void setUp() { 62 successLogHelper = createLogHelper(true, true); 63 } 64 65 66 public void testConstructors() throws Exception { 67 CruiseControlItem item = new CruiseControlItem(successLogHelper, "link"); 68 69 assertEquals("someproject somelabel Build Successful", item.getTitle()); 70 Date date = DateUtil.parseFormattedTime("20020313120000", "mockcctimestamp"); 71 assertEquals("<em>Build Time:</em> " + date + "<br/><em>Label:</em> somelabel<br/>" 72 + "<em>Modifications: </em>4" 73 + "<li>filename1 by user1 (The comment)</li><li>filename2 by user2 (The comment)</li>" 74 + "<li>filename3 by user2 (The comment)</li><li>filename4 by user3 (The comment)</li>" 75 + "</ul><br/>\n<ul>", 76 item.getDescription()); 77 78 83 } 85 } | Popular Tags |