Example usage for java.io UncheckedIOException getMessage

List of usage examples for java.io UncheckedIOException getMessage

Introduction

In this page you can find the example usage for java.io UncheckedIOException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:objective.taskboard.utils.ZipUtilsTest.java

@Test
public void whenZipFolderNonexistent_ShouldThrowAnUncheckedIOException() throws IOException {
    Path source = Paths.get("sourceNonexistent");
    Path destiny = Paths.get("destinyNonexistent");
    try {/* w  w w.  j a v  a 2  s  . c o m*/
        zip(source, destiny);
        fail("Should have thrown UncheckedIOException");
    } catch (UncheckedIOException e) {
        assertEquals("Exception message", "java.nio.file.NoSuchFileException: sourceNonexistent",
                e.getMessage());
    } finally {
        deleteQuietly(destiny.toFile());
    }
}