google-nomulus/java
Ben McIlwain f5e76868f0 Add generic implementation comparator
This is an alternative to the "manually constructed" version in []

This generator recieves two objects implementing some interface. It returns a new implementation that exactly duplicates the behavior (return values, exceptions etc.) of the first ("original") object, but also logs any differences (in either return value or thrown exception) from the second object.

Nothing in the second object's execution will affect the results - not even thrown exceptions - it's only used for logging any differences.

This is useful when switching backend architecture for the some interface (say... from keystore to datastore+KMS for the Keyring interface :)) as we can make sure everything was OK for some extended period of real data before doing the switch.

This is better than just comparing the outputs once because having a completely different backend out of our control can result in "glitches" that are rare but relevant: maybe the new backend has lower availability, or sometimes fails and gives wrong results, or... well, that's it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=149706165
2017-03-13 11:22:55 -04:00
..
com/google/testing/builddefs Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
google/registry Add generic implementation comparator 2017-03-13 11:22:55 -04:00