@Test
public void testPublish() throws CruiseControlException {

    MockSchedule sched = new MockSchedule();
    projectConfig.add(sched);
    MockPublisher publisher = new MockPublisher();
    Publisher exceptionThrower = new MockPublisher() {
        private static final long serialVersionUID = -8476214888230413824L;
        public void publish(Element log) throws CruiseControlException {
            throw new CruiseControlException("exception");
        }
    };
    ProjectConfig.Publishers publishers = new ProjectConfig.Publishers();
    publishers.add(publisher);
    publishers.add(exceptionThrower);
    publishers.add(publisher);
    projectConfig.add(publishers);
    project.setName("projectName");
    project.setLabel("label.1");
    projectConfig.add(new DefaultLabelIncrementer());
    projectConfig.add(new Log());
    project.init();
    project.publish(projectConfig.getLog());
    assertEquals(2, publisher.getPublishCount());
}