Common test case support class for controllers, tag libraries, and anything else that has access to the standard web properties such as "request", "response", and "session".
Modifiers | Name | Description |
---|---|---|
protected java.util.Map |
forwardArgs |
|
protected java.util.Map |
mockFlash |
|
protected java.util.Map |
mockParams |
|
protected GrailsMockHttpServletRequest |
mockRequest |
|
protected GrailsMockHttpServletResponse |
mockResponse |
|
protected org.springframework.mock.web.MockHttpSession |
mockSession |
|
protected java.util.Map |
redirectArgs |
|
protected java.util.Map |
renderArgs |
|
protected GrailsWebRequest |
webRequest |
Fields inherited from class | Fields |
---|---|
class groovy.util.GroovyTestCase |
TEST_SCRIPT_NAME_PREFIX |
Constructor and description |
---|
MvcUnitTestCase
(java.lang.String suffix) Creates a new test case for the class whose name and package matches this test's class up to and including the given suffix. |
MvcUnitTestCase
(java.lang.Class clazz) Creates a new test case for the given class. |
Type | Name and description |
---|---|
protected java.lang.Object |
bindMockWebRequest(GrailsMockHttpServletRequest mockRequest, GrailsMockHttpServletResponse mockResponse) |
java.lang.Class |
getTestClass() |
protected java.lang.Object |
newInstance() |
protected void |
reset() |
protected void |
tearDown() |
Methods inherited from class | Name |
---|---|
class GrailsUnitTestCase |
addConverters, enableCascadingValidation, loadCodec, mockConfig, mockController, mockDomain, mockFor, mockForConstraintsTests, mockLogging, mockTagLib, registerMetaClass, setUp, tearDown |
class groovy.util.GroovyTestCase |
groovy.util.GroovyTestCase#getName(), groovy.util.GroovyTestCase#getMethodName(), groovy.util.GroovyTestCase#assertEquals(java.lang.String, java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#assertEquals(java.lang.String, java.lang.String), groovy.util.GroovyTestCase#assertEquals(java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#notYetImplemented(), groovy.util.GroovyTestCase#notYetImplemented(java.lang.Object), groovy.util.GroovyTestCase#run(), groovy.util.GroovyTestCase#run(junit.framework.TestResult), groovy.util.GroovyTestCase#toString(), groovy.util.GroovyTestCase#format(java.lang.String, java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#setName(java.lang.String), groovy.util.GroovyTestCase#fail(java.lang.String), groovy.util.GroovyTestCase#fail(), groovy.util.GroovyTestCase#assertNotNull(java.lang.String, java.lang.Object), groovy.util.GroovyTestCase#assertNotNull(java.lang.Object), groovy.util.GroovyTestCase#assertTrue(java.lang.String, boolean), groovy.util.GroovyTestCase#assertTrue(boolean), groovy.util.GroovyTestCase#countTestCases(), groovy.util.GroovyTestCase#assertEquals(java.lang.String, short, short), groovy.util.GroovyTestCase#assertEquals(char, char), groovy.util.GroovyTestCase#assertEquals(java.lang.String, char, char), groovy.util.GroovyTestCase#assertEquals(byte, byte), groovy.util.GroovyTestCase#assertEquals(java.lang.String, byte, byte), groovy.util.GroovyTestCase#assertEquals(boolean, boolean), groovy.util.GroovyTestCase#assertEquals(int, int), groovy.util.GroovyTestCase#assertEquals(java.lang.String, int, int), groovy.util.GroovyTestCase#assertEquals(short, short), groovy.util.GroovyTestCase#assertEquals(java.lang.String, float, float, float), groovy.util.GroovyTestCase#assertEquals(double, double, double), groovy.util.GroovyTestCase#assertEquals(java.lang.String, java.lang.String, java.lang.String), groovy.util.GroovyTestCase#assertEquals(java.lang.String, double, double, double), groovy.util.GroovyTestCase#assertEquals(java.lang.String, boolean, boolean), groovy.util.GroovyTestCase#assertEquals(long, long), groovy.util.GroovyTestCase#assertEquals(java.lang.String, long, long), groovy.util.GroovyTestCase#assertEquals(float, float, float), groovy.util.GroovyTestCase#runBare(), groovy.util.GroovyTestCase#assertFalse(boolean), groovy.util.GroovyTestCase#assertFalse(java.lang.String, boolean), groovy.util.GroovyTestCase#assertNull(java.lang.Object), groovy.util.GroovyTestCase#assertNull(java.lang.String, java.lang.Object), groovy.util.GroovyTestCase#assertSame(java.lang.String, java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#assertSame(java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#assertNotSame(java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#assertNotSame(java.lang.String, java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#failSame(java.lang.String), groovy.util.GroovyTestCase#failNotSame(java.lang.String, java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#failNotEquals(java.lang.String, java.lang.Object, java.lang.Object), groovy.util.GroovyTestCase#wait(long, int), groovy.util.GroovyTestCase#wait(long), groovy.util.GroovyTestCase#wait(), groovy.util.GroovyTestCase#equals(java.lang.Object), groovy.util.GroovyTestCase#hashCode(), groovy.util.GroovyTestCase#getClass(), groovy.util.GroovyTestCase#notify(), groovy.util.GroovyTestCase#notifyAll() |
Creates a new test case for the class whose name and package
matches this test's class up to and including the given suffix.
In other words, if this test is org.example.MyControllerTests
then the class under test is org.example.MyController
.
This example assumes that the suffix is "Controller".
Creates a new test case for the given class.