This is an automated email from the ASF dual-hosted git repository.

jonathanhurley pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0e97706  [AMBARI-25059] SPI Upgrade Improvements For Web Calls And 
Required Plugins (#2737)
0e97706 is described below

commit 0e97706c7b5b4f9b43d9bee961ce7b4a735eb638
Author: Jonathan Hurley <[email protected]>
AuthorDate: Fri Dec 21 09:08:33 2018 -0500

    [AMBARI-25059] SPI Upgrade Improvements For Web Calls And Required Plugins 
(#2737)
---
 ambari-agent/pom.xml                               |  1 +
 ambari-project/pom.xml                             |  2 +-
 .../ambari/spi/net/HttpURLConnectionProvider.java  | 46 +++++++++++++++
 .../org/apache/ambari/spi/net/package-info.java    | 21 +++++++
 .../ambari/spi/upgrade/UpgradeCheckRequest.java    | 21 ++++++-
 .../ambari/server/checks/UpgradeCheckRegistry.java | 69 ++++++++++++++++++++--
 .../internal/PreUpgradeCheckResourceProvider.java  |  4 +-
 .../controller/internal/URLStreamProvider.java     | 46 +++++++++++++--
 .../server/orm/entities/ClusterConfigEntity.java   |  4 +-
 .../entities/HostComponentDesiredStateEntity.java  |  3 +-
 .../orm/entities/HostComponentStateEntity.java     |  4 +-
 .../server/orm/entities/UpgradeHistoryEntity.java  |  3 +-
 .../upgrades/FinalizeUpgradeAction.java            |  3 +-
 .../apache/ambari/server/stack/StackDirectory.java |  2 +-
 .../stack/upgrade/ConfigurationCondition.java      |  4 +-
 .../ambari/server/stack/upgrade/Grouping.java      |  4 +-
 .../ambari/server/stack/upgrade/HostOrderItem.java |  4 +-
 .../org/apache/ambari/server/state/StackInfo.java  |  7 ++-
 .../ambari/server/upgrade/UpgradeCatalog270.java   |  2 +-
 .../AmbariMetricsHadoopSinkVersionCheckTest.java   |  4 +-
 .../server/checks/AutoStartDisabledCheckTest.java  |  8 +--
 .../ambari/server/checks/ClusterCheckTest.java     |  4 +-
 .../checks/ComponentExistsInRepoCheckTest.java     |  2 +-
 .../checks/ComponentsInstallationCheckTest.java    |  2 +-
 .../server/checks/ConfigurationMergeCheckTest.java |  2 +-
 .../ambari/server/checks/HealthCheckTest.java      |  4 +-
 .../checks/HostMaintenanceModeCheckTest.java       |  6 +-
 .../server/checks/HostsHeartbeatCheckTest.java     |  2 +-
 .../checks/HostsMasterMaintenanceCheckTest.java    |  2 +-
 .../checks/HostsRepositoryVersionCheckTest.java    |  6 +-
 .../server/checks/InstallPackagesCheckTest.java    |  2 +-
 .../KerberosAdminPersistedCredentialCheckTest.java |  2 +-
 .../apache/ambari/server/checks/LZOCheckTest.java  |  2 +-
 .../checks/MissingOsInRepoVersionCheckTest.java    |  2 +-
 .../server/checks/PluginChecksLoadedCheckTest.java |  4 +-
 .../checks/PreviousUpgradeCompletedTest.java       |  2 +-
 .../RequiredServicesInRepositoryCheckTest.java     |  4 +-
 .../checks/ServiceCheckValidityCheckTest.java      | 10 ++--
 .../server/checks/ServicePresenceCheckTest.java    | 14 ++---
 .../checks/ServicesMaintenanceModeCheckTest.java   |  2 +-
 .../ambari/server/checks/ServicesUpCheckTest.java  |  2 +-
 .../checks/UpgradeTypeQualificationTest.java       |  4 +-
 .../server/checks/VersionMismatchCheckTest.java    |  4 +-
 .../PreUpgradeCheckResourceProviderTest.java       | 29 ++++++++-
 .../upgrades/PluginUpgradeServerActionTest.java    |  3 +-
 .../ambari/server/state/CheckHelperTest.java       | 12 ++--
 46 files changed, 303 insertions(+), 87 deletions(-)

diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 9389ac3..7321f16 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -90,6 +90,7 @@
     <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
+      <version>18.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.hadoop</groupId>
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 96fb7cc..33e5375 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -291,7 +291,7 @@
       <dependency>
         <groupId>com.google.guava</groupId>
         <artifactId>guava</artifactId>
-        <version>18.0</version>
+        <version>24.1.1-jre</version>
       </dependency>
       <dependency>
         <groupId>com.google.code.findbugs</groupId>
diff --git 
a/ambari-server-spi/src/main/java/org/apache/ambari/spi/net/HttpURLConnectionProvider.java
 
b/ambari-server-spi/src/main/java/org/apache/ambari/spi/net/HttpURLConnectionProvider.java
new file mode 100644
index 0000000..b982025
--- /dev/null
+++ 
b/ambari-server-spi/src/main/java/org/apache/ambari/spi/net/HttpURLConnectionProvider.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.spi.net;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The {@link HttpURLConnectionProvider} is used as a way to provide
+ * {@link HttpURLConnection} instances which are backed by Ambari's truststore,
+ * cookie store, and timeout configurations.
+ */
+public interface HttpURLConnectionProvider {
+
+  /**
+   * Gets a {@link HttpURLConnection} which is initialized and ready to read.
+   *
+   * @param url
+   *          the URL to retrieve information from.
+   * @param headers
+   *          the HTTP headers to use in the request.
+   *
+   * @return an iniitalized HTTP connection which is ready to read.
+   * @throws IOException
+   *           if the URL could not be opened.
+   */
+  HttpURLConnection getConnection(String url, Map<String, List<String>> 
headers) throws IOException;
+
+}
diff --git 
a/ambari-server-spi/src/main/java/org/apache/ambari/spi/net/package-info.java 
b/ambari-server-spi/src/main/java/org/apache/ambari/spi/net/package-info.java
new file mode 100644
index 0000000..be24533
--- /dev/null
+++ 
b/ambari-server-spi/src/main/java/org/apache/ambari/spi/net/package-info.java
@@ -0,0 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+
+/**
+ * Provides classes for working with network connections and streaming.
+ */
+package org.apache.ambari.spi.net;
\ No newline at end of file
diff --git 
a/ambari-server-spi/src/main/java/org/apache/ambari/spi/upgrade/UpgradeCheckRequest.java
 
b/ambari-server-spi/src/main/java/org/apache/ambari/spi/upgrade/UpgradeCheckRequest.java
index 62e7673..ce3b87f 100644
--- 
a/ambari-server-spi/src/main/java/org/apache/ambari/spi/upgrade/UpgradeCheckRequest.java
+++ 
b/ambari-server-spi/src/main/java/org/apache/ambari/spi/upgrade/UpgradeCheckRequest.java
@@ -17,11 +17,13 @@
  */
 package org.apache.ambari.spi.upgrade;
 
+import java.net.HttpURLConnection;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.ambari.spi.ClusterInformation;
 import org.apache.ambari.spi.RepositoryVersion;
+import org.apache.ambari.spi.net.HttpURLConnectionProvider;
 
 /**
  * Represents a request to run the upgrade checks before an upgrade begins.
@@ -32,6 +34,7 @@ public class UpgradeCheckRequest {
   private boolean m_revert = false;
   private final RepositoryVersion m_targetRepositoryVersion;
   private final Map<String,String> m_checkConfigurations;
+  private final HttpURLConnectionProvider m_httpURLConnectionProvider;
 
   /**
    * Used for tracking results during a check request.
@@ -51,13 +54,19 @@ public class UpgradeCheckRequest {
    * @param checkConfigurations
    *          any configurations specified in the upgrade pack which can be 
used
    *          to when
+   * @param httpURLConnectionProvider
+   *          provides a mechanism for an {@link UpgradeCheck} to make URL
+   *          requests while using Ambari's truststore and configured stream
+   *          timeout settings.
    */
   public UpgradeCheckRequest(ClusterInformation clusterInformation, 
UpgradeType upgradeType,
-      RepositoryVersion targetRepositoryVersion, Map<String,String> 
checkConfigurations) {
+      RepositoryVersion targetRepositoryVersion, Map<String, String> 
checkConfigurations,
+      HttpURLConnectionProvider httpURLConnectionProvider) {
     m_clusterInformation = clusterInformation;
     m_upgradeType = upgradeType;
     m_targetRepositoryVersion = targetRepositoryVersion;
     m_checkConfigurations = checkConfigurations;
+    m_httpURLConnectionProvider = httpURLConnectionProvider;
   }
 
   /**
@@ -133,4 +142,14 @@ public class UpgradeCheckRequest {
   public UpgradeCheckStatus getResult(UpgradeCheckDescription description) {
     return m_results.get(description);
   }
+
+  /**
+   * Gets a class which can construct {@link HttpURLConnection} instances which
+   * are backed by Ambari's cookie store, truststore, and timeout settings.
+   *
+   * @return the httpURLConnectionProvider an instance of the provider.
+   */
+  public HttpURLConnectionProvider getHttpURLConnectionProvider() {
+    return m_httpURLConnectionProvider;
+  }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
index 2e36f36..35dc749 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
@@ -17,10 +17,13 @@
  */
 package org.apache.ambari.server.checks;
 
+import java.net.URL;
+import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -41,6 +44,10 @@ import org.apache.ambari.spi.upgrade.UpgradeCheckGroup;
 import org.apache.ambari.spi.upgrade.UpgradeType;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
+import org.reflections.Reflections;
+import org.reflections.scanners.SubTypesScanner;
+import org.reflections.scanners.TypeAnnotationsScanner;
+import org.reflections.util.ConfigurationBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -171,7 +178,18 @@ public class UpgradeCheckRegistry {
 
   /**
    * Uses the library classloader from the the target stack in order to find 
any
-   * plugin-in {@link UpgradeCheck}s which are declared in the upgrade pack.
+   * plugin-in {@link UpgradeCheck}s which are declared in the upgrade pack as
+   * well as any upgrade checks which are found in the classloader and marked 
as
+   * {@link UpgradeCheckInfo#required()} for this {@link UpgradeType}.
+   * <p/>
+   * This method uses a {@link Reflections} instance which has been created
+   * using only the {@link URL}s which the stack library is comprised of. This
+   * means that scanning the path for {@link UpgradeCheck} instances is quick.
+   * However, this also means that the {@link ClassLoader} is unable to load
+   * classes which are defined in the stack but ship with Ambari's
+   * {@link ClassLoader}. For this reason, we must use a different
+   * {@link ClassLoader} for loading explicitly defined classes versus those
+   * which are discovered by {@link Reflections}.
    *
    * @param upgradePack
    *          the upgrade pack which defines the upgrade check classes.
@@ -180,15 +198,19 @@ public class UpgradeCheckRegistry {
    */
   private void loadPluginUpgradeChecksFromStack(UpgradePack upgradePack,
       PluginUpgradeChecks pluginChecks) throws AmbariException {
-    List<String> pluginCheckClassNames = upgradePack.getPrerequisiteChecks();
+    Set<String> pluginCheckClassNames = new 
HashSet<>(upgradePack.getPrerequisiteChecks());
     StackId ownerStackId = upgradePack.getOwnerStackId();
     StackInfo stackInfo = metainfoProvider.get().getStack(ownerStackId);
 
-    ClassLoader classLoader = stackInfo.getLibraryClassLoader();
+    URLClassLoader classLoader = stackInfo.getLibraryClassLoader();
     if (null != classLoader) {
+
+      // first find all of the plugins which are explicitely defined in the
+      // upgrade pack and attempt to load and register them
       for (String pluginCheckClassName : pluginCheckClassNames) {
         try {
-          UpgradeCheck upgradeCheck = stackInfo.getLibraryInstance(m_injector, 
pluginCheckClassName);
+          UpgradeCheck upgradeCheck = stackInfo.getLibraryInstance(m_injector,
+              pluginCheckClassName);
 
           pluginChecks.m_loadedChecks.add(upgradeCheck);
 
@@ -200,10 +222,47 @@ public class UpgradeCheckRegistry {
           pluginChecks.m_failedChecks.add(pluginCheckClassName);
         }
       }
+
+      // next find all plugin checks which are required for this upgrade type 
by
+      // scanning just the classes shipped with the stack's library JAR
+      Reflections reflections = new Reflections(
+          new ConfigurationBuilder()
+            .addClassLoader(classLoader)
+            .addUrls(classLoader.getURLs())
+            .setScanners(new SubTypesScanner(),new TypeAnnotationsScanner()));
+
+      Set<Class<? extends UpgradeCheck>> upgradeChecksFromLoader = 
reflections.getSubTypesOf(
+          UpgradeCheck.class);
+
+      if(null != upgradeChecksFromLoader && 
!upgradeChecksFromLoader.isEmpty()) {
+        for (Class<? extends UpgradeCheck> clazz : upgradeChecksFromLoader) {
+          // first check to make sure we didn't already try to load this one 
if it
+          // was explicitely defined in the upgrade pack (from above)
+          if (pluginCheckClassNames.contains(clazz.getName())) {
+            continue;
+          }
+
+          // see if this check required by inspecting the annotation
+          UpgradeCheckInfo upgradeCheckInfo = 
clazz.getAnnotation(UpgradeCheckInfo.class);
+          if (null != upgradeCheckInfo && 
ArrayUtils.contains(upgradeCheckInfo.required(), upgradePack.getType())) {
+            // if the annotation says the check is required, then load it
+            try {
+              pluginChecks.m_loadedChecks.add(clazz.newInstance());
+
+              LOG.info("Registered pre-upgrade check {} for stack {}", clazz, 
ownerStackId);
+            } catch (Exception exception) {
+              LOG.error("Unable to load the upgrade check {}", clazz, 
exception);
+
+              // keep track of the failed check
+              pluginChecks.m_failedChecks.add(clazz.getName());
+            }
+          }
+        }
+      }
     } else {
       LOG.error(
           "Unable to perform the following upgrade checks because no libraries 
could be loaded for the {} stack: {}",
-          ownerStackId, StringUtils.join(pluginCheckClassNames, ","));
+          ownerStackId, StringUtils.join(pluginCheckClassNames, ", "));
 
       pluginChecks.m_failedChecks.addAll(pluginCheckClassNames);
     }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
index 412730e..fea91bc 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
@@ -28,6 +28,7 @@ import org.apache.ambari.server.StaticallyInject;
 import org.apache.ambari.server.checks.UpgradeCheckRegistry;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariManagementController;
+import 
org.apache.ambari.server.controller.internal.URLStreamProvider.AmbariHttpUrlConnectionProvider;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.NoSuchResourceException;
 import org.apache.ambari.server.controller.spi.Predicate;
@@ -215,7 +216,8 @@ public class PreUpgradeCheckResourceProvider extends 
ReadOnlyResourceProvider {
 
       final UpgradeCheckRequest upgradeCheckRequest = new 
UpgradeCheckRequest(clusterInformation,
           upgradeType, targetRepositoryVersion,
-          upgradePack.getPrerequisiteCheckConfig().getAllProperties());
+          upgradePack.getPrerequisiteCheckConfig().getAllProperties(),
+          new AmbariHttpUrlConnectionProvider());
 
       if (propertyMap.containsKey(UPGRADE_CHECK_FOR_REVERT_PROPERTY_ID)) {
         Boolean forRevert = 
BooleanUtils.toBooleanObject(propertyMap.get(UPGRADE_CHECK_FOR_REVERT_PROPERTY_ID).toString());
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
index d1e9349..765b93e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java
@@ -37,6 +37,8 @@ import javax.net.ssl.TrustManagerFactory;
 
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
 import org.apache.ambari.server.controller.utilities.StreamProvider;
+import org.apache.ambari.server.proxy.ProxyService;
+import org.apache.ambari.spi.net.HttpURLConnectionProvider;
 import org.apache.commons.io.IOUtils;
 import org.apache.http.HttpStatus;
 import org.slf4j.Logger;
@@ -93,20 +95,20 @@ public class URLStreamProvider implements StreamProvider {
   public URLStreamProvider(int connectionTimeout, int readTimeout, String 
trustStorePath,
                            String trustStorePassword, String trustStoreType) {
 
-    this.connTimeout        = connectionTimeout;
+    connTimeout        = connectionTimeout;
     this.readTimeout        = readTimeout;
     this.trustStorePath     = trustStorePath;
     this.trustStorePassword = trustStorePassword;
     this.trustStoreType     = trustStoreType;
-    this.setupTruststoreForHttps = true;
+    setupTruststoreForHttps = true;
   }
 
   public void setSetupTruststoreForHttps(boolean setupTruststoreForHttps) {
     this.setupTruststoreForHttps = setupTruststoreForHttps;
   }
-  
+
   public boolean getSetupTruststoreForHttps() {
-    return this.setupTruststoreForHttps;
+    return setupTruststoreForHttps;
   }
 
   // ----- StreamProvider ----------------------------------------------------
@@ -178,7 +180,7 @@ public class URLStreamProvider implements StreamProvider {
       LOG.debug("readFrom spec:{}", spec);
     }
 
-    HttpURLConnection connection = (spec.startsWith("https") && 
this.setupTruststoreForHttps) ?
+    HttpURLConnection connection = (spec.startsWith("https") && 
setupTruststoreForHttps) ?
             getSSLConnection(spec) : getConnection(spec);
 
     AppCookieManager appCookieManager = getAppCookieManager();
@@ -323,7 +325,39 @@ public class URLStreamProvider implements StreamProvider {
         .openConnection());
 
     connection.setSSLSocketFactory(sslSocketFactory);
- 
+
     return connection;
   }
+
+  /**
+   * A default implementation of {@link HttpURLConnectionProvider}, this class
+   * will use the {@link URLStreamProvider} in order to provide an
+   * {@link HttpURLConnection} which is able to use Ambari's cookie store,
+   * truststore, and timeout values.
+   */
+  public static final class AmbariHttpUrlConnectionProvider implements 
HttpURLConnectionProvider {
+
+    /**
+     * The stream provider.
+     */
+    private final URLStreamProvider m_streamProvider;
+
+    /**
+     * Constructor.
+     *
+     */
+    public AmbariHttpUrlConnectionProvider() {
+      m_streamProvider = new 
URLStreamProvider(ProxyService.URL_CONNECT_TIMEOUT,
+          ProxyService.URL_READ_TIMEOUT, ComponentSSLConfiguration.instance());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public HttpURLConnection getConnection(String url, Map<String, 
List<String>> headers)
+        throws IOException {
+      return m_streamProvider.processURL(url, "GET", (InputStream) null, 
headers);
+    }
+  }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
index 287ee89..23f916c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
@@ -42,6 +42,8 @@ import javax.persistence.UniqueConstraint;
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 
+import com.google.common.base.MoreObjects;
+
 @Entity
 @Table(name = "clusterconfig",
   uniqueConstraints = {@UniqueConstraint(name = "UQ_config_type_tag", 
columnNames = {"cluster_id", "type_name", "version_tag"}),
@@ -303,7 +305,7 @@ public class ClusterConfigEntity {
    */
   @Override
   public String toString() {
-    return com.google.common.base.Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
       .add("clusterId", clusterId)
       .add("type", type)
       .add("version", version)
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
index 3a2506d..eba273f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
@@ -41,6 +41,7 @@ import org.apache.ambari.server.state.HostComponentAdminState;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.State;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 
 
@@ -278,7 +279,7 @@ public class HostComponentDesiredStateEntity {
    */
   @Override
   public String toString() {
-    return Objects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
+    return MoreObjects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
         componentName).add("hostId", hostId).add("desiredState", 
desiredState).toString();
   }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
index 0d295a4..dacaa55 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
@@ -36,7 +36,7 @@ import javax.persistence.TableGenerator;
 import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.UpgradeState;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 
 @Entity
 @Table(name = "hostcomponentstate")
@@ -260,7 +260,7 @@ public class HostComponentStateEntity {
    */
   @Override
   public String toString() {
-    return Objects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
+    return MoreObjects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
         componentName).add("hostId", hostId).add("state", 
currentState).toString();
   }
 
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
index 0f7ac72..d1c9324 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
@@ -32,6 +32,7 @@ import javax.persistence.UniqueConstraint;
 
 import org.apache.commons.lang.builder.EqualsBuilder;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 
 /**
@@ -222,7 +223,7 @@ public class UpgradeHistoryEntity {
    */
   @Override
   public String toString() {
-    return Objects.toStringHelper(this)
+    return MoreObjects.toStringHelper(this)
         .add("id", id)
         .add("upgradeId", upgradeId)
         .add("serviceName", serviceName)
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
index 67c0be9..2b30282 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
@@ -59,6 +59,7 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.text.StrBuilder;
 
+import com.google.common.base.MoreObjects;
 import com.google.inject.Inject;
 
 /**
@@ -552,7 +553,7 @@ public class FinalizeUpgradeAction extends 
AbstractUpgradeServerAction {
      */
     @Override
     public String toString() {
-      return com.google.common.base.Objects.toStringHelper(this)
+      return MoreObjects.toStringHelper(this)
           .add("host", hostName)
           .add("component", componentName)
           .add("current", currentVersion)
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
index 89eec37..5b1a6bc 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
@@ -303,7 +303,7 @@ public class StackDirectory extends 
StackDefinitionDirectory {
    * @return the class loader for 3rd party JARs supplied by the stack or
    *         {@code null} if there are no libraries for this stack.
    */
-  public @Nullable ClassLoader getLibraryClassLoader() {
+  public @Nullable URLClassLoader getLibraryClassLoader() {
     return libraryClassLoader;
   }
 
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ConfigurationCondition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ConfigurationCondition.java
index 4e59100..fafd5e7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ConfigurationCondition.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ConfigurationCondition.java
@@ -31,7 +31,7 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Config;
 import org.apache.commons.lang.StringUtils;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 
 /**
  * The {@link ConfigurationCondition} class is used to represent a condition on
@@ -119,7 +119,7 @@ public final class ConfigurationCondition extends Condition 
{
    */
   @Override
   public String toString() {
-    return Objects.toStringHelper(this).add("type", type).add("property", 
property).add("value",
+    return MoreObjects.toStringHelper(this).add("type", type).add("property", 
property).add("value",
         value).add("comparison", comparisonType).omitNullValues().toString();
   }
 
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/Grouping.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/Grouping.java
index b2c02a6..dbc9f3b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/Grouping.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/Grouping.java
@@ -42,7 +42,7 @@ import 
org.apache.ambari.server.stack.upgrade.orchestrate.UpgradeContext;
 import org.apache.ambari.server.utils.SetUtils;
 import org.apache.commons.lang.StringUtils;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 
 /**
  *
@@ -417,6 +417,6 @@ public class Grouping {
    */
   @Override
   public String toString() {
-    return Objects.toStringHelper(this).add("name", name).toString();
+    return MoreObjects.toStringHelper(this).add("name", name).toString();
   }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderItem.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderItem.java
index 8fe361f..87557e7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderItem.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderItem.java
@@ -22,7 +22,7 @@ import java.util.List;
 import org.apache.ambari.spi.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 
 /**
  * The {@link HostOrderItem} class represents the orchestration order of hosts
@@ -96,7 +96,7 @@ public class HostOrderItem {
    */
   @Override
   public String toString() {
-    return Objects.toStringHelper(this).add("type", m_type).add("items",
+    return MoreObjects.toStringHelper(this).add("type", m_type).add("items",
         StringUtils.join(m_actionItems, ", ")).omitNullValues().toString();
   }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
index 99b2d3b..6b55e66 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
@@ -19,6 +19,7 @@
 package org.apache.ambari.server.state;
 
 import java.io.File;
+import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -91,7 +92,7 @@ public class StackInfo implements Comparable<StackInfo>, 
Validable {
    * A {@link ClassLoader} for any JARs discovered in the stack's library
    * folder.
    */
-  private ClassLoader libraryClassLoader = null;
+  private URLClassLoader libraryClassLoader = null;
 
   /**
    * List of services removed from current stack
@@ -673,7 +674,7 @@ public class StackInfo implements Comparable<StackInfo>, 
Validable {
    * @return the class loader for 3rd party JARs supplied by the stack or
    *         {@code null} if there are no libraries for this stack.
    */
-  public @Nullable ClassLoader getLibraryClassLoader() {
+  public @Nullable URLClassLoader getLibraryClassLoader() {
     return libraryClassLoader;
   }
 
@@ -684,7 +685,7 @@ public class StackInfo implements Comparable<StackInfo>, 
Validable {
    * @param libraryClassLoader
    *          the class loader.
    */
-  public void setLibraryClassLoader(ClassLoader libraryClassLoader) {
+  public void setLibraryClassLoader(URLClassLoader libraryClassLoader) {
     this.libraryClassLoader = libraryClassLoader;
   }
 
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
index 6ba4ce2..b8fa5c3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
@@ -1662,7 +1662,7 @@ public class UpgradeCatalog270 extends 
AbstractUpgradeCatalog {
           final HostAndPort hostAndPort = 
HostAndPort.fromString(propertyValue);
           AmbariServerConfigurationKey keyToBesaved = 
AmbariServerConfigurationKey.SERVER_HOST == key ? 
AmbariServerConfigurationKey.SERVER_HOST
               : AmbariServerConfigurationKey.SECONDARY_SERVER_HOST;
-          populateConfigurationToBeMoved(propertiesToBeMoved, oldPropertyName, 
keyToBesaved, hostAndPort.getHostText());
+          populateConfigurationToBeMoved(propertiesToBeMoved, oldPropertyName, 
keyToBesaved, hostAndPort.getHost());
 
           keyToBesaved = AmbariServerConfigurationKey.SERVER_HOST == key ? 
AmbariServerConfigurationKey.SERVER_PORT : 
AmbariServerConfigurationKey.SECONDARY_SERVER_PORT;
           populateConfigurationToBeMoved(propertiesToBeMoved, oldPropertyName, 
keyToBesaved, String.valueOf(hostAndPort.getPort()));
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCheckTest.java
index b41ff29..ef2e423 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCheckTest.java
@@ -206,7 +206,7 @@ public class AmbariMetricsHadoopSinkVersionCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("c1", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult check = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
@@ -265,7 +265,7 @@ public class AmbariMetricsHadoopSinkVersionCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("c1", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult check = m_check.perform(request);
 
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/AutoStartDisabledCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/AutoStartDisabledCheckTest.java
index 8f55d5b..9ce6780 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/AutoStartDisabledCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/AutoStartDisabledCheckTest.java
@@ -98,7 +98,7 @@ public class AutoStartDisabledCheckTest {
   @Test
   public void testIsApplicable() throws Exception {
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, m_configMap);
+        repositoryVersion, m_configMap, null);
 
     CheckHelper checkHelper = new CheckHelper();
     List<UpgradeCheck> applicableChecks = 
checkHelper.getApplicableChecks(request,
@@ -110,7 +110,7 @@ public class AutoStartDisabledCheckTest {
   @Test
   public void testNoAutoStart() throws Exception {
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, null);
+        repositoryVersion, null, null);
 
     UpgradeCheckResult check = m_check.perform(request);
 
@@ -121,7 +121,7 @@ public class AutoStartDisabledCheckTest {
   @Test
   public void testAutoStartFalse() throws Exception {
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, null);
+        repositoryVersion, null, null);
 
     m_configMap.put(AutoStartDisabledCheck.RECOVERY_ENABLED_KEY, "false");
 
@@ -134,7 +134,7 @@ public class AutoStartDisabledCheckTest {
   @Test
   public void testAutoStartTrue() throws Exception {
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, null);
+        repositoryVersion, null, null);
 
     m_configMap.put(AutoStartDisabledCheck.RECOVERY_ENABLED_KEY, "true");
     m_configMap.put(AutoStartDisabledCheck.RECOVERY_TYPE_KEY, 
AutoStartDisabledCheck.RECOVERY_AUTO_START);
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ClusterCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ClusterCheckTest.java
index c0fc842..316d377 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ClusterCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ClusterCheckTest.java
@@ -172,7 +172,7 @@ public class ClusterCheckTest extends EasyMockSupport {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(clusterName, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, null);
+        repositoryVersion, null, null);
 
     // case, where we need at least one service to be present
     check.setApplicableServices(oneServiceList);
@@ -249,7 +249,7 @@ public class ClusterCheckTest extends EasyMockSupport {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(clusterName, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, null);
+        repositoryVersion, null, null);
 
     // since the check is for SERVICE2, it should not match even though its
     // installed since the repository is only for SERVICE1
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentExistsInRepoCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentExistsInRepoCheckTest.java
index 2fb3275..494fde2 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentExistsInRepoCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentExistsInRepoCheckTest.java
@@ -76,7 +76,7 @@ public class ComponentExistsInRepoCheckTest extends 
EasyMockSupport {
     
expect(cluster.getCurrentStackVersion()).andReturn(sourceStackId).anyTimes();
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    request = new UpgradeCheckRequest(clusterInformation, UpgradeType.ROLLING, 
repoVersion(), null);
+    request = new UpgradeCheckRequest(clusterInformation, UpgradeType.ROLLING, 
repoVersion(), null, null);
   }
 
   @Test
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentsInstallationCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentsInstallationCheckTest.java
index 7e0c4f7..f029e00 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentsInstallationCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ComponentsInstallationCheckTest.java
@@ -311,7 +311,7 @@ public class ComponentsInstallationCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     Mockito.when(hcsTezClient.getCurrentState()).thenReturn(State.INSTALLED);
 
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
index 97d12a0..206bdea 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ConfigurationMergeCheckTest.java
@@ -165,7 +165,7 @@ public class ConfigurationMergeCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = cmc.perform(request);
     Assert.assertEquals("Expect no warnings", 0, check.getFailedOn().size());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
index 7a9151a..4cfed34 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HealthCheckTest.java
@@ -82,7 +82,7 @@ public class HealthCheckTest {
     
when(alertsDAO.findCurrentByCluster(eq(CLUSTER_ID))).thenReturn(Collections.emptyList());
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult result = healthCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, result.getStatus());
@@ -115,7 +115,7 @@ public class HealthCheckTest {
     
when(alertsDAO.findCurrentByCluster(eq(CLUSTER_ID))).thenReturn(asList(alertCurrentEntity));
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult result = healthCheck.perform(request);
 
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostMaintenanceModeCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostMaintenanceModeCheckTest.java
index 7bc28a4..07cec84 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostMaintenanceModeCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostMaintenanceModeCheckTest.java
@@ -77,7 +77,7 @@ public class HostMaintenanceModeCheckTest {
     Mockito.when(cluster.getHosts()).thenReturn(hosts);
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult check = hostMaintenanceModeCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
@@ -123,7 +123,7 @@ public class HostMaintenanceModeCheckTest {
     Mockito.when(cluster.getHosts()).thenReturn(hosts);
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult check = hostMaintenanceModeCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
@@ -132,7 +132,7 @@ public class HostMaintenanceModeCheckTest {
     // put a host into MM in order to trigger the warning
     
Mockito.when(host3.getMaintenanceState(1L)).thenReturn(MaintenanceState.ON);
 
-    request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.HOST_ORDERED, null, null);
+    request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.HOST_ORDERED, null, null, null);
     check = hostMaintenanceModeCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, check.getStatus());
     Assert.assertFalse(check.getFailedDetail().isEmpty());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsHeartbeatCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsHeartbeatCheckTest.java
index 9ca3ca1..d98da91 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsHeartbeatCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsHeartbeatCheckTest.java
@@ -107,7 +107,7 @@ public class HostsHeartbeatCheckTest {
     Mockito.when(cluster.getHosts()).thenReturn(hosts);
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult check = hostHeartbeatCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, check.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
index 5e09487..54bbbed 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
@@ -127,7 +127,7 @@ public class HostsMasterMaintenanceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest checkRequest = new 
UpgradeCheckRequest(clusterInformation,
-        UpgradeType.ROLLING, m_repositoryVersion, null);
+        UpgradeType.ROLLING, m_repositoryVersion, null, null);
 
     UpgradeCheckResult result = 
hostsMasterMaintenanceCheck.perform(checkRequest);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
index a74b282..e7639de 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
@@ -159,7 +159,7 @@ public class HostsRepositoryVersionCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = hostsRepositoryVersionCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, check.getStatus());
@@ -247,7 +247,7 @@ public class HostsRepositoryVersionCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = hostsRepositoryVersionCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
@@ -309,7 +309,7 @@ public class HostsRepositoryVersionCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = hostsRepositoryVersionCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/InstallPackagesCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/InstallPackagesCheckTest.java
index dd024dd..1b4927e 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/InstallPackagesCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/InstallPackagesCheckTest.java
@@ -159,7 +159,7 @@ public class InstallPackagesCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     // Case 1. Initialize with good values
     UpgradeCheckResult check = installPackagesCheck.perform(request);
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/KerberosAdminPersistedCredentialCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/KerberosAdminPersistedCredentialCheckTest.java
index 59ecc83..dfcad29 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/KerberosAdminPersistedCredentialCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/KerberosAdminPersistedCredentialCheckTest.java
@@ -159,7 +159,7 @@ public class KerberosAdminPersistedCredentialCheckTest 
extends EasyMockSupport {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(clusterName, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, checkProperties);
+        repositoryVersion, checkProperties, null);
 
     expect(upgradeHelper.suggestUpgradePack(eq(clusterName), anyObject(), 
anyObject(), eq(Direction.UPGRADE), eq(UpgradeType.ROLLING), anyObject()))
       .andReturn(upgradePackWithRegenKeytab()).anyTimes();
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
index a39974b..bbf1f1c 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
@@ -97,7 +97,7 @@ public class LZOCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult result = lZOCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, result.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheckTest.java
index b30235f..6d3703ee 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheckTest.java
@@ -146,7 +146,7 @@ public class MissingOsInRepoVersionCheckTest extends 
EasyMockSupport {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        repositoryVersion, null);
+        repositoryVersion, null, null);
 
     return request;
   }
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/PluginChecksLoadedCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/PluginChecksLoadedCheckTest.java
index 980d6c1..0214305 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/PluginChecksLoadedCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/PluginChecksLoadedCheckTest.java
@@ -69,7 +69,7 @@ public class PluginChecksLoadedCheckTest extends 
EasyMockSupport {
 
     replayAll();
 
-    UpgradeCheckRequest request = new UpgradeCheckRequest(null, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(null, 
UpgradeType.ROLLING, null, null, null);
     UpgradeCheckResult check = m_check.perform(request);
 
     Assert.assertEquals(UpgradeCheckStatus.WARNING, check.getStatus());
@@ -90,7 +90,7 @@ public class PluginChecksLoadedCheckTest extends 
EasyMockSupport {
         new HashSet<>()).atLeastOnce();
     replayAll();
 
-    UpgradeCheckRequest request = new UpgradeCheckRequest(null, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(null, 
UpgradeType.ROLLING, null, null, null);
     UpgradeCheckResult check = m_check.perform(request);
 
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/PreviousUpgradeCompletedTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/PreviousUpgradeCompletedTest.java
index dc55025..64143af 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/PreviousUpgradeCompletedTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/PreviousUpgradeCompletedTest.java
@@ -74,7 +74,7 @@ public class PreviousUpgradeCompletedTest {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(clusterName, false, null, null, null);
     checkRequest = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        null, null);
+        null, null, null);
 
     puc.clustersProvider = new Provider<Clusters>() {
       @Override
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/RequiredServicesInRepositoryCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/RequiredServicesInRepositoryCheckTest.java
index 2469248..4b46181 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/RequiredServicesInRepositoryCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/RequiredServicesInRepositoryCheckTest.java
@@ -122,7 +122,7 @@ public class RequiredServicesInRepositoryCheckTest {
   public void testNoMissingServices() throws Exception {
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = m_requiredServicesCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
@@ -140,7 +140,7 @@ public class RequiredServicesInRepositoryCheckTest {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = m_requiredServicesCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, check.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
index 918e1ba..a9facc6 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
@@ -144,7 +144,7 @@ public class ServiceCheckValidityCheckTest {
     
when(hostRoleCommandDAO.getLatestServiceChecksByRole(any(Long.class))).thenReturn(asList(lastServiceCheckDTO1,
 lastServiceCheckDTO2));
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     try {
       UpgradeCheckResult result = serviceCheckValidityCheck.perform(request);
@@ -172,7 +172,7 @@ public class ServiceCheckValidityCheckTest {
     
when(hostRoleCommandDAO.getLatestServiceChecksByRole(any(Long.class))).thenReturn(singletonList(lastServiceCheckDTO));
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult result =  serviceCheckValidityCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -195,7 +195,7 @@ public class ServiceCheckValidityCheckTest {
     
when(hostRoleCommandDAO.getLatestServiceChecksByRole(any(Long.class))).thenReturn(Collections.<LastServiceCheckDTO>emptyList());
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult result =  serviceCheckValidityCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -220,7 +220,7 @@ public class ServiceCheckValidityCheckTest {
     
when(hostRoleCommandDAO.getLatestServiceChecksByRole(any(Long.class))).thenReturn(asList(lastServiceCheckDTO1,
 lastServiceCheckDTO2));
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult result =  serviceCheckValidityCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -258,7 +258,7 @@ public class ServiceCheckValidityCheckTest {
     
when(hostRoleCommandDAO.getLatestServiceChecksByRole(any(Long.class))).thenReturn(asList(lastServiceCheckDTO1,
 lastServiceCheckDTO2));
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, null, null, null);
 
     UpgradeCheckResult result =  serviceCheckValidityCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());  }
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicePresenceCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicePresenceCheckTest.java
index 6e855a2..49d659e 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicePresenceCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicePresenceCheckTest.java
@@ -78,7 +78,7 @@ public class ServicePresenceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult result = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, result.getStatus());
@@ -99,7 +99,7 @@ public class ServicePresenceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult result = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -122,7 +122,7 @@ public class ServicePresenceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult result = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -144,7 +144,7 @@ public class ServicePresenceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult result = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -169,7 +169,7 @@ public class ServicePresenceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult result = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -192,7 +192,7 @@ public class ServicePresenceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult result = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
@@ -218,7 +218,7 @@ public class ServicePresenceCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, checkProperties);
+        m_repositoryVersion, checkProperties, null);
 
     UpgradeCheckResult result = m_check.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.FAIL, result.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
index 3f27ce8..97012d9 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
@@ -138,7 +138,7 @@ public class ServicesMaintenanceModeCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = servicesMaintenanceModeCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java
index 967780e..bb3dc6b 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesUpCheckTest.java
@@ -308,7 +308,7 @@ public class ServicesUpCheckTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        m_repositoryVersion, null);
+        m_repositoryVersion, null, null);
 
     UpgradeCheckResult check = servicesUpCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/UpgradeTypeQualificationTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/UpgradeTypeQualificationTest.java
index e5c7a02..66b40b2 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/UpgradeTypeQualificationTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/UpgradeTypeQualificationTest.java
@@ -44,8 +44,8 @@ public class UpgradeTypeQualificationTest {
    */
   @Test
   public void testRequired() throws Exception {
-    UpgradeCheckRequest rolling = new UpgradeCheckRequest(null, 
UpgradeType.ROLLING, null, null);
-    UpgradeCheckRequest express = new UpgradeCheckRequest(null, 
UpgradeType.NON_ROLLING, null, null);
+    UpgradeCheckRequest rolling = new UpgradeCheckRequest(null, 
UpgradeType.ROLLING, null, null, null);
+    UpgradeCheckRequest express = new UpgradeCheckRequest(null, 
UpgradeType.NON_ROLLING, null, null, null);
 
     UpgradeTypeQualification rollingQualification = new 
UpgradeTypeQualification(RollingTestCheckImpl.class);
 
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
index 147f422..81fdc17 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
@@ -86,7 +86,7 @@ public class VersionMismatchCheckTest {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        null, null);
+        null, null, null);
 
     UpgradeCheckResult check = versionMismatchCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.WARNING, check.getStatus());
@@ -98,7 +98,7 @@ public class VersionMismatchCheckTest {
 
     ClusterInformation clusterInformation = new 
ClusterInformation(CLUSTER_NAME, false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING,
-        null, null);
+        null, null, null);
 
     UpgradeCheckResult check = versionMismatchCheck.perform(request);
     Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
index 2e0c5d6..0b02005 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
@@ -23,6 +23,8 @@ import static org.easymock.EasyMock.expectLastCall;
 import static org.junit.Assert.assertNotNull;
 
 import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -106,6 +108,15 @@ import org.easymock.EasyMock;
 import org.easymock.EasyMockSupport;
 import org.junit.Assert;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Matchers;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.reflections.Configuration;
+import org.reflections.Reflections;
+import org.reflections.util.ConfigurationBuilder;
 import org.springframework.security.crypto.password.PasswordEncoder;
 
 import com.google.common.collect.Lists;
@@ -120,6 +131,8 @@ import com.google.inject.name.Names;
 /**
  * PreUpgradeCheckResourceProvider tests.
  */
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ UpgradeCheckRegistry.class })
 public class PreUpgradeCheckResourceProviderTest extends EasyMockSupport {
 
   private static final String TEST_SERVICE_CHECK_CLASS_NAME = 
"org.apache.ambari.server.sample.checks.SampleServiceCheck";
@@ -214,13 +227,25 @@ public class PreUpgradeCheckResourceProviderTest extends 
EasyMockSupport {
     String checks = 
ClassLoader.getSystemClassLoader().getResource("checks").getPath();
     expect(serviceInfo.getChecksFolder()).andReturn(new File(checks));
 
-    ClassLoader classLoader = createNiceMock(ClassLoader.class);
+    URL url = new URL("file://foo");
+    URLClassLoader classLoader = createNiceMock(URLClassLoader.class);
+    expect(classLoader.getURLs()).andReturn(new URL[] { url }).once();
+
     StackInfo stackInfo = createNiceMock(StackInfo.class);
     
expect(ambariMetaInfo.getStack(targetStackId)).andReturn(stackInfo).atLeastOnce();
     
expect(stackInfo.getLibraryClassLoader()).andReturn(classLoader).atLeastOnce();
     expect(stackInfo.getLibraryInstance(EasyMock.anyObject(), 
EasyMock.eq(TEST_SERVICE_CHECK_CLASS_NAME)))
       .andReturn(new SampleServiceCheck()).atLeastOnce();
 
+    // mock out plugin check loading
+    Reflections reflectionsMock = createNiceMock(Reflections.class);
+
+    PowerMockito.whenNew(Reflections.class).withParameterTypes(
+        
Configuration.class).withArguments(Matchers.any(ConfigurationBuilder.class)).thenReturn(
+            reflectionsMock);
+
+    PowerMock.replay(Reflections.class);
+
     // replay
     replayAll();
 
@@ -267,6 +292,8 @@ public class PreUpgradeCheckResourceProviderTest extends 
EasyMockSupport {
     Assert.assertEquals(CLUSTER_NAME, clusterName);
     UpgradeType upgradeType = (UpgradeType) 
customUpgradeCheck.getPropertyValue(PreUpgradeCheckResourceProvider.UPGRADE_CHECK_UPGRADE_TYPE_PROPERTY_ID);
     Assert.assertEquals(UpgradeType.NON_ROLLING, upgradeType);
+
+    PowerMock.verifyAll();
   }
 
   /**
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PluginUpgradeServerActionTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PluginUpgradeServerActionTest.java
index 6e4b17b..eeb818c 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PluginUpgradeServerActionTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PluginUpgradeServerActionTest.java
@@ -21,6 +21,7 @@ import static org.easymock.EasyMock.eq;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.expectLastCall;
 
+import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -82,7 +83,7 @@ public class PluginUpgradeServerActionTest extends 
EasyMockSupport {
 
   private final UpgradeContext m_mockUpgradeContext = 
createNiceMock(UpgradeContext.class);
   private final UpgradePack m_mockUpgradePack = 
createNiceMock(UpgradePack.class);
-  private final ClassLoader m_mockClassLoader = 
createNiceMock(ClassLoader.class);
+  private final URLClassLoader m_mockClassLoader = 
createNiceMock(URLClassLoader.class);
   private final AmbariMetaInfo m_mockMetaInfo = 
createNiceMock(AmbariMetaInfo.class);
   private final AmbariManagementController m_mockController = 
createNiceMock(AmbariManagementController.class);
 
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
index d4d8585..bc55def 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
@@ -121,7 +121,7 @@ public class CheckHelperTest {
     updateChecksRegistry.add(m_mockCheck);
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null, null);
 
     helper.performChecks(request, updateChecksRegistry, configuration);
 
@@ -154,13 +154,13 @@ public class CheckHelperTest {
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
     UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation,
-        UpgradeType.NON_ROLLING, m_repositoryVersion, null);
+        UpgradeType.NON_ROLLING, m_repositoryVersion, null, null);
 
     helper.performChecks(request, updateChecksRegistry, configuration);
 
     Assert.assertEquals(null, 
request.getResult(m_mockUpgradeCheckDescription));
 
-    request = new UpgradeCheckRequest(clusterInformation, UpgradeType.ROLLING, 
m_repositoryVersion, null);
+    request = new UpgradeCheckRequest(clusterInformation, UpgradeType.ROLLING, 
m_repositoryVersion, null, null);
   }
 
   /**
@@ -183,7 +183,7 @@ public class CheckHelperTest {
     Mockito.when(m_mockPerform.toString()).thenThrow(new RuntimeException());
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null, null);
 
     helper.performChecks(request, updateChecksRegistry, configuration);
 
@@ -210,7 +210,7 @@ public class CheckHelperTest {
     Mockito.when(m_mockPerform.toString()).thenThrow(new RuntimeException());
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null, null);
 
     helper.performChecks(request, updateChecksRegistry, configuration);
 
@@ -253,7 +253,7 @@ public class CheckHelperTest {
     Mockito.when(m_mockPerform.toString()).thenThrow(new RuntimeException());
 
     ClusterInformation clusterInformation = new ClusterInformation("cluster", 
false, null, null, null);
-    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null);
+    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, 
UpgradeType.ROLLING, m_repositoryVersion, null, null);
 
     helper.performChecks(request, updateChecksRegistry, configuration);
 

Reply via email to