cryptix.util.test

Class TestException


public class TestException
extends Exception

This exception is thrown when a test fails. If the test is running directly from the command line, the getErrorCode() method returns the error code that should be passed to System.exit.

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.2 $

Author:
David Hopwood

Since:
Cryptix 3.0.2

Field Summary

static int
ABORTED_BY_USER
static int
COMPLETE_FAILURE
static int
COMPLETE_SUCCESS
static int
FATAL_ERROR
static int
ILLEGAL_ARGUMENTS
static int
NO_TESTS_AVAILABLE
static int
PARTIAL_FAILURE

Constructor Summary

TestException(String reason, int code)
Constructs a TestException with the specified detail message and error code.

Method Summary

int
getErrorCode()
Returns the error code that should be passed to System.exit.

Field Details

ABORTED_BY_USER

public static final int ABORTED_BY_USER

Field Value:
5


COMPLETE_FAILURE

public static final int COMPLETE_FAILURE

Field Value:
1


COMPLETE_SUCCESS

public static final int COMPLETE_SUCCESS

Field Value:
10


FATAL_ERROR

public static final int FATAL_ERROR

Field Value:
0


ILLEGAL_ARGUMENTS

public static final int ILLEGAL_ARGUMENTS

Field Value:
2


NO_TESTS_AVAILABLE

public static final int NO_TESTS_AVAILABLE

Field Value:
3


PARTIAL_FAILURE

public static final int PARTIAL_FAILURE

Field Value:
4

Constructor Details

TestException

public TestException(String reason,
                     int code)
Constructs a TestException with the specified detail message and error code.

Parameters:
reason - the reason why the exception was thrown.
code - the error code.

Method Details

getErrorCode

public int getErrorCode()
Returns the error code that should be passed to System.exit.