5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-19 02:10:54 +08:00

SQOOP-2915: Fixing Oracle related unit tests

(Attila Szabo via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2016-04-26 13:41:39 -07:00
parent 660f3e8ad0
commit db8c247000
5 changed files with 21 additions and 21 deletions

View File

@ -271,10 +271,10 @@ public void testUpsertTextExport() throws IOException, SQLException {
createTable();
// first time will be insert.
runExport(getArgv(true, 10, 10, newStrArray(null,
"--update-key", "ID", "--update-mode", "allowinsert")));
"--update-key", "id", "--update-mode", "allowinsert")));
// second time will be update.
runExport(getArgv(true, 10, 10, newStrArray(null,
"--update-key", "ID", "--update-mode", "allowinsert")));
"--update-key", "id", "--update-mode", "allowinsert")));
verifyExport(TOTAL_RECORDS);
}
}

View File

@ -45,7 +45,7 @@ public final class OracleUtils {
public static final String ORACLE_SECONDARY_USER_PASS = "ABCDEF";
public static final String ORACLE_INVALID_USER_NAME = "invalidusr";
public static final String SYSTEMTEST_TABLE_NAME = "oraoop_test";
public static final String SYSTEMTEST_TABLE_NAME = "ORAOOP_TEST";
public static final int SYSTEMTEST_NUM_ROWS = 100;
public static final int INTEGRATIONTEST_NUM_ROWS = 10000;
// Number of mappers if wanting to override default setting

View File

@ -40,21 +40,21 @@ public static void setUpHdfsData() throws Exception {
TEST_CASE.createTable("table_tst_product.xml");
int retCode =
TEST_CASE.runImport("tst_product", TEST_CASE.getSqoopConf(), false);
TEST_CASE.runImport("TST_PRODUCT", TEST_CASE.getSqoopConf(), false);
Assert.assertEquals("Return code should be 0", 0, retCode);
}
@Test
public void testProductExport() throws Exception {
int retCode =
TEST_CASE.runExportFromTemplateTable("tst_product", "tst_product_exp");
TEST_CASE.runExportFromTemplateTable("TST_PRODUCT", "TST_PRODUCT_EXP");
Assert.assertEquals("Return code should be 0", 0, retCode);
}
@Test
public void testProductExportMixedCaseTableName() throws Exception {
int retCode =
TEST_CASE.runExportFromTemplateTable("tst_product",
TEST_CASE.runExportFromTemplateTable("TST_PRODUCT",
"\"\"T5+_Pr#duct_Exp\"\"");
Assert.assertEquals("Return code should be 0", 0, retCode);
}

View File

@ -90,23 +90,23 @@ private String[] getArgv(String... extraArgs) {
private void createObjects() {
String createTableSql = "CREATE TABLE " + tableName + " ( "
+ "id INT NOT NULL PRIMARY KEY, "
+ "msg VARCHAR(24) NOT NULL, "
+ "d DATE, "
+ "f FLOAT, "
+ "vc VARCHAR(32))";
+ "\"id\" INT NOT NULL PRIMARY KEY, "
+ "\"msg\" VARCHAR(24) NOT NULL, "
+ "\"d\" DATE, "
+ "\"f\" FLOAT, "
+ "\"vc\" VARCHAR(32))";
String createProcSql = "CREATE PROCEDURE " + procName + " ( "
+ "id IN INT,"
+ "msg IN VARCHAR,"
+ "d IN DATE,"
+ "f IN FLOAT) IS BEGIN "
+ "\"id\" IN INT,"
+ "\"msg\" IN VARCHAR,"
+ "\"d\" IN DATE,"
+ "\"f\" IN FLOAT) IS BEGIN "
+ "INSERT INTO " + tableName + " "
+ "VALUES(id,"
+ "msg,"
+ "d,"
+ "f,"
+ "msg || '_2'); END;";
+ "VALUES(\"id\","
+ "\"msg\","
+ "\"d\","
+ "\"f\","
+ "\"msg\" || '_2'); END;";
try {
dropTableIfExists(tableName);

View File

@ -39,7 +39,7 @@ public void testProductImportTimezone() throws Exception {
sqoopConf.setBoolean(OraOopConstants.ORAOOP_MAP_TIMESTAMP_AS_STRING, false);
try {
int retCode = runImport("tst_product", sqoopConf, false);
int retCode = runImport("TST_PRODUCT", sqoopConf, false);
Assert.assertEquals("Return code should be 0", 0, retCode);
} finally {