diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistValidation.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistValidation.java index e0a905a..7fe80e7 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistValidation.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestPartitionNameWhitelistValidation.java @@ -21,16 +21,14 @@ import java.util.ArrayList; import java.util.List; -import junit.framework.Assert; -import junit.framework.TestCase; - import org.apache.hadoop.hive.cli.CliSessionState; import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.ql.Driver; import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.shims.ShimLoader; import org.junit.Test; +import junit.framework.Assert; +import junit.framework.TestCase; + // Validate the metastore client call validatePartitionNameCharacters to ensure it throws // an exception if partition fields contain Unicode characters or commas @@ -40,21 +38,15 @@ private HiveConf hiveConf; private HiveMetaStoreClient msc; - private Driver driver; @Override protected void setUp() throws Exception { super.setUp(); System.setProperty(HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.varname, partitionValidationPattern); - int port = MetaStoreUtils.findFreePort(); - MetaStoreUtils.startMetaStore(port, ShimLoader.getHadoopThriftAuthBridge()); hiveConf = new HiveConf(this.getClass()); - hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + port); - hiveConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTCONNECTIONRETRIES, 3); SessionState.start(new CliSessionState(hiveConf)); msc = new HiveMetaStoreClient(hiveConf); - driver = new Driver(hiveConf); } // Runs an instance of DisallowUnicodePreEventListener