diff --git a/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java b/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java index c99b2c0a..1a300aeb 100644 --- a/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java +++ b/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java @@ -33,6 +33,7 @@ import java.util.ConcurrentModificationException; import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.TimeUnit; public class TestSqoopOutputFormatLoadExecutor { @@ -165,10 +166,8 @@ public void testSuccessfulContinuousLoader() throws Throwable { writer.close(null); } - @Test + @Test (expected = SqoopException.class) public void testSuccessfulLoader() throws Throwable { - conf.set(JobConstants.JOB_TYPE, "EXPORT"); - conf.set(JobConstants.JOB_ETL_LOADER, GoodLoader.class.getName()); SqoopOutputFormatLoadExecutor executor = new SqoopOutputFormatLoadExecutor(true, GoodLoader.class.getName()); RecordWriter writer = executor.getRecordWriter(); @@ -182,6 +181,8 @@ public void testSuccessfulLoader() throws Throwable { } data.setContent(builder.toString(), Data.CSV_RECORD); writer.write(data, null); + //Allow writer to complete. + TimeUnit.SECONDS.sleep(5); writer.close(null); }