You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by ch...@apache.org on 2013/12/29 23:49:46 UTC
svn commit: r1554086 - in /pig/trunk: CHANGES.txt
test/org/apache/pig/test/TestBuiltin.java
Author: cheolsoo
Date: Sun Dec 29 22:49:45 2013
New Revision: 1554086
URL: http://svn.apache.org/r1554086
Log:
PIG-3616: TestBuiltIn.testURIwithCurlyBrace() silently fails (lbendig via cheolsoo)
Modified:
pig/trunk/CHANGES.txt
pig/trunk/test/org/apache/pig/test/TestBuiltin.java
Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1554086&r1=1554085&r2=1554086&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sun Dec 29 22:49:45 2013
@@ -62,6 +62,8 @@ OPTIMIZATIONS
BUG FIXES
+PIG-3616: TestBuiltIn.testURIwithCurlyBrace() silently fails (lbendig via cheolsoo)
+
PIG-3608: ClassCastException when looking up a value from AvroMapWrapper using a Utf8 key (rding)
PIG-3639: TestRegisteredJarVisibility is broken in trunk (cheolsoo)
Modified: pig/trunk/test/org/apache/pig/test/TestBuiltin.java
URL: http://svn.apache.org/viewvc/pig/trunk/test/org/apache/pig/test/TestBuiltin.java?rev=1554086&r1=1554085&r2=1554086&view=diff
==============================================================================
--- pig/trunk/test/org/apache/pig/test/TestBuiltin.java (original)
+++ pig/trunk/test/org/apache/pig/test/TestBuiltin.java Sun Dec 29 22:49:45 2013
@@ -119,6 +119,7 @@ import org.apache.pig.data.DefaultBagFac
import org.apache.pig.data.Tuple;
import org.apache.pig.data.TupleFactory;
import org.apache.pig.impl.PigContext;
+import org.apache.pig.impl.io.FileLocalizer;
import org.apache.pig.impl.io.ReadToEndLoader;
import org.apache.pig.impl.logicalLayer.FrontendException;
import org.apache.pig.impl.logicalLayer.schema.Schema;
@@ -200,6 +201,10 @@ public class TestBuiltin {
@Before
public void setUp() throws Exception {
+ // re initialize FileLocalizer so that each test will run correctly
+ // without any side effect of other tests - this is needed since some
+ // tests are in mapred and some in local mode.
+ FileLocalizer.setInitialized(false);
pigServer = new PigServer(ExecType.LOCAL, new Properties());
pigServer.setValidateEachStatement(true);
@@ -2704,25 +2709,23 @@ public class TestBuiltin {
"1",
"a",
"r"};
- Util.createInputFile(cluster, inputFileName, inputData);
- try {
- pigServer.registerQuery("a = load '" + inputFileName + "'AS (s:chararray);");
- pigServer.store("a", inputFileName1, "BinStorage");
- pigServer.registerQuery("b = load 'part-{1,2}' using BinStorage() AS (s:chararray);");
- Iterator<Tuple> it = pigServer.openIterator("b");
- int i=0;
- while(it.hasNext())
- {
- assertTrue(it.next().get(0).equals(inputData[i]));
- i++;
- }
- assertTrue(i==3);
- } catch (Exception e) {
- } finally {
- Util.deleteFile(cluster, inputFileName);
- }
+ Util.createLocalInputFile(inputFileName, inputData);
+ pigServer.registerQuery("a = load '" + inputFileName + "'AS (s:chararray);");
+ pigServer.store("a", inputFileName1, "BinStorage");
+ pigServer.registerQuery("b = load 'part-{1,2}' using BinStorage() AS (s:chararray);");
+ Iterator<Tuple> it = pigServer.openIterator("b");
+ int i=0;
+ while(it.hasNext())
+ {
+ assertTrue(it.next().get(0).equals(inputData[i]));
+ i++;
+ }
+ assertTrue(i==3);
+ Util.deleteFile(pigServer.getPigContext(), inputFileName);
+ Util.deleteFile(pigServer.getPigContext(), inputFileName1);
}
+
private static String getInputType(String typeFor) {
return allowedInput.get(typeFor);
}