From afac7a2640c34abf5b2794ea83e81b7fda085438 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Sun, 22 Nov 2015 18:29:03 -0800 Subject: [PATCH] HADOOP-10068. Improve log4j regex in testFindContainingJar. Contributed by Robert Rati. --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/test/java/org/apache/hadoop/util/TestClassUtil.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e7b59be6fdb..6b56071481e 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -830,6 +830,9 @@ Release 2.8.0 - UNRELEASED HADOOP-12098. Remove redundant test dependencies in Hadoop Archives. (Varun Saxena via wheat9) + HADOOP-10068. Improve log4j regex in testFindContainingJar. + (Robert Rati via wheat9) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestClassUtil.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestClassUtil.java index 14e19f43637..4bc36e2ec0a 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestClassUtil.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestClassUtil.java @@ -32,9 +32,9 @@ public class TestClassUtil { Assert.assertNotNull("Containing jar not found for Logger", containingJar); File jarFile = new File(containingJar); - Assert.assertTrue("Containing jar does not exist on file system", + Assert.assertTrue("Containing jar does not exist on file system ", jarFile.exists()); - Assert.assertTrue("Incorrect jar file" + containingJar, - jarFile.getName().matches("log4j.+[.]jar")); + Assert.assertTrue("Incorrect jar file " + containingJar, + jarFile.getName().matches("log4j.*[.]jar")); } }