Repository: incubator-hawq
Updated Branches:
  refs/heads/master 9fd36e3e3 -> 46fac1851


HAWQ-1537. Sort files explicitly in PartitionedJsonParserNoSeekTest.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/46fac185
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/46fac185
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/46fac185

Branch: refs/heads/master
Commit: 46fac18511e82b5a3b4bba653c43a606ec202be5
Parents: 9fd36e3
Author: Oleksandr Diachenko <[email protected]>
Authored: Mon Oct 9 15:46:54 2017 -0700
Committer: Oleksandr Diachenko <[email protected]>
Committed: Mon Oct 9 15:46:54 2017 -0700

----------------------------------------------------------------------
 .../json/parser/PartitionedJsonParserNoSeekTest.java     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/46fac185/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/parser/PartitionedJsonParserNoSeekTest.java
----------------------------------------------------------------------
diff --git 
a/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/parser/PartitionedJsonParserNoSeekTest.java
 
b/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/parser/PartitionedJsonParserNoSeekTest.java
index cdc876b..5dab0ec 100644
--- 
a/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/parser/PartitionedJsonParserNoSeekTest.java
+++ 
b/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/parser/PartitionedJsonParserNoSeekTest.java
@@ -28,6 +28,8 @@ import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.InputStream;
 
+import java.util.Arrays;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
@@ -43,7 +45,7 @@ public class PartitionedJsonParserNoSeekTest {
                File testsDir = new 
File("src/test/resources/parser-tests/noseek");
                File[] jsonFiles = testsDir.listFiles(new FilenameFilter() {
                        public boolean accept(File file, String s) {
-                               return s.endsWith(".json");
+                               return s.endsWith(".json") && 
!s.contains("expected");
                        }
                });
 
@@ -58,13 +60,13 @@ public class PartitionedJsonParserNoSeekTest {
                try {
                        PartitionedJsonParser parser = new 
PartitionedJsonParser(jsonInputStream);
 
-                       File[] jsonOjbectFiles = 
jsonFile.getParentFile().listFiles(new FilenameFilter() {
+                       File[] jsonObjectFiles = 
jsonFile.getParentFile().listFiles(new FilenameFilter() {
                                public boolean accept(File file, String s) {
                                        return s.contains(jsonFile.getName()) 
&& s.contains("expected");
                                }
                        });
-
-                       for (File jsonObjectFile : jsonOjbectFiles) {
+                       Arrays.sort(jsonObjectFiles);
+                       for (File jsonObjectFile : jsonObjectFiles) {
                                String expected = 
trimWhitespaces(FileUtils.readFileToString(jsonObjectFile));
                                String result = 
parser.nextObjectContainingMember("name");
                                assertNotNull(jsonFile.getName() + "/" + 
jsonObjectFile.getName(), result);
@@ -80,4 +82,5 @@ public class PartitionedJsonParserNoSeekTest {
        public String trimWhitespaces(String s) {
                return s.replaceAll("[\\n\\t\\r \\t]+", " ").trim();
        }
+
 }

Reply via email to