assertContainsMessage(vm, vr.getMessages(Severity.INFO));
assertEquals(false, vr.getHasErrors());
assertEquals(false, vr.getHasWarnings());
assertEquals(true, vr.getHasInfo());
vm = new DefaultValidationMessage("field2", Severity.WARNING, "message");
vr.addMessage(vm);
assertEquals(2, vr.getMessageCount());
assertEquals(1, vr.getMessageCount(Severity.WARNING));
assertEquals(1, vr.getMessageCount("field2"));
assertContainsMessage(vm, vr.getMessages());
assertContainsMessage(vm, vr.getMessages("field2"));
assertContainsMessage(vm, vr.getMessages(Severity.WARNING));
assertEquals(false, vr.getHasErrors());
assertEquals(true, vr.getHasWarnings());
assertEquals(true, vr.getHasInfo());
vm = new DefaultValidationMessage(ValidationMessage.GLOBAL_PROPERTY, Severity.ERROR, "message");
vr.addMessage(vm);
assertEquals(3, vr.getMessageCount());
assertEquals(1, vr.getMessageCount(Severity.ERROR));
assertEquals(1, vr.getMessageCount(ValidationMessage.GLOBAL_PROPERTY));
assertContainsMessage(vm, vr.getMessages());
assertContainsMessage(vm, vr.getMessages(ValidationMessage.GLOBAL_PROPERTY));
assertContainsMessage(vm, vr.getMessages(Severity.ERROR));
assertEquals(true, vr.getHasErrors());
assertEquals(true, vr.getHasWarnings());
assertEquals(true, vr.getHasInfo());
vm = new DefaultValidationMessage("field1", Severity.ERROR, "message");
vr.addMessage(vm);
assertEquals(4, vr.getMessageCount());
assertEquals(2, vr.getMessageCount(Severity.ERROR));
assertEquals(2, vr.getMessageCount("field1"));
assertContainsMessage(vm, vr.getMessages());
assertContainsMessage(vm, vr.getMessages("field1"));
assertContainsMessage(vm, vr.getMessages(Severity.ERROR));
DefaultValidationResults vr2 = new DefaultValidationResults();
vm = new DefaultValidationMessage("newField", Severity.INFO, "message");
vr2.addMessage(vm);
ValidationMessage vm2 = new DefaultValidationMessage("newField", Severity.ERROR, "message");
vr2.addMessage(vm2);
vr.addAllMessages(vr2.getMessages());
assertEquals(6, vr.getMessageCount());
assertEquals(3, vr.getMessageCount(Severity.ERROR));