Browse Source

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

Added test case for exception.  This probably fails on a non-Sun JVM?
pull/23217/head
David Syer 16 years ago
parent
commit
c63cdb2444
  1. 24
      org.springframework.web.servlet/src/test/java/org/springframework/web/util/NestedServletExceptionTests.java

24
org.springframework.web.servlet/src/test/java/org/springframework/web/util/NestedServletExceptionTests.java

@ -0,0 +1,24 @@ @@ -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());
}
}
Loading…
Cancel
Save