1 6 package fr.jayasoft.ivy.ant; 7 8 import java.io.File ; 9 10 import junit.framework.TestCase; 11 12 import org.apache.tools.ant.Project; 13 import org.apache.tools.ant.taskdefs.Delete; 14 15 public class IvyReportTest extends TestCase { 16 private File _cache; 17 private IvyReport _report; 18 private Project _project; 19 20 protected void setUp() throws Exception { 21 createCache(); 22 _project = new Project(); 23 _project.setProperty("ivy.conf.file", "test/repositories/ivyconf.xml"); 24 25 _report = new IvyReport(); 26 _report.setTaskName("report"); 27 _report.setProject(_project); 28 _report.setCache(_cache); 29 } 30 31 private void createCache() { 32 _cache = new File ("build/cache"); 33 _cache.mkdirs(); 34 } 35 36 protected void tearDown() throws Exception { 37 cleanCache(); 38 } 39 40 private void cleanCache() { 41 Delete del = new Delete(); 42 del.setProject(new Project()); 43 del.setDir(_cache); 44 del.execute(); 45 } 46 47 public void testRegularCircular() throws Exception { 48 _project.setProperty("ivy.dep.file", "test/repositories/2/mod11.1/ivy-1.0.xml"); 49 IvyResolve res = new IvyResolve(); 50 res.setProject(_project); 51 res.execute(); 52 53 _report.setTodir(new File (_cache, "report")); 54 _report.setXml(true); 55 56 _report.setXsl(false); 58 _report.setGraph(false); 59 60 _report.execute(); 61 62 assertTrue(new File (_cache, "report/org11-mod11.1-compile.xml").exists()); 63 } 64 } 65 | Popular Tags |