pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1604504 - in /pig/trunk: CHANGES.txt build.xml test/org/apache/pig/test/TestGrunt.java test/org/apache/pig/test/TestPigRunner.java
Date Sun, 22 Jun 2014 02:50:41 GMT
Author: daijy
Date: Sun Jun 22 02:50:40 2014
New Revision: 1604504

URL: http://svn.apache.org/r1604504
Log:
PIG-4030: TestGrunt, TestPigRunner fail after PIG-3892

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/build.xml
    pig/trunk/test/org/apache/pig/test/TestGrunt.java
    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=1604504&r1=1604503&r2=1604504&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sun Jun 22 02:50:40 2014
@@ -211,6 +211,8 @@ PIG-3882: Multiquery off mode execution 
  
 BUG FIXES
 
+PIG-4030: TestGrunt, TestPigRunner fail after PIG-3892 (daijy)
+
 PIG-3975: Multiple Scalar reference calls leading to missing records (knoguchi via rohini)
 
 PIG-4017: NPE thrown from JobControlCompiler.shipToHdfs (cheolsoo)

Modified: pig/trunk/build.xml
URL: http://svn.apache.org/viewvc/pig/trunk/build.xml?rev=1604504&r1=1604503&r2=1604504&view=diff
==============================================================================
--- pig/trunk/build.xml (original)
+++ pig/trunk/build.xml Sun Jun 22 02:50:40 2014
@@ -884,6 +884,7 @@
         <tempfile property="junit.tmp.dir" prefix="pig_junit_tmp" destDir="${java.io.tmpdir}"
/>
         <mkdir dir="${junit.tmp.dir}/"/>
         <junit showoutput="${test.output}" printsummary="yes" haltonfailure="no" fork="yes"
maxmemory="2048m" dir="${basedir}" timeout="${test.timeout}" errorProperty="tests.failed"
failureProperty="tests.failed">
+            <sysproperty key="hadoopversion" value="${hadoopversion}" />
             <sysproperty key="test.exec.type" value="${test.exec.type}" />
             <sysproperty key="ssh.gateway" value="${ssh.gateway}" />
             <sysproperty key="hod.server" value="${hod.server}" />

Modified: pig/trunk/test/org/apache/pig/test/TestGrunt.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestGrunt.java?rev=1604504&r1=1604503&r2=1604504&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestGrunt.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestGrunt.java Sun Jun 22 02:50:40 2014
@@ -1186,8 +1186,12 @@ public class TestGrunt {
     public void testRegisterWithQuotes() throws Throwable {
         PigServer server = new PigServer(cluster.getExecType(), cluster.getProperties());
         PigContext context = server.getPigContext();
+        String jarName = "pig-withouthadoop-h2.jar";
+        if (System.getProperty("hadoopversion").equals("20")) {
+            jarName = "pig-withouthadoop-h1.jar";
+        }
 
-        String strCmd = "register 'pig-withouthadoop.jar'\n";
+        String strCmd = "register '" + jarName + "'\n";
 
         ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes());
         InputStreamReader reader = new InputStreamReader(cmd);
@@ -1196,15 +1200,18 @@ public class TestGrunt {
 
         grunt.exec();
         assertEquals(context.extraJars+ " of size 1", 1, context.extraJars.size());
-        assertTrue(context.extraJars.get(0)+" ends with /pig-withouthadoop.jar", context.extraJars.get(0).toString().endsWith("/pig-withouthadoop.jar"));
+        assertTrue(context.extraJars.get(0)+" ends with /" + jarName, context.extraJars.get(0).toString().endsWith("/"
+ jarName));
     }
 
     @Test
     public void testRegisterWithoutQuotes() throws Throwable {
         PigServer server = new PigServer(cluster.getExecType(), cluster.getProperties());
         PigContext context = server.getPigContext();
-
-        String strCmd = "register pig-withouthadoop.jar\n";
+        String jarName = "pig-withouthadoop-h2.jar";
+        if (System.getProperty("hadoopversion").equals("20")) {
+            jarName = "pig-withouthadoop-h1.jar";
+        }
+        String strCmd = "register " + jarName + "\n";
 
         ByteArrayInputStream cmd = new ByteArrayInputStream(strCmd.getBytes());
         InputStreamReader reader = new InputStreamReader(cmd);
@@ -1213,7 +1220,7 @@ public class TestGrunt {
 
         grunt.exec();
         assertEquals(context.extraJars+ " of size 1", 1, context.extraJars.size());
-        assertTrue(context.extraJars.get(0)+" ends with /pig-withouthadoop.jar", context.extraJars.get(0).toString().endsWith("/pig-withouthadoop.jar"));
+        assertTrue(context.extraJars.get(0)+" ends with /" + jarName, context.extraJars.get(0).toString().endsWith("/"
+ jarName));
     }
 
     @Test

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=1604504&r1=1604503&r2=1604504&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestPigRunner.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestPigRunner.java Sun Jun 22 02:50:40 2014
@@ -609,7 +609,11 @@ public class TestPigRunner {
 
     @Test
     public void testRegisterExternalJar() throws Exception {
-        String[] args = { "-Dpig.additional.jars=pig-withouthadoop.jar",
+        String jarName = "pig-withouthadoop-h2.jar";
+        if (System.getProperty("hadoopversion").equals("20")) {
+            jarName = "pig-withouthadoop-h1.jar";
+        }
+        String[] args = { "-Dpig.additional.jars=" + jarName,
                 "-Dmapred.job.queue.name=default",
                 "-e", "A = load '" + INPUT_FILE + "';store A into '" + OUTPUT_FILE + "';\n"
};
         PigStats stats = PigRunner.run(args, new TestNotificationListener());
@@ -619,7 +623,7 @@ public class TestPigRunner {
 
         assertNotNull(ctx);
 
-        assertTrue(ctx.extraJars.contains(ClassLoader.getSystemResource("pig-withouthadoop.jar")));
+        assertTrue(ctx.extraJars.contains(ClassLoader.getSystemResource(jarName)));
         assertTrue("default", ctx.getProperties().getProperty("mapred.job.queue.name")!=null
&& ctx.getProperties().getProperty("mapred.job.queue.name").equals("default")||
                 ctx.getProperties().getProperty("mapreduce.job.queuename")!=null &&
ctx.getProperties().getProperty("mapreduce.job.queuename").equals("default"));
 



Mime
View raw message