public class FileAssert extends 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(File tstvalue) |
static void |
assertDirectory(File tstvalue,
String message)
Asserts that a
tstvalue is a proper directory. |
static void |
assertFile(File tstvalue) |
static void |
assertFile(File tstvalue,
String message)
Asserts that a
tstvalue is a proper file. |
static void |
assertLength(File tstvalue,
long expected) |
static void |
assertLength(File tstvalue,
long expected,
String message)
Asserts that a
tstvalue is a file of exactly expected characters or a directory
of exactly expected entries. |
static void |
assertMaxLength(File tstvalue,
long expected) |
static void |
assertMaxLength(File tstvalue,
long expected,
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(File tstvalue,
long expected) |
static void |
assertMinLength(File tstvalue,
long expected,
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(File tstvalue) |
static void |
assertReadable(File tstvalue,
String message)
Asserts that a
tstvalue is readable. |
static void |
assertReadWrite(File tstvalue) |
static void |
assertReadWrite(File tstvalue,
String message)
Asserts that a
tstvalue is readable and writeable. |
static void |
assertWriteable(File tstvalue) |
static void |
assertWriteable(File tstvalue,
String message)
Asserts that a
tstvalue is writeable. |
static void |
fail()
Fails a test with no message.
|
static void |
fail(String message)
Fails a test with the given message.
|
static void |
fail(String message,
Throwable realCause)
Fails a test with the given message and wrapping the original exception.
|
public static void assertDirectory(File tstvalue, 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(File tstvalue)
public static void assertFile(File tstvalue, 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(File tstvalue)
tstvalue - The actual fileassertFile(File, String)public static void assertLength(File tstvalue, long expected, 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 evaluateexpected - the expected valuemessage - the assertion error messagepublic static void assertLength(File tstvalue, long expected)
tstvalue - The actual fileexpected - The expected lengthassertLength(File, long, String)public static void assertMinLength(File tstvalue, long expected, 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 evaluateexpected - the expected valuemessage - the assertion error messagepublic static void assertMinLength(File tstvalue, long expected)
tstvalue - The actual fileexpected - The expected min lengthassertMinLength(File, long, String)public static void assertMaxLength(File tstvalue, long expected, 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 evaluateexpected - The expected max lengthmessage - the assertion error messagepublic static void assertMaxLength(File tstvalue, long expected)
tstvalue - The actual fileexpected - The expected lengthassertMaxLength(File, long, String)public static void assertReadable(File tstvalue, 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(File tstvalue)
tstvalue - The actual fileassertReadable(File, String)public static void assertWriteable(File tstvalue, 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(File tstvalue)
tstvalue - The actual fileassertWriteable(File, String)public static void assertReadWrite(File tstvalue, 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(File tstvalue)
tstvalue - The actual fileassertReadWrite(File, String)public static void fail(String message, Throwable realCause)
message - the assertion error messagerealCause - the original exceptionpublic static void fail(String message)
message - the assertion error messagepublic static void fail()
Copyright © 2025. All rights reserved.