Repository: sqoop Updated Branches: refs/heads/trunk 00a02dec2 -> d58e5f106
http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java b/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java index ee3f005..9f9e865 100644 --- a/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java +++ b/src/test/org/apache/sqoop/metastore/postgres/PostgresSavedJobsTest.java @@ -20,6 +20,8 @@ package org.apache.sqoop.metastore.postgres; import org.apache.sqoop.metastore.SavedJobsTestBase; import org.apache.sqoop.manager.JdbcDrivers; +import org.apache.sqoop.testcategories.thirdpartytest.PostgresqlTest; +import org.junit.experimental.categories.Category; /** * Test of GenericJobStorage compatibility with PostgreSQL @@ -36,7 +38,7 @@ import org.apache.sqoop.manager.JdbcDrivers; * -Dsqoop.test.postgresql.connectstring.host_url, -Dsqoop.test.postgresql.database, * -Dsqoop.test.postgresql.username and -Dsqoop.test.postgresql.password respectively */ - +@Category(PostgresqlTest.class) public class PostgresSavedJobsTest extends SavedJobsTestBase { private static final String HOST_URL = System.getProperty("sqoop.test.postgresql.connectstring.host_url", http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerJobToolTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerJobToolTest.java b/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerJobToolTest.java index 87d7b34..8a27b0d 100644 --- a/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerJobToolTest.java +++ b/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerJobToolTest.java @@ -20,6 +20,8 @@ package org.apache.sqoop.metastore.sqlserver; import org.apache.sqoop.metastore.JobToolTestBase; import org.apache.sqoop.manager.sqlserver.MSSQLTestUtils; +import org.apache.sqoop.testcategories.thirdpartytest.SqlServerTest; +import org.junit.experimental.categories.Category; /** * Test that the Job Tool works in SQLServer @@ -40,7 +42,7 @@ import org.apache.sqoop.manager.sqlserver.MSSQLTestUtils; * -Dsqoop.test.sqlserver.connectstring.host_url, -Dsqoop.test.sqlserver.database, * -Dms.sqlserver.username and -Dms.sqlserver.password respectively */ - +@Category(SqlServerTest.class) public class SqlServerJobToolTest extends JobToolTestBase { private static MSSQLTestUtils msSQLTestUtils = new MSSQLTestUtils(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerMetaConnectIncrementalImportTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerMetaConnectIncrementalImportTest.java b/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerMetaConnectIncrementalImportTest.java index f1a2a66..87028a4 100644 --- a/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerMetaConnectIncrementalImportTest.java +++ b/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerMetaConnectIncrementalImportTest.java @@ -20,6 +20,8 @@ package org.apache.sqoop.metastore.sqlserver; import org.apache.sqoop.metastore.MetaConnectIncrementalImportTestBase; import org.apache.sqoop.manager.sqlserver.MSSQLTestUtils; +import org.apache.sqoop.testcategories.thirdpartytest.SqlServerTest; +import org.junit.experimental.categories.Category; /** * Test that Incremental-Import values are stored correctly in SQLServer @@ -40,7 +42,7 @@ import org.apache.sqoop.manager.sqlserver.MSSQLTestUtils; * -Dsqoop.test.sqlserver.connectstring.host_url, -Dsqoop.test.sqlserver.database, * -Dms.sqlserver.username and -Dms.sqlserver.password respectively */ - +@Category(SqlServerTest.class) public class SqlServerMetaConnectIncrementalImportTest extends MetaConnectIncrementalImportTestBase { private static MSSQLTestUtils msSQLTestUtils = new MSSQLTestUtils(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerSavedJobsTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerSavedJobsTest.java b/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerSavedJobsTest.java index b37623b..34987b6 100644 --- a/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerSavedJobsTest.java +++ b/src/test/org/apache/sqoop/metastore/sqlserver/SqlServerSavedJobsTest.java @@ -21,6 +21,8 @@ package org.apache.sqoop.metastore.sqlserver; import org.apache.sqoop.metastore.SavedJobsTestBase; import org.apache.sqoop.manager.JdbcDrivers; import org.apache.sqoop.manager.sqlserver.MSSQLTestUtils; +import org.apache.sqoop.testcategories.thirdpartytest.SqlServerTest; +import org.junit.experimental.categories.Category; /** * Test of GenericJobStorage compatibility with SQLServer @@ -41,7 +43,7 @@ import org.apache.sqoop.manager.sqlserver.MSSQLTestUtils; * -Dsqoop.test.sqlserver.connectstring.host_url, -Dsqoop.test.sqlserver.database, * -Dms.sqlserver.username and -Dms.sqlserver.password respectively */ - +@Category(SqlServerTest.class) public class SqlServerSavedJobsTest extends SavedJobsTestBase { private static MSSQLTestUtils msSQLTestUtils = new MSSQLTestUtils(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/orm/TestClassWriter.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/orm/TestClassWriter.java b/src/test/org/apache/sqoop/orm/TestClassWriter.java index 0cc07cf..59a8908 100644 --- a/src/test/org/apache/sqoop/orm/TestClassWriter.java +++ b/src/test/org/apache/sqoop/orm/TestClassWriter.java @@ -34,6 +34,7 @@ import java.util.jar.JarInputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.util.Shell; +import org.apache.sqoop.testcategories.sqooptest.IntegrationTest; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -47,6 +48,7 @@ import org.apache.sqoop.testutil.HsqldbTestServer; import org.apache.sqoop.testutil.ImportJobTestCase; import org.apache.sqoop.tool.ImportTool; import org.apache.sqoop.util.ClassLoaderStack; +import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import java.lang.reflect.Field; @@ -61,6 +63,7 @@ import static org.junit.Assert.fail; * Test that the ClassWriter generates Java classes based on the given table, * which compile. */ +@Category(IntegrationTest.class) public class TestClassWriter { public static final Log LOG = http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/orm/TestCompilationManager.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/orm/TestCompilationManager.java b/src/test/org/apache/sqoop/orm/TestCompilationManager.java index abd72d8..fb39f29 100644 --- a/src/test/org/apache/sqoop/orm/TestCompilationManager.java +++ b/src/test/org/apache/sqoop/orm/TestCompilationManager.java @@ -18,12 +18,15 @@ package org.apache.sqoop.orm; import org.apache.sqoop.SqoopOptions; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; +@Category(UnitTest.class) public class TestCompilationManager { private CompilationManager compilationManager; http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/KerberizedTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/KerberizedTest.java b/src/test/org/apache/sqoop/testcategories/KerberizedTest.java new file mode 100644 index 0000000..2a1bd7c --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/KerberizedTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories; + +/** + * A kerberized test shall run in kerberized environment thus it starts mini KDC server. + */ +public interface KerberizedTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/sqooptest/IntegrationTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/sqooptest/IntegrationTest.java b/src/test/org/apache/sqoop/testcategories/sqooptest/IntegrationTest.java new file mode 100644 index 0000000..aa3fa97 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/sqooptest/IntegrationTest.java @@ -0,0 +1,26 @@ +/** + * 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.sqoop.testcategories.sqooptest; + +/** + * An integration test shall test if independently developed classes work together correctly. + * An integration test checks a whole scenario and thus may start mini clusters or embedded databases and may connect to + * external resources like RDBMS instances. + */ +public interface IntegrationTest extends SqoopTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/sqooptest/ManualTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/sqooptest/ManualTest.java b/src/test/org/apache/sqoop/testcategories/sqooptest/ManualTest.java new file mode 100644 index 0000000..e349117 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/sqooptest/ManualTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.sqooptest; + +/** + * Deprecated category, shall not be used nor extended. + */ +public interface ManualTest extends IntegrationTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/sqooptest/SqoopTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/sqooptest/SqoopTest.java b/src/test/org/apache/sqoop/testcategories/sqooptest/SqoopTest.java new file mode 100644 index 0000000..c1dc529 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/sqooptest/SqoopTest.java @@ -0,0 +1,35 @@ +/** + * 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.sqoop.testcategories.sqooptest; + +/** + * SqoopTest includes UnitTest, IntegrationTest and ManualTest. + * + * UnitTest: + * A unit test shall test one class at a time having it's dependencies mocked. + * A unit test shall not start a mini cluster nor an embedded database and it shall not use a JDBC driver. + * + * IntegrationTest: + * An integration test shall test if independently developed classes work together correctly. + * An integration test checks a whole scenario and thus may start mini clusters or embedded databases and may connect to external resources like RDBMS instances. + * + * ManualTest: + * Deprecated category, shall not be used nor extended. + */ +public interface SqoopTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/sqooptest/UnitTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/sqooptest/UnitTest.java b/src/test/org/apache/sqoop/testcategories/sqooptest/UnitTest.java new file mode 100644 index 0000000..b6afac6 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/sqooptest/UnitTest.java @@ -0,0 +1,25 @@ +/** + * 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.sqoop.testcategories.sqooptest; + +/** + * A unit test shall test one class at a time having it's dependencies mocked. + * A unit test shall not start a mini cluster nor an embedded database and it shall not use a JDBC driver. + */ +public interface UnitTest extends SqoopTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/CubridTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/CubridTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/CubridTest.java new file mode 100644 index 0000000..4efc262 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/CubridTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * A CubridTest shall test scenarios where a Cubrid driver and/or external instance is required. + */ +public interface CubridTest extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/Db2Test.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/Db2Test.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/Db2Test.java new file mode 100644 index 0000000..e33aa81 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/Db2Test.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * A DB2 test shall test scenarios where a DB2 driver and/or external instance is required. + */ +public interface Db2Test extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/MainFrameTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/MainFrameTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/MainFrameTest.java new file mode 100644 index 0000000..8f3ed36 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/MainFrameTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * A MainFrame test shall test scenarios where a MainFrame external instance is required. + */ +public interface MainFrameTest extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/MysqlTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/MysqlTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/MysqlTest.java new file mode 100644 index 0000000..db9fc69 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/MysqlTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * A MySql test shall test scenarios where a MySql driver and/or external instance is required. + */ +public interface MysqlTest extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/NetezzaTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/NetezzaTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/NetezzaTest.java new file mode 100644 index 0000000..7ea2768 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/NetezzaTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * A Netezza test shall test scenarios where a Netezza driver and/or external instance is required. + */ +public interface NetezzaTest extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleTest.java new file mode 100644 index 0000000..045f545 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/OracleTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * An Oracle test shall test scenarios where a Oracle driver and/or external instance is required. + */ +public interface OracleTest extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/PostgresqlTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/PostgresqlTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/PostgresqlTest.java new file mode 100644 index 0000000..663e668 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/PostgresqlTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * A PostgreSql test shall test scenarios where a PostgreSql driver and/or external instance is required. + */ +public interface PostgresqlTest extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/SqlServerTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/SqlServerTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/SqlServerTest.java new file mode 100644 index 0000000..7832017 --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/SqlServerTest.java @@ -0,0 +1,24 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * An SqlServer test shall test scenarios where a SqlServer driver and/or external instance is required. + */ +public interface SqlServerTest extends ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testcategories/thirdpartytest/ThirdPartyTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testcategories/thirdpartytest/ThirdPartyTest.java b/src/test/org/apache/sqoop/testcategories/thirdpartytest/ThirdPartyTest.java new file mode 100644 index 0000000..d2dd29a --- /dev/null +++ b/src/test/org/apache/sqoop/testcategories/thirdpartytest/ThirdPartyTest.java @@ -0,0 +1,25 @@ +/** + * 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.sqoop.testcategories.thirdpartytest; + +/** + * A third party test shall test a scenario where a third party side is required such as a JDBC driver or an external + * RDBMS instance. + */ +public interface ThirdPartyTest { +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testutil/BaseSqoopTestCase.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testutil/BaseSqoopTestCase.java b/src/test/org/apache/sqoop/testutil/BaseSqoopTestCase.java index fe6ba83..e23aad3 100644 --- a/src/test/org/apache/sqoop/testutil/BaseSqoopTestCase.java +++ b/src/test/org/apache/sqoop/testutil/BaseSqoopTestCase.java @@ -22,6 +22,7 @@ import org.apache.sqoop.ConnFactory; import org.apache.sqoop.SqoopOptions; import org.apache.sqoop.manager.ConnManager; import org.apache.sqoop.metastore.JobData; +import org.apache.sqoop.testcategories.sqooptest.IntegrationTest; import org.apache.sqoop.tool.ImportTool; import com.google.common.collect.ObjectArrays; import org.apache.commons.logging.Log; @@ -34,6 +35,7 @@ import org.apache.log4j.BasicConfigurator; import org.apache.sqoop.SqoopJobDataPublisher; import org.junit.After; import org.junit.Before; +import org.junit.experimental.categories.Category; import java.io.File; import java.io.IOException; @@ -53,6 +55,7 @@ import static org.junit.Assert.fail; /** * Class that implements common methods required for tests. */ +@Category(IntegrationTest.class) public abstract class BaseSqoopTestCase { public static class DummyDataPublisher extends SqoopJobDataPublisher { http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/testutil/TestArgumentArrayBuilder.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/testutil/TestArgumentArrayBuilder.java b/src/test/org/apache/sqoop/testutil/TestArgumentArrayBuilder.java index 6d701ab..0c38eac 100644 --- a/src/test/org/apache/sqoop/testutil/TestArgumentArrayBuilder.java +++ b/src/test/org/apache/sqoop/testutil/TestArgumentArrayBuilder.java @@ -18,10 +18,13 @@ package org.apache.sqoop.testutil; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertArrayEquals; +@Category(UnitTest.class) public class TestArgumentArrayBuilder { @Test http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/tool/ImportToolValidateOptionsTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/tool/ImportToolValidateOptionsTest.java b/src/test/org/apache/sqoop/tool/ImportToolValidateOptionsTest.java index bdac437..b192415 100644 --- a/src/test/org/apache/sqoop/tool/ImportToolValidateOptionsTest.java +++ b/src/test/org/apache/sqoop/tool/ImportToolValidateOptionsTest.java @@ -19,9 +19,12 @@ package org.apache.sqoop.tool; import org.apache.sqoop.SqoopOptions; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; +import org.apache.sqoop.util.BlockJUnit4ClassRunnerWithParametersFactory; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -34,7 +37,9 @@ import static org.apache.sqoop.SqoopOptions.FileLayout.AvroDataFile; import static org.apache.sqoop.SqoopOptions.FileLayout.ParquetFile; import static org.apache.sqoop.SqoopOptions.FileLayout.TextFile; +@Category(UnitTest.class) @RunWith(Parameterized.class) [email protected](BlockJUnit4ClassRunnerWithParametersFactory.class) public class ImportToolValidateOptionsTest { @Parameters(name = "fileLayout = {0}, validationMessage = {1}") http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/tool/TestBaseSqoopTool.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/tool/TestBaseSqoopTool.java b/src/test/org/apache/sqoop/tool/TestBaseSqoopTool.java index aecfa8b..5767e0a 100644 --- a/src/test/org/apache/sqoop/tool/TestBaseSqoopTool.java +++ b/src/test/org/apache/sqoop/tool/TestBaseSqoopTool.java @@ -23,9 +23,11 @@ import org.apache.commons.cli.Option; import org.apache.sqoop.SqoopOptions; import org.apache.sqoop.cli.RelatedOptions; import org.apache.sqoop.mapreduce.parquet.ParquetJobConfiguratorImplementation; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.mockito.Mockito; @@ -36,6 +38,7 @@ import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +@Category(UnitTest.class) public class TestBaseSqoopTool { private static final String PARQUET_CONFIGURATOR_IMPLEMENTATION = "parquet-configurator-implementation"; http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/tool/TestExportToolValidateOptions.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/tool/TestExportToolValidateOptions.java b/src/test/org/apache/sqoop/tool/TestExportToolValidateOptions.java index f16d187..6a5184a 100644 --- a/src/test/org/apache/sqoop/tool/TestExportToolValidateOptions.java +++ b/src/test/org/apache/sqoop/tool/TestExportToolValidateOptions.java @@ -21,7 +21,9 @@ package org.apache.sqoop.tool; import org.apache.sqoop.SqoopOptions; import org.apache.hadoop.conf.Configuration; import org.apache.sqoop.manager.SupportedManagers; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -44,6 +46,7 @@ import static org.mockito.Mockito.when; * See the License for the specific language governing permissions and * limitations under the License. */ +@Category(UnitTest.class) public class TestExportToolValidateOptions { ExportTool exportTool = new ExportTool(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/tool/TestHiveServer2OptionValidations.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/tool/TestHiveServer2OptionValidations.java b/src/test/org/apache/sqoop/tool/TestHiveServer2OptionValidations.java index ed4b5a4..926d2fc 100644 --- a/src/test/org/apache/sqoop/tool/TestHiveServer2OptionValidations.java +++ b/src/test/org/apache/sqoop/tool/TestHiveServer2OptionValidations.java @@ -19,9 +19,12 @@ package org.apache.sqoop.tool; import org.apache.sqoop.SqoopOptions; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; +import org.apache.sqoop.util.BlockJUnit4ClassRunnerWithParametersFactory; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -30,7 +33,6 @@ import org.junit.runners.Parameterized.Parameters; import java.util.Arrays; import java.util.Properties; -import static org.apache.sqoop.SqoopOptions.FileLayout.ParquetFile; import static org.apache.sqoop.SqoopOptions.IncrementalMode.None; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; @@ -39,6 +41,8 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @RunWith(Parameterized.class) +@Category(UnitTest.class) [email protected](BlockJUnit4ClassRunnerWithParametersFactory.class) public class TestHiveServer2OptionValidations { @Parameters(name = "sqoopTool = {0}") http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/tool/TestImportTool.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/tool/TestImportTool.java b/src/test/org/apache/sqoop/tool/TestImportTool.java index 8c2be3b..9f7c50c 100644 --- a/src/test/org/apache/sqoop/tool/TestImportTool.java +++ b/src/test/org/apache/sqoop/tool/TestImportTool.java @@ -38,17 +38,20 @@ import org.apache.avro.Schema; import org.apache.sqoop.SqoopOptions; import org.apache.sqoop.avro.AvroSchemaMismatchException; import org.apache.sqoop.hive.HiveClientFactory; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.apache.sqoop.util.ExpectedLogMessage; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.experimental.theories.DataPoints; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; @RunWith(Theories.class) +@Category(UnitTest.class) public class TestImportTool { @DataPoints public static final Object[][] TRANSACTION_ISOLATION_LEVEL_NAMES_AND_VALUES = { http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/tool/TestToolPlugin.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/tool/TestToolPlugin.java b/src/test/org/apache/sqoop/tool/TestToolPlugin.java index 19dea22..70d13dd 100644 --- a/src/test/org/apache/sqoop/tool/TestToolPlugin.java +++ b/src/test/org/apache/sqoop/tool/TestToolPlugin.java @@ -38,7 +38,9 @@ import org.apache.sqoop.cli.ToolOptions; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -46,6 +48,7 @@ import static org.junit.Assert.fail; /** * Test that tool plugins work. */ +@Category(UnitTest.class) public class TestToolPlugin { public static final Log LOG = LogFactory http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/tool/TestValidateImportOptions.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/tool/TestValidateImportOptions.java b/src/test/org/apache/sqoop/tool/TestValidateImportOptions.java index 9b61bd5..99814b4 100644 --- a/src/test/org/apache/sqoop/tool/TestValidateImportOptions.java +++ b/src/test/org/apache/sqoop/tool/TestValidateImportOptions.java @@ -22,7 +22,9 @@ import org.apache.sqoop.SqoopOptions; import org.apache.hadoop.conf.Configuration; import org.apache.sqoop.manager.SupportedManagers; import org.apache.commons.lang.RandomStringUtils; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -30,6 +32,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; +@Category(UnitTest.class) public class TestValidateImportOptions { ImportTool importTool = new ImportTool(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParameters.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParameters.java b/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParameters.java new file mode 100644 index 0000000..2bb2a09 --- /dev/null +++ b/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParameters.java @@ -0,0 +1,45 @@ +/** + * 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.sqoop.util; + +import org.junit.runner.RunWith; +import org.junit.runners.model.InitializationError; +import org.junit.runners.parameterized.TestWithParameters; + +import java.lang.annotation.Annotation; + +public class BlockJUnit4ClassRunnerWithParameters extends org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters { + public BlockJUnit4ClassRunnerWithParameters(TestWithParameters test) throws InitializationError { + super(test); + } + + @Override + protected Annotation[] getRunnerAnnotations() { + Annotation[] allAnnotations = getTestClass().getAnnotations(); + Annotation[] annotationsWithoutRunWith = new Annotation[allAnnotations.length - 1]; + int i = 0; + for (Annotation annotation: allAnnotations) { + if (!annotation.annotationType().equals(RunWith.class)) { + annotationsWithoutRunWith[i] = annotation; + ++i; + } + } + return annotationsWithoutRunWith; + } +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParametersFactory.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParametersFactory.java b/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParametersFactory.java new file mode 100644 index 0000000..2e9d330 --- /dev/null +++ b/src/test/org/apache/sqoop/util/BlockJUnit4ClassRunnerWithParametersFactory.java @@ -0,0 +1,37 @@ +/** + * 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.sqoop.util; + +import org.junit.runner.Runner; +import org.junit.runners.model.InitializationError; +import org.junit.runners.parameterized.ParametersRunnerFactory; +import org.junit.runners.parameterized.TestWithParameters; + +/** + * Due to an issue in JUnit Gradle does not execute categorized tests which are parameterized too. + * The issue is already reported(https://github.com/junit-team/junit4/issues/751) but its fix will be released in JUnit 4.13. + * This factory returns a custom BlockJUnit4ClassRunnerWithParameters instance which contains the fix for this issue so + * we have to use @Parameterized.UseParametersRunnerFactory(BlockJUnit4ClassRunnerWithParametersFactory.class) annotation + * on parameterized test classes until JUnit 4.13 is released and we migrate to it. + */ +public class BlockJUnit4ClassRunnerWithParametersFactory implements ParametersRunnerFactory { + @Override + public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError { + return new BlockJUnit4ClassRunnerWithParameters(test); + } +} http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/TestDirCleanupHook.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/TestDirCleanupHook.java b/src/test/org/apache/sqoop/util/TestDirCleanupHook.java index 41146fd..1af5033 100644 --- a/src/test/org/apache/sqoop/util/TestDirCleanupHook.java +++ b/src/test/org/apache/sqoop/util/TestDirCleanupHook.java @@ -18,13 +18,16 @@ package org.apache.sqoop.util; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.rules.TemporaryFolder; import static org.junit.Assert.assertFalse; +@Category(UnitTest.class) public class TestDirCleanupHook { @Rule public TemporaryFolder tmpFolder = new TemporaryFolder(); http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/TestFileSystemUtil.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/TestFileSystemUtil.java b/src/test/org/apache/sqoop/util/TestFileSystemUtil.java index 28fb58c..961c8fa 100644 --- a/src/test/org/apache/sqoop/util/TestFileSystemUtil.java +++ b/src/test/org/apache/sqoop/util/TestFileSystemUtil.java @@ -23,10 +23,14 @@ import java.net.URI; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.RawLocalFileSystem; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Test; import org.junit.Before; +import org.junit.experimental.categories.Category; + import static org.junit.Assert.*; +@Category(UnitTest.class) public class TestFileSystemUtil { private Configuration conf; http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/TestMainframeFTPClientUtils.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/TestMainframeFTPClientUtils.java b/src/test/org/apache/sqoop/util/TestMainframeFTPClientUtils.java index 0714bdc..fc6e56d 100644 --- a/src/test/org/apache/sqoop/util/TestMainframeFTPClientUtils.java +++ b/src/test/org/apache/sqoop/util/TestMainframeFTPClientUtils.java @@ -34,11 +34,14 @@ import org.apache.hadoop.mapred.JobConf; import org.apache.sqoop.mapreduce.JobBase; import org.apache.sqoop.mapreduce.db.DBConfiguration; import org.apache.sqoop.mapreduce.mainframe.MainframeConfiguration; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(UnitTest.class) public class TestMainframeFTPClientUtils { private JobConf conf; http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/TestOptionsFileExpansion.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/TestOptionsFileExpansion.java b/src/test/org/apache/sqoop/util/TestOptionsFileExpansion.java index 3fc9e60..98e2bde 100644 --- a/src/test/org/apache/sqoop/util/TestOptionsFileExpansion.java +++ b/src/test/org/apache/sqoop/util/TestOptionsFileExpansion.java @@ -22,15 +22,18 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.apache.sqoop.util.OptionsFileUtil; import org.junit.Assert; import org.apache.sqoop.Sqoop; import org.junit.Test; +import org.junit.experimental.categories.Category; /** * Tests various options file loading scenarios. */ +@Category(UnitTest.class) public class TestOptionsFileExpansion { /** http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/TestSqoopJsonUtil.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/TestSqoopJsonUtil.java b/src/test/org/apache/sqoop/util/TestSqoopJsonUtil.java index fdf972c..a19b955 100644 --- a/src/test/org/apache/sqoop/util/TestSqoopJsonUtil.java +++ b/src/test/org/apache/sqoop/util/TestSqoopJsonUtil.java @@ -23,9 +23,12 @@ import static org.junit.Assert.assertTrue; import java.util.HashMap; import java.util.Map; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category(UnitTest.class) public class TestSqoopJsonUtil { private static Map<String, String> paramMap; http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/util/TestSubstitutionUtils.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/util/TestSubstitutionUtils.java b/src/test/org/apache/sqoop/util/TestSubstitutionUtils.java index a2ac341..53e790a 100644 --- a/src/test/org/apache/sqoop/util/TestSubstitutionUtils.java +++ b/src/test/org/apache/sqoop/util/TestSubstitutionUtils.java @@ -17,14 +17,17 @@ */ package org.apache.sqoop.util; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.apache.sqoop.util.SubstitutionUtils; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; /** * */ +@Category(UnitTest.class) public class TestSubstitutionUtils { @Test http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/validation/AbortOnFailureHandlerTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/validation/AbortOnFailureHandlerTest.java b/src/test/org/apache/sqoop/validation/AbortOnFailureHandlerTest.java index ee04563..6bc0d44 100644 --- a/src/test/org/apache/sqoop/validation/AbortOnFailureHandlerTest.java +++ b/src/test/org/apache/sqoop/validation/AbortOnFailureHandlerTest.java @@ -20,7 +20,9 @@ package org.apache.sqoop.validation; import org.apache.sqoop.SqoopOptions; import org.apache.hadoop.conf.Configuration; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -28,6 +30,7 @@ import static org.junit.Assert.fail; /** * Tests for AbortOnFailureHandler. */ +@Category(UnitTest.class) public class AbortOnFailureHandlerTest { @Test http://git-wip-us.apache.org/repos/asf/sqoop/blob/d58e5f10/src/test/org/apache/sqoop/validation/AbsoluteValidationThresholdTest.java ---------------------------------------------------------------------- diff --git a/src/test/org/apache/sqoop/validation/AbsoluteValidationThresholdTest.java b/src/test/org/apache/sqoop/validation/AbsoluteValidationThresholdTest.java index 86a99c4..2c44349 100644 --- a/src/test/org/apache/sqoop/validation/AbsoluteValidationThresholdTest.java +++ b/src/test/org/apache/sqoop/validation/AbsoluteValidationThresholdTest.java @@ -18,7 +18,9 @@ package org.apache.sqoop.validation; +import org.apache.sqoop.testcategories.sqooptest.UnitTest; import org.junit.Test; +import org.junit.experimental.categories.Category; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -26,6 +28,7 @@ import static org.junit.Assert.assertTrue; /** * Tests for AbsoluteValidationThreshold. */ +@Category(UnitTest.class) public class AbsoluteValidationThresholdTest { /**
