From 4353f6b8d76120f51302b298e36d09a8b9409308 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 2 Aug 2011 07:32:03 +0000 Subject: [PATCH] configure surefire plugin to avoid creating temp file on . git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1153054 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 8 ++++++++ src/java/com/cloudera/sqoop/util/AppendUtils.java | 2 +- src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 344cef21..8a5b364d 100644 --- a/pom.xml +++ b/pom.xml @@ -196,6 +196,14 @@ limitations under the License. org.apache.maven.plugins maven-surefire-plugin 2.9 + + + ${project.build.outputDirectory} + ${project.build.outputDirectory} + ${project.build.outputDirectory} + ${project.build.outputDirectory} + + org.apache.maven.plugins diff --git a/src/java/com/cloudera/sqoop/util/AppendUtils.java b/src/java/com/cloudera/sqoop/util/AppendUtils.java index d365e838..219ba3d7 100644 --- a/src/java/com/cloudera/sqoop/util/AppendUtils.java +++ b/src/java/com/cloudera/sqoop/util/AppendUtils.java @@ -42,7 +42,7 @@ public class AppendUtils { private static final SimpleDateFormat DATE_FORM = new SimpleDateFormat( "ddHHmmssSSS"); - private static final String TEMP_IMPORT_ROOT = "_sqoop"; + private static final String TEMP_IMPORT_ROOT = System.getProperty( "sqoop.test.import.rootDir", "_sqoop"); private static final int PARTITION_DIGITS = 5; private static final String FILEPART_SEPARATOR = "-"; diff --git a/src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java b/src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java index 81d59366..deff3e18 100644 --- a/src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java +++ b/src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.io.OutputStreamWriter; +import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -57,6 +58,8 @@ public void testFailedImportDueToIOException() throws IOException { Configuration conf = new Configuration(); + LogFactory.getLog( getClass() ).info( " getWarehouseDir() " + getWarehouseDir() ); + // Make the output dir exist so we know the job will fail via IOException. Path outputPath = new Path(new Path(getWarehouseDir()), getTableName()); FileSystem fs = FileSystem.getLocal(conf);