Rename .toString and .equals to be less confusing.

There will now be "resultToString" and "resultEquals" to stringify / compare
the method results.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150135475
This commit is contained in:
guyben 2017-03-14 17:14:58 -07:00 committed by Ben McIlwain
parent 3a13a4d6b6
commit e6a5083b55
2 changed files with 23 additions and 22 deletions

View file

@ -79,26 +79,27 @@ public class ComparingInvocationHandlerTest {
log.add(String.format("%s: %s", method.getName(), message));
}
@Override protected boolean equals(Method method, @Nullable Object a, @Nullable Object b) {
@Override protected boolean compareResults(
Method method, @Nullable Object a, @Nullable Object b) {
if (method.getReturnType().equals(Dummy.class)) {
return dummyEqualsResult;
}
return super.equals(method, a, b);
return super.compareResults(method, a, b);
}
@Override protected String toString(Method method, @Nullable Object a) {
@Override protected String stringifyResult(Method method, @Nullable Object a) {
if (method.getReturnType().equals(Dummy.class)) {
return "dummy";
}
return super.toString(method, a);
return super.stringifyResult(method, a);
}
@Override protected boolean exceptionEquals(Method method, Throwable a, Throwable b) {
return exceptionEqualsResult && super.exceptionEquals(method, a, b);
@Override protected boolean compareException(Method method, Throwable a, Throwable b) {
return exceptionEqualsResult && super.compareException(method, a, b);
}
@Override protected String exceptionToString(Method method, Throwable a) {
return String.format("testException(%s)", super.exceptionToString(method, a));
@Override protected String stringifyException(Method method, Throwable a) {
return String.format("testException(%s)", super.stringifyException(method, a));
}
}