public class Assertion extends Object
Modifier | Constructor and Description |
---|---|
protected |
Assertion(Assertion creator)
Constructor used when this assertion is being created from within another assertion.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
assertNotNull(Object value,
String msg,
Object... args)
Asserts the specified value is not null.
|
protected Object |
assertNotNull(String parameter,
Object value)
Asserts the specified parameter is not null.
|
protected static String |
className(Object o)
Convenience method for getting the class name for an object.
|
protected BasicAssertionError |
error(String msg,
Object... args)
Creates a new
BasicAssertionError . |
Assertion |
msg(String msg,
Object... args)
Allows to to specify the assertion failure message.
|
Assertion |
stderr()
If an error occurs, send the error message to STDERR.
|
Assertion |
stdout()
If an error occurs, send the error message to STDOUT.
|
public Assertion msg(String msg, Object... args)
String can contain
msg
- The assertion failure message.args
- Optional message arguments.public Assertion stdout()
public Assertion stderr()
protected BasicAssertionError error(String msg, Object... args)
BasicAssertionError
.msg
- The message.args
- The message arguments.BasicAssertionError
.protected static String className(Object o)
o
- The object to get the class name for.protected Object assertNotNull(Object value, String msg, Object... args)
value
- The value to check.msg
- The message.args
- The message arguments.protected Object assertNotNull(String parameter, Object value)
parameter
- The parameter name.value
- The value to check.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.