Diary of a (not so) lazy Java Developer coping with Java SE, Jave EE, ORM, Spring and the idiosyncrasy of IT.
Search This Blog
Tuesday, September 24, 2013
A Littel Junit Helper: org.junit.Assume
By using the JUnit's AssumeXXX methods, tests can be run based on specific assumptions.
If the assumption is not met the test will not run but will be shown as passed.
As Explained by an example:
@Test
public void checkNtfsFileSystem() {
FileSystem fileSystem = FileSystems.getType()
assumeTrue(fileSystem == NTFS); // run test only if filesystem is NTFS
//
// do test
//
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment