Repository: hive Updated Branches: refs/heads/master b0a58d245 -> 4fc9d5230
HIVE-18791: Fix TestJdbcWithMiniHS2#testHttpHeaderSize (Andrew Sherman, via Peter Vary) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4fc9d523 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4fc9d523 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4fc9d523 Branch: refs/heads/master Commit: 4fc9d52300c41923d7aa3e9968f831a1a43ed17b Parents: b0a58d2 Author: Peter Vary <pv...@cloudera.com> Authored: Wed Mar 7 23:42:24 2018 +0100 Committer: Peter Vary <pv...@cloudera.com> Committed: Wed Mar 7 23:42:24 2018 +0100 ---------------------------------------------------------------------- .../org/apache/hive/jdbc/TestJdbcWithMiniHS2.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/4fc9d523/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java ---------------------------------------------------------------------- diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java index a70ef63..f45fb50 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcWithMiniHS2.java @@ -960,12 +960,14 @@ public class TestJdbcWithMiniHS2 { conf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_RESPONSE_HEADER_SIZE, 1024); startMiniHS2(conf, true); - // Username is added to the request header - String userName = StringUtils.leftPad("*", 100); + // Username and password are added to the http request header. + // We will test the reconfiguration of the header size by changing the password length. + String userName = "userName"; + String password = StringUtils.leftPad("*", 100); Connection conn = null; // This should go fine, since header should be less than the configured header size try { - conn = getConnection(miniHS2.getJdbcURL(testDbName), userName, "password"); + conn = getConnection(miniHS2.getJdbcURL(testDbName), userName, password); } catch (Exception e) { fail("Not expecting exception: " + e); } finally { @@ -976,11 +978,11 @@ public class TestJdbcWithMiniHS2 { // This should fail with given HTTP response code 413 in error message, since header is more // than the configured the header size - userName = StringUtils.leftPad("*", 2000); + password = StringUtils.leftPad("*", 2000); Exception headerException = null; try { conn = null; - conn = getConnection(miniHS2.getJdbcURL(testDbName), userName, "password"); + conn = getConnection(miniHS2.getJdbcURL(testDbName), userName, password); } catch (Exception e) { headerException = e; } finally { @@ -1002,7 +1004,7 @@ public class TestJdbcWithMiniHS2 { // This should now go fine, since we increased the configured header size try { conn = null; - conn = getConnection(miniHS2.getJdbcURL(testDbName), userName, "password"); + conn = getConnection(miniHS2.getJdbcURL(testDbName), userName, password); } catch (Exception e) { fail("Not expecting exception: " + e); } finally {