You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by ol...@apache.org on 2008/07/19 03:43:32 UTC
svn commit: r678090 [2/2] - in /incubator/pig/branches/types:
lib-src/shock/org/apache/pig/shock/ src/org/apache/pig/
src/org/apache/pig/backend/executionengine/
src/org/apache/pig/backend/hadoop/datastorage/
src/org/apache/pig/backend/hadoop/execution...
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestFilterOpString.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestFilterOpString.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestFilterOpString.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestFilterOpString.java Fri Jul 18 18:43:31 2008
@@ -22,10 +22,12 @@
import java.io.PrintStream;
import java.util.Iterator;
+import org.junit.Before;
import org.junit.Test;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.builtin.PigStorage;
import org.apache.pig.data.Tuple;
@@ -38,10 +40,18 @@
private static int LOOP_COUNT = 1024;
private String initString = "mapreduce";
MiniCluster cluster = MiniCluster.buildCluster();
+
+ private PigServer pig;
+ @Before
+ @Override
+ protected void setUp() throws Exception {
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
+ }
+
+
@Test
public void testStringEq() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -69,7 +79,6 @@
@Test
public void testStringNeq() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -97,7 +106,6 @@
@Test
public void testStringGt() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -127,7 +135,6 @@
@Test
public void testStringGte() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -158,7 +165,6 @@
@Test
public void testStringLt() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestGrunt.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestGrunt.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestGrunt.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestGrunt.java Fri Jul 18 18:43:31 2008
@@ -23,6 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.impl.PigContext;
import org.apache.pig.tools.grunt.Grunt;
@@ -38,7 +39,7 @@
@Test
public void testCopyFromLocal() throws Throwable {
- PigServer server = new PigServer("MAPREDUCE");
+ PigServer server = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
PigContext context = server.getPigContext();
String strCmd = "copyFromLocal /bin/sh . ;";
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestInfixArithmetic.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestInfixArithmetic.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestInfixArithmetic.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestInfixArithmetic.java Fri Jul 18 18:43:31 2008
@@ -22,10 +22,12 @@
import java.io.PrintStream;
import java.util.Iterator;
+import org.junit.Before;
import org.junit.Test;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.builtin.PigStorage;
import org.apache.pig.data.DataType;
@@ -38,12 +40,18 @@
private final Log log = LogFactory.getLog(getClass());
private static int LOOP_COUNT = 1024;
- private String initString = "mapreduce";
MiniCluster cluster = MiniCluster.buildCluster();
+
+ private PigServer pig;
+ @Before
+ @Override
+ protected void setUp() throws Exception {
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
+ }
+
@Test
public void testAdd() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -65,7 +73,6 @@
@Test
public void testSubtract() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -86,7 +93,6 @@
@Test
public void testMultiply() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -108,7 +114,6 @@
@Test
public void testDivide() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 1; i < LOOP_COUNT; i++) {
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestInputOutputFileValidator.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestInputOutputFileValidator.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestInputOutputFileValidator.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestInputOutputFileValidator.java Fri Jul 18 18:43:31 2008
@@ -1,6 +1,7 @@
package org.apache.pig.test;
import java.io.* ;
+import java.util.Properties;
import org.apache.pig.ExecType;
import org.apache.pig.FuncSpec;
@@ -27,7 +28,7 @@
@Test
public void testLocalModeInputPositive() throws Throwable {
- PigContext ctx = new PigContext(ExecType.LOCAL) ;
+ PigContext ctx = new PigContext(ExecType.LOCAL, new Properties()) ;
ctx.connect() ;
String inputfile = generateTempFile().getAbsolutePath() ;
@@ -46,7 +47,7 @@
@Test
public void testLocalModeNegative1() throws Throwable {
- PigContext ctx = new PigContext(ExecType.LOCAL) ;
+ PigContext ctx = new PigContext(ExecType.LOCAL, new Properties()) ;
ctx.connect() ;
String inputfile = generateNonExistenceTempFile().getAbsolutePath() ;
@@ -66,7 +67,7 @@
@Test
public void testLocalModeNegative2() throws Throwable {
- PigContext ctx = new PigContext(ExecType.LOCAL) ;
+ PigContext ctx = new PigContext(ExecType.LOCAL, new Properties()) ;
ctx.connect() ;
String inputfile = generateTempFile().getAbsolutePath() ;
@@ -86,7 +87,7 @@
@Test
public void testLocalModeNegative3() throws Throwable {
- PigContext ctx = new PigContext(ExecType.LOCAL) ;
+ PigContext ctx = new PigContext(ExecType.LOCAL, new Properties()) ;
ctx.connect() ;
String inputfile = generateNonExistenceTempFile().getAbsolutePath() ;
@@ -107,7 +108,7 @@
@Test
public void testMapReduceModeInputPositive() throws Throwable {
- PigContext ctx = new PigContext(ExecType.MAPREDUCE) ;
+ PigContext ctx = new PigContext(ExecType.MAPREDUCE, cluster.getProperties()) ;
ctx.connect() ;
String inputfile = createHadoopTempFile(ctx) ;
@@ -126,7 +127,7 @@
@Test
public void testMapReduceModeInputNegative1() throws Throwable {
- PigContext ctx = new PigContext(ExecType.MAPREDUCE) ;
+ PigContext ctx = new PigContext(ExecType.MAPREDUCE, cluster.getProperties()) ;
ctx.connect() ;
String inputfile = createHadoopNonExistenceTempFile(ctx) ;
@@ -146,7 +147,7 @@
@Test
public void testMapReduceModeInputNegative2() throws Throwable {
- PigContext ctx = new PigContext(ExecType.MAPREDUCE) ;
+ PigContext ctx = new PigContext(ExecType.MAPREDUCE, cluster.getProperties()) ;
ctx.connect() ;
String inputfile = createHadoopTempFile(ctx) ;
@@ -166,7 +167,7 @@
@Test
public void testMapReduceModeInputNegative3() throws Throwable {
- PigContext ctx = new PigContext(ExecType.MAPREDUCE) ;
+ PigContext ctx = new PigContext(ExecType.MAPREDUCE, cluster.getProperties()) ;
ctx.connect() ;
String inputfile = createHadoopNonExistenceTempFile(ctx) ;
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestJobSubmission.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestJobSubmission.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestJobSubmission.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestJobSubmission.java Fri Jul 18 18:43:31 2008
@@ -34,6 +34,7 @@
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.jobcontrol.Job;
import org.apache.hadoop.mapred.jobcontrol.JobControl;
+import org.apache.pig.ExecType;
import org.apache.pig.FuncSpec;
import org.apache.pig.backend.executionengine.ExecException;
import org.apache.pig.backend.executionengine.ExecutionEngine;
@@ -90,7 +91,7 @@
static {
MiniCluster cluster = MiniCluster.buildCluster();
- pc = new PigContext();
+ pc = new PigContext(ExecType.MAPREDUCE, cluster.getProperties());
try {
pc.connect();
} catch (ExecException e) {
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestLargeFile.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestLargeFile.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestLargeFile.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestLargeFile.java Fri Jul 18 18:43:31 2008
@@ -18,6 +18,7 @@
package org.apache.pig.test;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.data.DataType;
@@ -51,7 +52,6 @@
private long total = defaultBlockSize >> 1;
private int max_rand = 500;
- private String initString = "mapreduce";
// private double sum = 0.0, sumIn = 0.0;
MiniCluster cluster = MiniCluster.buildCluster();
@@ -90,7 +90,7 @@
dat.close();
try {
- pig = new PigServer(initString);
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
}
catch (ExecException e) {
IOException ioe = new IOException("Failed to create Pig server");
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestLogToPhyCompiler.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestLogToPhyCompiler.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestLogToPhyCompiler.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestLogToPhyCompiler.java Fri Jul 18 18:43:31 2008
@@ -26,6 +26,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.Random;
import org.apache.commons.logging.Log;
@@ -65,7 +66,7 @@
final int MAX_RANGE = 10;
Random r = new Random();
- PigContext pc = new PigContext(ExecType.LOCAL);
+ PigContext pc = new PigContext(ExecType.LOCAL, new Properties());
private boolean generate = false;
@@ -516,7 +517,7 @@
public LogicalPlan buildPlan(String query, ClassLoader cldr) {
LogicalPlanBuilder.classloader = cldr;
- PigContext pigContext = new PigContext(ExecType.LOCAL);
+ PigContext pigContext = new PigContext(ExecType.LOCAL, new Properties());
LogicalPlanBuilder builder = new LogicalPlanBuilder(pigContext); //
try {
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestLogicalPlanBuilder.java Fri Jul 18 18:43:31 2008
@@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Properties;
import java.net.URL;
import java.util.List;
import java.util.Set;
@@ -1003,7 +1004,7 @@
public LogicalPlan buildPlan(String query, ClassLoader cldr) {
LogicalPlanBuilder.classloader = cldr;
- PigContext pigContext = new PigContext(ExecType.LOCAL);
+ PigContext pigContext = new PigContext(ExecType.LOCAL, new Properties());
LogicalPlanBuilder builder = new LogicalPlanBuilder(pigContext); //
try {
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestMapReduce.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestMapReduce.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestMapReduce.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestMapReduce.java Fri Jul 18 18:43:31 2008
@@ -29,11 +29,14 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Properties;
import junit.framework.TestCase;
import org.junit.Test;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.pig.EvalFunc;
import org.apache.pig.FuncSpec;
import org.apache.pig.LoadFunc;
@@ -52,16 +55,25 @@
import org.apache.pig.impl.io.BufferedPositionedInputStream;
import org.apache.pig.impl.logicalLayer.schema.Schema;
import org.apache.pig.backend.datastorage.ElementDescriptor;
+import org.junit.Before;
public class TestMapReduce extends TestCase {
- private String initString = "mapreduce";
+ private Log log = LogFactory.getLog(getClass());
+
MiniCluster cluster = MiniCluster.buildCluster();
+ private PigServer pig;
+
+ @Before
+ @Override
+ protected void setUp() throws Exception {
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
+ }
+
@Test
public void testBigGroupAll() throws Throwable {
int LOOP_COUNT = 4*1024;
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", "txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < LOOP_COUNT; i++) {
@@ -193,7 +205,6 @@
}
@Test
public void testStoreFunction() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", ".txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < 10; i++) {
@@ -220,7 +231,6 @@
}
@Test
public void testQualifiedFuncions() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", ".txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < 1; i++) {
@@ -245,7 +255,6 @@
@Test
public void testDefinedFunctions() throws Throwable {
- PigServer pig = new PigServer(initString);
File tmpFile = File.createTempFile("test", ".txt");
PrintStream ps = new PrintStream(new FileOutputStream(tmpFile));
for(int i = 0; i < 1; i++) {
@@ -272,8 +281,8 @@
@Test
public void testPigServer() throws Throwable {
- System.out.println("creating pig server");
- PigContext pigContext = new PigContext(ExecType.MAPREDUCE);
+ log.debug("creating pig server");
+ PigContext pigContext = new PigContext(ExecType.MAPREDUCE, cluster.getProperties());
PigServer pig = new PigServer(pigContext);
System.out.println("testing capacity");
long capacity = pig.capacity();
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestOrderBy.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestOrderBy.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestOrderBy.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestOrderBy.java Fri Jul 18 18:43:31 2008
@@ -27,12 +27,12 @@
import org.junit.Test;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.data.DataType;
import org.apache.pig.data.Tuple;
public class TestOrderBy extends TestCase {
- private String initString = "mapreduce";
private static final int DATALEN = 1024;
private String[][] DATA = new String[2][DATALEN];
MiniCluster cluster = MiniCluster.buildCluster();
@@ -46,7 +46,7 @@
DATA[0][i] = myFormatter.format(i);
DATA[1][i] = myFormatter.format(DATALEN - i - 1);
}
- pig = new PigServer(initString);
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
}
protected void setUp() throws Exception {
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestPi.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestPi.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestPi.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestPi.java Fri Jul 18 18:43:31 2008
@@ -18,6 +18,7 @@
package org.apache.pig.test;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.data.DataType;
@@ -53,7 +54,6 @@
private long total = ((defaultBlockSize >> 20) / 10) << 20;
private int inCircle = 0;
- private String initString = "mapreduce";
MiniCluster cluster = MiniCluster.buildCluster();
private long totalLength = 0, totalLengthTest = 0;
@@ -100,7 +100,7 @@
dat.close();
try {
- pig = new PigServer(initString);
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
}
catch (ExecException e) {
IOException ioe = new IOException("Failed to create Pig Server");
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestPigScriptParser.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestPigScriptParser.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestPigScriptParser.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestPigScriptParser.java Fri Jul 18 18:43:31 2008
@@ -8,6 +8,7 @@
import java.util.List;
import java.util.Map;
import java.util.HashMap;
+import java.util.Properties;
import org.junit.Test;
import junit.framework.TestCase;
@@ -28,7 +29,7 @@
Map<LogicalOperator, LogicalPlan> aliases = new HashMap<LogicalOperator, LogicalPlan>();
Map<OperatorKey, LogicalOperator> opTable = new HashMap<OperatorKey, LogicalOperator>() ;
Map<String, LogicalOperator> aliasOp = new HashMap<String, LogicalOperator>() ;
- PigContext pigContext = new PigContext(ExecType.LOCAL) ;
+ PigContext pigContext = new PigContext(ExecType.LOCAL, new Properties()) ;
String tempFile = this.prepareTempFile() ;
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestPigServer.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestPigServer.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestPigServer.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestPigServer.java Fri Jul 18 18:43:31 2008
@@ -28,6 +28,7 @@
import java.net.URLClassLoader;
import java.lang.reflect.Method;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.junit.Test;
@@ -40,7 +41,7 @@
private void initPigServer() throws Throwable {
if (pig == null) {
- pig = new PigServer();
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
}
}
@@ -264,4 +265,4 @@
(new File(dir + FILE_SEPARATOR + jarName)).delete();
(new File(dir)).delete();
}
-}
\ No newline at end of file
+}
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestPigSplit.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestPigSplit.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestPigSplit.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestPigSplit.java Fri Jul 18 18:43:31 2008
@@ -25,8 +25,10 @@
import java.io.PrintWriter;
import java.util.Iterator;
+import org.junit.Before;
import org.junit.Test;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.data.Tuple;
import org.apache.pig.backend.executionengine.ExecException;
@@ -38,17 +40,11 @@
MiniCluster cluster = MiniCluster.buildCluster();
@Override
+ @Before
protected void setUp() throws Exception {
super.setUp();
- try {
- pig = new PigServer();
- }
- catch (ExecException e) {
- IOException ioe = new IOException("Failed to create Pig Server");
- ioe.initCause(e);
- throw ioe;
- }
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
}
@Test
public void testLongEvalSpec() throws Exception{
Modified: incubator/pig/branches/types/test/org/apache/pig/test/TestStoreOld.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/TestStoreOld.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/TestStoreOld.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/TestStoreOld.java Fri Jul 18 18:43:31 2008
@@ -21,6 +21,7 @@
import java.io.PrintWriter;
import java.util.Iterator;
+import org.apache.pig.ExecType;
import org.apache.pig.PigServer;
import org.apache.pig.data.DataType;
import org.apache.pig.data.Tuple;
@@ -30,7 +31,6 @@
public class TestStoreOld extends TestCase {
- private String initString = "mapreduce";
MiniCluster cluster = MiniCluster.buildCluster();
private int LOOP_COUNT = 1024;
@@ -106,7 +106,7 @@
pw.println(i + "\t" + i);
}
pw.close();
- pig = new PigServer(initString);
+ pig = new PigServer(ExecType.MAPREDUCE, cluster.getProperties());
fileName = "'" + FileLocalizer.hadoopify(f.toString(), pig.getPigContext()) + "'";
tmpFile1 = "'" + FileLocalizer.getTemporaryPath(null, pig.getPigContext()).toString() + "'";
tmpFile2 = "'" + FileLocalizer.getTemporaryPath(null, pig.getPigContext()).toString() + "'";
Modified: incubator/pig/branches/types/test/org/apache/pig/test/Util.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/Util.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/Util.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/Util.java Fri Jul 18 18:43:31 2008
@@ -18,6 +18,7 @@
package org.apache.pig.test;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import org.apache.pig.backend.executionengine.ExecException;
@@ -144,4 +145,19 @@
return t;
}
+ static public void printQueryOutput(Iterator<Tuple> actualResults,
+ Tuple[] expectedResults) {
+
+ System.out.println("Expected :") ;
+ for (Tuple expected : expectedResults) {
+ System.out.println(expected.toString()) ;
+ }
+ System.out.println("---End----") ;
+
+ System.out.println("Actual :") ;
+ while (actualResults.hasNext()) {
+ System.out.println(actualResults.next().toString()) ;
+ }
+ System.out.println("---End----") ;
+ }
}
Modified: incubator/pig/branches/types/test/org/apache/pig/test/utils/LogicalPlanTester.java
URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/test/org/apache/pig/test/utils/LogicalPlanTester.java?rev=678090&r1=678089&r2=678090&view=diff
==============================================================================
--- incubator/pig/branches/types/test/org/apache/pig/test/utils/LogicalPlanTester.java (original)
+++ incubator/pig/branches/types/test/org/apache/pig/test/utils/LogicalPlanTester.java Fri Jul 18 18:43:31 2008
@@ -37,6 +37,7 @@
import java.util.List;
import java.util.HashMap;
import java.util.Map;
+import java.util.Properties;
import java.io.IOException;
import static junit.framework.Assert.assertTrue;
@@ -181,7 +182,7 @@
private LogicalPlan buildPlan(String query, ClassLoader cldr) {
LogicalPlanBuilder.classloader = LogicalPlanTester.class.getClassLoader() ;
- PigContext pigContext = new PigContext(ExecType.LOCAL);
+ PigContext pigContext = new PigContext(ExecType.LOCAL, new Properties());
LogicalPlanBuilder builder = new LogicalPlanBuilder(pigContext);
try {