|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Testable
A testing interface for Java command-line applications.
| Field Summary | |
|---|---|
static int |
APPLICATION_ERROR
|
static int |
COMMAND_LINE_ERROR
|
static int |
CONFIG_FILE_ERROR
|
static int |
SECURITY_ERROR
|
static int |
SUCCESS_CODE
|
| Method Summary | |
|---|---|
String[] |
getArgs()
Gets the command-line arguments used to invoke the application. |
int |
getExitCode()
Gets the exit code. |
int |
getExitCode(boolean forceRun)
A convenience method that executes the application and gets the exit code. |
void |
run()
Execute the command-line application. |
void |
setExitCode(int exitCode)
Sets the exit code of the application. |
| Field Detail |
|---|
static final int SUCCESS_CODE
static final int SECURITY_ERROR
static final int CONFIG_FILE_ERROR
static final int COMMAND_LINE_ERROR
static final int APPLICATION_ERROR
| Method Detail |
|---|
String[] getArgs()
void run()
throws ApplicationRuntimeException
setExitCode(int) but
MUST NOT call System.exit(int).
ApplicationRuntimeException - if execution of the application failsvoid setExitCode(int exitCode)
exitCode - the exit codeint getExitCode()
setExitCode(int) method,
otherwise this method returns SECURITY_ERROR.
int getExitCode(boolean forceRun)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||