コード例 #1
0
 @Test
 public void testNestedServletExceptionStringThrowable() {
   Throwable cause = new RuntimeException();
   NestedServletException exception = new NestedServletException("foo", cause);
   assertEquals(NestedExceptionUtils.buildMessage("foo", cause), exception.getMessage());
   assertEquals(cause, exception.getCause());
 }
コード例 #2
0
 @Test
 public void testNestedServletExceptionString() {
   NestedServletException exception = new NestedServletException("foo");
   assertEquals("foo", exception.getMessage());
 }
コード例 #3
0
 @Test
 public void testNestedServletExceptionStringNullThrowable() {
   // This can happen if someone is sloppy with Throwable causes...
   NestedServletException exception = new NestedServletException("foo", null);
   assertEquals("foo", exception.getMessage());
 }