SQOOP-480 MS SQL server connector is incompatible with Sqoop-1.4

git-svn-id: https://svn.apache.org/repos/asf/sqoop/trunk@1347112 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bilung Lee 2012-06-06 20:49:36 +00:00
Родитель 0c406e7830
Коммит 5f6dd35e8e
3 изменённых файлов: 37 добавлений и 0 удалений

Просмотреть файл

@ -248,6 +248,18 @@
<property name="java.security.krb5.kdc"
value="kdc0.ox.ac.uk:kdc1.ox.ac.uk"/>
<if>
<isset property="sqoop.test.msserver.connector.factory"/>
<then>
<echo message="Use ${sqoop.test.msserver.connector.factory}"/>
</then>
<else>
<echo message="Use built-in SQL server connector by default"/>
<property name="sqoop.test.msserver.connector.factory"
value="org.apache.sqoop.manager.DefaultManagerFactory"/>
</else>
</if>
<!-- The classpath for compiling and running Sqoop -->
<if>
<isset property="hadoop.home" />
@ -715,6 +727,9 @@
<sysproperty key="sqoop.test.sqlserver.connectstring.host_url"
value="${sqoop.test.sqlserver.connectstring.host_url}"/>
<sysproperty key="sqoop.test.msserver.connector.factory"
value="${sqoop.test.msserver.connector.factory}"/>
<sysproperty key="java.security.krb5.realm"
value="${java.security.krb5.realm}"/>

Просмотреть файл

@ -33,6 +33,10 @@ public class ImportJobContext
super(table, jar, opts, destination);
}
public void setConnManager(ConnManager mgr) {
super.setConnManager(mgr);
}
public ConnManager getConnManager() {
return (ConnManager)super.getConnManager();
}

Просмотреть файл

@ -30,8 +30,10 @@ import java.util.ArrayList;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
import org.apache.sqoop.ConnFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@ -77,9 +79,20 @@ public class SQLServerManagerImportManualTest extends ImportJobTestCase {
static final String CONNECT_STRING = HOST_URL
+ ";databaseName=" + DATABASE_NAME;
static final String CONNECTOR_FACTORY = System.getProperty(
"sqoop.test.msserver.connector.factory",
ConnFactory.DEFAULT_FACTORY_CLASS_NAMES);
// instance variables populated during setUp, used during tests
private SQLServerManager manager;
private Configuration conf = new Configuration();
@Override
protected Configuration getConf() {
return conf;
}
@Override
protected boolean useHsqldbTestServer() {
return false;
@ -173,6 +186,11 @@ public class SQLServerManagerImportManualTest extends ImportJobTestCase {
"3,Fred,15.0,marketing",
};
// To test with Microsoft SQL server connector, copy the connector jar to
// sqoop.thirdparty.lib.dir and set sqoop.test.msserver.connector.factory
// to com.microsoft.sqoop.SqlServer.MSSQLServerManagerFactory. By default,
// the built-in SQL server connector is used.
conf.setStrings(ConnFactory.FACTORY_CLASS_NAMES_KEY, CONNECTOR_FACTORY);
runSQLServerTest(expectedResults);
}