Example usage for org.springframework.beans.factory BeanInitializationException getCause

List of usage examples for org.springframework.beans.factory BeanInitializationException getCause

Introduction

In this page you can find the example usage for org.springframework.beans.factory BeanInitializationException 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:com.brienwheeler.lib.spring.beans.PropertyPlaceholderConfigurerTest.java

@Test
public void testIOException() {
    try {//from ww w .  ja v  a 2  s. c om
        PropertyPlaceholderConfigurer.processLocation(
                "classpath:com/brienwheeler/lib/spring/beans/PropertyPlaceholderConfigurer-test-not-existent.properties");
        Assert.fail();
    } catch (BeanInitializationException e) {
        Assert.assertNotNull(e.getCause());
        Assert.assertEquals(FileNotFoundException.class, e.getCause().getClass());
    }
}