Skip to content

Commit c63cdb2

Browse files
author
David Syer
committed
OPEN - issue SPR-6246: Velocity MethodInvocationExceptions not properly reported
Added test case for exception. This probably fails on a non-Sun JVM?
1 parent 2978a4d commit c63cdb2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.springframework.web.util;
2+
3+
import static org.junit.Assert.*;
4+
5+
import org.junit.Test;
6+
import org.springframework.core.NestedExceptionUtils;
7+
8+
public class NestedServletExceptionTests {
9+
10+
@Test
11+
public void testNestedServletExceptionString() {
12+
NestedServletException exception = new NestedServletException("foo");
13+
assertEquals("foo", exception.getMessage());
14+
}
15+
16+
@Test
17+
public void testNestedServletExceptionStringThrowable() {
18+
Throwable cause = new RuntimeException();
19+
NestedServletException exception = new NestedServletException("foo", cause);
20+
assertEquals(NestedExceptionUtils.buildMessage("foo", cause), exception.getMessage());
21+
assertEquals(cause, exception.getCause());
22+
}
23+
24+
}

0 commit comments

Comments
 (0)