Integrate with ant-based testing.

Delete old results before geenrating new.
This commit is contained in:
Diomidis Spinellis 2005-11-15 07:15:35 +00:00
parent 5da7e8c305
commit 6c34360410
2 changed files with 16 additions and 12 deletions

View File

@ -28,11 +28,11 @@ import java.util.List;
public class BasicTest {
static String testSourceFolder = "./test-data/simple/java";
static String testSourceFolder = "test/data/simple/java";
static String testDestFolder = "./test-data/simple/dot-out";
static String testDestFolder = "test/data/simple/dot-out";
static String testRefFolder = "./test-data/simple/dot-ref";
static String testRefFolder = "test/data/simple/dot-ref";
static PrintWriter pw = new PrintWriter(System.out);
@ -47,13 +47,15 @@ public class BasicTest {
boolean equal = true;
for (int i = 0; i < javaFiles.length; i++) {
String javaFileName = javaFiles[i].substring(0, javaFiles[i].length() - 5);
String dotPath = new File(testDestFolder, javaFileName + ".dot").getAbsolutePath();
File dotFile = new File(testDestFolder, javaFileName + ".dot");
dotFile.delete();
String dotPath = dotFile.getAbsolutePath();
String refPath = new File(testRefFolder, javaFileName + ".dot").getAbsolutePath();
String javaPath = new File(testSourceFolder, javaFiles[i]).getAbsolutePath();
String[] options = new String[] { "-hide", "Hidden", "-private", "-output", dotPath,
String[] options = new String[] { "-docletpath", "build", "-hide", "Hidden", "-private", "-output", dotPath,
javaPath };
com.sun.tools.javadoc.Main.execute("UMLGraph test", pw, pw, pw, "UmlGraph", options);
com.sun.tools.javadoc.Main.execute("UMLGraph test", pw, pw, pw, "gr.spinellis.umlgraph.doclet.UmlGraph", options);
System.out.println("Performing diff:\nout:" + dotPath + "\nref:" + refPath);
DotDiff differ = new DotDiff(new File(dotPath), new File(refPath));

View File

@ -28,11 +28,11 @@ import java.util.List;
public class BasicTest {
static String testSourceFolder = "./test-data/simple/java";
static String testSourceFolder = "test/data/simple/java";
static String testDestFolder = "./test-data/simple/dot-out";
static String testDestFolder = "test/data/simple/dot-out";
static String testRefFolder = "./test-data/simple/dot-ref";
static String testRefFolder = "test/data/simple/dot-ref";
static PrintWriter pw = new PrintWriter(System.out);
@ -47,13 +47,15 @@ public class BasicTest {
boolean equal = true;
for (int i = 0; i < javaFiles.length; i++) {
String javaFileName = javaFiles[i].substring(0, javaFiles[i].length() - 5);
String dotPath = new File(testDestFolder, javaFileName + ".dot").getAbsolutePath();
File dotFile = new File(testDestFolder, javaFileName + ".dot");
dotFile.delete();
String dotPath = dotFile.getAbsolutePath();
String refPath = new File(testRefFolder, javaFileName + ".dot").getAbsolutePath();
String javaPath = new File(testSourceFolder, javaFiles[i]).getAbsolutePath();
String[] options = new String[] { "-hide", "Hidden", "-private", "-output", dotPath,
String[] options = new String[] { "-docletpath", "build", "-hide", "Hidden", "-private", "-output", dotPath,
javaPath };
com.sun.tools.javadoc.Main.execute("UMLGraph test", pw, pw, pw, "UmlGraph", options);
com.sun.tools.javadoc.Main.execute("UMLGraph test", pw, pw, pw, "gr.spinellis.umlgraph.doclet.UmlGraph", options);
System.out.println("Performing diff:\nout:" + dotPath + "\nref:" + refPath);
DotDiff differ = new DotDiff(new File(dotPath), new File(refPath));