Hi, 

If you don't know what ValidationResult is, check out 
http://www.ovirt.org/ValidationResult 

In a gist, I added a new way to test this using JUnit's assertThat syntax: 
// Test that validation result is valid
assertThat(someValidation(), isValid());

// Test that validation result is invalid
assertThat(someValidation(), failsWith(VdcBllMessages.SOME_ERROR));

// Test that validation result is invalid and has replacement
assertThat(someValidation(), 
both(failsWith(VdcBllMessages.SOME_ERROR)).and(replacements(hasItem(EXPECTED_REPLACEMENT))));
 You need to statically import ValidationResultMatchers (and the basic JUnit 
matchers) for this to work. 

The rest I documented in the aforementioned wiki. 

Check out the patch: http://gerrit.ovirt.org/#/c/13061 

Or how to use it: http://gerrit.ovirt.org/#/c/13062 


Regards, 
Mike 

_______________________________________________
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel

Reply via email to