test/tools/javadoc/lib/Tester.java

Print this page




  22  */
  23 
  24 /*
  25  * A utility used to invoke and test the javadoc tool.
  26  *
  27  * @author Scott Seligman
  28  */
  29 
  30 
  31 import java.io.*;
  32 import java.util.*;
  33 import com.sun.javadoc.*;
  34 
  35 
  36 public class Tester {
  37 
  38     protected final String TEST_SRC = System.getProperty("test.src", ".");
  39     protected final String TEST_CLASSES = System.getProperty("test.classes",
  40                                                              ".");
  41     private final String DEFAULT_ARGS[] = {
  42         "-source", "1.5",
  43         "-sourcepath", TEST_SRC,
  44     };
  45 
  46     private final File outputFile = new File(TEST_CLASSES, "testrun.out");
  47     private final File expectedOutputFile = new File(TEST_SRC, "expected.out");
  48 //  private final File bootstrapMarkerFile = new File("bootstrap");
  49 
  50     // True if we should "set expectations" by writing the expected output file
  51     // rather than reading it and comparing.
  52 //  private final boolean bootstrap = bootstrapMarkerFile.isFile();
  53 
  54     private String docletName;
  55     private String[] args;
  56     private Writer out = null;
  57 
  58 
  59     /*
  60      * Individual tests can extend this to create generics-aware doclets.
  61      */
  62     public static abstract class Doclet extends com.sun.javadoc.Doclet {




  22  */
  23 
  24 /*
  25  * A utility used to invoke and test the javadoc tool.
  26  *
  27  * @author Scott Seligman
  28  */
  29 
  30 
  31 import java.io.*;
  32 import java.util.*;
  33 import com.sun.javadoc.*;
  34 
  35 
  36 public class Tester {
  37 
  38     protected final String TEST_SRC = System.getProperty("test.src", ".");
  39     protected final String TEST_CLASSES = System.getProperty("test.classes",
  40                                                              ".");
  41     private final String DEFAULT_ARGS[] = {

  42         "-sourcepath", TEST_SRC,
  43     };
  44 
  45     private final File outputFile = new File(TEST_CLASSES, "testrun.out");
  46     private final File expectedOutputFile = new File(TEST_SRC, "expected.out");
  47 //  private final File bootstrapMarkerFile = new File("bootstrap");
  48 
  49     // True if we should "set expectations" by writing the expected output file
  50     // rather than reading it and comparing.
  51 //  private final boolean bootstrap = bootstrapMarkerFile.isFile();
  52 
  53     private String docletName;
  54     private String[] args;
  55     private Writer out = null;
  56 
  57 
  58     /*
  59      * Individual tests can extend this to create generics-aware doclets.
  60      */
  61     public static abstract class Doclet extends com.sun.javadoc.Doclet {