01: /*
02: * UmlGraph class diagram testing framework
03: *
04: * Contibuted by Andrea Aime
05: * (C) Copyright 2005 Diomidis Spinellis
06: *
07: * Permission to use, copy, and distribute this software and its
08: * documentation for any purpose and without fee is hereby granted,
09: * provided that the above copyright notice appear in all copies and that
10: * both that copyright notice and this permission notice appear in
11: * supporting documentation.
12: *
13: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
14: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
15: * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16: *
17: * $Id$
18: *
19: */
20:
21: package org.umlgraph.test;
22:
23: import java.io.File;
24: import java.io.PrintWriter;
25:
26: public class RunOne {
27:
28: static String testSourceFolder = "testdata/java/";
29:
30: static String testDestFolder = "testdata/dot-out";
31:
32: static PrintWriter pw = new PrintWriter(System.out);
33:
34: public static void main(String[] args) {
35: File outFolder = new File(testDestFolder);
36: if (!outFolder.exists())
37: outFolder.mkdirs();
38:
39: // runView("gr.spinellis.views.ViewChildEmpty");
40: runSingleClass("TestHiddenOp");
41: }
42:
43: public static void runView(String viewClass) {
44: String[] options = new String[] { "-docletpath", "build",
45: "-private", "-d", testDestFolder, "-sourcepath",
46: "testdata/java", "-subpackages", "gr.spinellis",
47: "-view", viewClass };
48: runDoclet(options);
49: }
50:
51: public static void runSingleClass(String className) {
52: String[] options = new String[] { "-docletpath", "build",
53: "-hide", "Hidden", "-private", "-d", testDestFolder,
54: "-output", className + ".dot",
55: testSourceFolder + className + ".java" };
56: runDoclet(options);
57: }
58:
59: private static void runDoclet(String[] options) {
60: com.sun.tools.javadoc.Main.execute("UMLGraph test", pw, pw, pw,
61: "org.umlgraph.doclet.UmlGraph", options);
62: }
63:
64: }
|