[teiid-commits] teiid SVN: r1828 - trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Feb 15 15:26:34 EST 2010


Author: vhalbert at redhat.com
Date: 2010-02-15 15:26:34 -0500 (Mon, 15 Feb 2010)
New Revision: 1828

Modified:
   trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
Log:
Teiid-773 - changed the comparison logic to do it char by char.

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java	2010-02-15 20:24:04 UTC (rev 1827)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java	2010-02-15 20:26:34 UTC (rev 1828)
@@ -32,6 +32,7 @@
 import java.sql.SQLXML;
 import java.text.MessageFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -42,8 +43,8 @@
 import org.jdom.JDOMException;
 import org.teiid.test.client.ClassFactory;
 import org.teiid.test.client.ExpectedResults;
+import org.teiid.test.client.QueryScenario;
 import org.teiid.test.client.QueryTest;
-import org.teiid.test.client.QueryScenario;
 import org.teiid.test.client.ResultsGenerator;
 import org.teiid.test.client.TestProperties;
 import org.teiid.test.client.TestResult;
@@ -52,7 +53,6 @@
 import org.teiid.test.framework.TestLogger;
 import org.teiid.test.framework.exception.QueryTestFailedException;
 
-
 import com.metamatrix.core.util.StringUtil;
 
 
@@ -606,17 +606,22 @@
 		// TODO: Replace stripCR() with XMLUnit comparison for XML results.
 		// stripCR() is a workaround for comparing XML Queries
 		// that have '\r'.
-		String expected = stripCR(expectedStr);
-		String actual = stripCR(actualStr);
+		String expected = stripCR(expectedStr).trim();
+		String actual = stripCR(actualStr).trim();
 
 		String locationText = ""; //$NON-NLS-1$
 		int mismatchIndex = -1;
-		if (!expected.equals(actual)) {
+		
+		
+		boolean isequal = Arrays.equals(expected.toCharArray(), actual.toCharArray());
+		
+		//if (!expected.equals(actual)) {
+		if (!isequal) {
 			if (expected != null && actual != null) {
 				int shortestStringLength = expected.length();
 				if (actual.length() < expected.length()) {
 					shortestStringLength = actual.length();
-				}
+				} 
 				for (int i = 0; i < shortestStringLength; i++) {
 					if (expected.charAt(i) != actual.charAt(i)) {
 						locationText = "  Strings do not match at character: " + (i + 1) + //$NON-NLS-1$



More information about the teiid-commits mailing list