OPEN - issue SPR-6246: Velocity MethodInvocationExceptions not properly reported

Added test case for exception.  This probably fails on a non-Sun JVM?
This commit is contained in:
David Syer 2009-10-27 12:32:14 +00:00
parent 2978a4d0eb
commit c63cdb2444
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package org.springframework.web.util;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.core.NestedExceptionUtils;
public class NestedServletExceptionTests {
@Test
public void testNestedServletExceptionString() {
NestedServletException exception = new NestedServletException("foo");
assertEquals("foo", exception.getMessage());
}
@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());
}
}