4fd522baed4258c726cde33051d30dea76cba78d
[sqoop.git] / src / test / org / apache / sqoop / manager / cubrid / CubridTestUtils.java
1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package org.apache.sqoop.manager.cubrid;
20
21 import org.apache.commons.logging.Log;
22 import org.apache.commons.logging.LogFactory;
23
24 /**
25 * Utilities for Cubrid-based tests.
26 *
27 * Since this requires a CUBRID installation on your local machine to use, this
28 * class is named in such a way that Hadoop's default QA process does not run
29 * it. You need to run this manually with -Dtestcase=CubridTestUtils
30 *
31 * You need to put CUBRID's Connector/J JDBC driver library into a location
32 * where Hadoop will be able to access it (since this library cannot be checked
33 * into Apache's tree for licensing reasons).
34 *
35 * To set up your test environment:
36 * Install Cubrid 9.2.2
37 * ref:http://www.cubrid.org/wiki_tutorials/entry/installing-cubrid-on-linux-using-shell-and-rpm
38 * Create a database SQOOPCUBRIDTEST
39 * $cubrid createdb SQOOPCUBRIDTEST en_us.utf8
40 * Start cubrid and database
41 * $cubrid service start
42 * $cubrid server start SQOOPCUBRIDTEST
43 * Create a login SQOOPUSER with password PASSWORD and grant all
44 * $csql -u dba SQOOPCUBRIDTEST
45 * csql>CREATE USER SQOOPUSER password 'PASSWORD';
46 */
47 public class CubridTestUtils {
48
49 public static final Log LOG = LogFactory.getLog(CubridTestUtils.class
50 .getName());
51
52 public static final String HOST_URL = System
53 .getProperty("sqoop.test.cubrid.connectstring.host_url",
54 "jdbc:cubrid:localhost:30000");
55
56 static final String TEST_DATABASE = System
57 .getProperty("sqoop.test.cubrid.connectstring.database",
58 "SQOOPCUBRIDTEST");
59 static final String TEST_USER = System
60 .getProperty("sqoop.test.cubrid.connectstring.username",
61 "SQOOPUSER");
62 static final String TEST_PASS = System
63 .getProperty("sqoop.test.cubrid.connectstring.password",
64 "PASSWORD");
65 static final String TABLE_NAME = "EMPLOYEES_CUBRID";
66 static final String NULL_TABLE_NAME = "NULL_EMPLOYEES_CUBRID";
67 static final String CONNECT_STRING = HOST_URL + ":"
68 + TEST_DATABASE + ":::";
69
70 public static String getCurrentUser() {
71 return TEST_USER;
72 }
73
74 public static String getPassword() {
75 return TEST_PASS;
76 }
77
78 public static String getConnectString() {
79 return CONNECT_STRING;
80 }
81
82 public static String getTableName() {
83 return TABLE_NAME;
84 }
85 }