KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > jayasoft > ivy > ant > IvyRepositoryReportTest


1 package fr.jayasoft.ivy.ant;
2
3 import java.io.File JavaDoc;
4
5 import junit.framework.TestCase;
6
7 import org.apache.tools.ant.Project;
8 import org.apache.tools.ant.taskdefs.Delete;
9
10 public class IvyRepositoryReportTest extends TestCase {
11     private File JavaDoc _cache;
12     private IvyRepositoryReport _report;
13     
14     protected void setUp() throws Exception JavaDoc {
15         createCache();
16         Project project = new Project();
17         project.setProperty("ivy.conf.file", "test/repositories/ivyconf-1.xml");
18
19         _report = new IvyRepositoryReport();
20         _report.setProject(project);
21         _report.setCache(_cache);
22     }
23
24     private void createCache() {
25         _cache = new File JavaDoc("build/cache");
26         _cache.mkdirs();
27     }
28     
29     protected void tearDown() throws Exception JavaDoc {
30         cleanCache();
31     }
32
33     private void cleanCache() {
34         Delete del = new Delete();
35         del.setProject(new Project());
36         del.setDir(_cache);
37         del.execute();
38     }
39     
40     public void test() {}
41
42 // no xslt transformation is possible in the junit test on our continuous integration server for the moment...
43
// public void testGraph() throws Exception {
44
// _report.setOrganisation("org1");
45
// _report.setXml(false);
46
// _report.setGraph(true);
47
// _report.setTodir(_cache);
48
// _report.setOutputname("test-graph");
49
// _report.execute();
50
// File graphml = new File(_cache, "test-graph.graphml");
51
// assertTrue(graphml.exists());
52
// String g = FileUtil.readEntirely(new BufferedReader(new FileReader(graphml)));
53
// assertFalse(g.indexOf("caller") != -1);
54
// assertTrue(g.indexOf("mod1.1") != -1);
55
// }
56
//
57
// public void testDot() throws Exception {
58
// _report.setOrganisation("org1");
59
// _report.setXml(false);
60
// _report.setDot(true);
61
// _report.setTodir(_cache);
62
// _report.setOutputname("test-graph");
63
// _report.execute();
64
// File dot = new File(_cache, "test-graph.dot");
65
// assertTrue(dot.exists());
66
// String g = FileUtil.readEntirely(new BufferedReader(new FileReader(dot)));
67
// assertFalse(g.indexOf("caller") != -1);
68
// assertTrue(g.indexOf("mod1.1") != -1);
69
// }
70
}
71
Popular Tags