1 37 package net.sourceforge.cruisecontrol.bootstrappers; 38 39 import net.sourceforge.cruisecontrol.CruiseControlException; 40 41 import java.io.IOException ; 42 43 import junit.framework.TestCase; 44 45 50 public class SnapshotCMBootstrapperTest extends TestCase { 51 52 public void testValidate() throws CruiseControlException, IOException { 53 54 SnapshotCMBootstrapper bootstrapper = new SnapshotCMBootstrapper(); 55 56 try { 57 bootstrapper.validate(); 58 fail("SnapshotCMBootstrapper should throw exceptions when required fields are not set."); 59 } catch (CruiseControlException e) { 60 } 61 62 bootstrapper.setFile("thepath"); 63 64 try { 65 bootstrapper.validate(); 66 } catch (CruiseControlException e) { 67 fail("SnapshotCMBootstrapper should not throw exceptions when required fields are set."); 68 } 69 70 } 72 73 public void testBuildUpdateCommand() throws IOException , CruiseControlException { 74 75 SnapshotCMBootstrapper bootstrapper = new SnapshotCMBootstrapper(); 76 bootstrapper.setFile("somefile"); 77 78 assertEquals("wco -fR somefile", bootstrapper.buildUpdateCommand().toString()); 79 } 80 } 81 | Popular Tags |