asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject incubator-asterixdb-hyracks git commit: Fix for ASTERIXDB-1200
Date Fri, 15 Jan 2016 16:42:41 GMT
Repository: incubator-asterixdb-hyracks
Updated Branches:
  refs/heads/master c10677f36 -> 84ddcb998


Fix for ASTERIXDB-1200

Fixes an issue where in the Hyracks integration tests,
if the result size is 0, a NPE is thrown instead of
an assert passing or failing.

Change-Id: Ib519882b9cbca941addcd66232c176a2eaeecc4b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/524
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/commit/84ddcb99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/tree/84ddcb99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/diff/84ddcb99

Branch: refs/heads/master
Commit: 84ddcb998e908cf4f8f27275aa6855063c14b3f0
Parents: c10677f
Author: Ian Maxon <imaxon@apache.org>
Authored: Thu Jan 14 16:23:52 2016 -0800
Committer: Ian Maxon <imaxon@apache.org>
Committed: Fri Jan 15 08:38:11 2016 -0800

----------------------------------------------------------------------
 .../tests/integration/AbstractIntegrationTest.java        | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/84ddcb99/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
----------------------------------------------------------------------
diff --git a/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
b/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
index 44dc231..7a339b7 100644
--- a/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
+++ b/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
@@ -145,7 +145,6 @@ public abstract class AbstractIntegrationTest {
         hcc.waitForCompletion(jobId);
     }
 
-
     protected List<String> readResults(JobSpecification spec, JobId jobId, ResultSetId
resultSetId) throws Exception {
         int nReaders = 1;
 
@@ -190,6 +189,10 @@ public abstract class AbstractIntegrationTest {
             results = readResults(spec, jobId, spec.getResultSetIds().get(i));
             BufferedReader expectedFile = new BufferedReader(new FileReader(expectedFileNames[i]));
 
+            //We're expecting some sort of result.
+            Assert.assertTrue(results != null);
+            Assert.assertTrue(results.size() > 0);
+
             String expectedLine, actualLine;
             int j = 0;
             while ((expectedLine = expectedFile.readLine()) != null) {
@@ -197,6 +200,7 @@ public abstract class AbstractIntegrationTest {
                 Assert.assertEquals(expectedLine, actualLine);
                 j++;
             }
+            //We also expect the same amount of results.
             Assert.assertEquals(j, results.size());
             expectedFile.close();
         }
@@ -212,7 +216,7 @@ public abstract class AbstractIntegrationTest {
         List<String> results;
         for (int i = 0; i < spec.getResultSetIds().size(); i++) {
             results = readResults(spec, jobId, spec.getResultSetIds().get(i));
-            for(String str : results) {
+            for (String str : results) {
                 output.write(str);
             }
         }
@@ -229,4 +233,4 @@ public abstract class AbstractIntegrationTest {
         outputFiles.add(tempFile);
         return tempFile;
     }
-}
\ No newline at end of file
+}


Mime
View raw message