1 37 package net.sourceforge.cruisecontrol.sourcecontrols; 38 39 import java.util.Date ; 40 import java.util.List ; 41 import java.util.Map ; 42 43 import junit.framework.TestCase; 44 import net.sourceforge.cruisecontrol.CruiseControlException; 45 46 public class ForceOnlyTest extends TestCase { 47 48 public void testGettingModifications() { 49 ForceOnly forceOnly = new ForceOnly(); 50 51 List mods = forceOnly.getModifications(null, null); 52 assertNotNull(mods); 53 assertEquals("ForceOnly source control should never return any mods.", 0, mods.size()); 54 55 mods = forceOnly.getModifications(new Date (), new Date ()); 56 assertNotNull(mods); 57 assertEquals("ForceOnly source control should never return any mods.", 0, mods.size()); 58 59 mods = forceOnly.getModifications(new Date (0), null); 60 assertNotNull(mods); 61 assertEquals("ForceOnly source control should never return any mods.", 0, mods.size()); 62 63 mods = forceOnly.getModifications(null, new Date (0)); 64 assertNotNull(mods); 65 assertEquals("ForceOnly source control should never return any mods.", 0, mods.size()); 66 67 mods = forceOnly.getModifications(new Date (0), new Date ()); 68 assertNotNull(mods); 69 assertEquals("ForceOnly source control should never return any mods.", 0, mods.size()); 70 } 71 72 public void testSettingProperties() { 73 ForceOnly forceOnly = new ForceOnly(); 74 75 Map props = forceOnly.getProperties(); 76 assertNotNull(props); 77 assertEquals("Expected the properties to be empty", 0, props.size()); 78 } 79 80 public void testValidate() { 81 ForceOnly forceOnly = new ForceOnly(); 82 83 try { 85 forceOnly.validate(); 86 } catch (CruiseControlException e) { 87 fail("validate should never throw an exception"); 88 } 89 } 90 } 91 | Popular Tags |