1 37 package net.sourceforge.cruisecontrol; 38 39 import org.jdom.Element; 40 41 import java.util.Date ; 42 import java.util.Map ; 43 44 public class MockSchedule extends Schedule { 45 46 private Map properties = null; 47 private boolean validateWasCalled = false; 48 49 public MockSchedule() { 50 add(new Builder() { 52 public Element build(Map properties) throws CruiseControlException { return null; } 53 public Element buildWithTarget(Map properties, String target) throws CruiseControlException { return null; } 54 }); 55 } 56 57 public Element build(int buildNumber, Date lastBuild, Date now, Map properties, String buildTarget) 58 throws CruiseControlException { 59 this.properties = properties; 60 return new Element("build"); 61 } 62 63 public boolean isPaused(Date now) { 64 return false; 65 } 66 67 protected Map getBuildProperties() { 68 return properties; 69 } 70 71 72 public long getTimeToNextBuild(Date date, long interval) { 73 return interval; 74 } 75 76 public void validate() throws CruiseControlException { 77 super.validate(); 78 validateWasCalled = true; 79 } 80 81 public boolean validateWasCalled() { 82 return validateWasCalled; 83 } 84 } | Popular Tags |