From c3ba44d8586289faeb63bf23c58f808b2aa6b9f6 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 08a8bf4d796..26f97b40892 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -1454,6 +1454,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")); } }