mirror of
https://github.com/apache/struts.git
synced 2026-08-06 15:17:00 +00:00
WW-5063 Adds tests to cover new functionality
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
import org.apache.struts2.util.TestUtils;
|
||||
@@ -713,6 +714,16 @@ public class JSONResultTest extends StrutsTestCase {
|
||||
assertEquals("UTF-8", encoding);
|
||||
}
|
||||
|
||||
public void testPassingNullInvocation() throws Exception{
|
||||
Result result = new JSONResult();
|
||||
try {
|
||||
result.execute(null);
|
||||
fail("Exception should be thrown!");
|
||||
} catch (IllegalArgumentException e) {
|
||||
assertEquals("Invocation cannot be null!", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
Reference in New Issue
Block a user