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
    //
 }

No comments:

Post a Comment