mirror of
https://github.com/apache/sqoop.git
synced 2025-05-04 00:30:00 +08:00
MAPREDUCE-749. Make Sqoop unit tests more Hudson-friendly. Contributed by Aaron Kimball.
From: Thomas White <tomwhite@apache.org> git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149822 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a87e225891
commit
e7cf0ed69c
@ -25,6 +25,7 @@ to call at top-level: ant deploy-contrib compile-core-test
|
||||
|
||||
<import file="../build-contrib.xml"/>
|
||||
<property environment="env"/>
|
||||
<property name="sqoop.thirdparty.lib.dir" value="" />
|
||||
|
||||
<!-- ================================================================== -->
|
||||
<!-- Run unit tests -->
|
||||
@ -76,6 +77,11 @@ to call at top-level: ant deploy-contrib compile-core-test
|
||||
-->
|
||||
<sysproperty key="sqoop.src.dir" value="${build.test}/data"/>
|
||||
|
||||
<!-- Override standalone Hadoop's working dirs to allow parallel
|
||||
execution of multiple Hudson builders
|
||||
-->
|
||||
<sysproperty key="hadoop.tmp.dir" value="${build.test}/hadoop"/>
|
||||
|
||||
<sysproperty key="fs.default.name" value="${fs.default.name}"/>
|
||||
<sysproperty key="hadoop.test.localoutputfile" value="${hadoop.test.localoutputfile}"/>
|
||||
<sysproperty key="hadoop.log.dir" value="${hadoop.log.dir}"/>
|
||||
@ -91,6 +97,8 @@ to call at top-level: ant deploy-contrib compile-core-test
|
||||
<path refid="test.classpath"/>
|
||||
<path refid="contrib-classpath"/>
|
||||
<pathelement path="${env.JAVA_HOME}/lib/tools.jar" />
|
||||
<fileset dir="${sqoop.thirdparty.lib.dir}"
|
||||
includes="*.jar" />
|
||||
</classpath>
|
||||
<formatter type="${test.junit.output.format}" />
|
||||
<batchtest todir="${build.test}" unless="testcase">
|
||||
|
@ -21,9 +21,6 @@
|
||||
import org.apache.hadoop.sqoop.hive.TestHiveImport;
|
||||
import org.apache.hadoop.sqoop.lib.TestFieldFormatter;
|
||||
import org.apache.hadoop.sqoop.lib.TestRecordParser;
|
||||
import org.apache.hadoop.sqoop.manager.LocalMySQLTest;
|
||||
import org.apache.hadoop.sqoop.manager.MySQLAuthTest;
|
||||
import org.apache.hadoop.sqoop.manager.OracleManagerTest;
|
||||
import org.apache.hadoop.sqoop.manager.TestHsqldbManager;
|
||||
import org.apache.hadoop.sqoop.manager.TestSqlManager;
|
||||
import org.apache.hadoop.sqoop.orm.TestClassWriter;
|
||||
@ -52,14 +49,12 @@ public static Test suite() {
|
||||
suite.addTestSuite(TestMultiCols.class);
|
||||
suite.addTestSuite(TestOrderBy.class);
|
||||
suite.addTestSuite(TestWhere.class);
|
||||
suite.addTestSuite(LocalMySQLTest.class);
|
||||
suite.addTestSuite(MySQLAuthTest.class);
|
||||
suite.addTestSuite(TestHiveImport.class);
|
||||
suite.addTestSuite(TestRecordParser.class);
|
||||
suite.addTestSuite(TestFieldFormatter.class);
|
||||
suite.addTestSuite(TestImportOptions.class);
|
||||
suite.addTestSuite(TestParseMethods.class);
|
||||
suite.addTestSuite(OracleManagerTest.class);
|
||||
suite.addTest(ThirdPartyTests.suite());
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
49
src/test/org/apache/hadoop/sqoop/ThirdPartyTests.java
Normal file
49
src/test/org/apache/hadoop/sqoop/ThirdPartyTests.java
Normal file
@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.hadoop.sqoop;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.hadoop.sqoop.manager.LocalMySQLTest;
|
||||
import org.apache.hadoop.sqoop.manager.MySQLAuthTest;
|
||||
import org.apache.hadoop.sqoop.manager.OracleManagerTest;
|
||||
|
||||
/**
|
||||
* Test battery including all tests of vendor-specific ConnManager implementations.
|
||||
* These tests likely aren't run by Apache Hudson, because they require configuring
|
||||
* and using Oracle, MySQL, etc., which may have incompatible licenses with Apache.
|
||||
*/
|
||||
public final class ThirdPartyTests extends TestCase {
|
||||
|
||||
private ThirdPartyTests() { }
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("Tests vendor-specific ConnManager "
|
||||
+ "implementations in Sqoop");
|
||||
suite.addTestSuite(LocalMySQLTest.class);
|
||||
suite.addTestSuite(MySQLAuthTest.class);
|
||||
suite.addTestSuite(OracleManagerTest.class);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user