@Test public void failureExceptionShouldKeepCause() throws MojoFailureException { IllegalArgumentException cause = new IllegalArgumentException("not valid"); FailureException failureException = new FailureException("Gurka", cause); expectedException.expect(MojoFailureException.class); expectedException.expectMessage("Gurka"); expectedException.expectCause(is(cause)); new ExceptionHandler(failureException).throwMojoFailureException(); }
public void throwMojoFailureException() throws MojoFailureException { if (fex.getCause() != null) { throw new MojoFailureException(fex.getMessage(), fex.getCause()); } else { throw new MojoFailureException(fex.getMessage()); } }
ExceptionHandler { public void throwMojoFailureException() throws MojoFailureException { if (fex.getCause() != null) { throw new MojoFailureException(fex.getMessage(), fex.getCause()); } else { throw new MojoFailureException(fex.getMessage()); } } }
ExceptionHandler { public void throwMojoFailureException() throws MojoFailureException { if (fex.getCause() != null) { throw new MojoFailureException(fex.getMessage(), fex.getCause()); } else { throw new MojoFailureException(fex.getMessage()); } } ExceptionHandler(FailureException fex); }
ExceptionHandler { public void throwMojoFailureException() throws MojoFailureException { if (fex.getCause() != null) { throw new MojoFailureException(fex.getMessage(), fex.getCause()); } else { throw new MojoFailureException(fex.getMessage()); } } ExceptionHandler(FailureException fex); void throwMojoFailureException(); }
ExceptionHandler { public void throwMojoFailureException() throws MojoFailureException { if (fex.getCause() != null) { throw new MojoFailureException(fex.getMessage(), fex.getCause()); } else { throw new MojoFailureException(fex.getMessage()); } } ExceptionHandler(FailureException fex); void throwMojoFailureException();  }