1 37 package net.sourceforge.cruisecontrol.publishers; 38 39 import org.jdom.Element; 40 41 import net.sourceforge.cruisecontrol.CruiseControlException; 42 import net.sourceforge.cruisecontrol.testutil.TestUtil; 43 44 public class OnFailurePublisherTest extends ConditionalPublisherTestBase { 45 46 ConditionalPublisher createPublisher() { 47 return new OnFailurePublisher(); 48 } 49 50 public void testPublish() throws CruiseControlException { 51 OnFailurePublisher publisher = (OnFailurePublisher) createPublisher(); 52 MyMockPublisher mock = new MyMockPublisher(); 53 publisher.add(mock); 54 55 Element successfulBuild = TestUtil.createElement(true, false); 56 publisher.publish(successfulBuild); 57 assertFalse(mock.wasPublished()); 58 59 mock.setPublished(false); 60 Element failedBuild = TestUtil.createElement(false, true); 61 publisher.publish(failedBuild); 62 assertTrue(mock.wasPublished()); 63 } 64 } 65 | Popular Tags |