pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject svn commit: r1734023 - in /pig/branches/spark/test/org/apache/pig/test: TestMultiQuery.java Util.java
Date Tue, 08 Mar 2016 05:53:32 GMT
Author: xuefu
Date: Tue Mar  8 05:53:32 2016
New Revision: 1734023

URL: http://svn.apache.org/viewvc?rev=1734023&view=rev
Log:
PIG-4828: TestMultiQuery test fix (Pallavi via Xuefu)

Modified:
    pig/branches/spark/test/org/apache/pig/test/TestMultiQuery.java
    pig/branches/spark/test/org/apache/pig/test/Util.java

Modified: pig/branches/spark/test/org/apache/pig/test/TestMultiQuery.java
URL: http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/TestMultiQuery.java?rev=1734023&r1=1734022&r2=1734023&view=diff
==============================================================================
--- pig/branches/spark/test/org/apache/pig/test/TestMultiQuery.java (original)
+++ pig/branches/spark/test/org/apache/pig/test/TestMultiQuery.java Tue Mar  8 05:53:32 2016
@@ -834,12 +834,12 @@ public class TestMultiQuery {
         List<Tuple> actualResults = data.get("output1");
         List<Tuple> expectedResults = Util.getTuplesFromConstantTupleStrings(
                 new String[] {"(1)", "(2)"});
-        Util.checkQueryOutputs(actualResults.iterator(), expectedResults);
+        Util.checkQueryOutputsAfterSort(actualResults.iterator(), expectedResults);
 
         actualResults = data.get("output2");
         expectedResults = Util.getTuplesFromConstantTupleStrings(
                 new String[] {"(1, 'world')", "(2, 'world')"});
-        Util.checkQueryOutputs(actualResults.iterator(), expectedResults);
+        Util.checkQueryOutputsAfterSort(actualResults.iterator(), expectedResults);
     }
 
     @Test

Modified: pig/branches/spark/test/org/apache/pig/test/Util.java
URL: http://svn.apache.org/viewvc/pig/branches/spark/test/org/apache/pig/test/Util.java?rev=1734023&r1=1734022&r2=1734023&view=diff
==============================================================================
--- pig/branches/spark/test/org/apache/pig/test/Util.java (original)
+++ pig/branches/spark/test/org/apache/pig/test/Util.java Tue Mar  8 05:53:32 2016
@@ -524,11 +524,10 @@ public class Util {
      static public void checkQueryOutputs(Iterator<Tuple> actualResults,
                                      List<Tuple> expectedResults) {
          int count = 0;
-         // Order of expected and actual can be different.
-         while (actualResults.hasNext()) {
+         for (Tuple expected : expectedResults) {
              Tuple actual = actualResults.next();
              count++;
-             Assert.assertTrue(expectedResults.contains(actual));
+             Assert.assertEquals(expected.toString(), actual.toString());
          }
          Assert.assertEquals(expectedResults.size(), count);
      }



Mime
View raw message