public class FileAssert
extends java.lang.Object
Assert
.
Presents assertion methods with a more natural parameter order. The order is always
actualValue, expectedValue [, message].Modifier and Type | Method and Description |
---|---|
static void |
assertDirectory(java.io.File tstvalue) |
static void |
assertDirectory(java.io.File tstvalue,
java.lang.String message)
Asserts that a
tstvalue is a proper directory. |
static void |
assertFile(java.io.File tstvalue) |
static void |
assertFile(java.io.File tstvalue,
java.lang.String message)
Asserts that a
tstvalue is a proper file. |
static void |
assertLength(java.io.File tstvalue,
long expected) |
static void |
assertLength(java.io.File tstvalue,
long expected,
java.lang.String message)
Asserts that a
tstvalue is a file of exactly expected characters or a directory
of exactly expected entries. |
static void |
assertMaxLength(java.io.File tstvalue,
long expected) |
static void |
assertMaxLength(java.io.File tstvalue,
long expected,
java.lang.String message)
Asserts that a
tstvalue is a file of at most expected characters or a directory
of at most expected entries. |
static void |
assertMinLength(java.io.File tstvalue,
long expected) |
static void |
assertMinLength(java.io.File tstvalue,
long expected,
java.lang.String message)
Asserts that a
tstvalue is a file of at least expected characters or a
directory of at least expected entries. |
static void |
assertReadable(java.io.File tstvalue) |
static void |
assertReadable(java.io.File tstvalue,
java.lang.String message)
Asserts that a
tstvalue is readable. |
static void |
assertReadWrite(java.io.File tstvalue) |
static void |
assertReadWrite(java.io.File tstvalue,
java.lang.String message)
Asserts that a
tstvalue is readable and writeable. |
static void |
assertWriteable(java.io.File tstvalue) |
static void |
assertWriteable(java.io.File tstvalue,
java.lang.String message)
Asserts that a
tstvalue is writeable. |
static void |
fail()
Fails a test with no message.
|
static void |
fail(java.lang.String message)
Fails a test with the given message.
|
static void |
fail(java.lang.String message,
java.lang.Throwable realCause)
Fails a test with the given message and wrapping the original exception.
|
public static void assertDirectory(java.io.File tstvalue, java.lang.String message)
tstvalue
is a proper directory. If it isn't, an AssertionError with the
given message is thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertDirectory(java.io.File tstvalue)
public static void assertFile(java.io.File tstvalue, java.lang.String message)
tstvalue
is a proper file. If it isn't, an AssertionError with the
given message is thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertFile(java.io.File tstvalue)
assertFile(File, String)
public static void assertLength(java.io.File tstvalue, long expected, java.lang.String message)
tstvalue
is a file of exactly expected
characters or a directory
of exactly expected
entries. If it isn't, an AssertionError with the given message is
thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertLength(java.io.File tstvalue, long expected)
assertLength(File, long, String)
public static void assertMinLength(java.io.File tstvalue, long expected, java.lang.String message)
tstvalue
is a file of at least expected
characters or a
directory of at least expected
entries. If it isn't, an AssertionError with the given
message is thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertMinLength(java.io.File tstvalue, long expected)
assertMinLength(File, long, String)
public static void assertMaxLength(java.io.File tstvalue, long expected, java.lang.String message)
tstvalue
is a file of at most expected
characters or a directory
of at most expected
entries. If it isn't, an AssertionError with the given message is
thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertMaxLength(java.io.File tstvalue, long expected)
assertMaxLength(File, long, String)
public static void assertReadable(java.io.File tstvalue, java.lang.String message)
tstvalue
is readable. If it isn't, an AssertionError with the given
message is thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertReadable(java.io.File tstvalue)
assertReadable(File, String)
public static void assertWriteable(java.io.File tstvalue, java.lang.String message)
tstvalue
is writeable. If it isn't, an AssertionError with the given
message is thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertWriteable(java.io.File tstvalue)
assertWriteable(File, String)
public static void assertReadWrite(java.io.File tstvalue, java.lang.String message)
tstvalue
is readable and writeable. If it isn't, an AssertionError with
the given message is thrown.tstvalue
- the file to evaluatemessage
- the assertion error messagepublic static void assertReadWrite(java.io.File tstvalue)
assertReadWrite(File, String)
public static void fail(java.lang.String message, java.lang.Throwable realCause)
message
- the assertion error messagerealCause
- the original exceptionpublic static void fail(java.lang.String message)
message
- the assertion error messagepublic static void fail()