You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by rv...@apache.org on 2012/03/23 06:50:21 UTC
svn commit: r1304195 - in
/incubator/bigtop/branches/hadoop-0.23/bigtop-tests:
test-artifacts/sqoop-smokes/ test-artifacts/sqoop-smokes/src/
test-artifacts/sqoop-smokes/src/main/
test-artifacts/sqoop-smokes/src/main/groovy/ test-artifacts/sqoop-smokes/...
Author: rvs
Date: Fri Mar 23 05:50:20 2012
New Revision: 1304195
URL: http://svn.apache.org/viewvc?rev=1304195&view=rev
Log:
BIGTOP-444. Add sqoop smoke tests (Prashant Gokhale via rvs)
Added:
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/pom.xml
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopExport.groovy
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopImport.groovy
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-db.sql
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-tables.sql
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-insert-data.sql
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-all-tables.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-append.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-columns.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-non-string.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-string.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-query.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool-export.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date-export.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_fp.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_int.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_string.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-testtable.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-where-clause.out
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-execution/smokes/sqoop-smokes/
incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-execution/smokes/sqoop-smokes/pom.xml
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/pom.xml?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/pom.xml (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/pom.xml Fri Mar 23 05:50:20 2012
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.bigtop.itest</groupId>
+ <artifactId>bigtop-smokes</artifactId>
+ <version>0.3.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.bigtop.itest</groupId>
+ <artifactId>sqoopsmokes</artifactId>
+ <version>0.3.0-incubating-SNAPSHOT</version>
+ <name>sqoopsmokes</name>
+</project>
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopExport.groovy
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopExport.groovy?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopExport.groovy (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopExport.groovy Fri Mar 23 05:50:20 2012
@@ -0,0 +1,164 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.itest.sqoop;
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertTrue
+import org.junit.AfterClass
+import org.junit.BeforeClass
+import org.junit.Test
+
+import org.apache.bigtop.itest.JarContent
+import org.apache.bigtop.itest.shell.Shell
+
+class TestSqoopExport {
+ private static String mysql_user =
+ System.getenv("MYSQL_USER");
+ private static String mysql_password =
+ System.getenv("MYSQL_PASSWORD");
+ private static final String MYSQL_USER =
+ (mysql_user == null) ? "root" : mysql_user;
+ private static final String MYSQL_PASSWORD =
+ (mysql_password == null) ? "" : mysql_password;
+ private static final String MYSQL_HOST = System.getProperty("mysql.host", "localhost");
+ private static final String HADOOP_HOME =
+ System.getenv('HADOOP_HOME');
+ private static String streaming_home = System.getenv('STREAMING_HOME');
+ private static final String STREAMING_HOME =
+ (streaming_home == null) ? HADOOP_HOME + "/contrib/streaming" :
+ streaming_home;
+ private static final String SQOOP_HOME =
+ System.getenv("SQOOP_HOME");
+ static {
+ assertNotNull("HADOOP_HOME is not set", HADOOP_HOME);
+ assertNotNull("SQOOP_HOME is not set", SQOOP_HOME);
+ assertNotNull("mysql connector jar is required to be present in $SQOOP_HOME/lib",
+ JarContent.getJarName("$SQOOP_HOME/lib", "mysql-connector-java.*.jar"));
+ }
+ private static String sqoop_jar =
+ JarContent.getJarName(SQOOP_HOME, "sqoop-1.*.jar");
+ private static String streaming_jar =
+ JarContent.getJarName(STREAMING_HOME, "hadoop.*streaming.*.jar");
+ static {
+ assertNotNull("Can't find sqoop.jar", sqoop_jar);
+ assertNotNull("Can't find hadoop-streaming.jar", streaming_jar);
+ }
+ private static final String SQOOP_JAR = SQOOP_HOME + "/" + sqoop_jar;
+ private static final String STREAMING_JAR = STREAMING_HOME + "/" + streaming_jar;
+ private static final String MYSQL_COMMAND =
+ "mysql --user=$MYSQL_USER" +
+ (("".equals(MYSQL_PASSWORD)) ? "" : " --password=$MYSQL_PASSWORD");
+ private static final String MYSQL_DBNAME = System.getProperty("mysql.dbname", "mysqltestdb");
+ private static final String SQOOP_CONNECTION =
+ "--connect jdbc:mysql://$MYSQL_HOST/$MYSQL_DBNAME --username=$MYSQL_USER" +
+ (("".equals(MYSQL_PASSWORD)) ? "" : " --password=$MYSQL_PASSWORD");
+ static {
+ System.out.println("SQOOP_CONNECTION string is " + SQOOP_CONNECTION );
+ }
+ private static final String DATA_DIR = System.getProperty("data.dir", "mysql-files");
+ private static final String INPUT = System.getProperty("input.dir", "input-dir");
+ private static Shell sh = new Shell("/bin/bash -s");
+
+ @BeforeClass
+ static void setUp() {
+ sh.exec("hadoop fs -test -e $INPUT");
+ if (sh.getRet() == 0) {
+ sh.exec("hadoop fs -rmr -skipTrash $INPUT");
+ assertTrue("Deletion of previous $INPUT from HDFS failed",
+ sh.getRet() == 0);
+ }
+ sh.exec("hadoop fs -mkdir $INPUT");
+ assertTrue("Could not create $INPUT directory", sh.getRet() == 0);
+ // unpack resource
+ JarContent.unpackJarContainer(TestSqoopExport.class, '.' , null)
+ // upload data to HDFS
+ sh.exec("hadoop fs -put $DATA_DIR/sqoop-testtable.out input-dir/testtable/part-m-00000");
+ sh.exec("hadoop fs -put $DATA_DIR/sqoop-t_bool.out $INPUT/t_bool/part-m-00000");
+ sh.exec("hadoop fs -put $DATA_DIR/sqoop-t_date-export.out $INPUT/t_date/part-m-00000");
+ sh.exec("hadoop fs -put $DATA_DIR/sqoop-t_string.out $INPUT/t_string/part-m-00000");
+ sh.exec("hadoop fs -put $DATA_DIR/sqoop-t_fp.out $INPUT/t_fp/part-m-00000");
+ sh.exec("hadoop fs -put $DATA_DIR/sqoop-t_int.out $INPUT/t_int/part-m-00000");
+
+ //create db
+ sh.exec("cat $DATA_DIR/mysql-create-db.sql | $MYSQL_COMMAND");
+ //create tables
+ sh.exec("cat $DATA_DIR/mysql-create-tables.sql | $MYSQL_COMMAND");
+ }
+
+ @AfterClass
+ static void tearDown() {
+ if ('YES'.equals(System.getProperty('delete.testdata','no').toUpperCase())) {
+ sh.exec("hadoop fs -test -e $INPUT");
+ if (sh.getRet() == 0) {
+ // sh.exec("hadoop fs -rmr -skipTrash $INPUT");
+ assertTrue("Deletion of $INPUT from HDFS failed",
+ sh.getRet() == 0);
+ }
+ }
+ }
+
+ @Test
+ public void testBooleanExport() {
+ sh.exec("sqoop export $SQOOP_CONNECTION --table t_bool --export-dir $INPUT/t_bool");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("echo 'use mysqltestdb;select * from t_bool' | $MYSQL_COMMAND --skip-column-names | sed 's/\t/,/g' > t_bool.out");
+ assertEquals("sqoop export did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_bool-export.out t_bool.out").getRet());
+ }
+
+
+ @Test
+ public void testIntegerExport() {
+ sh.exec("sqoop export $SQOOP_CONNECTION --table t_int --export-dir $INPUT/t_int");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("echo 'use mysqltestdb;select * from t_int' | $MYSQL_COMMAND --skip-column-names | sed 's/\t/,/g' > t_int.out");
+ assertEquals("sqoop export did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_int.out t_int.out").getRet());
+ }
+
+ @Test
+ public void testFixedPointFloatingPointExport() {
+ sh.exec("sqoop export $SQOOP_CONNECTION --table t_fp --export-dir $INPUT/t_fp");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("echo 'use mysqltestdb;select * from t_fp' | $MYSQL_COMMAND --skip-column-names | sed 's/\t/,/g' > t_fp.out");
+ assertEquals("sqoop export did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_fp.out t_fp.out").getRet());
+ }
+
+ @Test
+ public void testDateTimeExport() {
+ sh.exec("sqoop export $SQOOP_CONNECTION --table t_date --export-dir $INPUT/t_date");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("echo 'use mysqltestdb;select * from t_date' | $MYSQL_COMMAND --skip-column-names | sed 's/\t/,/g' > t_date.out");
+ assertEquals("sqoop export did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_date.out t_date.out").getRet());
+ }
+
+ @Test
+ public void testStringExport() {
+ sh.exec("sqoop export $SQOOP_CONNECTION --table t_string --export-dir $INPUT/t_string");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("echo 'use mysqltestdb;select * from t_string' | $MYSQL_COMMAND --skip-column-names | sed 's/\t/,/g' > t_string.out");
+ assertEquals("sqoop export did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_string.out t_string.out").getRet());
+ }
+
+}
+
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopImport.groovy
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopImport.groovy?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopImport.groovy (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/groovy/org/apache/itest/sqoop/TestSqoopImport.groovy Fri Mar 23 05:50:20 2012
@@ -0,0 +1,264 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.itest.sqoop;
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertTrue
+import org.junit.AfterClass
+import org.junit.BeforeClass
+import org.junit.Test
+
+import org.apache.bigtop.itest.JarContent
+import org.apache.bigtop.itest.shell.Shell
+
+class TestSqoopImport {
+ private static String mysql_user =
+ System.getenv("MYSQL_USER");
+ private static String mysql_password =
+ System.getenv("MYSQL_PASSWORD");
+ private static final String MYSQL_USER =
+ (mysql_user == null) ? "root" : mysql_user;
+ private static final String MYSQL_PASSWORD =
+ (mysql_password == null) ? "" : mysql_password;
+ private static final String MYSQL_HOST = System.getProperty("mysql.host", "localhost");
+ private static final String HADOOP_HOME =
+ System.getenv('HADOOP_HOME');
+ private static String streaming_home = System.getenv('STREAMING_HOME');
+ private static final String STREAMING_HOME =
+ (streaming_home == null) ? HADOOP_HOME + "/contrib/streaming" :
+ streaming_home;
+ private static final String SQOOP_HOME =
+ System.getenv("SQOOP_HOME");
+ static {
+ assertNotNull("HADOOP_HOME is not set", HADOOP_HOME);
+ assertNotNull("SQOOP_HOME is not set", SQOOP_HOME);
+ assertNotNull("mysql connector jar is required to be present in $SQOOP_HOME/lib",
+ JarContent.getJarName("$SQOOP_HOME/lib", "mysql-connector-java.*.jar"));
+ }
+ private static String sqoop_jar =
+ JarContent.getJarName(SQOOP_HOME, "sqoop-1.*.jar");
+ private static String streaming_jar =
+ JarContent.getJarName(STREAMING_HOME, "hadoop.*streaming.*.jar");
+ static {
+ assertNotNull("Can't find sqoop.jar", sqoop_jar);
+ assertNotNull("Can't find hadoop-streaming.jar", streaming_jar);
+ }
+ private static final String SQOOP_JAR = SQOOP_HOME + "/" + sqoop_jar;
+ private static final String STREAMING_JAR = STREAMING_HOME + "/" + streaming_jar;
+ private static final String MYSQL_COMMAND =
+ "mysql --user=$MYSQL_USER" +
+ (("".equals(MYSQL_PASSWORD)) ? "" : " --password=$MYSQL_PASSWORD");
+ private static final String MYSQL_DBNAME = System.getProperty("mysql.dbname", "mysqltestdb");
+ private static final String SQOOP_CONNECTION =
+ "--connect jdbc:mysql://$MYSQL_HOST/$MYSQL_DBNAME --username=$MYSQL_USER" +
+ (("".equals(MYSQL_PASSWORD)) ? "" : " --password=$MYSQL_PASSWORD");
+ static {
+ System.out.println("SQOOP_CONNECTION string is " + SQOOP_CONNECTION );
+ }
+ private static final String DATA_DIR = System.getProperty("data.dir", "mysql-files");
+ private static final String OUTPUT = System.getProperty("output.dir", "output-dir");
+ private static Shell sh = new Shell("/bin/bash -s");
+
+ @BeforeClass
+ static void setUp() {
+ sh.exec("hadoop fs -test -e $OUTPUT");
+ if (sh.getRet() == 0) {
+ sh.exec("hadoop fs -rmr -skipTrash $OUTPUT");
+ assertTrue("Deletion of previous $OUTPUT from HDFS failed",
+ sh.getRet() == 0);
+ }
+ sh.exec("hadoop fs -mkdir $OUTPUT");
+ assertTrue("Could not create $OUTPUT directory", sh.getRet() == 0);
+ // unpack resource
+ JarContent.unpackJarContainer(TestSqoopImport.class, '.' , null)
+ // create the database
+ sh.exec("cat $DATA_DIR/mysql-create-db.sql | $MYSQL_COMMAND");
+ //create tables
+ sh.exec("cat $DATA_DIR/mysql-create-tables.sql | $MYSQL_COMMAND");
+ //populate data
+ sh.exec("cat $DATA_DIR/mysql-insert-data.sql | $MYSQL_COMMAND");
+ }
+
+ @AfterClass
+ static void tearDown() {
+ if ('YES'.equals(System.getProperty('delete.testdata','no').toUpperCase())) {
+ sh.exec("hadoop fs -test -e $OUTPUT");
+ if (sh.getRet() == 0) {
+ sh.exec("hadoop fs -rmr -skipTrash $OUTPUT");
+ assertTrue("Deletion of $OUTPUT from HDFS failed",
+ sh.getRet() == 0);
+ }
+ }
+ }
+
+ @Test
+ public void testBooleanImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table t_bool --target-dir $OUTPUT/t_bool");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/t_bool/part-* > t_bool.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_bool.out t_bool.out").getRet());
+ }
+
+
+ @Test
+ public void testIntegerImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table t_int --target-dir $OUTPUT/t_int");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/t_int/part-* > t_int.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_int.out t_int.out").getRet());
+ }
+
+ @Test
+ public void testFixedPointFloatingPointImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table t_fp --target-dir $OUTPUT/t_fp");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/t_fp/part-* > t_fp.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_fp.out t_fp.out").getRet());
+ }
+
+ @Test
+ public void testDateTimeImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table t_date --target-dir $OUTPUT/t_date");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/t_date/part-* > t_date.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_date.out t_date.out").getRet());
+ }
+
+ @Test
+ public void testStringImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table t_string --target-dir $OUTPUT/t_string");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/t_string/part-* > t_string.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-t_string.out t_string.out").getRet());
+ }
+
+ @Test
+ public void testAppendImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --target-dir $OUTPUT/append");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ //import again with append
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --append --target-dir $OUTPUT/append");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/append/part-* > append.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-append.out append.out").getRet());
+ }
+
+ @Test
+ public void testColumnsImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --columns id,fname --target-dir $OUTPUT/columns");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/columns/part-* > columns.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-columns.out columns.out").getRet());
+ }
+
+ @Test
+ public void testDirectImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --direct --target-dir $OUTPUT/direct");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/direct/part-* > direct.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-testtable.out direct.out").getRet());
+ }
+
+ @Test
+ public void testNumMappersImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --num-mappers 1 --target-dir $OUTPUT/num-mappers");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/num-mappers/part-*0 > num-mappers.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-testtable.out num-mappers.out").getRet());
+ }
+
+ @Test
+ public void testQueryImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --query 'select t1.id as id, t2.fname as fname from testtable as t1 join testtable2 as t2 on (t1.id = t2.id ) where t1.id < 3 AND \$CONDITIONS' --split-by t1.id --target-dir $OUTPUT/query");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/query/part-* > query.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-query.out query.out").getRet());
+ }
+
+ @Test
+ public void testSplityByImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --split-by fname --target-dir $OUTPUT/split-by");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/split-by/part-* > split-by.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-testtable.out split-by.out").getRet());
+ }
+
+ @Test
+ public void testWarehouseDirImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --warehouse-dir $OUTPUT/warehouse-dir");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/warehouse-dir/testtable/part-* > warehouse-dir.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-testtable.out warehouse-dir.out").getRet());
+ }
+
+ @Test
+ public void testWhereClauseImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testtable --where \"id < 5\" --target-dir $OUTPUT/where-clause");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/where-clause/part-* > where-clause.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-where-clause.out where-clause.out").getRet());
+ }
+
+ @Test
+ public void testNullStringImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testnullvalues --null-string mynullstring --target-dir $OUTPUT/null-string");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/null-string/part-* > null-string.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-null-string.out null-string.out").getRet());
+ }
+
+ @Test
+ public void testNullNonStringImport() {
+ sh.exec("sqoop import $SQOOP_CONNECTION --table testnullvalues --null-non-string 10 --target-dir $OUTPUT/non-null-string");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/non-null-string/part-* > non-null-string.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-null-non-string.out non-null-string.out").getRet());
+ }
+
+ //database name is hardcoded here
+ @Test
+ public void testImportAllTables() {
+ String SQOOP_CONNECTION_IMPORT_ALL =
+ "--connect jdbc:mysql://$MYSQL_HOST/mysqltestdb2 --username=$MYSQL_USER" +
+ (("".equals(MYSQL_PASSWORD)) ? "" : " --password=$MYSQL_PASSWORD");
+
+ sh.exec("sqoop import-all-tables $SQOOP_CONNECTION_IMPORT_ALL --warehouse-dir $OUTPUT/alltables");
+ assertTrue("Sqoop job failed!", sh.getRet() == 0);
+ sh.exec("hadoop fs -cat $OUTPUT/alltables/testtable*/part-* > all-tables.out");
+ assertEquals("sqoop import did not write expected data",
+ 0, sh.exec("diff -u $DATA_DIR/sqoop-all-tables.out all-tables.out").getRet());
+ }
+}
+
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-db.sql
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-db.sql?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-db.sql (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-db.sql Fri Mar 23 05:50:20 2012
@@ -0,0 +1,39 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+
+drop database if exists mysqltestdb;
+
+create database mysqltestdb;
+
+use mysqltestdb;
+
+grant all privileges on mysqltestdb.* to 'root'@'%';
+
+flush privileges;
+
+/* create database2 for import-all */
+
+drop database if exists mysqltestdb2;
+
+create database mysqltestdb2;
+
+use mysqltestdb2;
+
+grant all privileges on mysqltestdb2.* to 'root'@'%';
+
+flush privileges;
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-tables.sql
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-tables.sql?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-tables.sql (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-create-tables.sql Fri Mar 23 05:50:20 2012
@@ -0,0 +1,54 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+
+/* functional test db tables */
+use mysqltestdb;
+
+drop table if exists t_bool;
+create table t_bool ( pri int not null auto_increment, a boolean, primary key (pri));
+
+drop table if exists t_int;
+create table t_int ( pri int not null auto_increment,a tinyint, b smallint, c mediumint , d int, e integer , f bigint,primary key (pri));
+
+drop table if exists t_fp;
+create table t_fp (pri int not null auto_increment, a decimal (6,4), b float (6,4), c double precision (6,4),d float (4),primary key (pri));
+
+drop table if exists t_date;
+create table t_date (pri int not null auto_increment,a date , c timestamp, d time , e year(4),primary key (pri));
+
+drop table if exists t_string;
+create table t_string (pri int not null auto_increment, a char (5), b varchar (5), c text , d tinytext, e mediumtext, f mediumtext, g longtext, h enum ('A','B'),primary key (pri));
+
+drop table if exists testtable;
+create table testtable ( id int , fname varchar (20), lname varchar(20) , primary key (id));
+
+drop table if exists testtable2;
+create table testtable2 ( id int , fname varchar (20), lname varchar(20) , primary key (id));
+
+drop table if exists testnullvalues;
+create table testnullvalues ( id int , a int , b varchar(20) , primary key (id));
+
+/* import-all test db-tables */
+
+use mysqltestdb2;
+
+drop table if exists testtable;
+create table testtable ( id int , fname varchar (20), lname varchar(20) , primary key (id));
+
+drop table if exists testtable2;
+create table testtable2 ( id int , fname varchar (20), lname varchar(20) , primary key (id));
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-insert-data.sql
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-insert-data.sql?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-insert-data.sql (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/mysql-insert-data.sql Fri Mar 23 05:50:20 2012
@@ -0,0 +1,57 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+
+use mysqltestdb;
+
+insert into t_int (a,b,c,d,e,f) values (127,32767,8388607,2147483647,-2147483648,9223372036854775807);
+
+insert into t_bool (a) values (1);
+
+insert into t_fp(a,b,c,d) values (-99.9999,-99.9999,99.9999,99.99);
+
+insert into t_date (a,c,d,e) values ('9999-12-31',19731230153000,'23:59:59','2155');
+
+insert into t_string (a,b,c,d,e,f,g,h) values ('aaa','aaa','0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR','0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR','0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR','0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR','0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9
Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR','A');
+
+insert into testtable values (1,'aaa','aaa');
+insert into testtable values (2,'bbb','bbb');
+insert into testtable values (3,'ccc','ccc');
+insert into testtable values (4,'ddd','ddd');
+insert into testtable values (5,'eee','eee');
+insert into testtable values (6,'fff','fff');
+insert into testtable values (7,'ggg','ggg');
+insert into testtable values (8,'hhh','hhh');
+insert into testtable values (9,'iii','iii');
+insert into testtable values (10,'jjj','jjj');
+
+
+insert into testtable2 values (1,'111','111');
+insert into testtable2 values (2,'222','222');
+insert into testtable2 values (3,'333','333');
+
+
+insert into testnullvalues (id) values (1);
+insert into testnullvalues (id,a) values (2,2);
+insert into testnullvalues (id,b) values (3,'aaa');
+
+/* data for import-all test */
+
+use mysqltestdb2;
+
+insert into testtable values (1,'aaa','aaa');
+insert into testtable2 values (1,'aaa','aaa');
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-all-tables.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-all-tables.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-all-tables.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-all-tables.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,2 @@
+1,aaa,aaa
+1,aaa,aaa
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-append.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-append.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-append.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-append.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,20 @@
+1,aaa,aaa
+2,bbb,bbb
+3,ccc,ccc
+4,ddd,ddd
+5,eee,eee
+6,fff,fff
+7,ggg,ggg
+8,hhh,hhh
+9,iii,iii
+10,jjj,jjj
+1,aaa,aaa
+2,bbb,bbb
+3,ccc,ccc
+4,ddd,ddd
+5,eee,eee
+6,fff,fff
+7,ggg,ggg
+8,hhh,hhh
+9,iii,iii
+10,jjj,jjj
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-columns.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-columns.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-columns.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-columns.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,10 @@
+1,aaa
+2,bbb
+3,ccc
+4,ddd
+5,eee
+6,fff
+7,ggg
+8,hhh
+9,iii
+10,jjj
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-non-string.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-non-string.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-non-string.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-non-string.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,3 @@
+1,10,null
+2,2,null
+3,10,aaa
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-string.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-string.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-string.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-null-string.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,3 @@
+1,null,mynullstring
+2,2,mynullstring
+3,null,aaa
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-query.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-query.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-query.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-query.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,2 @@
+1,111
+2,222
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool-export.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool-export.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool-export.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool-export.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1 @@
+1,1
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_bool.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1 @@
+1,true
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date-export.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date-export.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date-export.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date-export.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1 @@
+1,"9999-12-31","9999-12-31 23:59:59","1973-12-30 15:30:00","23:59:59","2155"
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_date.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1 @@
+1,9999-12-31,1973-12-30 15:30:00.0,23:59:59,2155
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_fp.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_fp.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_fp.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_fp.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1 @@
+1,-99.9999,-99.9999,99.9999,99.99
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_int.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_int.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_int.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_int.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1 @@
+1,127,32767,8388607,2147483647,-2147483648,9223372036854775807
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_string.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_string.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_string.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-t_string.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1 @@
+1,aaa,aaa,0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR,0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR,0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR,0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7lhI0HJXmvyDkJEqOc0VxdT0ySR,0GIQM3CONg5jAUloRoP7f76TJrYkYnto5i76IUDbKuG1dMSP5znIM6Ct3qc1WdRCD9THFjWXBIxOoAqhOgdFQEwICX7fYN4n9P3AOoo3ZrnUBu3rtuwf9Y2HXJvUBgAqs44Ypdg6iv511JQSufMeKvbLIpIbk9saJW82EeTgoWkAS7l
hI0HJXmvyDkJEqOc0VxdT0ySR,A
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-testtable.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-testtable.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-testtable.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-testtable.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,10 @@
+1,aaa,aaa
+2,bbb,bbb
+3,ccc,ccc
+4,ddd,ddd
+5,eee,eee
+6,fff,fff
+7,ggg,ggg
+8,hhh,hhh
+9,iii,iii
+10,jjj,jjj
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-where-clause.out
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-where-clause.out?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-where-clause.out (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-artifacts/sqoop-smokes/src/main/resources/mysql-files/sqoop-where-clause.out Fri Mar 23 05:50:20 2012
@@ -0,0 +1,4 @@
+1,aaa,aaa
+2,bbb,bbb
+3,ccc,ccc
+4,ddd,ddd
Added: incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-execution/smokes/sqoop-smokes/pom.xml
URL: http://svn.apache.org/viewvc/incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-execution/smokes/sqoop-smokes/pom.xml?rev=1304195&view=auto
==============================================================================
--- incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-execution/smokes/sqoop-smokes/pom.xml (added)
+++ incubator/bigtop/branches/hadoop-0.23/bigtop-tests/test-execution/smokes/sqoop-smokes/pom.xml Fri Mar 23 05:50:20 2012
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.apache.bigtop.itest</groupId>
+ <artifactId>smoke-tests</artifactId>
+ <version>0.3.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.bigtop.itest</groupId>
+ <artifactId>sqoop-smoke-execution</artifactId>
+ <version>0.3.0-incubating-SNAPSHOT</version>
+ <name>Sqoop smoke test execution</name>
+
+ <properties>
+ <!--Additional environment variables are required-->
+ <SQOOP_HOME>${env.SQOOP_HOME}</SQOOP_HOME>
+ <!-- Integration tests are special -->
+ <org.apache.maven-dependency-plugin.groupId>org.apache.bigtop.itest</org.apache.maven-dependency-plugin.groupId>
+ <org.apache.maven-dependency-plugin.artifactId>sqoopsmokes</org.apache.maven-dependency-plugin.artifactId>
+ <org.apache.maven-dependency-plugin.version>0.3.0-incubating-SNAPSHOT</org.apache.maven-dependency-plugin.version>
+ <org.apache.maven-dependency-plugin.type>jar</org.apache.maven-dependency-plugin.type>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${org.apache.maven-dependency-plugin.groupId}</groupId>
+ <artifactId>${org.apache.maven-dependency-plugin.artifactId}</artifactId>
+ <version>${org.apache.maven-dependency-plugin.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>enforce-property</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>SQOOP_HOME</property>
+ <message>SQOOP_HOME env. variable has to be set</message>
+ </requireProperty>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.7.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>