Package com.sun.javatest
Class Command
- java.lang.Object
-
- com.sun.javatest.Command
-
- Direct Known Subclasses:
ExecStdTestSameJVMCmd
,JavaCompileCommand
,ProcessCommand
public abstract class Command extends java.lang.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 Summary
Constructors Constructor Description Command()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.ClassLoader
getClassLoader()
Get the class loader to be used if this command needs to dynamically load additional classes.abstract Status
run(java.lang.String[] args, java.io.PrintWriter out1, java.io.PrintWriter out2)
The method that that does the work of the command.void
setClassLoader(java.lang.ClassLoader cl)
Set a class loader that to be used if this command needs to dynamically load additional classes.
-
-
-
Method Detail
-
run
public abstract Status run(java.lang.String[] args, java.io.PrintWriter out1, java.io.PrintWriter out2)
The method that that does the work of the command.- Parameters:
args
- Command-specific options and argumentsout1
- 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
-
setClassLoader
public void setClassLoader(java.lang.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:
getClassLoader()
-
getClassLoader
public java.lang.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(java.lang.ClassLoader)
-
-