sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject [6/9] SQOOP-1379: Sqoop2: From/To: Disable tests
Date Wed, 16 Jul 2014 04:15:21 GMT
http://git-wip-us.apache.org/repos/asf/sqoop/blob/d883557d/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportInitializer.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportInitializer.java b/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportInitializer.java
index a33fa36..40c70f1 100644
--- a/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportInitializer.java
+++ b/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportInitializer.java
@@ -35,370 +35,370 @@ import org.apache.sqoop.schema.type.Text;
 
 public class TestImportInitializer extends TestCase {
 
-  private final String schemaName;
-  private final String tableName;
-  private final String schemalessTableName;
-  private final String tableSql;
-  private final String schemalessTableSql;
-  private final String tableColumns;
-
-  private GenericJdbcExecutor executor;
-
-  private static final int START = -50;
-  private static final int NUMBER_OF_ROWS = 101;
-
-  public TestImportInitializer() {
-    schemaName = getClass().getSimpleName().toUpperCase() + "SCHEMA";
-    tableName = getClass().getSimpleName().toUpperCase() + "TABLEWITHSCHEMA";
-    schemalessTableName = getClass().getSimpleName().toUpperCase() + "TABLE";
-    tableSql = "SELECT * FROM " + schemaName + "." + tableName + " WHERE ${CONDITIONS}";
-    schemalessTableSql = "SELECT * FROM " + schemalessTableName + " WHERE ${CONDITIONS}";
-    tableColumns = "ICOL,VCOL";
-  }
-
-  @Override
-  public void setUp() {
-    executor = new GenericJdbcExecutor(GenericJdbcTestConstants.DRIVER,
-        GenericJdbcTestConstants.URL, null, null);
-
-    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
-    if (!executor.existTable(tableName)) {
-      executor.executeUpdate("CREATE SCHEMA " + executor.delimitIdentifier(schemaName));
-      executor.executeUpdate("CREATE TABLE "
-          + fullTableName
-          + "(ICOL INTEGER PRIMARY KEY, DCOL DOUBLE, VCOL VARCHAR(20))");
-
-      for (int i = 0; i < NUMBER_OF_ROWS; i++) {
-        int value = START + i;
-        String sql = "INSERT INTO " + fullTableName
-            + " VALUES(" + value + ", " + value + ", '" + value + "')";
-        executor.executeUpdate(sql);
-      }
-    }
-
-    fullTableName = executor.delimitIdentifier(schemalessTableName);
-    if (!executor.existTable(schemalessTableName)) {
-      executor.executeUpdate("CREATE TABLE "
-          + fullTableName
-          + "(ICOL INTEGER PRIMARY KEY, DCOL DOUBLE, VCOL VARCHAR(20))");
-
-      for (int i = 0; i < NUMBER_OF_ROWS; i++) {
-        int value = START + i;
-        String sql = "INSERT INTO " + fullTableName
-            + " VALUES(" + value + ", " + value + ", '" + value + "')";
-        executor.executeUpdate(sql);
-      }
-    }
-  }
-
-  /**
-   * Return Schema representation for the testing table.
-   *
-   * @param name Name that should be used for the generated schema.
-   * @return
-   */
-  public Schema getSchema(String name) {
-    return new Schema(name)
-      .addColumn(new FixedPoint("ICOL"))
-      .addColumn(new FloatingPoint("DCOL"))
-      .addColumn(new Text("VCOL"))
-    ;
-  }
-
-  @Override
-  public void tearDown() {
-    executor.close();
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableName() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.tableName = schemalessTableName;
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT * FROM " + executor.delimitIdentifier(schemalessTableName)
-            + " WHERE ${CONDITIONS}",
-        "ICOL,DCOL,VCOL",
-        "ICOL",
-        String.valueOf(Types.INTEGER),
-        String.valueOf(START),
-        String.valueOf(START+NUMBER_OF_ROWS-1));
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableNameWithTableColumns() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.tableName = schemalessTableName;
-    jobConf.table.columns = tableColumns;
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT ICOL,VCOL FROM " + executor.delimitIdentifier(schemalessTableName)
-            + " WHERE ${CONDITIONS}",
-        tableColumns,
-        "ICOL",
-        String.valueOf(Types.INTEGER),
-        String.valueOf(START),
-        String.valueOf(START+NUMBER_OF_ROWS-1));
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableSql() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.sql = schemalessTableSql;
-    jobConf.table.partitionColumn = "DCOL";
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT * FROM " + executor.delimitIdentifier(schemalessTableName)
-            + " WHERE ${CONDITIONS}",
-        "ICOL,DCOL,VCOL",
-        "DCOL",
-        String.valueOf(Types.DOUBLE),
-        String.valueOf((double)START),
-        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableSqlWithTableColumns() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.sql = schemalessTableSql;
-    jobConf.table.columns = tableColumns;
-    jobConf.table.partitionColumn = "DCOL";
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT SQOOP_SUBQUERY_ALIAS.ICOL,SQOOP_SUBQUERY_ALIAS.VCOL FROM "
-            + "(SELECT * FROM " + executor.delimitIdentifier(schemalessTableName)
-            + " WHERE ${CONDITIONS}) SQOOP_SUBQUERY_ALIAS",
-        tableColumns,
-        "DCOL",
-        String.valueOf(Types.DOUBLE),
-        String.valueOf((double)START),
-        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableNameWithSchema() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.schemaName = schemaName;
-    jobConf.table.tableName = tableName;
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT * FROM " + fullTableName
-            + " WHERE ${CONDITIONS}",
-        "ICOL,DCOL,VCOL",
-        "ICOL",
-        String.valueOf(Types.INTEGER),
-        String.valueOf(START),
-        String.valueOf(START+NUMBER_OF_ROWS-1));
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableNameWithTableColumnsWithSchema() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.schemaName = schemaName;
-    jobConf.table.tableName = tableName;
-    jobConf.table.columns = tableColumns;
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT ICOL,VCOL FROM " + fullTableName
-            + " WHERE ${CONDITIONS}",
-        tableColumns,
-        "ICOL",
-        String.valueOf(Types.INTEGER),
-        String.valueOf(START),
-        String.valueOf(START+NUMBER_OF_ROWS-1));
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableSqlWithSchema() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.schemaName = schemaName;
-    jobConf.table.sql = tableSql;
-    jobConf.table.partitionColumn = "DCOL";
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT * FROM " + fullTableName
-            + " WHERE ${CONDITIONS}",
-        "ICOL,DCOL,VCOL",
-        "DCOL",
-        String.valueOf(Types.DOUBLE),
-        String.valueOf((double)START),
-        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
-  }
-
-
-  @SuppressWarnings("unchecked")
-  public void testGetSchemaForTable() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.schemaName = schemaName;
-    jobConf.table.tableName = tableName;
-    jobConf.table.partitionColumn = "DCOL";
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-    Schema schema = initializer.getSchema(initializerContext, connConf, jobConf);
-    assertEquals(getSchema(tableName), schema);
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testGetSchemaForSql() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.schemaName = schemaName;
-    jobConf.table.sql = tableSql;
-    jobConf.table.partitionColumn = "DCOL";
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-    Schema schema = initializer.getSchema(initializerContext, connConf, jobConf);
-    assertEquals(getSchema("Query"), schema);
-  }
-
-  @SuppressWarnings("unchecked")
-  public void testTableSqlWithTableColumnsWithSchema() throws Exception {
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
-
-    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
-    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
-    jobConf.table.schemaName = schemaName;
-    jobConf.table.sql = tableSql;
-    jobConf.table.columns = tableColumns;
-    jobConf.table.partitionColumn = "DCOL";
-
-    MutableContext context = new MutableMapContext();
-    InitializerContext initializerContext = new InitializerContext(context);
-
-    @SuppressWarnings("rawtypes")
-    Initializer initializer = new GenericJdbcImportInitializer();
-    initializer.initialize(initializerContext, connConf, jobConf);
-
-    verifyResult(context,
-        "SELECT SQOOP_SUBQUERY_ALIAS.ICOL,SQOOP_SUBQUERY_ALIAS.VCOL FROM "
-            + "(SELECT * FROM " + fullTableName
-            + " WHERE ${CONDITIONS}) SQOOP_SUBQUERY_ALIAS",
-        tableColumns,
-        "DCOL",
-        String.valueOf(Types.DOUBLE),
-        String.valueOf((double)START),
-        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
-  }
-
-  private void verifyResult(MutableContext context,
-      String dataSql, String fieldNames,
-      String partitionColumnName, String partitionColumnType,
-      String partitionMinValue, String partitionMaxValue) {
-    assertEquals(dataSql, context.getString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_DATA_SQL));
-    assertEquals(fieldNames, context.getString(
-        Constants.JOB_ETL_FIELD_NAMES));
-
-    assertEquals(partitionColumnName, context.getString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME));
-    assertEquals(partitionColumnType, context.getString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE));
-    assertEquals(partitionMinValue, context.getString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE));
-    assertEquals(partitionMaxValue, context.getString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE));
-  }
+//  private final String schemaName;
+//  private final String tableName;
+//  private final String schemalessTableName;
+//  private final String tableSql;
+//  private final String schemalessTableSql;
+//  private final String tableColumns;
+//
+//  private GenericJdbcExecutor executor;
+//
+//  private static final int START = -50;
+//  private static final int NUMBER_OF_ROWS = 101;
+//
+//  public TestImportInitializer() {
+//    schemaName = getClass().getSimpleName().toUpperCase() + "SCHEMA";
+//    tableName = getClass().getSimpleName().toUpperCase() + "TABLEWITHSCHEMA";
+//    schemalessTableName = getClass().getSimpleName().toUpperCase() + "TABLE";
+//    tableSql = "SELECT * FROM " + schemaName + "." + tableName + " WHERE ${CONDITIONS}";
+//    schemalessTableSql = "SELECT * FROM " + schemalessTableName + " WHERE ${CONDITIONS}";
+//    tableColumns = "ICOL,VCOL";
+//  }
+//
+//  @Override
+//  public void setUp() {
+//    executor = new GenericJdbcExecutor(GenericJdbcTestConstants.DRIVER,
+//        GenericJdbcTestConstants.URL, null, null);
+//
+//    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
+//    if (!executor.existTable(tableName)) {
+//      executor.executeUpdate("CREATE SCHEMA " + executor.delimitIdentifier(schemaName));
+//      executor.executeUpdate("CREATE TABLE "
+//          + fullTableName
+//          + "(ICOL INTEGER PRIMARY KEY, DCOL DOUBLE, VCOL VARCHAR(20))");
+//
+//      for (int i = 0; i < NUMBER_OF_ROWS; i++) {
+//        int value = START + i;
+//        String sql = "INSERT INTO " + fullTableName
+//            + " VALUES(" + value + ", " + value + ", '" + value + "')";
+//        executor.executeUpdate(sql);
+//      }
+//    }
+//
+//    fullTableName = executor.delimitIdentifier(schemalessTableName);
+//    if (!executor.existTable(schemalessTableName)) {
+//      executor.executeUpdate("CREATE TABLE "
+//          + fullTableName
+//          + "(ICOL INTEGER PRIMARY KEY, DCOL DOUBLE, VCOL VARCHAR(20))");
+//
+//      for (int i = 0; i < NUMBER_OF_ROWS; i++) {
+//        int value = START + i;
+//        String sql = "INSERT INTO " + fullTableName
+//            + " VALUES(" + value + ", " + value + ", '" + value + "')";
+//        executor.executeUpdate(sql);
+//      }
+//    }
+//  }
+//
+//  /**
+//   * Return Schema representation for the testing table.
+//   *
+//   * @param name Name that should be used for the generated schema.
+//   * @return
+//   */
+//  public Schema getSchema(String name) {
+//    return new Schema(name)
+//      .addColumn(new FixedPoint("ICOL"))
+//      .addColumn(new FloatingPoint("DCOL"))
+//      .addColumn(new Text("VCOL"))
+//    ;
+//  }
+//
+//  @Override
+//  public void tearDown() {
+//    executor.close();
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableName() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.tableName = schemalessTableName;
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT * FROM " + executor.delimitIdentifier(schemalessTableName)
+//            + " WHERE ${CONDITIONS}",
+//        "ICOL,DCOL,VCOL",
+//        "ICOL",
+//        String.valueOf(Types.INTEGER),
+//        String.valueOf(START),
+//        String.valueOf(START+NUMBER_OF_ROWS-1));
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableNameWithTableColumns() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.tableName = schemalessTableName;
+//    jobConf.table.columns = tableColumns;
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT ICOL,VCOL FROM " + executor.delimitIdentifier(schemalessTableName)
+//            + " WHERE ${CONDITIONS}",
+//        tableColumns,
+//        "ICOL",
+//        String.valueOf(Types.INTEGER),
+//        String.valueOf(START),
+//        String.valueOf(START+NUMBER_OF_ROWS-1));
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableSql() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.sql = schemalessTableSql;
+//    jobConf.table.partitionColumn = "DCOL";
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT * FROM " + executor.delimitIdentifier(schemalessTableName)
+//            + " WHERE ${CONDITIONS}",
+//        "ICOL,DCOL,VCOL",
+//        "DCOL",
+//        String.valueOf(Types.DOUBLE),
+//        String.valueOf((double)START),
+//        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableSqlWithTableColumns() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.sql = schemalessTableSql;
+//    jobConf.table.columns = tableColumns;
+//    jobConf.table.partitionColumn = "DCOL";
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT SQOOP_SUBQUERY_ALIAS.ICOL,SQOOP_SUBQUERY_ALIAS.VCOL FROM "
+//            + "(SELECT * FROM " + executor.delimitIdentifier(schemalessTableName)
+//            + " WHERE ${CONDITIONS}) SQOOP_SUBQUERY_ALIAS",
+//        tableColumns,
+//        "DCOL",
+//        String.valueOf(Types.DOUBLE),
+//        String.valueOf((double)START),
+//        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableNameWithSchema() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.schemaName = schemaName;
+//    jobConf.table.tableName = tableName;
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT * FROM " + fullTableName
+//            + " WHERE ${CONDITIONS}",
+//        "ICOL,DCOL,VCOL",
+//        "ICOL",
+//        String.valueOf(Types.INTEGER),
+//        String.valueOf(START),
+//        String.valueOf(START+NUMBER_OF_ROWS-1));
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableNameWithTableColumnsWithSchema() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.schemaName = schemaName;
+//    jobConf.table.tableName = tableName;
+//    jobConf.table.columns = tableColumns;
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT ICOL,VCOL FROM " + fullTableName
+//            + " WHERE ${CONDITIONS}",
+//        tableColumns,
+//        "ICOL",
+//        String.valueOf(Types.INTEGER),
+//        String.valueOf(START),
+//        String.valueOf(START+NUMBER_OF_ROWS-1));
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableSqlWithSchema() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.schemaName = schemaName;
+//    jobConf.table.sql = tableSql;
+//    jobConf.table.partitionColumn = "DCOL";
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT * FROM " + fullTableName
+//            + " WHERE ${CONDITIONS}",
+//        "ICOL,DCOL,VCOL",
+//        "DCOL",
+//        String.valueOf(Types.DOUBLE),
+//        String.valueOf((double)START),
+//        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
+//  }
+//
+//
+//  @SuppressWarnings("unchecked")
+//  public void testGetSchemaForTable() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.schemaName = schemaName;
+//    jobConf.table.tableName = tableName;
+//    jobConf.table.partitionColumn = "DCOL";
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//    Schema schema = initializer.getSchema(initializerContext, connConf, jobConf);
+//    assertEquals(getSchema(tableName), schema);
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testGetSchemaForSql() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.schemaName = schemaName;
+//    jobConf.table.sql = tableSql;
+//    jobConf.table.partitionColumn = "DCOL";
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//    Schema schema = initializer.getSchema(initializerContext, connConf, jobConf);
+//    assertEquals(getSchema("Query"), schema);
+//  }
+//
+//  @SuppressWarnings("unchecked")
+//  public void testTableSqlWithTableColumnsWithSchema() throws Exception {
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    String fullTableName = executor.delimitIdentifier(schemaName) + "." + executor.delimitIdentifier(tableName);
+//
+//    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
+//    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
+//    jobConf.table.schemaName = schemaName;
+//    jobConf.table.sql = tableSql;
+//    jobConf.table.columns = tableColumns;
+//    jobConf.table.partitionColumn = "DCOL";
+//
+//    MutableContext context = new MutableMapContext();
+//    InitializerContext initializerContext = new InitializerContext(context);
+//
+//    @SuppressWarnings("rawtypes")
+//    Initializer initializer = new GenericJdbcImportInitializer();
+//    initializer.initialize(initializerContext, connConf, jobConf);
+//
+//    verifyResult(context,
+//        "SELECT SQOOP_SUBQUERY_ALIAS.ICOL,SQOOP_SUBQUERY_ALIAS.VCOL FROM "
+//            + "(SELECT * FROM " + fullTableName
+//            + " WHERE ${CONDITIONS}) SQOOP_SUBQUERY_ALIAS",
+//        tableColumns,
+//        "DCOL",
+//        String.valueOf(Types.DOUBLE),
+//        String.valueOf((double)START),
+//        String.valueOf((double)(START+NUMBER_OF_ROWS-1)));
+//  }
+//
+//  private void verifyResult(MutableContext context,
+//      String dataSql, String fieldNames,
+//      String partitionColumnName, String partitionColumnType,
+//      String partitionMinValue, String partitionMaxValue) {
+//    assertEquals(dataSql, context.getString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_DATA_SQL));
+//    assertEquals(fieldNames, context.getString(
+//        Constants.JOB_ETL_FIELD_NAMES));
+//
+//    assertEquals(partitionColumnName, context.getString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME));
+//    assertEquals(partitionColumnType, context.getString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE));
+//    assertEquals(partitionMinValue, context.getString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE));
+//    assertEquals(partitionMaxValue, context.getString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE));
+//  }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/d883557d/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportPartitioner.java
----------------------------------------------------------------------
diff --git a/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportPartitioner.java b/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportPartitioner.java
index 679accf..5b574c8 100644
--- a/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportPartitioner.java
+++ b/connector/connector-generic-jdbc/src/test/java/org/apache/sqoop/connector/jdbc/TestImportPartitioner.java
@@ -39,467 +39,467 @@ import org.apache.sqoop.job.etl.PartitionerContext;
 
 public class TestImportPartitioner extends TestCase {
 
-  private static final int START = -5;
-  private static final int NUMBER_OF_ROWS = 11;
-
-  public void testIntegerEvenPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
-        "ICOL");
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
-        String.valueOf(Types.INTEGER));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        String.valueOf(START));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-        String.valueOf(START + NUMBER_OF_ROWS - 1));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "-5 <= ICOL AND ICOL < -3",
-        "-3 <= ICOL AND ICOL < -1",
-        "-1 <= ICOL AND ICOL < 1",
-        "1 <= ICOL AND ICOL < 3",
-        "3 <= ICOL AND ICOL <= 5"
-    });
-  }
-
-  public void testIntegerUnevenPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
-        "ICOL");
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
-        String.valueOf(Types.INTEGER));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        String.valueOf(START));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-        String.valueOf(START + NUMBER_OF_ROWS - 1));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "-5 <= ICOL AND ICOL < -1",
-        "-1 <= ICOL AND ICOL < 2",
-        "2 <= ICOL AND ICOL <= 5"
-    });
-  }
-
-  public void testIntegerOverPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
-        "ICOL");
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
-        String.valueOf(Types.INTEGER));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        String.valueOf(START));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-        String.valueOf(START + NUMBER_OF_ROWS - 1));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 13, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "-5 <= ICOL AND ICOL < -4",
-        "-4 <= ICOL AND ICOL < -3",
-        "-3 <= ICOL AND ICOL < -2",
-        "-2 <= ICOL AND ICOL < -1",
-        "-1 <= ICOL AND ICOL < 0",
-        "0 <= ICOL AND ICOL < 1",
-        "1 <= ICOL AND ICOL < 2",
-        "2 <= ICOL AND ICOL < 3",
-        "3 <= ICOL AND ICOL < 4",
-        "4 <= ICOL AND ICOL <= 5"
-    });
-  }
-
-  public void testFloatingPointEvenPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
-        "DCOL");
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
-        String.valueOf(Types.DOUBLE));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        String.valueOf((double)START));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-        String.valueOf((double)(START + NUMBER_OF_ROWS - 1)));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "-5.0 <= DCOL AND DCOL < -3.0",
-        "-3.0 <= DCOL AND DCOL < -1.0",
-        "-1.0 <= DCOL AND DCOL < 1.0",
-        "1.0 <= DCOL AND DCOL < 3.0",
-        "3.0 <= DCOL AND DCOL <= 5.0"
-    });
-  }
-
-  public void testFloatingPointUnevenPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
-        "DCOL");
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
-        String.valueOf(Types.DOUBLE));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        String.valueOf((double)START));
-    context.setString(
-        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-        String.valueOf((double)(START + NUMBER_OF_ROWS - 1)));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "-5.0 <= DCOL AND DCOL < -1.6666666666666665",
-        "-1.6666666666666665 <= DCOL AND DCOL < 1.666666666666667",
-        "1.666666666666667 <= DCOL AND DCOL <= 5.0"
-    });
-  }
-
-  public void testNumericEvenPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "ICOL");
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.NUMERIC));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE, String.valueOf(START));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE, String.valueOf(START + NUMBER_OF_ROWS - 1));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "-5 <= ICOL AND ICOL < -3",
-        "-3 <= ICOL AND ICOL < -1",
-        "-1 <= ICOL AND ICOL < 1",
-        "1 <= ICOL AND ICOL < 3",
-        "3 <= ICOL AND ICOL <= 5"
-    });
-  }
-
-  public void testNumericUnevenPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "DCOL");
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.NUMERIC));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE, String.valueOf(new BigDecimal(START)));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE, String.valueOf(new BigDecimal(START + NUMBER_OF_ROWS - 1)));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[]{
-      "-5 <= DCOL AND DCOL < -2",
-      "-2 <= DCOL AND DCOL < 1",
-      "1 <= DCOL AND DCOL <= 5"
-    });
-  }
-
-  public void testNumericSinglePartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "DCOL");
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.NUMERIC));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE, String.valueOf(new BigDecimal(START)));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE, String.valueOf(new BigDecimal(START)));
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[]{
-      "DCOL = -5",
-    });
-  }
-
-
-  public void testDatePartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "DCOL");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.DATE));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        Date.valueOf("2004-10-20").toString());
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MAXVALUE, Date.valueOf("2013-10-17")
-        .toString());
-
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-
-    verifyResult(partitions, new String[]{
-        "'2004-10-20' <= DCOL AND DCOL < '2007-10-19'",
-        "'2007-10-19' <= DCOL AND DCOL < '2010-10-18'",
-        "'2010-10-18' <= DCOL AND DCOL <= '2013-10-17'",
-    });
-
-  }
-
-  public void testTimePartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "TCOL");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.TIME));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        Time.valueOf("01:01:01").toString());
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-        Time.valueOf("10:40:50").toString());
-
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[]{
-        "'01:01:01' <= TCOL AND TCOL < '04:14:17'",
-        "'04:14:17' <= TCOL AND TCOL < '07:27:33'",
-        "'07:27:33' <= TCOL AND TCOL <= '10:40:50'",
-    });
-  }
-
-  public void testTimestampPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "TSCOL");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.TIMESTAMP));
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
-        Timestamp.valueOf("2013-01-01 01:01:01.123").toString());
-    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
-        Timestamp.valueOf("2013-12-31 10:40:50.654").toString());
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-    verifyResult(partitions, new String[]{
-        "'2013-01-01 01:01:01.123' <= TSCOL AND TSCOL < '2013-05-02 12:14:17.634'",
-        "'2013-05-02 12:14:17.634' <= TSCOL AND TSCOL < '2013-08-31 23:27:34.144'",
-        "'2013-08-31 23:27:34.144' <= TSCOL AND TSCOL <= '2013-12-31 10:40:50.654'",
-    });
-  }
-
-  public void testBooleanPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "BCOL");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.BOOLEAN));
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MINVALUE, "0");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "1");
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-    verifyResult(partitions, new String[]{
-      "BCOL = TRUE",
-      "BCOL = FALSE",
-    });
-  }
-
-  public void testVarcharPartition() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MINVALUE, "A");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "Z");
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 25, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "'A' <= VCCOL AND VCCOL < 'B'",
-        "'B' <= VCCOL AND VCCOL < 'C'",
-        "'C' <= VCCOL AND VCCOL < 'D'",
-        "'D' <= VCCOL AND VCCOL < 'E'",
-        "'E' <= VCCOL AND VCCOL < 'F'",
-        "'F' <= VCCOL AND VCCOL < 'G'",
-        "'G' <= VCCOL AND VCCOL < 'H'",
-        "'H' <= VCCOL AND VCCOL < 'I'",
-        "'I' <= VCCOL AND VCCOL < 'J'",
-        "'J' <= VCCOL AND VCCOL < 'K'",
-        "'K' <= VCCOL AND VCCOL < 'L'",
-        "'L' <= VCCOL AND VCCOL < 'M'",
-        "'M' <= VCCOL AND VCCOL < 'N'",
-        "'N' <= VCCOL AND VCCOL < 'O'",
-        "'O' <= VCCOL AND VCCOL < 'P'",
-        "'P' <= VCCOL AND VCCOL < 'Q'",
-        "'Q' <= VCCOL AND VCCOL < 'R'",
-        "'R' <= VCCOL AND VCCOL < 'S'",
-        "'S' <= VCCOL AND VCCOL < 'T'",
-        "'T' <= VCCOL AND VCCOL < 'U'",
-        "'U' <= VCCOL AND VCCOL < 'V'",
-        "'V' <= VCCOL AND VCCOL < 'W'",
-        "'W' <= VCCOL AND VCCOL < 'X'",
-        "'X' <= VCCOL AND VCCOL < 'Y'",
-        "'Y' <= VCCOL AND VCCOL <= 'Z'",
-    });
-  }
-
-  public void testVarcharPartition2() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants
-      .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
-    context.setString(GenericJdbcConnectorConstants
-      .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
-    context.setString(GenericJdbcConnectorConstants
-      .CONNECTOR_JDBC_PARTITION_MINVALUE, "Breezy Badger");
-    context.setString(GenericJdbcConnectorConstants
-      .CONNECTOR_JDBC_PARTITION_MAXVALUE, "Warty Warthog");
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-    assertEquals(partitions.size(), 5);
-    // First partition needs to contain entire upper bound
-    assertTrue(partitions.get(0).toString().contains("Breezy Badger"));
-    // Last partition needs to contain entire lower bound
-    assertTrue(partitions.get(4).toString().contains("Warty Warthog"));
-  }
-
-  public void testVarcharPartitionWithCommonPrefix() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MINVALUE, "AAA");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "AAF");
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
-
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "'AAA' <= VCCOL AND VCCOL < 'AAB'",
-        "'AAB' <= VCCOL AND VCCOL < 'AAC'",
-        "'AAC' <= VCCOL AND VCCOL < 'AAD'",
-        "'AAD' <= VCCOL AND VCCOL < 'AAE'",
-        "'AAE' <= VCCOL AND VCCOL <= 'AAF'",
-    });
-
-  }
-
-  public void testPatitionWithNullValues() throws Exception {
-    MutableContext context = new MutableMapContext();
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MINVALUE, "AAA");
-    context.setString(GenericJdbcConnectorConstants
-        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "AAE");
-
-    ConnectionConfiguration connConf = new ConnectionConfiguration();
-    ImportJobConfiguration jobConf = new ImportJobConfiguration();
-    jobConf.table.partitionColumnNull = true;
-
-    Partitioner partitioner = new GenericJdbcImportPartitioner();
-    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
-
-    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
-
-    verifyResult(partitions, new String[] {
-        "VCCOL IS NULL",
-        "'AAA' <= VCCOL AND VCCOL < 'AAB'",
-        "'AAB' <= VCCOL AND VCCOL < 'AAC'",
-        "'AAC' <= VCCOL AND VCCOL < 'AAD'",
-        "'AAD' <= VCCOL AND VCCOL <= 'AAE'",
-    });
-
-  }
-
-  private void verifyResult(List<Partition> partitions,
-      String[] expected) {
-    assertEquals(expected.length, partitions.size());
-
-    Iterator<Partition> iterator = partitions.iterator();
-    for (int i = 0; i < expected.length; i++) {
-      assertEquals(expected[i],
-          ((GenericJdbcImportPartition)iterator.next()).getConditions());
-    }
-  }
+//  private static final int START = -5;
+//  private static final int NUMBER_OF_ROWS = 11;
+//
+//  public void testIntegerEvenPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
+//        "ICOL");
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
+//        String.valueOf(Types.INTEGER));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        String.valueOf(START));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
+//        String.valueOf(START + NUMBER_OF_ROWS - 1));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "-5 <= ICOL AND ICOL < -3",
+//        "-3 <= ICOL AND ICOL < -1",
+//        "-1 <= ICOL AND ICOL < 1",
+//        "1 <= ICOL AND ICOL < 3",
+//        "3 <= ICOL AND ICOL <= 5"
+//    });
+//  }
+//
+//  public void testIntegerUnevenPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
+//        "ICOL");
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
+//        String.valueOf(Types.INTEGER));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        String.valueOf(START));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
+//        String.valueOf(START + NUMBER_OF_ROWS - 1));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "-5 <= ICOL AND ICOL < -1",
+//        "-1 <= ICOL AND ICOL < 2",
+//        "2 <= ICOL AND ICOL <= 5"
+//    });
+//  }
+//
+//  public void testIntegerOverPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
+//        "ICOL");
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
+//        String.valueOf(Types.INTEGER));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        String.valueOf(START));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
+//        String.valueOf(START + NUMBER_OF_ROWS - 1));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 13, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "-5 <= ICOL AND ICOL < -4",
+//        "-4 <= ICOL AND ICOL < -3",
+//        "-3 <= ICOL AND ICOL < -2",
+//        "-2 <= ICOL AND ICOL < -1",
+//        "-1 <= ICOL AND ICOL < 0",
+//        "0 <= ICOL AND ICOL < 1",
+//        "1 <= ICOL AND ICOL < 2",
+//        "2 <= ICOL AND ICOL < 3",
+//        "3 <= ICOL AND ICOL < 4",
+//        "4 <= ICOL AND ICOL <= 5"
+//    });
+//  }
+//
+//  public void testFloatingPointEvenPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
+//        "DCOL");
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
+//        String.valueOf(Types.DOUBLE));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        String.valueOf((double)START));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
+//        String.valueOf((double)(START + NUMBER_OF_ROWS - 1)));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "-5.0 <= DCOL AND DCOL < -3.0",
+//        "-3.0 <= DCOL AND DCOL < -1.0",
+//        "-1.0 <= DCOL AND DCOL < 1.0",
+//        "1.0 <= DCOL AND DCOL < 3.0",
+//        "3.0 <= DCOL AND DCOL <= 5.0"
+//    });
+//  }
+//
+//  public void testFloatingPointUnevenPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
+//        "DCOL");
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
+//        String.valueOf(Types.DOUBLE));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        String.valueOf((double)START));
+//    context.setString(
+//        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
+//        String.valueOf((double)(START + NUMBER_OF_ROWS - 1)));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "-5.0 <= DCOL AND DCOL < -1.6666666666666665",
+//        "-1.6666666666666665 <= DCOL AND DCOL < 1.666666666666667",
+//        "1.666666666666667 <= DCOL AND DCOL <= 5.0"
+//    });
+//  }
+//
+//  public void testNumericEvenPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "ICOL");
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.NUMERIC));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE, String.valueOf(START));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE, String.valueOf(START + NUMBER_OF_ROWS - 1));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "-5 <= ICOL AND ICOL < -3",
+//        "-3 <= ICOL AND ICOL < -1",
+//        "-1 <= ICOL AND ICOL < 1",
+//        "1 <= ICOL AND ICOL < 3",
+//        "3 <= ICOL AND ICOL <= 5"
+//    });
+//  }
+//
+//  public void testNumericUnevenPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "DCOL");
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.NUMERIC));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE, String.valueOf(new BigDecimal(START)));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE, String.valueOf(new BigDecimal(START + NUMBER_OF_ROWS - 1)));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[]{
+//      "-5 <= DCOL AND DCOL < -2",
+//      "-2 <= DCOL AND DCOL < 1",
+//      "1 <= DCOL AND DCOL <= 5"
+//    });
+//  }
+//
+//  public void testNumericSinglePartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "DCOL");
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.NUMERIC));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE, String.valueOf(new BigDecimal(START)));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE, String.valueOf(new BigDecimal(START)));
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[]{
+//      "DCOL = -5",
+//    });
+//  }
+//
+//
+//  public void testDatePartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME, "DCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.DATE));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        Date.valueOf("2004-10-20").toString());
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MAXVALUE, Date.valueOf("2013-10-17")
+//        .toString());
+//
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//
+//    verifyResult(partitions, new String[]{
+//        "'2004-10-20' <= DCOL AND DCOL < '2007-10-19'",
+//        "'2007-10-19' <= DCOL AND DCOL < '2010-10-18'",
+//        "'2010-10-18' <= DCOL AND DCOL <= '2013-10-17'",
+//    });
+//
+//  }
+//
+//  public void testTimePartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "TCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.TIME));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        Time.valueOf("01:01:01").toString());
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
+//        Time.valueOf("10:40:50").toString());
+//
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[]{
+//        "'01:01:01' <= TCOL AND TCOL < '04:14:17'",
+//        "'04:14:17' <= TCOL AND TCOL < '07:27:33'",
+//        "'07:27:33' <= TCOL AND TCOL <= '10:40:50'",
+//    });
+//  }
+//
+//  public void testTimestampPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "TSCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.TIMESTAMP));
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
+//        Timestamp.valueOf("2013-01-01 01:01:01.123").toString());
+//    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
+//        Timestamp.valueOf("2013-12-31 10:40:50.654").toString());
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//    verifyResult(partitions, new String[]{
+//        "'2013-01-01 01:01:01.123' <= TSCOL AND TSCOL < '2013-05-02 12:14:17.634'",
+//        "'2013-05-02 12:14:17.634' <= TSCOL AND TSCOL < '2013-08-31 23:27:34.144'",
+//        "'2013-08-31 23:27:34.144' <= TSCOL AND TSCOL <= '2013-12-31 10:40:50.654'",
+//    });
+//  }
+//
+//  public void testBooleanPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "BCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.BOOLEAN));
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MINVALUE, "0");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "1");
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 3, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//    verifyResult(partitions, new String[]{
+//      "BCOL = TRUE",
+//      "BCOL = FALSE",
+//    });
+//  }
+//
+//  public void testVarcharPartition() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MINVALUE, "A");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "Z");
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 25, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "'A' <= VCCOL AND VCCOL < 'B'",
+//        "'B' <= VCCOL AND VCCOL < 'C'",
+//        "'C' <= VCCOL AND VCCOL < 'D'",
+//        "'D' <= VCCOL AND VCCOL < 'E'",
+//        "'E' <= VCCOL AND VCCOL < 'F'",
+//        "'F' <= VCCOL AND VCCOL < 'G'",
+//        "'G' <= VCCOL AND VCCOL < 'H'",
+//        "'H' <= VCCOL AND VCCOL < 'I'",
+//        "'I' <= VCCOL AND VCCOL < 'J'",
+//        "'J' <= VCCOL AND VCCOL < 'K'",
+//        "'K' <= VCCOL AND VCCOL < 'L'",
+//        "'L' <= VCCOL AND VCCOL < 'M'",
+//        "'M' <= VCCOL AND VCCOL < 'N'",
+//        "'N' <= VCCOL AND VCCOL < 'O'",
+//        "'O' <= VCCOL AND VCCOL < 'P'",
+//        "'P' <= VCCOL AND VCCOL < 'Q'",
+//        "'Q' <= VCCOL AND VCCOL < 'R'",
+//        "'R' <= VCCOL AND VCCOL < 'S'",
+//        "'S' <= VCCOL AND VCCOL < 'T'",
+//        "'T' <= VCCOL AND VCCOL < 'U'",
+//        "'U' <= VCCOL AND VCCOL < 'V'",
+//        "'V' <= VCCOL AND VCCOL < 'W'",
+//        "'W' <= VCCOL AND VCCOL < 'X'",
+//        "'X' <= VCCOL AND VCCOL < 'Y'",
+//        "'Y' <= VCCOL AND VCCOL <= 'Z'",
+//    });
+//  }
+//
+//  public void testVarcharPartition2() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants
+//      .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//      .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
+//    context.setString(GenericJdbcConnectorConstants
+//      .CONNECTOR_JDBC_PARTITION_MINVALUE, "Breezy Badger");
+//    context.setString(GenericJdbcConnectorConstants
+//      .CONNECTOR_JDBC_PARTITION_MAXVALUE, "Warty Warthog");
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//    assertEquals(partitions.size(), 5);
+//    // First partition needs to contain entire upper bound
+//    assertTrue(partitions.get(0).toString().contains("Breezy Badger"));
+//    // Last partition needs to contain entire lower bound
+//    assertTrue(partitions.get(4).toString().contains("Warty Warthog"));
+//  }
+//
+//  public void testVarcharPartitionWithCommonPrefix() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MINVALUE, "AAA");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "AAF");
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
+//
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "'AAA' <= VCCOL AND VCCOL < 'AAB'",
+//        "'AAB' <= VCCOL AND VCCOL < 'AAC'",
+//        "'AAC' <= VCCOL AND VCCOL < 'AAD'",
+//        "'AAD' <= VCCOL AND VCCOL < 'AAE'",
+//        "'AAE' <= VCCOL AND VCCOL <= 'AAF'",
+//    });
+//
+//  }
+//
+//  public void testPatitionWithNullValues() throws Exception {
+//    MutableContext context = new MutableMapContext();
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNNAME, "VCCOL");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_COLUMNTYPE, String.valueOf(Types.VARCHAR));
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MINVALUE, "AAA");
+//    context.setString(GenericJdbcConnectorConstants
+//        .CONNECTOR_JDBC_PARTITION_MAXVALUE, "AAE");
+//
+//    ConnectionConfiguration connConf = new ConnectionConfiguration();
+//    ImportJobConfiguration jobConf = new ImportJobConfiguration();
+//    jobConf.table.partitionColumnNull = true;
+//
+//    Partitioner partitioner = new GenericJdbcImportPartitioner();
+//    PartitionerContext partitionerContext = new PartitionerContext(context, 5, null);
+//
+//    List<Partition> partitions = partitioner.getPartitions(partitionerContext, connConf, jobConf);
+//
+//    verifyResult(partitions, new String[] {
+//        "VCCOL IS NULL",
+//        "'AAA' <= VCCOL AND VCCOL < 'AAB'",
+//        "'AAB' <= VCCOL AND VCCOL < 'AAC'",
+//        "'AAC' <= VCCOL AND VCCOL < 'AAD'",
+//        "'AAD' <= VCCOL AND VCCOL <= 'AAE'",
+//    });
+//
+//  }
+//
+//  private void verifyResult(List<Partition> partitions,
+//      String[] expected) {
+//    assertEquals(expected.length, partitions.size());
+//
+//    Iterator<Partition> iterator = partitions.iterator();
+//    for (int i = 0; i < expected.length; i++) {
+//      assertEquals(expected[i],
+//          ((GenericJdbcImportPartition)iterator.next()).getConditions());
+//    }
+//  }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/d883557d/core/src/test/java/org/apache/sqoop/framework/TestFrameworkMetadataUpgrader.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/sqoop/framework/TestFrameworkMetadataUpgrader.java b/core/src/test/java/org/apache/sqoop/framework/TestFrameworkMetadataUpgrader.java
index cc0d984..e0c4561 100644
--- a/core/src/test/java/org/apache/sqoop/framework/TestFrameworkMetadataUpgrader.java
+++ b/core/src/test/java/org/apache/sqoop/framework/TestFrameworkMetadataUpgrader.java
@@ -32,139 +32,139 @@ import static org.junit.Assert.assertNull;
  */
 public class TestFrameworkMetadataUpgrader {
 
-  FrameworkMetadataUpgrader upgrader;
-
-  @Before
-  public void initializeUpgrader() {
-    upgrader = new FrameworkMetadataUpgrader();
-  }
-
-  /**
-   * We take the same forms on input and output and we
-   * expect that all values will be correctly transferred.
-   */
-  @Test
-  public void testConnectionUpgrade() {
-    MConnectionForms original = connection1();
-    MConnectionForms target = connection1();
-
-    original.getStringInput("f1.s1").setValue("A");
-    original.getStringInput("f1.s2").setValue("B");
-    original.getIntegerInput("f1.i").setValue(3);
-
-    upgrader.upgrade(original, target);
-
-    assertEquals("A", target.getStringInput("f1.s1").getValue());
-    assertEquals("B", target.getStringInput("f1.s2").getValue());
-    assertEquals(3, (long)target.getIntegerInput("f1.i").getValue());
-  }
-
-  /**
-   * We take the same forms on input and output and we
-   * expect that all values will be correctly transferred.
-   */
-  @Test
-  public void testJobUpgrade() {
-    MJobForms original = job1(MJob.Type.IMPORT);
-    MJobForms target = job1(MJob.Type.IMPORT);
-
-    original.getStringInput("f1.s1").setValue("A");
-    original.getStringInput("f1.s2").setValue("B");
-    original.getIntegerInput("f1.i").setValue(3);
-
-    upgrader.upgrade(original, target);
-
-    assertEquals("A", target.getStringInput("f1.s1").getValue());
-    assertEquals("B", target.getStringInput("f1.s2").getValue());
-    assertEquals(3, (long)target.getIntegerInput("f1.i").getValue());
-  }
-
-  /**
-   * Upgrade scenario when new input has been added to the target forms.
-   */
-  @Test
-  public void testNonExistingInput() {
-    MConnectionForms original = connection1();
-    MConnectionForms target = connection2();
-
-    original.getStringInput("f1.s1").setValue("A");
-    original.getStringInput("f1.s2").setValue("B");
-    original.getIntegerInput("f1.i").setValue(3);
-
-    upgrader.upgrade(original, target);
-
-    assertEquals("A", target.getStringInput("f1.s1").getValue());
-    assertNull(target.getStringInput("f1.s2_").getValue());
-    assertEquals(3, (long)target.getIntegerInput("f1.i").getValue());
-  }
-
-  /**
-   * Upgrade scenario when entire has been added in the target and
-   * therefore is missing in the original.
-   */
-  @Test
-  public void testNonExistingForm() {
-    MConnectionForms original = connection1();
-    MConnectionForms target = connection3();
-
-    original.getStringInput("f1.s1").setValue("A");
-    original.getStringInput("f1.s2").setValue("B");
-    original.getIntegerInput("f1.i").setValue(3);
-
-    upgrader.upgrade(original, target);
-
-    assertNull(target.getStringInput("f2.s1").getValue());
-    assertNull(target.getStringInput("f2.s2").getValue());
-    assertNull(target.getIntegerInput("f2.i").getValue());
-  }
-
-  MJobForms job1(MJob.Type type) {
-    return new MJobForms(type, forms1());
-  }
-
-  MConnectionForms connection1() {
-    return new MConnectionForms(forms1());
-  }
-
-  MConnectionForms connection2() {
-    return new MConnectionForms(forms2());
-  }
-
-  MConnectionForms connection3() {
-    return new MConnectionForms(forms3());
-  }
-
-  List<MForm> forms1() {
-    List<MForm> list = new LinkedList<MForm>();
-    list.add(new MForm("f1", inputs1("f1")));
-    return list;
-  }
-
-  List<MInput<?>> inputs1(String formName) {
-    List<MInput<?>> list = new LinkedList<MInput<?>>();
-    list.add(new MStringInput(formName + ".s1", false, (short)30));
-    list.add(new MStringInput(formName + ".s2", false, (short)30));
-    list.add(new MIntegerInput(formName + ".i", false));
-    return list;
-  }
-
-  List<MForm> forms2() {
-    List<MForm> list = new LinkedList<MForm>();
-    list.add(new MForm("f1", inputs2("f1")));
-    return list;
-  }
-
-  List<MInput<?>> inputs2(String formName) {
-    List<MInput<?>> list = new LinkedList<MInput<?>>();
-    list.add(new MStringInput(formName + ".s1", false, (short)30));
-    list.add(new MStringInput(formName + ".s2_", false, (short)30));
-    list.add(new MIntegerInput(formName + ".i", false));
-    return list;
-  }
-
-  List<MForm> forms3() {
-    List<MForm> list = new LinkedList<MForm>();
-    list.add(new MForm("f2", inputs1("f2")));
-    return list;
-  }
+//  FrameworkMetadataUpgrader upgrader;
+//
+//  @Before
+//  public void initializeUpgrader() {
+//    upgrader = new FrameworkMetadataUpgrader();
+//  }
+//
+//  /**
+//   * We take the same forms on input and output and we
+//   * expect that all values will be correctly transferred.
+//   */
+//  @Test
+//  public void testConnectionUpgrade() {
+//    MConnectionForms original = connection1();
+//    MConnectionForms target = connection1();
+//
+//    original.getStringInput("f1.s1").setValue("A");
+//    original.getStringInput("f1.s2").setValue("B");
+//    original.getIntegerInput("f1.i").setValue(3);
+//
+//    upgrader.upgrade(original, target);
+//
+//    assertEquals("A", target.getStringInput("f1.s1").getValue());
+//    assertEquals("B", target.getStringInput("f1.s2").getValue());
+//    assertEquals(3, (long)target.getIntegerInput("f1.i").getValue());
+//  }
+//
+//  /**
+//   * We take the same forms on input and output and we
+//   * expect that all values will be correctly transferred.
+//   */
+//  @Test
+//  public void testJobUpgrade() {
+//    MJobForms original = job1(MJob.Type.IMPORT);
+//    MJobForms target = job1(MJob.Type.IMPORT);
+//
+//    original.getStringInput("f1.s1").setValue("A");
+//    original.getStringInput("f1.s2").setValue("B");
+//    original.getIntegerInput("f1.i").setValue(3);
+//
+//    upgrader.upgrade(original, target);
+//
+//    assertEquals("A", target.getStringInput("f1.s1").getValue());
+//    assertEquals("B", target.getStringInput("f1.s2").getValue());
+//    assertEquals(3, (long)target.getIntegerInput("f1.i").getValue());
+//  }
+//
+//  /**
+//   * Upgrade scenario when new input has been added to the target forms.
+//   */
+//  @Test
+//  public void testNonExistingInput() {
+//    MConnectionForms original = connection1();
+//    MConnectionForms target = connection2();
+//
+//    original.getStringInput("f1.s1").setValue("A");
+//    original.getStringInput("f1.s2").setValue("B");
+//    original.getIntegerInput("f1.i").setValue(3);
+//
+//    upgrader.upgrade(original, target);
+//
+//    assertEquals("A", target.getStringInput("f1.s1").getValue());
+//    assertNull(target.getStringInput("f1.s2_").getValue());
+//    assertEquals(3, (long)target.getIntegerInput("f1.i").getValue());
+//  }
+//
+//  /**
+//   * Upgrade scenario when entire has been added in the target and
+//   * therefore is missing in the original.
+//   */
+//  @Test
+//  public void testNonExistingForm() {
+//    MConnectionForms original = connection1();
+//    MConnectionForms target = connection3();
+//
+//    original.getStringInput("f1.s1").setValue("A");
+//    original.getStringInput("f1.s2").setValue("B");
+//    original.getIntegerInput("f1.i").setValue(3);
+//
+//    upgrader.upgrade(original, target);
+//
+//    assertNull(target.getStringInput("f2.s1").getValue());
+//    assertNull(target.getStringInput("f2.s2").getValue());
+//    assertNull(target.getIntegerInput("f2.i").getValue());
+//  }
+//
+//  MJobForms job1(MJob.Type type) {
+//    return new MJobForms(type, forms1());
+//  }
+//
+//  MConnectionForms connection1() {
+//    return new MConnectionForms(forms1());
+//  }
+//
+//  MConnectionForms connection2() {
+//    return new MConnectionForms(forms2());
+//  }
+//
+//  MConnectionForms connection3() {
+//    return new MConnectionForms(forms3());
+//  }
+//
+//  List<MForm> forms1() {
+//    List<MForm> list = new LinkedList<MForm>();
+//    list.add(new MForm("f1", inputs1("f1")));
+//    return list;
+//  }
+//
+//  List<MInput<?>> inputs1(String formName) {
+//    List<MInput<?>> list = new LinkedList<MInput<?>>();
+//    list.add(new MStringInput(formName + ".s1", false, (short)30));
+//    list.add(new MStringInput(formName + ".s2", false, (short)30));
+//    list.add(new MIntegerInput(formName + ".i", false));
+//    return list;
+//  }
+//
+//  List<MForm> forms2() {
+//    List<MForm> list = new LinkedList<MForm>();
+//    list.add(new MForm("f1", inputs2("f1")));
+//    return list;
+//  }
+//
+//  List<MInput<?>> inputs2(String formName) {
+//    List<MInput<?>> list = new LinkedList<MInput<?>>();
+//    list.add(new MStringInput(formName + ".s1", false, (short)30));
+//    list.add(new MStringInput(formName + ".s2_", false, (short)30));
+//    list.add(new MIntegerInput(formName + ".i", false));
+//    return list;
+//  }
+//
+//  List<MForm> forms3() {
+//    List<MForm> list = new LinkedList<MForm>();
+//    list.add(new MForm("f2", inputs1("f2")));
+//    return list;
+//  }
 }


Mime
View raw message