Assert |
Assert (see Figure B-1) contains only static methods. Its public interface consists solely of unit test assert methods. These methods throw an AssertionFailedError or ComparisonFailure if the test fails. Assert is a parent class of TestCase and other classes that use unit test assert methods.
public class Assert extends Object
Constructor for Assert . It is protected since this is a static class.
Asserts equality of two boolean values.
Asserts equality of two byte values.
Asserts equality of two char values.
Asserts equality of two double values within a tolerance of delta . A delta of tests exact equality.
Asserts equality of two float values within a tolerance of delta . A delta of tests exact equality.
Asserts equality of two int values.
Asserts equality of two long values.
Asserts equality of two Object s using the method Object.equals( ) .
Asserts equality of two short values.
Asserts equality of two String s using the method String.equals( ) .
Asserts that a boolean condition is false.
Asserts that an Object is not null .
Asserts that two Object s are not the same Object using the == " operator.
Asserts that an Object is null .
Asserts that two Object s are the same Object using the == operator.
Asserts that a condition is true, the most generic type of assertion.
Produces a test failure.
Private methods to deal with a test failure by calling fail() with a formatted message string.
Package private method to format a failure message.
None.