You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by ro...@apache.org on 2017/06/01 19:53:35 UTC

svn commit: r1797256 - in /pig/trunk: ./ test/org/apache/pig/parser/ test/org/apache/pig/test/

Author: rohini
Date: Thu Jun  1 19:53:35 2017
New Revision: 1797256

URL: http://svn.apache.org/viewvc?rev=1797256&view=rev
Log:
PIG-5225: Several unit tests are not annotated with @Test (nkollar via rohini)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/test/org/apache/pig/parser/TestQueryParser.java
    pig/trunk/test/org/apache/pig/test/TestDataBag.java
    pig/trunk/test/org/apache/pig/test/TestEvalPipelineLocal.java
    pig/trunk/test/org/apache/pig/test/TestHBaseStorage.java
    pig/trunk/test/org/apache/pig/test/TestPigServer.java
    pig/trunk/test/org/apache/pig/test/TestPruneColumn.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1797256&r1=1797255&r2=1797256&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Jun  1 19:53:35 2017
@@ -28,6 +28,8 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-5225: Several unit tests are not annotated with @Test (nkollar via rohini)
+
 
 Release 0.17.0
  

Modified: pig/trunk/test/org/apache/pig/parser/TestQueryParser.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/parser/TestQueryParser.java?rev=1797256&r1=1797255&r2=1797256&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/parser/TestQueryParser.java (original)
+++ pig/trunk/test/org/apache/pig/parser/TestQueryParser.java Thu Jun  1 19:53:35 2017
@@ -405,6 +405,7 @@ public class TestQueryParser {
     }
 
     //PIG-2267
+    @Test
     public void testThatColNameIsGeneratedProperly() throws IOException {
         String query = "a = load '1.txt' as (int,(long,[]),{([])});"
                      + "b = foreach a generate val_0, tuple_0, bag_0;"

Modified: pig/trunk/test/org/apache/pig/test/TestDataBag.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestDataBag.java?rev=1797256&r1=1797255&r2=1797256&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestDataBag.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestDataBag.java Thu Jun  1 19:53:35 2017
@@ -862,6 +862,7 @@ public class TestDataBag  {
         assertEquals(bg1, bg2);
     }
 
+    @Test
     public void testInternalCachedBag() throws Exception {
     	// check adding empty tuple
     	DataBag bg0 = new InternalCachedBag();
@@ -924,6 +925,7 @@ public class TestDataBag  {
         assertEquals(bg4.size(), 0);
     }
 
+    @Test
     public void testInternalSortedBag() throws Exception {
 
     	// check adding empty tuple
@@ -1047,6 +1049,7 @@ public class TestDataBag  {
         assertEquals(bg6, bg7);
     }
 
+    @Test
     public void testInternalDistinctBag() throws Exception {
     	// check adding empty tuple
     	DataBag bg0 = new InternalDistinctBag();

Modified: pig/trunk/test/org/apache/pig/test/TestEvalPipelineLocal.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestEvalPipelineLocal.java?rev=1797256&r1=1797255&r2=1797256&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestEvalPipelineLocal.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestEvalPipelineLocal.java Thu Jun  1 19:53:35 2017
@@ -17,7 +17,6 @@
  */
 package org.apache.pig.test;
 
-import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -27,7 +26,6 @@ import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -37,11 +35,9 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.Set;
 import java.util.StringTokenizer;
-import java.util.Collections;
 
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.log4j.Appender;
-import org.apache.log4j.FileAppender;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.log4j.SimpleLayout;
@@ -67,7 +63,6 @@ import org.apache.pig.impl.logicalLayer.
 import org.apache.pig.impl.util.Pair;
 import org.apache.pig.impl.util.UDFContext;
 import org.apache.pig.impl.util.Utils;
-import org.apache.pig.newplan.logical.rules.ColumnPruneVisitor;
 import org.apache.pig.test.utils.Identity;
 import org.junit.Assume;
 import org.junit.Before;
@@ -390,7 +385,7 @@ public class TestEvalPipelineLocal {
         testSortDistinct(false, false);
     }
     */
-    
+
     @Test
     public void testSortWithUDF() throws Exception{
         testSortDistinct(false, true);
@@ -455,7 +450,8 @@ public class TestEvalPipelineLocal {
         }
         
     }
-    
+
+    @Test
     public void testNestedPlan() throws Exception{
         int LOOP_COUNT = 10;
         File tmpFile = Util.createTempFileDelOnExit("test", "txt");
@@ -496,6 +492,7 @@ public class TestEvalPipelineLocal {
         Assert.assertEquals(LOOP_COUNT, numIdentity);
     }
 
+    @Test
     public void testNestedPlanWithExpressionAssignment() throws Exception{
         int LOOP_COUNT = 10;
         File tmpFile = Util.createTempFileDelOnExit("test", "txt");
@@ -541,6 +538,7 @@ public class TestEvalPipelineLocal {
         Assert.assertEquals(LOOP_COUNT, numIdentity);
     }
 
+    @Test
     public void testLimit() throws Exception{
         int LOOP_COUNT = 20;
         File tmpFile = Util.createTempFileDelOnExit("test", "txt");
@@ -789,6 +787,7 @@ public class TestEvalPipelineLocal {
         
     }
 
+    @Test
     public void testMapUDF() throws Exception{
         int LOOP_COUNT = 2;
         File tmpFile = Util.createTempFileDelOnExit("test", "txt");
@@ -832,38 +831,6 @@ public class TestEvalPipelineLocal {
         Assert.assertEquals(LOOP_COUNT * LOOP_COUNT, numIdentity);
     }
 
-    public void testMapUDFFail() throws Exception{
-        int LOOP_COUNT = 2;
-        File tmpFile = File.createTempFile("test", "txt");
-        tmpFile.deleteOnExit();
-        PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
-        for(int i = 0; i < LOOP_COUNT; i++) {
-            for(int j=0;j<LOOP_COUNT;j+=2){
-                ps.println(i+"\t"+j);
-                ps.println(i+"\t"+j);
-            }
-        }
-        ps.close();
-
-        pigServer.registerQuery("A = LOAD '"
-                + Util.generateURI(tmpFile.toString(), pigServer
-                        .getPigContext()) + "';");
-        pigServer.registerQuery("B = foreach A generate "
-                + MapUDF.class.getName() + "($0) as mymap;"); // the argument
-                                                              // does not matter
-        String query = "C = foreach B {"
-        + "generate mymap#'dba' * 10;"
-        + "};";
-
-        pigServer.registerQuery(query);
-        try {
-            Iterator<Tuple> iter = pigServer.openIterator("C");
-            Assert.fail("Error expected.");
-        } catch (Exception e) {
-            e.getMessage().contains("Cannot determine");
-        }
-    }
-
     @Test
     public void testLoadCtorArgs() throws IOException, ExecException {
         

Modified: pig/trunk/test/org/apache/pig/test/TestHBaseStorage.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestHBaseStorage.java?rev=1797256&r1=1797255&r2=1797256&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestHBaseStorage.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestHBaseStorage.java Thu Jun  1 19:53:35 2017
@@ -432,6 +432,7 @@ public class TestHBaseStorage {
         LOG.info("LoadFromHBase done");
     }
 
+    @Test
     public void testLoadWithFixedAndPrefixedCols3() throws IOException {
         prepareTable(TESTTABLE_1, true, DataFormat.UTF8PlainText);
 

Modified: pig/trunk/test/org/apache/pig/test/TestPigServer.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestPigServer.java?rev=1797256&r1=1797255&r2=1797256&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestPigServer.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestPigServer.java Thu Jun  1 19:53:35 2017
@@ -368,6 +368,7 @@ public class TestPigServer {
         assertTrue(fs.delete(new Path(jarLocation), true));
     }
 
+    @Test
     public void testDescribeLoad() throws Throwable {
         PigServer pig = new PigServer(cluster.getExecType(), properties);
         pig.registerQuery("a = load 'a' as (field1: int, field2: float, field3: chararray );") ;

Modified: pig/trunk/test/org/apache/pig/test/TestPruneColumn.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestPruneColumn.java?rev=1797256&r1=1797255&r2=1797256&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestPruneColumn.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestPruneColumn.java Thu Jun  1 19:53:35 2017
@@ -2006,6 +2006,7 @@ public class TestPruneColumn {
         }
     }
 
+    @Test
     public void testAliasInRequiredFieldList() throws Exception{
         pigServer.registerQuery("A = load '"+ Util.generateURI(tmpFile1.toString(), pigServer.getPigContext()) + "' using "
                 + PruneColumnEvalFunc.class.getName() +"() as (a0, a1, a2);");