@ Override public String getDescription ( Comparison difference ) { final ComparisonType type = difference . getType ( ) ; String description = type . getDescription ( ) ; final Detail controlDetails = difference . getControlDetails ( ) ; final Detail testDetails = difference . getTestDetails ( ) ; final String controlTarget = getShortString ( controlDetails . getTarget ( ) , controlDetails . getXPath ( ) , type ) ; final String testTarget = getShortString ( testDetails . getTarget ( ) , testDetails . getXPath ( ) , type ) ; if ( type == ComparisonType . ATTR_NAME_LOOKUP ) { return String . format ( "Expected %s '%s' - comparing %s to %s" , description , controlDetails . getXPath ( ) , controlTarget , testTarget ) ; } return String . format ( "Expected %s '%s' but was '%s' - comparing %s to %s" , description , getValue ( controlDetails . getValue ( ) , type ) , getValue ( testDetails . getValue ( ) , type ) , controlTarget , testTarget ) ; }
Return a short String of the Comparison including the XPath and the shorten value of the effected control and test Node .