avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fo...@apache.org
Subject [avro] branch master updated: AVRO-2452: Interop tests should check the number of records (#570)
Date Thu, 04 Jul 2019 09:27:08 GMT
This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 223f953  AVRO-2452: Interop tests should check the number of records (#570)
223f953 is described below

commit 223f953d5218cd3aab9b82a526d8177f27a50861
Author: Kengo Seki <sekikn@apache.org>
AuthorDate: Thu Jul 4 18:27:03 2019 +0900

    AVRO-2452: Interop tests should check the number of records (#570)
    
    * AVRO-2452: Interop tests should check the number of records
    
    * AVRO-2452: Interop tests should check the number of records
    
    Simplify the loop
    
    * Fix the base index number of the loop so that it works as expected
---
 lang/java/ipc/src/test/java/org/apache/avro/DataFileInteropTest.java | 5 ++++-
 lang/py/test/test_datafile_interop.py                                | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lang/java/ipc/src/test/java/org/apache/avro/DataFileInteropTest.java b/lang/java/ipc/src/test/java/org/apache/avro/DataFileInteropTest.java
index 5348c4f..6093015 100644
--- a/lang/java/ipc/src/test/java/org/apache/avro/DataFileInteropTest.java
+++ b/lang/java/ipc/src/test/java/org/apache/avro/DataFileInteropTest.java
@@ -80,9 +80,12 @@ public class DataFileInteropTest {
     for (File f : Objects.requireNonNull(DATAFILE_DIR.listFiles())) {
       System.out.println("Reading: " + f.getName());
       try (FileReader<? extends Object> reader = DataFileReader.openReader(f, provider.get()))
{
+        int i = 0;
         for (Object datum : reader) {
+          i++;
           Assert.assertNotNull(datum);
         }
+        Assert.assertNotEquals(0, i);
       }
     }
   }
@@ -91,4 +94,4 @@ public class DataFileInteropTest {
     public DatumReader<T> get();
   }
 
-}
\ No newline at end of file
+}
diff --git a/lang/py/test/test_datafile_interop.py b/lang/py/test/test_datafile_interop.py
index 545ce6c..90cf4e5 100644
--- a/lang/py/test/test_datafile_interop.py
+++ b/lang/py/test/test_datafile_interop.py
@@ -35,8 +35,10 @@ class TestDataFileInterop(unittest.TestCase):
       reader = open(os.path.join('@INTEROP_DATA_DIR@', f), 'rb')
       datum_reader = io.DatumReader()
       dfr = datafile.DataFileReader(reader, datum_reader)
-      for datum in dfr:
+      i = 0
+      for i, datum in enumerate(dfr, 1):
         assert datum is not None
+      assert i > 0
 
 if __name__ == '__main__':
   unittest.main()


Mime
View raw message