Example usage for java.util MissingResourceException getCause

List of usage examples for java.util MissingResourceException getCause

Introduction

In this page you can find the example usage for java.util MissingResourceException getCause.

Prototype

public synchronized Throwable getCause() 

Source Link

Document

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Usage

From source file:org.synyx.sample.ResourceBundleMessageSourceTest.java

@Test
public void test_util_resource_bundle_with_broken() {
    try {//  w w  w .  j  a  v  a 2s  .c o  m
        ResourceBundle.getBundle("broken_messages");
        fail("Should throw Exception due to wrong format of file");
    } catch (MissingResourceException e) {
        assertTrue(e.getCause() instanceof IllegalArgumentException);
    }
}