1 37 package net.sourceforge.cruisecontrol; 38 39 import java.io.File ; 40 import java.net.URL ; 41 import java.net.URLDecoder ; 42 43 import junit.framework.TestCase; 44 import net.sourceforge.cruisecontrol.util.Util; 45 46 import org.jdom.Element; 47 48 public class CruiseControlConfigPreConfTest extends TestCase { 49 50 private CruiseControlConfig config; 51 private File configFile; 52 private File tempDirectory; 53 54 protected void setUp() throws Exception { 55 URL url = this.getClass().getClassLoader().getResource("net/sourceforge/cruisecontrol/testconfig-preconf.xml"); 57 configFile = new File (URLDecoder.decode(url.getPath())); 58 tempDirectory = configFile.getParentFile(); 59 60 Element rootElement = Util.loadConfigFile(configFile); 61 config = new CruiseControlConfig(); 62 config.configure(rootElement); 63 } 64 65 protected void tearDown() { 66 File fooDirectory = new File (tempDirectory, "foo"); 71 fooDirectory.delete(); 72 } 73 74 public void testGetProjectNames() { 75 assertEquals(6, config.getProjectNames().size()); 76 } 77 78 135 136 } 137 | Popular Tags |