pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1604502 - in /pig/branches/branch-0.13: CHANGES.txt build.xml test/org/apache/pig/test/TestGrunt.java test/org/apache/pig/test/TestPigRunner.java
Date Sun, 22 Jun 2014 02:43:37 GMT
Author: daijy
Date: Sun Jun 22 02:43:37 2014
New Revision: 1604502

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

Modified:
    pig/branches/branch-0.13/CHANGES.txt
    pig/branches/branch-0.13/build.xml
    pig/branches/branch-0.13/test/org/apache/pig/test/TestGrunt.java
    pig/branches/branch-0.13/test/org/apache/pig/test/TestPigRunner.java

Modified: pig/branches/branch-0.13/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.13/CHANGES.txt?rev=1604502&r1=1604501&r2=1604502&view=diff
==============================================================================
--- pig/branches/branch-0.13/CHANGES.txt (original)
+++ pig/branches/branch-0.13/CHANGES.txt Sun Jun 22 02:43:37 2014
@@ -153,6 +153,8 @@ PIG-3882: Multiquery off mode execution 
  
 BUG FIXES
 
+PIG-4030: TestGrunt, TestPigRunner fail after PIG-3892 (daijy)
+
 PIG-4017: NPE thrown from JobControlCompiler.shipToHdfs (cheolsoo)
 
 PIG-3975: Multiple Scalar reference calls leading to missing records (knoguchi via rohini)


Modified: pig/branches/branch-0.13/build.xml
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.13/build.xml?rev=1604502&r1=1604501&r2=1604502&view=diff
==============================================================================
--- pig/branches/branch-0.13/build.xml (original)
+++ pig/branches/branch-0.13/build.xml Sun Jun 22 02:43:37 2014
@@ -868,6 +868,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="1024m" dir="${basedir}" timeout="${test.timeout}" errorProperty="tests.failed"
failureProperty="tests.failed">
+            <sysproperty key="hadoopversion" value="${hadoopversion}" />
             <sysproperty key="ssh.gateway" value="${ssh.gateway}" />
             <sysproperty key="hod.server" value="${hod.server}" />
             <sysproperty key="java.io.tmpdir" value="${junit.tmp.dir}" />

Modified: pig/branches/branch-0.13/test/org/apache/pig/test/TestGrunt.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.13/test/org/apache/pig/test/TestGrunt.java?rev=1604502&r1=1604501&r2=1604502&view=diff
==============================================================================
--- pig/branches/branch-0.13/test/org/apache/pig/test/TestGrunt.java (original)
+++ pig/branches/branch-0.13/test/org/apache/pig/test/TestGrunt.java Sun Jun 22 02:43:37 2014
@@ -1176,8 +1176,11 @@ public class TestGrunt {
     public void testRegisterWithQuotes() throws Throwable {
         PigServer server = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
         PigContext context = server.getPigContext();
+        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);
@@ -1186,15 +1189,19 @@ 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(ExecType.MAPREDUCE, 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);
@@ -1203,7 +1210,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/branches/branch-0.13/test/org/apache/pig/test/TestPigRunner.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.13/test/org/apache/pig/test/TestPigRunner.java?rev=1604502&r1=1604501&r2=1604502&view=diff
==============================================================================
--- pig/branches/branch-0.13/test/org/apache/pig/test/TestPigRunner.java (original)
+++ pig/branches/branch-0.13/test/org/apache/pig/test/TestPigRunner.java Sun Jun 22 02:43:37
2014
@@ -608,7 +608,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());
@@ -618,7 +622,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