From 8277fab2be3b0898ba326d15e4cb641da2ac51ce Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Wed, 13 Sep 2017 10:59:04 -0700 Subject: [PATCH] HADOOP-14857. Fix downstream shaded client integration test. Contributed by Sean Busbey. --- .../hadoop/example/ITUseMiniCluster.java | 4 +++- .../hadoop-client-minicluster/pom.xml | 21 +++++++++++++++++++ .../org/apache/hadoop/http/HttpServer2.java | 1 + pom.xml | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java b/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java index 5fcbe13c97..6022fbc688 100644 --- a/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java +++ b/hadoop-client-modules/hadoop-client-integration-tests/src/test/java/org/apache/hadoop/example/ITUseMiniCluster.java @@ -77,7 +77,9 @@ public void clusterUp() throws IOException { @After public void clusterDown() { - cluster.close(); + if (cluster != null) { + cluster.close(); + } } @Test diff --git a/hadoop-client-modules/hadoop-client-minicluster/pom.xml b/hadoop-client-modules/hadoop-client-minicluster/pom.xml index ba84e87802..681cb1c84e 100644 --- a/hadoop-client-modules/hadoop-client-minicluster/pom.xml +++ b/hadoop-client-modules/hadoop-client-minicluster/pom.xml @@ -75,6 +75,9 @@ provided --> + org.apache.hadoop hadoop-minicluster @@ -282,6 +285,12 @@ + + + org.mockito + mockito-all + true + @@ -635,6 +644,18 @@ testshell/* + + + org.mockito:mockito-all + + asm-license.txt + cglib-license.txt + hamcrest-license.txt + objenesis-license.txt + org/hamcrest/**/*.class + org/hamcrest/*.class + + diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java index 7f1362cfba..fa447d8d46 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java @@ -1218,6 +1218,7 @@ private void bindForPortRange(ServerConnector listener, int startPort) * @throws Exception */ void openListeners() throws Exception { + LOG.debug("opening listeners: {}", listeners); for (ServerConnector listener : listeners) { if (listener.getLocalPort() != -1 && listener.getLocalPort() != -2) { // This listener is either started externally or has been bound or was diff --git a/pom.xml b/pom.xml index efd75782ea..08e858514f 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs 1.5 1.7 2.4 - 2.10 + 3.0.1 3.0.0-M1 2.10.4 1.5