Review Board 1.7.22


SQOOP-1129 PostgreSQL direct test are failing on trunk

Review Request #12397 - Created July 10, 2013 and submitted

Jarek Cecho
SQOOP-1129
Reviewers
Sqoop
sqoop-trunk
The test code was expecting different file name than is being created. The changed file name was introduced in SQOOP-1078.
Testcase PostgresqlImportTest is now working correctly. I've used variant of following command to verify that:

ant clean test -Dtestcase=PostgresqlImportTest -Dsqoop.test.postgresql.connectstring.host_url=jdbc:postgresql://postgresql/

Diff revision 1 (Latest)

  1. src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java: Loading...
src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java
Revision 7414199b548dc4b5f6520c156d8cd6714c18681c New Change
[20] 237 lines
[+20] [+] public void setUpData(String tableName, String schema, boolean nullEntry) {
238
  private void doImportAndVerify(boolean isDirect, String [] expectedResults,
238
  private void doImportAndVerify(boolean isDirect, String [] expectedResults,
239
      String tableName, String... extraArgs) throws IOException {
239
      String tableName, String... extraArgs) throws IOException {
240

    
   
240

   
241
    Path warehousePath = new Path(this.getWarehouseDir());
241
    Path warehousePath = new Path(this.getWarehouseDir());
242
    Path tablePath = new Path(warehousePath, tableName);
242
    Path tablePath = new Path(warehousePath, tableName);

    
   
243
    Path filePath = new Path(tablePath, "part-m-00000");
243

    
   
244

   
244
    Path filePath;

   
245
    if (isDirect) {

   
246
      filePath = new Path(tablePath, "data-00000");

   
247
    } else {

   
248
      filePath = new Path(tablePath, "part-m-00000");

   
249
    }

   
250

    
   

   
251
    File tableFile = new File(tablePath.toString());
245
    File tableFile = new File(tablePath.toString());
252
    if (tableFile.exists() && tableFile.isDirectory()) {
246
    if (tableFile.exists() && tableFile.isDirectory()) {
253
      // remove the directory before running the import.
247
      // remove the directory before running the import.
254
      FileListing.recursiveDeleteDir(tableFile);
248
      FileListing.recursiveDeleteDir(tableFile);
255
    }
249
    }
[+20] [20] 142 lines
  1. src/test/com/cloudera/sqoop/manager/PostgresqlImportTest.java: Loading...