示例#1
0
 @Test
 public void shouldReturnHasCodeOnNonFatal() {
   final Exception exception = new java.lang.Exception();
   final NonFatalException cause = NonFatalException.of(exception);
   assertThat(cause.hashCode()).isEqualTo(Objects.hashCode(exception));
 }
示例#2
0
 @Test
 public void shouldReturnToStringOnNonFatal() {
   final Exception exception = new java.lang.Exception();
   final NonFatalException cause = NonFatalException.of(exception);
   assertThat(cause.toString()).isEqualTo("NonFatal(" + exception.toString() + ")");
 }
示例#3
0
 @Test
 public void shouldDetectNonFatalException() throws Exception {
   final NonFatalException cause = NonFatalException.of(new Exception());
   assertThat(cause).isNotNull();
 }
示例#4
0
 @Test
 public void shouldReturnAndNotThrowOnNonFatal() {
   final NonFatalException cause = NonFatalException.of(new Exception());
   assertThat(NonFatalException.of(cause)).isNotNull();
 }
示例#5
0
 @Test(expected = Try.FatalException.class)
 public void shouldDetectFatalException() throws Exception {
   NonFatalException.of(new OutOfMemoryError());
 }