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 47 public class OnSuccessPublisherTest extends ConditionalPublisherTestBase { 48 49 ConditionalPublisher createPublisher() { 50 return new OnSuccessPublisher(); 51 } 52 53 public void testPublish() throws CruiseControlException { 54 OnSuccessPublisher publisher = (OnSuccessPublisher) createPublisher(); 55 MyMockPublisher mock = new MyMockPublisher(); 56 publisher.add(mock); 57 58 Element successfulBuild = TestUtil.createElement(true, false); 59 publisher.publish(successfulBuild); 60 assertTrue(mock.wasPublished()); 61 62 mock.setPublished(false); 63 Element failedBuild = TestUtil.createElement(false, true); 64 publisher.publish(failedBuild); 65 assertFalse(mock.wasPublished()); 66 } 67 68 } 69 | Popular Tags |