KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > cruisecontrol > bootstrappers > AntBootstrapperTest


1 package net.sourceforge.cruisecontrol.bootstrappers;
2
3 import junit.framework.TestCase;
4 import net.sourceforge.cruisecontrol.CruiseControlException;
5
6 public class AntBootstrapperTest extends TestCase {
7     public void testValidate() {
8         AntBootstrapper bootstrapper = new AntBootstrapper();
9
10         try {
11             bootstrapper.validate();
12         } catch (CruiseControlException e) {
13             fail("antbuilder has no required attributes");
14         }
15
16         bootstrapper.setBuildFile("buildfile");
17         bootstrapper.setTarget("target");
18
19         try {
20             bootstrapper.validate();
21         } catch (CruiseControlException e) {
22             fail("validate should not throw exceptions when options are set.");
23         }
24
25         bootstrapper.setSaveLogDir("I/hope/this/dir/does/not/exist/");
26         try {
27             bootstrapper.validate();
28             fail("validate should throw exceptions when saveLogDir doesn't exist");
29         } catch (CruiseControlException e) {
30         }
31     }
32
33     public void testBootstrap() throws Exception JavaDoc {
34         AntBootstrapper bootstrapper = new AntBootstrapper();
35
36         bootstrapper.setBuildFile("testbuild.xml");
37         bootstrapper.setTempFile("notLog.xml");
38         bootstrapper.setTarget("init");
39         bootstrapper.validate();
40         bootstrapper.bootstrap();
41     }
42 }
43
Popular Tags