List of usage examples for org.apache.commons.beanutils ConversionException getCause
public Throwable getCause()
From source file:com.puppycrawl.tools.checkstyle.checks.header.HeaderCheckTest.java
@Test public void testIoExceptionWhenLoadingHeader() throws Exception { HeaderCheck check = PowerMockito.spy(new HeaderCheck()); PowerMockito.doThrow(new IOException("expected exception")).when(check, "loadHeader", anyObject()); try {/*from ww w . j av a2 s . c om*/ check.setHeader("header"); fail("Exception expected"); } catch (ConversionException ex) { assertTrue(ex.getCause() instanceof IOException); assertEquals("unable to load header", ex.getMessage()); } }