/**
* Simply check if {@link DefaultValidationResultsModel} counts its messages correctly.
*/
public void testMessageCount() {
DefaultValidationResultsModel resultsModel = new DefaultValidationResultsModel();
resultsModel.addMessage(new DefaultValidationMessage("property1", Severity.ERROR, "message1"));
resultsModel.addMessage(new DefaultValidationMessage("property1", Severity.INFO, "message2"));
resultsModel.addMessage(new DefaultValidationMessage("property2", Severity.ERROR, "message3"));
assertEquals("Number of messages should be 3", 3, resultsModel.getMessageCount());
assertEquals("Number of messages registered for property1 should be 2", 2, resultsModel.getMessageCount("property1"));
assertEquals("Number of messages flagged as INFO should be 1", 1, resultsModel.getMessageCount(Severity.INFO));