Skip to content

Commit

Permalink
WIP HBASE-23829 Get -PrunSmallTests passing on JDK11
Browse files Browse the repository at this point in the history
TestBackupSmallTests fails due to HADOOP-15775.
  • Loading branch information
ndimiduk committed Mar 12, 2020
1 parent 64e67fb commit 0113e49
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -69,7 +70,7 @@ public void testRecordStackTrace() throws IOException {
} 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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ private static void exceptionShouldContains(String substr, Throwable throwable)
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();
Expand Down
7 changes: 0 additions & 7 deletions hbase-shaded/hbase-shaded-check-invariants/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>${extra.enforcer.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>${extra.enforcer.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
Expand Down
74 changes: 56 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${enforcer.version}</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>${extra.enforcer.version}</version>
</dependency>
<dependency>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<version>${restrict-imports.enforcer.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -1022,20 +1039,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${enforcer.version}</version>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>${extra.enforcer.version}</version>
</dependency>
<dependency>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<version>${restrict-imports.enforcer.version}</version>
</dependency>
</dependencies>
<!-- version set by parent -->
<executions>
<execution>
<id>hadoop-profile-min-maven-min-java-banned-xerces</id>
Expand Down Expand Up @@ -2410,10 +2413,45 @@
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencyManagement>
<dependencies>
</dependencies>
</dependencyManagement>
<properties>
<!-- TODO: replicate logic for windows support -->
<argLine>--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED ${hbase-surefire.argLine}</argLine>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>hadoop3-profile-required</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<!--
$ JAVA_HOME=... mvn -Dhadoop.profile=3.0 -PrunSmallTests help:active-profiles enforcer:display-info clean test
enforcer plugin does not see active profiles on sub-modules, so enforce based
on the presence of the activation property and value.
-->
<property>hadoop.profile</property>
<regex>.*3\.0$</regex>
<message>
HBase with JDK11 requires Hadoop3. Activate the profile with `-Dhadoop.version=3.0`.
</message>
<regexMessage>
HBase with JDK11 requires Hadoop3. Activate the profile with `-Dhadoop.version=3.0`.
</regexMessage>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- profile activated by the Jenkins patch testing job -->
<profile>
Expand Down

0 comments on commit 0113e49

Please sign in to comment.