A support class to run one test in the debugger

This commit is contained in:
Andrea Aime 2006-01-02 14:06:50 +00:00
parent d23eab3432
commit 761320b44d
2 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,61 @@
/*
* UmlGraph class diagram testing framework
*
* Contibuted by Andrea Aime
* (C) Copyright 2005 Diomidis Spinellis
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id$
*
*/
package gr.spinellis.umlgraph.test;
import java.io.File;
import java.io.PrintWriter;
public class RunOne {
static String testSourceFolder = "testdata/java/";
static String testDestFolder = "testdata/dot-out";
static PrintWriter pw = new PrintWriter(System.out);
public static void main(String[] args) {
File outFolder = new File(testDestFolder);
if (!outFolder.exists())
outFolder.mkdirs();
runView("gr.spinellis.views.ViewChildEmpty");
runSingleClass("foo");
}
public static void runView(String viewClass) {
String[] options = new String[] { "-docletpath", "build", "-private", "-d",
testDestFolder, "-sourcepath", "testdata/java", "-subpackages",
"gr.spinellis", "-view", viewClass};
runDoclet(options);
}
public static void runSingleClass(String className) {
String[] options = new String[] { "-docletpath", "build", "-hide", "Hidden",
"-private", "-d", testDestFolder, "-output", className + ".dot", testSourceFolder + className + ".java"};
runDoclet(options);
}
private static void runDoclet(String[] options) {
com.sun.tools.javadoc.Main.execute("UMLGraph test", pw, pw, pw, "gr.spinellis.umlgraph.doclet.UmlGraph", options);
}
}

View File

@ -0,0 +1,61 @@
/*
* UmlGraph class diagram testing framework
*
* Contibuted by Andrea Aime
* (C) Copyright 2005 Diomidis Spinellis
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id$
*
*/
package gr.spinellis.umlgraph.test;
import java.io.File;
import java.io.PrintWriter;
public class RunOne {
static String testSourceFolder = "testdata/java/";
static String testDestFolder = "testdata/dot-out";
static PrintWriter pw = new PrintWriter(System.out);
public static void main(String[] args) {
File outFolder = new File(testDestFolder);
if (!outFolder.exists())
outFolder.mkdirs();
runView("gr.spinellis.views.ViewChildEmpty");
runSingleClass("foo");
}
public static void runView(String viewClass) {
String[] options = new String[] { "-docletpath", "build", "-private", "-d",
testDestFolder, "-sourcepath", "testdata/java", "-subpackages",
"gr.spinellis", "-view", viewClass};
runDoclet(options);
}
public static void runSingleClass(String className) {
String[] options = new String[] { "-docletpath", "build", "-hide", "Hidden",
"-private", "-d", testDestFolder, "-output", className + ".dot", testSourceFolder + className + ".java"};
runDoclet(options);
}
private static void runDoclet(String[] options) {
com.sun.tools.javadoc.Main.execute("UMLGraph test", pw, pw, pw, "gr.spinellis.umlgraph.doclet.UmlGraph", options);
}
}