Class Command

java.lang.Object
com.sun.javatest.Command
Direct Known Subclasses:
ExecStdTestSameJVMCmd, JavaCompileCommand, ProcessCommand

public abstract class Command extends Object
Command provides the ability to invoke arbitrary Java code from within a Script. Standard implementations may exist to compile or execute tests, in the same JVM as the harness or its agent, in separate processes, or even on a separate machine. Custom implementations can also be used.
  • Constructor Details

    • Command

      public Command()
  • Method Details

    • run

      public abstract Status run(String[] args, PrintWriter out1, PrintWriter out2)
      The method that that does the work of the command.
      Parameters:
      args - Command-specific options and arguments
      out1 - A stream to which to report messages and errors. This stream was previously called "log".
      out2 - An additional stream to which to write output. This stream was previously called "ref".
      Returns:
      The result of the command
    • getClassLoader

      public ClassLoader getClassLoader()
      Get the class loader to be used if this command needs to dynamically load additional classes.
      Returns:
      the class loader to be used
      See Also:
    • setClassLoader

      public void setClassLoader(ClassLoader cl)
      Set a class loader that to be used if this command needs to dynamically load additional classes.
      Parameters:
      cl - the class loader to be used
      See Also: