|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.assertj.core.internal.Files
public class Files
Reusable assertions for s.
File
| Method Summary | |
|---|---|
void |
assertCanRead(AssertionInfo info,
File actual)
Asserts that the given file can be read by the application. |
void |
assertCanWrite(AssertionInfo info,
File actual)
Asserts that the given file can be modified by the application. |
void |
assertDoesNotExist(AssertionInfo info,
File actual)
Asserts that the given file does not exist. |
void |
assertEqualContent(AssertionInfo info,
File actual,
File expected)
Asserts that the given files have equal content. |
void |
assertExists(AssertionInfo info,
File actual)
Asserts that the given file exists, regardless it's a file or directory. |
void |
assertHasBinaryContent(AssertionInfo info,
File actual,
byte[] expected)
Asserts that the given file has the given binary content. |
void |
assertHasContent(AssertionInfo info,
File actual,
String expected,
Charset charset)
Asserts that the given file has the given text content. |
void |
assertHasExtension(AssertionInfo info,
File actual,
String expected)
Asserts that the given File has the given extension. |
void |
assertHasName(AssertionInfo info,
File actual,
String expected)
Asserts that the given File has the given name. |
void |
assertHasNoParent(AssertionInfo info,
File actual)
Asserts that the given File does not have a parent. |
void |
assertHasParent(AssertionInfo info,
File actual,
File expected)
Asserts that the given File has the given parent. |
void |
assertIsAbsolute(AssertionInfo info,
File actual)
Asserts that the given file is an absolute path. |
void |
assertIsDirectory(AssertionInfo info,
File actual)
Asserts that the given file is an existing directory. |
void |
assertIsFile(AssertionInfo info,
File actual)
Asserts that the given file is an existing file. |
void |
assertIsRelative(AssertionInfo info,
File actual)
Asserts that the given file is a relative path. |
static Files |
instance()
Returns the singleton instance of this class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Files instance()
public void assertEqualContent(AssertionInfo info,
File actual,
File expected)
info - contains information about the assertion.actual - the "actual" file.expected - the "expected" file.
NullPointerException - if expected is null.
IllegalArgumentException - if expected is not an existing file.
AssertionError - if actual is null.
AssertionError - if actual is not an existing file.
FilesException - if an I/O error occurs.
AssertionError - if the given files do not have equal content.
public void assertHasBinaryContent(AssertionInfo info,
File actual,
byte[] expected)
info - contains information about the assertion.actual - the "actual" file.expected - the "expected" binary content.
NullPointerException - if expected is null.
AssertionError - if actual is null.
AssertionError - if actual is not an existing file.
FilesException - if an I/O error occurs.
AssertionError - if the file does not have the binary content.
public void assertHasContent(AssertionInfo info,
File actual,
String expected,
Charset charset)
info - contains information about the assertion.actual - the "actual" file.expected - the "expected" text content.charset - the charset to use to read the file.
NullPointerException - if expected is null.
AssertionError - if actual is null.
AssertionError - if actual is not an existing file.
FilesException - if an I/O error occurs.
AssertionError - if the file does not have the text content.
public void assertIsFile(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file is not an existing file.
public void assertIsDirectory(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file is not an existing directory.
public void assertIsAbsolute(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file is not an absolute path.
public void assertIsRelative(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file is not a relative path.
public void assertExists(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file does not exist.
public void assertDoesNotExist(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file exists.
public void assertCanWrite(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file can not be modified.
public void assertCanRead(AssertionInfo info,
File actual)
info - contains information about the assertion.actual - the given file.
AssertionError - if the given file is null.
AssertionError - if the given file can not be modified.
public void assertHasParent(AssertionInfo info,
File actual,
File expected)
File has the given parent.
info - contains information about the assertion.actual - the given file.expected - the expected parent File.
NullPointerException - if the expected parent File is null.
FilesException - if an I/O error occurs.
AssertionError - if the given File is null.
AssertionError - if the given File does not have a parent.
AssertionError - if the given File parent is not equal to the expected one.
public void assertHasExtension(AssertionInfo info,
File actual,
String expected)
File has the given extension.
info - contains information about the assertion.actual - the given file.expected - the expected extension, it does not contains the '.'
NullPointerException - if the expected extension is null.
AssertionError - if the actual File is null.
AssertionError - if the actual File is not a file (ie a directory).
AssertionError - if the actual File does not have the expected extension.
public void assertHasName(AssertionInfo info,
File actual,
String expected)
File has the given name.
info - contains information about the assertion.actual - the given file.expected - the expected file name.
NullPointerException - if the expected name is null.
AssertionError - if the actual File is null.
AssertionError - if the actual File does not have the expected name.
public void assertHasNoParent(AssertionInfo info,
File actual)
File does not have a parent.
info - contains information about the assertion.actual - the given file.
AssertionError - if the actual File is null.
AssertionError - if the actual File has a parent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||