You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ct...@apache.org on 2016/09/29 13:07:38 UTC
hive git commit: HIVE-14426: Extensive logging on info level in
WebHCat (Addendum: add tests) (PeterVary via Chaoyu Tang)
Repository: hive
Updated Branches:
refs/heads/branch-2.1 878b0e7de -> a109ff520
HIVE-14426: Extensive logging on info level in WebHCat (Addendum: add tests) (PeterVary via Chaoyu Tang)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a109ff52
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a109ff52
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a109ff52
Branch: refs/heads/branch-2.1
Commit: a109ff520adb14c431ad5fb4245df172d72a450f
Parents: 878b0e7
Author: ctang <ct...@cloudera.com>
Authored: Thu Sep 29 09:01:39 2016 -0400
Committer: ctang <ct...@cloudera.com>
Committed: Thu Sep 29 09:05:40 2016 -0400
----------------------------------------------------------------------
.../apache/hadoop/hive/common/TestLogUtils.java | 34 ++++++++++++++++++++
1 file changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/a109ff52/common/src/test/org/apache/hadoop/hive/common/TestLogUtils.java
----------------------------------------------------------------------
diff --git a/common/src/test/org/apache/hadoop/hive/common/TestLogUtils.java b/common/src/test/org/apache/hadoop/hive/common/TestLogUtils.java
new file mode 100644
index 0000000..923ac2d
--- /dev/null
+++ b/common/src/test/org/apache/hadoop/hive/common/TestLogUtils.java
@@ -0,0 +1,34 @@
+package org.apache.hadoop.hive.common;
+/**
+ * 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.
+ */
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestLogUtils {
+ @Test
+ public void testMaskIfPassword() {
+ Assert.assertNull(LogUtils.maskIfPassword("",null));
+ Assert.assertNull(LogUtils.maskIfPassword(null,null));
+ Assert.assertEquals("test", LogUtils.maskIfPassword(null,"test"));
+ Assert.assertEquals("test2", LogUtils.maskIfPassword("any","test2"));
+ Assert.assertEquals("###_MASKED_###", LogUtils.maskIfPassword("password","test3"));
+ Assert.assertEquals("###_MASKED_###", LogUtils.maskIfPassword("a_passWord","test4"));
+ Assert.assertEquals("###_MASKED_###", LogUtils.maskIfPassword("password_a","test5"));
+ Assert.assertEquals("###_MASKED_###", LogUtils.maskIfPassword("a_PassWord_a","test6"));
+ }
+}