diff --git a/COMPILING.txt b/COMPILING.txt index faca6ec8..abb430c0 100644 --- a/COMPILING.txt +++ b/COMPILING.txt @@ -72,16 +72,43 @@ Install MySQL server and client 5.0. Download MySQL Connector/J 5.0.8 for JDBC. Instructions for configuring the MySQL database are in MySQLAuthTest and DirectMySQLTest. +Use the system property sqoop.test.mysql.connectstring.host_url to specify the +URL for the MySQL host used for testing. Specify this property on the command +line or via the build.properties file. For example: + +sqoop.test.mysql.connectstring.host_url=jdbc:mysql://host.example.com/ + +If not specified, the default value used for this property is: +jdbc:mysql://localhost/ + === Oracle Install Oracle XE (Express edition) 10.2.0. Instructions for configuring the database are in OracleManagerTest. Download the ojdbc6_g jar. +Use the system property sqoop.test.oracle.connectstring to specify the +connection string for Oracle host used for testing. Specify this property on the +command line or via the build.properties file. For example: + +sqoop.test.oracle.connectstring=jdbc:oracle:thin:@//host.example.com/xe + +If not specified, the default value used for this property is: +jdbc:oracle:thin:@//localhost/xe + === PostgreSQL Install PostgreSQL 8.3.9. Download the postgresql 8.4 jdbc driver. Instructions for configuring the database are in PostgresqlTest. +Use the system property sqoop.test.postgresql.connectstring.host_url to specify +the URL for the PostgreSQL host used for testing. Specify this property on the +command line or via the build.properties file. For example: + +sqoop.test.postgresql.connectstring.host_url=jdbc:postgresql://sqoop-dbs.sf.cloudera.com/ + +If not specified, the default value used for this property is: +jdbc:postgresql://localhost/ + === Running the Third-party Tests After the third-party databases are installed and configured, run: diff --git a/build.xml b/build.xml index ca8ef2b5..4bcce79b 100644 --- a/build.xml +++ b/build.xml @@ -162,12 +162,18 @@ + value="${name}/[conf]/[artifact]-[revision](-[classifier]).[ext]"/> + + + + @@ -558,6 +564,12 @@ + + + + diff --git a/src/test/com/cloudera/sqoop/manager/DirectMySQLTest.java b/src/test/com/cloudera/sqoop/manager/DirectMySQLTest.java index 76d513a0..1a081f32 100644 --- a/src/test/com/cloudera/sqoop/manager/DirectMySQLTest.java +++ b/src/test/com/cloudera/sqoop/manager/DirectMySQLTest.java @@ -84,6 +84,10 @@ public void setUp() { SqoopOptions options = new SqoopOptions(MySQLTestUtils.CONNECT_STRING, getTableName()); options.setUsername(MySQLTestUtils.getCurrentUser()); + + LOG.debug("Setting up another DirectMySQLTest: " + + MySQLTestUtils.CONNECT_STRING); + manager = new DirectMySQLManager(options); Connection connection = null; @@ -94,7 +98,7 @@ public void setUp() { connection.setAutoCommit(false); st = connection.createStatement(); - // create the database table and populate it with data. + // create the database table and populate it with data. st.executeUpdate("DROP TABLE IF EXISTS " + getTableName()); st.executeUpdate("CREATE TABLE " + getTableName() + " (" + "id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, " diff --git a/src/test/com/cloudera/sqoop/manager/MySQLAuthTest.java b/src/test/com/cloudera/sqoop/manager/MySQLAuthTest.java index ddc01bfb..bd004068 100644 --- a/src/test/com/cloudera/sqoop/manager/MySQLAuthTest.java +++ b/src/test/com/cloudera/sqoop/manager/MySQLAuthTest.java @@ -65,7 +65,9 @@ public class MySQLAuthTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( MySQLAuthTest.class.getName()); - static final String HOST_URL = "jdbc:mysql://localhost/"; + static final String HOST_URL = System.getProperty( + "sqoop.test.mysql.connectstring.host_url", + "jdbc:mysql://localhost/"); static final String AUTH_TEST_DATABASE = "sqooppasstest"; static final String AUTH_TEST_USER = "sqooptest"; @@ -89,6 +91,8 @@ public void setUp() { options.setUsername(AUTH_TEST_USER); options.setPassword(AUTH_TEST_PASS); + LOG.debug("Setting up another MySQLAuthTest: " + AUTH_CONNECT_STRING); + manager = new DirectMySQLManager(options); Connection connection = null; @@ -99,7 +103,7 @@ public void setUp() { connection.setAutoCommit(false); st = connection.createStatement(); - // create the database table and populate it with data. + // create the database table and populate it with data. st.executeUpdate("DROP TABLE IF EXISTS " + AUTH_TABLE_NAME); st.executeUpdate("CREATE TABLE " + AUTH_TABLE_NAME + " (" + "id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, " @@ -286,7 +290,7 @@ public void doZeroTimestampTest(int testNum, boolean expectSuccess, connection.setAutoCommit(false); st = connection.createStatement(); - // create the database table and populate it with data. + // create the database table and populate it with data. st.executeUpdate("DROP TABLE IF EXISTS " + TABLE_NAME); st.executeUpdate("CREATE TABLE " + TABLE_NAME + " (" + "id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, " diff --git a/src/test/com/cloudera/sqoop/manager/MySQLTestUtils.java b/src/test/com/cloudera/sqoop/manager/MySQLTestUtils.java index 13478350..5e59e53f 100644 --- a/src/test/com/cloudera/sqoop/manager/MySQLTestUtils.java +++ b/src/test/com/cloudera/sqoop/manager/MySQLTestUtils.java @@ -34,7 +34,9 @@ public final class MySQLTestUtils { public static final Log LOG = LogFactory.getLog( MySQLTestUtils.class.getName()); - public static final String HOST_URL = "jdbc:mysql://localhost/"; + public static final String HOST_URL = System.getProperty( + "sqoop.test.mysql.connectstring.host_url", + "jdbc:mysql://localhost/"); public static final String MYSQL_DATABASE_NAME = "sqooptestdb"; public static final String TABLE_NAME = "EMPLOYEES_MYSQL"; @@ -81,7 +83,7 @@ public static String getCurrentUser() { if (0 != ret) { LOG.error("whoami exited with error status " + ret); // suppress original return value from this method. - return null; + return null; } } catch (InterruptedException ie) { continue; // loop around. diff --git a/src/test/com/cloudera/sqoop/manager/PostgresqlTest.java b/src/test/com/cloudera/sqoop/manager/PostgresqlTest.java index 5caac7a2..0e27e70d 100644 --- a/src/test/com/cloudera/sqoop/manager/PostgresqlTest.java +++ b/src/test/com/cloudera/sqoop/manager/PostgresqlTest.java @@ -82,7 +82,9 @@ public class PostgresqlTest extends ImportJobTestCase { public static final Log LOG = LogFactory.getLog( PostgresqlTest.class.getName()); - static final String HOST_URL = "jdbc:postgresql://localhost/"; + static final String HOST_URL = System.getProperty( + "sqoop.test.postgresql.connectstring.host_url", + "jdbc:postgresql://localhost/"); static final String DATABASE_USER = "sqooptest"; static final String DATABASE_NAME = "sqooptest"; @@ -98,7 +100,7 @@ protected boolean useHsqldbTestServer() { public void setUp() { super.setUp(); - LOG.debug("Setting up another postgresql test..."); + LOG.debug("Setting up another postgresql test: " + CONNECT_STRING); SqoopOptions options = new SqoopOptions(CONNECT_STRING, TABLE_NAME); options.setUsername(DATABASE_USER);