sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1199149 - in /incubator/sqoop/trunk/src/test/com/cloudera/sqoop: lib/TestLargeObjectLoader.java mapreduce/db/TestDataDrivenDBInputFormat.java testutil/MockObjectFactory.java
Date Tue, 08 Nov 2011 08:05:03 GMT
Author: blee
Date: Tue Nov  8 08:05:02 2011
New Revision: 1199149

URL: http://svn.apache.org/viewvc?rev=1199149&view=rev
Log:
SQOOP-354 SQOOP needs to be made compatible with Hadoop .23 release

Removed:
    incubator/sqoop/trunk/src/test/com/cloudera/sqoop/testutil/MockObjectFactory.java
Modified:
    incubator/sqoop/trunk/src/test/com/cloudera/sqoop/lib/TestLargeObjectLoader.java
    incubator/sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java

Modified: incubator/sqoop/trunk/src/test/com/cloudera/sqoop/lib/TestLargeObjectLoader.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/test/com/cloudera/sqoop/lib/TestLargeObjectLoader.java?rev=1199149&r1=1199148&r2=1199149&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/test/com/cloudera/sqoop/lib/TestLargeObjectLoader.java (original)
+++ incubator/sqoop/trunk/src/test/com/cloudera/sqoop/lib/TestLargeObjectLoader.java Tue Nov
 8 08:05:02 2011
@@ -31,10 +31,7 @@ import junit.framework.TestCase;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.mapreduce.MapContext;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
 
-import com.cloudera.sqoop.testutil.MockObjectFactory;
 import com.cloudera.sqoop.testutil.MockResultSet;
 
 /**
@@ -45,7 +42,6 @@ public class TestLargeObjectLoader exten
   protected Configuration conf;
   protected LargeObjectLoader loader;
   protected Path outDir;
-  protected MapContext mapContext;
 
   public void setUp() throws IOException, InterruptedException {
     conf = new Configuration();
@@ -60,17 +56,7 @@ public class TestLargeObjectLoader exten
     }
     fs.mkdirs(outDir);
 
-    /* A mock MapContext that uses FileOutputCommitter.
-     * This MapContext is actually serving two roles here; when writing the
-     * CLOB files, its OutputCommitter is used to determine where to write
-     * the CLOB data, as these are placed in the task output work directory.
-     * When reading the CLOB data back for verification, we use the
-     * getInputSplit() to determine where to read our source data from--the same
-     * directory. We are repurposing the same context for both output and input.
-     */
-    mapContext = MockObjectFactory.getMapContextForIOPath(conf, outDir);
-    loader = new LargeObjectLoader(mapContext.getConfiguration(),
-        FileOutputFormat.getWorkOutputPath(mapContext));
+    loader = new LargeObjectLoader(conf, outDir);
   }
 
   public void testReadClobRef()
@@ -88,7 +74,6 @@ public class TestLargeObjectLoader exten
     assertNotNull(clob);
     assertTrue(clob.isExternal());
     loader.close();
-    mapContext.getOutputCommitter().commitTask(mapContext);
     Reader r = clob.getDataStream(conf, outDir);
     char [] buf = new char[4096];
     int chars = r.read(buf, 0, 4096);
@@ -117,7 +102,6 @@ public class TestLargeObjectLoader exten
     assertNotNull(blob);
     assertTrue(blob.isExternal());
     loader.close();
-    mapContext.getOutputCommitter().commitTask(mapContext);
     InputStream is = blob.getDataStream(conf, outDir);
     byte [] buf = new byte[4096];
     int bytes = is.read(buf, 0, 4096);

Modified: incubator/sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java?rev=1199149&r1=1199148&r2=1199149&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java
(original)
+++ incubator/sqoop/trunk/src/test/com/cloudera/sqoop/mapreduce/db/TestDataDrivenDBInputFormat.java
Tue Nov  8 08:05:02 2011
@@ -23,13 +23,14 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import junit.framework.TestCase;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.*;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.NullWritable;
 import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.mapred.HadoopTestCase;
 import org.apache.hadoop.mapreduce.*;
 import org.apache.hadoop.mapreduce.lib.db.*;
 import org.apache.hadoop.mapreduce.lib.output.*;
@@ -38,7 +39,7 @@ import org.apache.hadoop.util.StringUtil
 /**
  * Test aspects of DataDrivenDBInputFormat.
  */
-public class TestDataDrivenDBInputFormat extends HadoopTestCase {
+public class TestDataDrivenDBInputFormat extends TestCase {
 
   private static final Log LOG = LogFactory.getLog(
       TestDataDrivenDBInputFormat.class);
@@ -52,10 +53,6 @@ public class TestDataDrivenDBInputFormat
 
   private static final String OUT_DIR;
 
-  public TestDataDrivenDBInputFormat() throws IOException {
-    super(LOCAL_MR, LOCAL_FS, 1, 1);
-  }
-
   static {
     OUT_DIR = System.getProperty("test.build.data", "/tmp") + "/dddbifout";
   }



Mime
View raw message