|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.springframework.test.web.AbstractModelAndViewTests
public abstract class AbstractModelAndViewTests
Convenient base class for tests dealing with Spring web MVC
ModelAndView
objects.
ModelAndView
Constructor Summary | |
---|---|
AbstractModelAndViewTests()
|
Method Summary | |
---|---|
protected Object |
assertAndReturnModelAttributeOfType(ModelAndView mav,
Object key,
Class type)
Checks whether the given model key exists and checks it type, based on the given type. |
protected void |
assertCompareListModelAttribute(ModelAndView mav,
Object key,
List assertionList)
Compare each individual entry in a list, not sorting the lists first. |
protected void |
assertModelAttributeAvailable(ModelAndView mav,
Object key)
Assert whether or not a model attribute is available. |
protected void |
assertModelAttributeValue(ModelAndView mav,
Object key,
Object value)
Compare a given Object to the value from the model bound under the given key. |
protected void |
assertModelAttributeValues(ModelAndView mav,
Map assertionModel)
Inspect the given model to see if all elements in the model appear and are equal |
protected void |
assertSortAndCompareListModelAttribute(ModelAndView mav,
Object key,
List assertionList,
Comparator comp)
Compare each individual entry in a list after having sorted both lists (optionally using a comparator). |
protected void |
assertViewName(ModelAndView mav,
String name)
Check to see if the view name in the ModelAndView matches the given String. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractModelAndViewTests()
Method Detail |
---|
protected void assertModelAttributeAvailable(ModelAndView mav, Object key)
protected void assertCompareListModelAttribute(ModelAndView mav, Object key, List assertionList)
protected void assertSortAndCompareListModelAttribute(ModelAndView mav, Object key, List assertionList, Comparator comp)
comp
- the comparator to use. If not specifying the comparator,
both lists will be sorted not using any comparator.protected Object assertAndReturnModelAttributeOfType(ModelAndView mav, Object key, Class type)
protected void assertViewName(ModelAndView mav, String name)
protected void assertModelAttributeValue(ModelAndView mav, Object key, Object value)
protected void assertModelAttributeValues(ModelAndView mav, Map assertionModel)
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |