From 059c1894516d1ebd211b3490615365631b159849 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Thu, 13 Feb 2020 12:43:05 -0800 Subject: [PATCH] HBASE-23829 Get `-PrunSmallTests` passing on JDK11 Signed-off-by: stack --- .../hadoop/hbase/util/TestFutureUtils.java | 3 +- hbase-hadoop2-compat/pom.xml | 8 ++ .../hadoop/hbase/http/log/TestLogLevel.java | 2 +- .../hbase-shaded-check-invariants/pom.xml | 7 -- .../pom.xml | 7 -- pom.xml | 93 +++++++++++++++---- 6 files changed, 86 insertions(+), 34 deletions(-) diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestFutureUtils.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestFutureUtils.java index d560b24f61e..0eef0a6fc51 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestFutureUtils.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestFutureUtils.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hbase.util; +import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; @@ -69,7 +70,7 @@ public class TestFutureUtils { } catch (HBaseIOException e) { assertEquals("Inject error!", e.getMessage()); StackTraceElement[] elements = e.getStackTrace(); - assertThat(elements[0].toString(), startsWith("java.lang.Thread.getStackTrace")); + assertThat(elements[0].toString(), containsString("java.lang.Thread.getStackTrace")); assertThat(elements[1].toString(), startsWith("org.apache.hadoop.hbase.util.FutureUtils.setStackTrace")); assertThat(elements[2].toString(), diff --git a/hbase-hadoop2-compat/pom.xml b/hbase-hadoop2-compat/pom.xml index 4c79857cd19..73d314a7c36 100644 --- a/hbase-hadoop2-compat/pom.xml +++ b/hbase-hadoop2-compat/pom.xml @@ -138,6 +138,14 @@ limitations under the License. hadoop-common ${hadoop.version} + + + javax.activation + javax.activation-api + runtime + org.apache.commons commons-lang3 diff --git a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java index fa3e61319f2..2c5d0c42b6d 100644 --- a/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java +++ b/hbase-http/src/test/java/org/apache/hadoop/hbase/http/log/TestLogLevel.java @@ -480,7 +480,7 @@ public class TestLogLevel { Throwable t = throwable; while (t != null) { String msg = t.toString(); - if (msg != null && msg.contains(substr)) { + if (msg != null && msg.toLowerCase().contains(substr.toLowerCase())) { return; } t = t.getCause(); diff --git a/hbase-shaded/hbase-shaded-check-invariants/pom.xml b/hbase-shaded/hbase-shaded-check-invariants/pom.xml index 2055a0466a9..bd9b3f4139f 100644 --- a/hbase-shaded/hbase-shaded-check-invariants/pom.xml +++ b/hbase-shaded/hbase-shaded-check-invariants/pom.xml @@ -88,13 +88,6 @@ org.apache.maven.plugins maven-enforcer-plugin - - - org.codehaus.mojo - extra-enforcer-rules - ${extra.enforcer.version} - - enforce-banned-dependencies diff --git a/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/pom.xml b/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/pom.xml index 3488281eb71..2d05ee2a037 100644 --- a/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/pom.xml +++ b/hbase-shaded/hbase-shaded-with-hadoop-check-invariants/pom.xml @@ -77,13 +77,6 @@ org.apache.maven.plugins maven-enforcer-plugin - - - org.codehaus.mojo - extra-enforcer-rules - ${extra.enforcer.version} - - enforce-banned-dependencies diff --git a/pom.xml b/pom.xml index 2effd75b53c..b897a77e229 100755 --- a/pom.xml +++ b/pom.xml @@ -983,6 +983,23 @@ + + org.apache.maven.plugins + maven-enforcer-plugin + ${enforcer.version} + + + org.codehaus.mojo + extra-enforcer-rules + ${extra.enforcer.version} + + + de.skuzzle.enforcer + restrict-imports-enforcer-rule + ${restrict-imports.enforcer.version} + + + @@ -1021,20 +1038,6 @@ org.apache.maven.plugins maven-enforcer-plugin - ${enforcer.version} - - - org.codehaus.mojo - extra-enforcer-rules - ${extra.enforcer.version} - - - de.skuzzle.enforcer - restrict-imports-enforcer-rule - ${restrict-imports.enforcer.version} - - - hadoop-profile-min-maven-min-java-banned-xerces @@ -2390,10 +2393,45 @@ [1.11,) - - - - + + + --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED ${hbase-surefire.argLine} + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + hadoop3-profile-required + + enforce + + + + + + hadoop.profile + .*3\.0$ + + HBase with JDK11 requires Hadoop3. Activate the profile with `-Dhadoop.profile=3.0`. + + + HBase with JDK11 requires Hadoop3. Activate the profile with `-Dhadoop.profile=3.0`. + + + + + + + + + @@ -2866,6 +2904,16 @@ + + + javax.activation + javax.activation-api + 1.2.0 + test + org.apache.hadoop hadoop-client @@ -3208,6 +3256,15 @@ + + + javax.activation + javax.activation-api + 1.2.0 + test + org.apache.hadoop hadoop-common