AbstractJUnit38SpringContextTests
)
or ModelAndViewAssert
with JUnit 4 and TestNG.@Deprecated public abstract class AbstractModelAndViewTests extends junit.framework.TestCase
ModelAndView
objects.
All assert*()
methods throw AssertionFailedError
s.
Consider the use of ModelAndViewAssert
with JUnit 4 and TestNG.
ModelAndView
,
ModelAndViewAssert
Constructor and Description |
---|
AbstractModelAndViewTests()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected <T> T |
assertAndReturnModelAttributeOfType(ModelAndView mav,
String modelName,
Class<T> expectedType)
Deprecated.
Checks whether the model value under the given
modelName
exists and checks it type, based on the expectedType . |
protected void |
assertCompareListModelAttribute(ModelAndView mav,
String modelName,
List expectedList)
Deprecated.
Compare each individual entry in a list, without first sorting the lists.
|
protected void |
assertModelAttributeAvailable(ModelAndView mav,
String modelName)
Deprecated.
Assert whether or not a model attribute is available.
|
protected void |
assertModelAttributeValue(ModelAndView mav,
String modelName,
Object expectedValue)
Deprecated.
Compare a given
expectedValue to the value from the model
bound under the given modelName . |
protected void |
assertModelAttributeValues(ModelAndView mav,
Map<String,Object> expectedModel)
Deprecated.
Inspect the
expectedModel to see if all elements in the
model appear and are equal. |
protected void |
assertSortAndCompareListModelAttribute(ModelAndView mav,
String modelName,
List expectedList,
Comparator comparator)
Deprecated.
Compare each individual entry in a list after having sorted both lists
(optionally using a comparator).
|
protected void |
assertViewName(ModelAndView mav,
String expectedName)
Deprecated.
Check to see if the view name in the ModelAndView matches the given
expectedName . |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
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
protected <T> T assertAndReturnModelAttributeOfType(ModelAndView mav, String modelName, Class<T> expectedType)
modelName
exists and checks it type, based on the expectedType
. If
the model entry exists and the type matches, the model value is returned.mav
- ModelAndView to test against (never null
)modelName
- name of the object to add to the model (never
null
)expectedType
- expected type of the model valueprotected void assertCompareListModelAttribute(ModelAndView mav, String modelName, List expectedList)
mav
- ModelAndView to test against (never null
)modelName
- name of the object to add to the model (never
null
)expectedList
- the expected listprotected void assertModelAttributeAvailable(ModelAndView mav, String modelName)
mav
- ModelAndView to test against (never null
)modelName
- name of the object to add to the model (never
null
)protected void assertModelAttributeValue(ModelAndView mav, String modelName, Object expectedValue)
expectedValue
to the value from the model
bound under the given modelName
.mav
- ModelAndView to test against (never null
)modelName
- name of the object to add to the model (never
null
)expectedValue
- the model valueprotected void assertModelAttributeValues(ModelAndView mav, Map<String,Object> expectedModel)
expectedModel
to see if all elements in the
model appear and are equal.mav
- ModelAndView to test against (never null
)expectedModel
- the expected modelprotected void assertSortAndCompareListModelAttribute(ModelAndView mav, String modelName, List expectedList, Comparator comparator)
mav
- ModelAndView to test against (never null
)modelName
- name of the object to add to the model (never
null
)expectedList
- the expected listcomparator
- the comparator to use (may be null
). If
not specifying the comparator, both lists will be sorted not using
any comparator.protected void assertViewName(ModelAndView mav, String expectedName)
expectedName
.mav
- ModelAndView to test against (never null
)expectedName
- the name of the model value