pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cheol...@apache.org
Subject svn commit: r1426119 - in /pig/trunk: CHANGES.txt test/org/apache/pig/test/TestPigRunner.java
Date Thu, 27 Dec 2012 04:42:04 GMT
Author: cheolsoo
Date: Thu Dec 27 04:42:04 2012
New Revision: 1426119

URL: http://svn.apache.org/viewvc?rev=1426119&view=rev
Log:
PIG-3066: Fix TestPigRunner in trunk (cheolsoo)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/test/org/apache/pig/test/TestPigRunner.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1426119&r1=1426118&r2=1426119&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Dec 27 04:42:04 2012
@@ -64,6 +64,8 @@ PIG-3013: BinInterSedes improve chararra
 
 BUG FIXES
 
+PIG-3066: Fix TestPigRunner in trunk (cheolsoo)
+
 PIG-3101: Increase io.sort.mb in YARN MiniCluste (cheolsoo)
 
 PIG-3100: If a .pig_schema file is present, can get an index out of bounds error (jcoveney)

Modified: pig/trunk/test/org/apache/pig/test/TestPigRunner.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestPigRunner.java?rev=1426119&r1=1426118&r2=1426119&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestPigRunner.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestPigRunner.java Thu Dec 27 04:42:04 2012
@@ -258,8 +258,18 @@ public class TestPigRunner {
             PigStats stats = PigRunner.run(args, new TestNotificationListener());
             assertTrue(stats.isSuccessful());
             assertTrue(stats.getJobGraph().size() == 1);
-            assertEquals(5, stats.getRecordWritten());
-            assertEquals(28, stats.getBytesWritten());
+            // Each output file should include the following:
+            // output:
+            //   1\t2\t3\n
+            //   3\t4\t5\n
+            //   3\t7\t8\n
+            // output2:
+            //   5\t3\t4\n
+            //   5\t6\t7\n
+            final int numOfRecords = 5;
+            final int numOfCharsPerRecord = 6;
+            assertEquals(numOfRecords, stats.getRecordWritten());
+            assertEquals(numOfRecords * numOfCharsPerRecord, stats.getBytesWritten());
             assertTrue(stats.getOutputNames().size() == 2);
             for (String fname : stats.getOutputNames()) {
                 assertTrue(fname.equals(OUTPUT_FILE) || fname.equals(OUTPUT_FILE_2));
@@ -297,8 +307,20 @@ public class TestPigRunner {
             PigStats stats = PigRunner.run(args, new TestNotificationListener());
             assertTrue(stats.isSuccessful());
             assertTrue(stats.getJobGraph().size() == 1);
-            assertEquals(4, stats.getRecordWritten());           
-            assertEquals(18, stats.getBytesWritten());
+            // Each output file should include the following:
+            // output:
+            //   5\t3\t4\n
+            //   5\t6\t7\n
+            // output2:
+            //   1\t1\n
+            //   3\t2\n
+            final int numOfRecords1 = 2;
+            final int numOfRecords2 = 2;
+            final int numOfCharsPerRecord1 = 6;
+            final int numOfCharsPerRecord2 = 4;
+            assertEquals(numOfRecords1 + numOfRecords2, stats.getRecordWritten());
+            assertEquals((numOfRecords1 * numOfCharsPerRecord1) + (numOfRecords2 * numOfCharsPerRecord2),
+                    stats.getBytesWritten());
             assertTrue(stats.getOutputNames().size() == 2);
             for (String fname : stats.getOutputNames()) {               
                 assertTrue(fname.equals(OUTPUT_FILE) || fname.equals(OUTPUT_FILE_2));



Mime
View raw message