1 4 package com.tc.test.collections; 5 6 import com.tc.util.Stringifier; 7 import com.tc.util.diff.DifferenceBuilder; 8 import com.tc.util.diff.Differenceable; 9 10 13 class UnequalObjectCollectionMismatch extends CollectionMismatch { 14 15 public UnequalObjectCollectionMismatch(Object originating, Object comparedAgainst, 16 boolean originatingIsInCollectionOne, int originatingIndex, 17 int comparedAgainstIndex, Stringifier describer) { 18 super(originating, comparedAgainst, originatingIsInCollectionOne, originatingIndex, comparedAgainstIndex, describer); 19 } 20 21 public String toString() { 22 if (originating() != null && comparedAgainst() != null && (originating() instanceof Differenceable) 23 && (comparedAgainst() instanceof Differenceable)) { 24 return "Unequal objects: differences are: " 26 + DifferenceBuilder.describeDifferences((Differenceable) originating(), 27 (Differenceable) comparedAgainst(), describer()) + "\n" 28 + originatingString() + "\nis not equal to\n" + comparedAgainstString() + "\n"; 29 } 30 31 return "Unequal objects: " + originatingString() + " is not equal to " + comparedAgainstString(); 32 } 33 34 } | Popular Tags |