You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2016/10/06 16:00:35 UTC

[01/12] ambari git commit: AMBARI-18512. Ambari-Server restart causes all host components to go in Heartbeat Lost state indefinitely. (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18456 38700445b -> 78a875cf2


AMBARI-18512. Ambari-Server restart causes all host components to go in Heartbeat Lost state indefinitely. (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2fc9a477
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2fc9a477
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2fc9a477

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 2fc9a477842ddd25057e07d084b31b7147c4f3bd
Parents: a901d8a
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Oct 5 15:55:42 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Oct 5 15:55:42 2016 +0300

----------------------------------------------------------------------
 .../python/ambari_agent/alerts/web_alert.py     | 12 ++---------
 .../main/python/ambari_commons/inet_utils.py    | 21 ++++++++++++++++++++
 .../HDFS/2.1.0.2.0/package/scripts/utils.py     | 15 ++------------
 3 files changed, 25 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2fc9a477/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
index 42ad96b..6caf1d0 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
@@ -33,7 +33,7 @@ from resource_management.libraries.functions.get_port_from_url import get_port_f
 from resource_management.libraries.functions.get_path_from_url import get_path_from_url
 from resource_management.libraries.functions.curl_krb_request import curl_krb_request
 from ambari_commons import OSCheck
-from ambari_commons.inet_utils import resolve_address
+from ambari_commons.inet_utils import resolve_address, ensure_ssl_using_tls_v1
 from ambari_agent import Constants
 
 # hashlib is supplied as of Python 2.5 as the replacement interface for md5
@@ -54,15 +54,7 @@ DEFAULT_CONNECTION_TIMEOUT = 5
 
 WebResponse = namedtuple('WebResponse', 'status_code time_millis error_msg')
 
-# patch ssl module to fix SSLv3 communication bug
-# for more info see http://stackoverflow.com/questions/9835506/urllib-urlopen-works-on-sslv3-urls-with-python-2-6-6-on-1-machine-but-not-wit
-def sslwrap(func):
-    @wraps(func)
-    def bar(*args, **kw):
-        kw['ssl_version'] = ssl.PROTOCOL_TLSv1
-        return func(*args, **kw)
-    return bar
-ssl.wrap_socket = sslwrap(ssl.wrap_socket)
+ensure_ssl_using_tls_v1()
 
 class WebAlert(BaseAlert):
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2fc9a477/ambari-common/src/main/python/ambari_commons/inet_utils.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/inet_utils.py b/ambari-common/src/main/python/ambari_commons/inet_utils.py
index 987c761..b5cea75 100644
--- a/ambari-common/src/main/python/ambari_commons/inet_utils.py
+++ b/ambari-common/src/main/python/ambari_commons/inet_utils.py
@@ -22,6 +22,7 @@ import os
 import sys
 import urllib2
 import socket
+from functools import wraps
 
 from exceptions import FatalException, NonFatalException, TimeoutError
 
@@ -181,3 +182,23 @@ def resolve_address(address):
     if address == '0.0.0.0':
       return '127.0.0.1'
   return address
+
+def ensure_ssl_using_tls_v1():
+  """
+  Monkey patching ssl module to force it use tls_v1. Do this in common module to avoid problems with
+  PythonReflectiveExecutor.
+  :return:
+  """
+  from functools import wraps
+  import ssl
+  if hasattr(ssl.wrap_socket, "_ambari_patched"):
+    return # do not create chain of wrappers, patch only once
+  def sslwrap(func):
+    @wraps(func)
+    def bar(*args, **kw):
+      import ssl
+      kw['ssl_version'] = ssl.PROTOCOL_TLSv1
+      return func(*args, **kw)
+    bar._ambari_patched = True
+    return bar
+  ssl.wrap_socket = sslwrap(ssl.wrap_socket)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/2fc9a477/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
index 966efa2..4577ad2 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
@@ -34,21 +34,10 @@ from resource_management.libraries.functions.curl_krb_request import curl_krb_re
 from resource_management.core.exceptions import Fail
 from resource_management.libraries.functions.namenode_ha_utils import get_namenode_states
 from resource_management.libraries.functions.show_logs import show_logs
-
+from ambari_commons.inet_utils import ensure_ssl_using_tls_v1
 from zkfc_slave import ZkfcSlaveDefault
 
-import ssl
-from functools import wraps
-
-# patch ssl module to fix SSLv3 communication bug
-# for more info see http://stackoverflow.com/questions/9835506/urllib-urlopen-works-on-sslv3-urls-with-python-2-6-6-on-1-machine-but-not-wit
-def sslwrap(func):
-    @wraps(func)
-    def bar(*args, **kw):
-        kw['ssl_version'] = ssl.PROTOCOL_TLSv1
-        return func(*args, **kw)
-    return bar
-ssl.wrap_socket = sslwrap(ssl.wrap_socket)
+ensure_ssl_using_tls_v1()
 
 def safe_zkfc_op(action, env):
   """


[04/12] ambari git commit: AMBARI-18527 HostCleanup.py to be able to resolve wildcards in a dir or file path to a list of dirs and files (dili)

Posted by jo...@apache.org.
AMBARI-18527 HostCleanup.py to be able to resolve wildcards in a dir or file path to a list of dirs and files (dili)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/713f413c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/713f413c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/713f413c

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 713f413c35c15d08f91bea619ecd7e9d1e877b9b
Parents: 1f7edfb
Author: Di Li <di...@apache.org>
Authored: Wed Oct 5 16:19:10 2016 -0400
Committer: Di Li <di...@apache.org>
Committed: Wed Oct 5 16:19:10 2016 -0400

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/HostCleanup.py | 32 ++++++++++++--------
 1 file changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/713f413c/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
index a3c72e6..cca79a8 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
@@ -35,6 +35,7 @@ import optparse
 import shlex
 import datetime
 import tempfile
+import glob
 from AmbariConfig import AmbariConfig
 from ambari_agent.Constants import AGENT_TMP_DIR
 from ambari_commons import OSCheck, OSConst
@@ -388,18 +389,25 @@ class HostCleanup:
 
   def do_erase_dir_silent(self, pathList):
     if pathList:
-      for path in pathList:
-        if path and os.path.exists(path):
-          if os.path.isdir(path):
-            try:
-              shutil.rmtree(path)
-            except:
-              logger.warn("Failed to remove dir: " + path + ", error: " + str(sys.exc_info()[0]))
-          else:
-            logger.info(path + " is a file and not a directory, deleting file")
-            self.do_erase_files_silent([path])
-        else:
-          logger.info("Path doesn't exists: " + path)
+      for aPath in pathList:
+        pathArr = glob.glob(aPath)
+        logger.debug("Resolved {0} to {1}".format(aPath, ','.join(pathArr)))
+        for path in pathArr:
+          if path:
+            if os.path.exists(path):
+              if os.path.isdir(path):
+                try:
+                  shutil.rmtree(path)
+                except:
+                  logger.warn("Failed to remove dir {0} , error: {1}".format(path, str(sys.exc_info()[0])))
+              else:
+                logger.info("{0} is a file, deleting file".format(path))
+                self.do_erase_files_silent([path])
+            elif os.path.islink(path):
+              logger.info("Deleting broken symbolic link {0}".format(path))
+              self.do_erase_files_silent([path])
+            else:
+              logger.info("Path doesn't exists: {0}".format(path))
     return 0
 
   def do_erase_files_silent(self, pathList):


[07/12] ambari git commit: AMBARI-18544. Update repo base urls for HDP-2.6 stack (smohanty)

Posted by jo...@apache.org.
AMBARI-18544. Update repo base urls for HDP-2.6 stack (smohanty)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/714d9b52
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/714d9b52
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/714d9b52

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 714d9b528e0c671d777452c31f8e79905a5801b0
Parents: 8f8b26a
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Oct 5 17:28:49 2016 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Wed Oct 5 17:28:49 2016 -0700

----------------------------------------------------------------------
 .../resources/stacks/HDP/2.6/repos/repoinfo.xml   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/714d9b52/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
index 1385fb4..34abae5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
@@ -16,10 +16,10 @@
    limitations under the License.
 -->
 <reposinfo>
-  <latest>http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json</latest>
+  <latest>http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json</latest>
   <os family="redhat6">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>
@@ -33,7 +33,7 @@
   </os>
   <os family="redhat7">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>
@@ -47,7 +47,7 @@
   </os>
   <os family="suse11">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/suse11sp3/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11sp3/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>
@@ -61,7 +61,7 @@
   </os>
   <os family="suse12">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/sles12/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/sles12/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>
@@ -75,7 +75,7 @@
   </os>
   <os family="ubuntu12">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/ubuntu12/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu12/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>
@@ -89,7 +89,7 @@
   </os>
   <os family="debian7">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/debian7/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian7/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>
@@ -103,7 +103,7 @@
   </os>
   <os family="ubuntu14">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>
@@ -117,7 +117,7 @@
   </os>
   <os family="ubuntu16">
     <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.5.0.0</baseurl>
+      <baseurl>http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/updates/2.6.0.0</baseurl>
       <repoid>HDP-2.6</repoid>
       <reponame>HDP</reponame>
       <unique>true</unique>


[09/12] ambari git commit: AMBARI-18516. Add ability to have services declare itself as tech-preview or mandatory.(vbrodetskyi)

Posted by jo...@apache.org.
AMBARI-18516. Add ability to have services declare itself as tech-preview or mandatory.(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/56e00acd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/56e00acd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/56e00acd

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 56e00acdc8d7357ba811fcd4dca4fbb23bad33be
Parents: 46cb402
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Thu Oct 6 04:59:49 2016 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Thu Oct 6 04:59:49 2016 +0300

----------------------------------------------------------------------
 .../server/controller/StackServiceResponse.java | 16 +++++++++--
 .../internal/StackServiceResourceProvider.java  |  6 ++++
 .../ambari/server/stack/ServiceModule.java      |  6 +++-
 .../apache/ambari/server/state/ServiceInfo.java | 27 ++++++++++++++++++
 .../src/main/resources/properties.json          |  1 +
 .../ambari/server/stack/ServiceModuleTest.java  | 19 +++++++++++++
 .../ambari/server/state/ServiceInfoTest.java    | 30 ++++++++++++++++++++
 7 files changed, 101 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
index 5865e20..75f65c0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
@@ -38,6 +38,7 @@ public class StackServiceResponse {
   private String userName;
   private String comments;
   private String serviceVersion;
+  private ServiceInfo.Selection selection;
   private boolean serviceCheckSupported;
   private List<String> customCommands;
 
@@ -73,6 +74,7 @@ public class StackServiceResponse {
     excludedConfigTypes = service.getExcludedConfigTypes();
     requiredServices = service.getRequiredServices();
     serviceCheckSupported = null != service.getCommandScript();
+    selection = service.getSelection();
 
     // the custom command names defined at the service (not component) level
     List<CustomCommandDefinition> definitions = service.getCustomCommands();
@@ -90,6 +92,14 @@ public class StackServiceResponse {
     serviceProperties = service.getServiceProperties();
   }
 
+  public ServiceInfo.Selection getSelection() {
+    return selection;
+  }
+
+  public void setSelection(ServiceInfo.Selection selection) {
+    this.selection = selection;
+  }
+
   public String getStackName() {
     return stackName;
   }
@@ -115,14 +125,14 @@ public class StackServiceResponse {
   }
 
   public String getServiceType() {
-	return serviceType;
+    return serviceType;
   }
 
   public void setServiceType(String serviceType) {
-	this.serviceType = serviceType;
+    this.serviceType = serviceType;
   }
 
-public String getServiceDisplayName() {
+  public String getServiceDisplayName() {
     return serviceDisplayName;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
index 16713dd..0fc65eb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
@@ -67,6 +67,9 @@ public class StackServiceResourceProvider extends ReadOnlyResourceProvider {
   private static final String COMMENTS_PROPERTY_ID = PropertyHelper.getPropertyId(
       "StackServices", "comments");
 
+  private static final String SELECTION_PROPERTY_ID = PropertyHelper.getPropertyId(
+      "StackServices", "selection");
+
   private static final String VERSION_PROPERTY_ID = PropertyHelper.getPropertyId(
       "StackServices", "service_version");
 
@@ -166,6 +169,9 @@ public class StackServiceResourceProvider extends ReadOnlyResourceProvider {
     setResourceProperty(resource, VERSION_PROPERTY_ID,
         response.getServiceVersion(), requestedIds);
 
+    setResourceProperty(resource, SELECTION_PROPERTY_ID,
+        response.getSelection(), requestedIds);
+
     setResourceProperty(resource, CONFIG_TYPES,
         response.getConfigTypes(), requestedIds);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
index 34e65c3..826abbc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
@@ -258,6 +258,10 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
       serviceInfo.setChecksFolder(parent.getChecksFolder());
     }
 
+    if (serviceInfo.isSelectionEmpty()) {
+      serviceInfo.setSelection(parent.getSelection());
+    }
+
     mergeCustomCommands(parent.getCustomCommands(), serviceInfo.getCustomCommands());
     mergeConfigDependencies(parent);
     mergeComponents(parentModule, allStacks, commonServices, extensions);
@@ -644,7 +648,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
       addErrors(serviceInfo.getErrors());
     }
   }
-  
+
 
   @Override
   public String toString() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index b0d81c3..7f83604 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -68,6 +68,7 @@ public class ServiceInfo implements Validable{
   private String version;
   private String comment;
   private String serviceType;
+  private Selection selection;
 
   @XmlTransient
   private List<PropertyInfo> properties;
@@ -324,6 +325,26 @@ public String getVersion() {
     this.version = version;
   }
 
+  public Selection getSelection() {
+    if (selection == null) {
+      return Selection.DEFAULT;
+    }
+    return selection;
+  }
+
+  public void setSelection(Selection selection) {
+    this.selection = selection;
+  }
+
+  /**
+   * Check if selection was presented in xml. We need this for proper stack inheritance, because {@link ServiceInfo#getSelection}
+   * by default returns {@link Selection#DEFAULT}, even if no value found in metainfo.xml.
+   * @return true, if selection not defined in metainfo.xml
+   */
+  public boolean isSelectionEmpty() {
+    return selection == null;
+  }
+
   public String getComment() {
     return comment;
   }
@@ -977,4 +998,10 @@ public String getVersion() {
     }
   }
 
+  public enum Selection {
+    DEFAULT,
+    TECH_PREVIEW,
+    MANDATORY,
+    DEPRECATED
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/main/resources/properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/properties.json b/ambari-server/src/main/resources/properties.json
index eb27878..30d83bd 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -208,6 +208,7 @@
         "StackServices/stack_version",
         "StackServices/service_name",
         "StackServices/display_name",
+        "StackServices/selection",
         "StackServices/user_name",
         "StackServices/comments",
         "StackServices/service_version",

http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java
index a9a8fdb..47f5eb9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java
@@ -730,6 +730,25 @@ public class ServiceModuleTest {
   }
 
   @Test
+  public void testResolve_Service__selection() throws Exception {
+    ServiceInfo firstInfo = new ServiceInfo();
+    ServiceInfo secondInfo = new ServiceInfo();
+    ServiceInfo thirdInfo = new ServiceInfo();
+
+    firstInfo.setSelection(ServiceInfo.Selection.MANDATORY);
+
+    resolveService(secondInfo, firstInfo);
+
+    assertEquals(secondInfo.getSelection(), ServiceInfo.Selection.MANDATORY);
+
+    thirdInfo.setSelection(ServiceInfo.Selection.TECH_PREVIEW);
+
+    resolveService(thirdInfo, secondInfo);
+
+    assertEquals(thirdInfo.getSelection(), ServiceInfo.Selection.TECH_PREVIEW);
+  }
+
+  @Test
   public void testResolve_Configuration__attributes() throws Exception {
     ServiceInfo info = new ServiceInfo();
     ServiceInfo parentInfo = new ServiceInfo();

http://git-wip-us.apache.org/repos/asf/ambari/blob/56e00acd/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceInfoTest.java
index 1754cbb..9986ee3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/ServiceInfoTest.java
@@ -112,6 +112,36 @@ public class ServiceInfoTest {
   }
 
   @Test
+  public void testSelectionField() throws Exception {
+    String serviceInfoXmlDeprecated = "<metainfo>\n" +
+        "  <schemaVersion>2.0</schemaVersion>\n" +
+        "  <services>\n" +
+        "    <service>\n" +
+        "      <name>DEPRECATED</name>\n" +
+        "      <selection>DEPRECATED</selection>\n" +
+        "    </service>\n" +
+        "  </services>\n" +
+        "</metainfo>\n";
+    Map<String, ServiceInfo> serviceInfoMapDeprecated = getServiceInfo(serviceInfoXmlDeprecated);
+    ServiceInfo deprecated = serviceInfoMapDeprecated.get("DEPRECATED");
+    assertEquals(deprecated.getSelection(), ServiceInfo.Selection.DEPRECATED);
+    assertFalse(deprecated.isSelectionEmpty());
+
+    String serviceInfoXmlDefault = "<metainfo>\n" +
+        "  <schemaVersion>2.0</schemaVersion>\n" +
+        "  <services>\n" +
+        "    <service>\n" +
+        "      <name>DEFAULT</name>\n" +
+        "    </service>\n" +
+        "  </services>\n" +
+        "</metainfo>\n";
+    Map<String, ServiceInfo> serviceInfoMapDefault = getServiceInfo(serviceInfoXmlDefault);
+    ServiceInfo defaultSi = serviceInfoMapDefault.get("DEFAULT");
+    assertEquals(defaultSi.getSelection(), ServiceInfo.Selection.DEFAULT);
+    assertTrue(defaultSi.isSelectionEmpty());
+  }
+
+  @Test
   public void testSetRestartRequiredAfterRackChange() throws Exception {
     ServiceInfo serviceInfo = new ServiceInfo();
 


[05/12] ambari git commit: Revert "AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)" This reverts commit 1f7edfba8358ad3f07b168ec5c7f2245e01016d8. This reverts commit ee02ad9c984b5a15eea13a175e212c0e1f6ff1c2.

Posted by jo...@apache.org.
Revert "AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)"
This reverts commit 1f7edfba8358ad3f07b168ec5c7f2245e01016d8.
This reverts commit ee02ad9c984b5a15eea13a175e212c0e1f6ff1c2.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d7a914b3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d7a914b3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d7a914b3

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: d7a914b3ba72630e3301ce23a40d099ceffaf98b
Parents: 713f413
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Wed Oct 5 14:40:48 2016 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Wed Oct 5 14:50:34 2016 -0700

----------------------------------------------------------------------
 ambari-logsearch/pom.xml                        | 13 ---
 .../ambari-metrics-timelineservice/pom.xml      |  9 --
 ambari-metrics/pom.xml                          | 27 +-----
 ambari-server/pom.xml                           | 11 ---
 .../alerts/AggregateAlertListenerTest.java      |  2 -
 .../alerts/AlertDefinitionEqualityTest.java     |  2 -
 .../state/alerts/AlertDefinitionHashTest.java   |  2 -
 .../state/alerts/AlertEventPublisherTest.java   |  2 -
 .../state/alerts/AlertReceivedListenerTest.java |  2 -
 .../alerts/AlertStateChangedEventTest.java      |  2 -
 .../state/alerts/InitialAlertEventTest.java     |  2 -
 .../KerberosComponentDescriptorTest.java        |  2 -
 .../KerberosConfigurationDescriptorTest.java    |  2 -
 .../state/kerberos/KerberosDescriptorTest.java  |  2 -
 .../KerberosDescriptorUpdateHelperTest.java     |  2 -
 .../KerberosIdentityDescriptorTest.java         |  2 -
 .../kerberos/KerberosKeytabDescriptorTest.java  |  2 -
 .../KerberosPrincipalDescriptorTest.java        |  2 -
 .../kerberos/KerberosServiceDescriptorTest.java |  2 -
 .../kerberos/VariableReplacementHelperTest.java |  2 -
 .../state/stack/ConfigUpgradePackTest.java      |  2 -
 .../state/stack/ConfigUpgradeValidityTest.java  |  2 -
 .../ambari/server/state/stack/OSFamilyTest.java |  3 -
 .../server/state/stack/UpgradePackTest.java     |  2 -
 pom.xml                                         | 86 +-------------------
 utility/pom.xml                                 | 49 -----------
 utility/src/main/java/category/AlertTest.java   | 27 ------
 .../main/java/category/AmbariUpgradeTest.java   | 27 ------
 .../src/main/java/category/BlueprintTest.java   | 27 ------
 utility/src/main/java/category/FastTest.java    | 27 ------
 .../src/main/java/category/KerberosTest.java    | 27 ------
 utility/src/main/java/category/MetricsTest.java | 27 ------
 utility/src/main/java/category/SlowTest.java    | 27 ------
 .../main/java/category/StackUpgradeTest.java    | 27 ------
 34 files changed, 3 insertions(+), 449 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-logsearch/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml
index a1b6c9d..0445c39 100644
--- a/ambari-logsearch/pom.xml
+++ b/ambari-logsearch/pom.xml
@@ -70,9 +70,6 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <skip>${skipSurefireTests}</skip>
-
-          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
-          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -177,14 +174,4 @@
     </plugins>
   </build>
 
-  <dependencies>
-    <!-- Dependency in order to annotate unit tests with a category. -->
-    <dependency>
-      <groupId>utility</groupId>
-      <artifactId>utility</artifactId>
-      <version>1.0.0.0-SNAPSHOT</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-metrics/ambari-metrics-timelineservice/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index 6896c6b..87e3423 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -239,8 +239,6 @@
           <redirectTestOutputToFile>true</redirectTestOutputToFile>
           <forkMode>always</forkMode>
           <argLine>-XX:-UseSplitVerifier</argLine>
-          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
-          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -630,13 +628,6 @@
       <scope>test</scope>
     </dependency>
 
-    <!-- Dependency in order to annotate unit tests with a category. -->
-    <dependency>
-      <groupId>utility</groupId>
-      <artifactId>utility</artifactId>
-      <version>1.0.0.0-SNAPSHOT</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <profiles>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index 80c99dc..6ab8c60 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -31,7 +31,6 @@
     <module>ambari-metrics-host-monitoring</module>
     <module>ambari-metrics-grafana</module>
     <module>ambari-metrics-assembly</module>
-    <module>../utility</module>
   </modules>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -169,9 +168,6 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <skip>${skipSurefireTests}</skip>
-
-          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
-          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -301,28 +297,7 @@
   </build>
 
   <dependencies>
-    <!-- Dependency in order to annotate unit tests with a category. -->
-    <dependency>
-      <groupId>utility</groupId>
-      <artifactId>utility</artifactId>
-      <version>1.0.0.0-SNAPSHOT</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
-  <profiles>
-    <profile>
-      <id>FastTests</id>
-      <properties>
-        <testcase.groups>category.FastTest</testcase.groups>
-      </properties>
-      <dependencies>
-        <dependency>
-          <groupId>utility</groupId>
-          <artifactId>utility</artifactId>
-          <version>1.0.0.0-SNAPSHOT</version>
-        </dependency>
-      </dependencies>
-    </profile>
-  </profiles>
+
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index d3ec9ad..e37accd 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -574,9 +574,6 @@
         <configuration>
           <skip>${skipSurefireTests}</skip>
           <argLine>-Xmx1024m -XX:MaxPermSize=512m -Xms512m</argLine>
-
-          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
-          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -1458,14 +1455,6 @@
       <artifactId>metrics-jvm</artifactId>
       <version>3.1.0</version>
     </dependency>
-
-    <!-- Dependency in order to annotate unit tests with a category. -->
-    <dependency>
-      <groupId>utility</groupId>
-      <artifactId>utility</artifactId>
-      <version>1.0.0.0-SNAPSHOT</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <pluginRepositories>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
index d53857c..85dedba 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
@@ -48,12 +48,10 @@ import com.google.inject.persist.PersistService;
 import com.google.inject.util.Modules;
 
 import junit.framework.Assert;
-import org.junit.experimental.categories.Category;
 
 /**
  * Tests the {@link AlertAggregateListener}.
  */
-@Category({ category.AlertTest.class})
 public class AggregateAlertListenerTest {
 
   private Injector m_injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
index 1a914cd..3cc84c0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
@@ -32,12 +32,10 @@ import org.apache.ambari.server.state.alert.ScriptSource;
 import org.apache.ambari.server.state.alert.Source;
 import org.apache.ambari.server.state.alert.SourceType;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 /**
  * Tests equality of {@link AlertDefinition} for hashing and merging purposes.
  */
-@Category({ category.AlertTest.class})
 public class AlertDefinitionEqualityTest extends TestCase {
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
index 7a24966..c534c4a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
@@ -62,12 +62,10 @@ import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
-import org.junit.experimental.categories.Category;
 
 /**
  * Tests for {@link AlertDefinitionHash}.
  */
-@Category({ category.AlertTest.class})
 public class AlertDefinitionHashTest extends TestCase {
 
   private AlertDefinitionHash m_hash;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
index c511f1a..76aa2e4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
@@ -56,13 +56,11 @@ import com.google.gson.Gson;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
-import org.junit.experimental.categories.Category;
 
 /**
  * Tests that {@link AmbariEvent} instances are fired correctly and that alert
  * data is bootstrapped into the database.
  */
-@Category({ category.AlertTest.class})
 public class AlertEventPublisherTest {
 
   private AlertDispatchDAO dispatchDao;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
index 1867bda..7aef175 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
@@ -61,12 +61,10 @@ import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
 import com.google.inject.persist.UnitOfWork;
-import org.junit.experimental.categories.Category;
 
 /**
  * Tests the {@link AlertReceivedListener}.
  */
-@Category({ category.AlertTest.class})
 public class AlertReceivedListenerTest {
 
   private static final String ALERT_DEFINITION = "alert_definition_";

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
index 15ffef0..7964d14 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
@@ -61,7 +61,6 @@ import com.google.inject.persist.PersistService;
 import com.google.inject.util.Modules;
 
 import junit.framework.Assert;
-import org.junit.experimental.categories.Category;
 
 /**
  * Tests that {@link AlertStateChangeEvent} instances cause
@@ -69,7 +68,6 @@ import org.junit.experimental.categories.Category;
  * should only be created when received alerts which have a firmness of
  * {@link AlertFirmness#HARD}.
  */
-@Category({ category.AlertTest.class})
 public class AlertStateChangedEventTest extends EasyMockSupport {
 
   private AlertEventPublisher eventPublisher;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
index c7a5915..fc4803b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
@@ -51,12 +51,10 @@ import com.google.inject.persist.PersistService;
 import com.google.inject.util.Modules;
 
 import junit.framework.Assert;
-import org.junit.experimental.categories.Category;
 
 /**
  * Tests that {@link InitialAlertEventTest} instances are fired correctly.
  */
-@Category({ category.AlertTest.class })
 public class InitialAlertEventTest {
 
   private AlertsDAO m_alertsDao;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
index 814e010..201d84e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
@@ -22,7 +22,6 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -33,7 +32,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
-@Category({ category.KerberosTest.class})
 public class KerberosComponentDescriptorTest {
   public static final String JSON_VALUE =
       " {" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
index 47c4f19..4f2a2f5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
@@ -22,11 +22,9 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.util.*;
 
-@Category({ category.KerberosTest.class})
 public class KerberosConfigurationDescriptorTest {
   private static final String JSON_SINGLE_VALUE =
       "{ \"configuration-type\": {" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
index 9e21742..0070e6d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
@@ -21,7 +21,6 @@ import com.google.gson.*;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.IOException;
@@ -35,7 +34,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
-@Category({ category.KerberosTest.class})
 public class KerberosDescriptorTest {
   private static final KerberosDescriptorFactory KERBEROS_DESCRIPTOR_FACTORY = new KerberosDescriptorFactory();
   private static final KerberosServiceDescriptorFactory KERBEROS_SERVICE_DESCRIPTOR_FACTORY = new KerberosServiceDescriptorFactory();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
index 3f347dc..fca2f1f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
@@ -38,7 +38,6 @@ import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.EasyMock;
 import org.easymock.EasyMockSupport;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import javax.persistence.EntityManager;
 import javax.persistence.TypedQuery;
@@ -48,7 +47,6 @@ import java.util.Properties;
 import static org.easymock.EasyMock.anyString;
 import static org.easymock.EasyMock.expect;
 
-@Category({ category.KerberosTest.class})
 public class KerberosDescriptorUpdateHelperTest extends EasyMockSupport {
   private static final KerberosDescriptorFactory KERBEROS_DESCRIPTOR_FACTORY = new KerberosDescriptorFactory();
   private static final Gson GSON = new Gson();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
index dbf090e..ef1c7bb 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
@@ -22,14 +22,12 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.TreeMap;
 
-@Category({ category.KerberosTest.class})
 public class KerberosIdentityDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
index 5c82662..79350eb 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
@@ -22,12 +22,10 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.util.Map;
 import java.util.TreeMap;
 
-@Category({ category.KerberosTest.class})
 public class KerberosKeytabDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
index 54f5c3f..635cc30 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
@@ -22,11 +22,9 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.util.*;
 
-@Category({ category.KerberosTest.class})
 public class KerberosPrincipalDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
index fb341ca..9896317 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
@@ -21,7 +21,6 @@ import com.google.gson.Gson;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.IOException;
@@ -35,7 +34,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
-@Category({ category.KerberosTest.class})
 public class KerberosServiceDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
index 90f7022..8be0eb9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
@@ -21,12 +21,10 @@ package org.apache.ambari.server.state.kerberos;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.util.HashMap;
 import java.util.Map;
 
-@Category({ category.KerberosTest.class})
 public class VariableReplacementHelperTest {
   VariableReplacementHelper helper = new VariableReplacementHelper();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
index 27ee146..388a81f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
@@ -28,7 +28,6 @@ import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping.ExecuteStage
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -44,7 +43,6 @@ import static org.junit.Assert.*;
 /**
  * Tests for the config upgrade pack
  */
-@Category({ category.StackUpgradeTest.class})
 public class ConfigUpgradePackTest {
 
   private Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
index e764781..bf716b7 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
@@ -39,7 +39,6 @@ import org.apache.ambari.server.state.stack.upgrade.Task.Type;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,7 +52,6 @@ import junit.framework.Assert;
  * Tests that for every upgrade pack found, that all referenced configuration
  * IDs exist in the {@code config-upgrade.xml} which will be used/created.
  */
-@Category({ category.StackUpgradeTest.class})
 public class ConfigUpgradeValidityTest {
 
   private static final Logger LOG = LoggerFactory.getLogger(ConfigUpgradeValidityTest.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
index ba41687..9654dc3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
@@ -25,13 +25,10 @@ import junit.framework.Assert;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
 import java.lang.reflect.Method;
 import java.util.*;
 
 
-@Category({ category.StackUpgradeTest.class})
 public class OSFamilyTest {
    OsFamily os_family = null;
    private Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
index 6c81c61..97e50c3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
@@ -58,7 +58,6 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,7 +68,6 @@ import com.google.inject.persist.PersistService;
 /**
  * Tests for the upgrade pack
  */
-@Category({ category.StackUpgradeTest.class})
 public class UpgradePackTest {
 
   private Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index bd0aa7b..7ca4ba4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -516,7 +516,7 @@
         <module>ambari-client</module>
         <module>ambari-shell</module>
         <module>ambari-logsearch</module>
-        </modules>
+      </modules>
     </profile>
     <profile>
       <id>ambari-metrics</id>
@@ -542,7 +542,7 @@
         <module>ambari-agent</module>
         <module>ambari-client</module>
         <module>ambari-shell</module>
-        </modules>
+      </modules>
     </profile>
     <profile>
       <id>clover</id>
@@ -662,87 +662,5 @@ instead of a SNAPSHOT. -->
         </plugins>
       </build>
     </profile>
-
-    <!-- Start of profiles for running unit tests.
-     The category names are Java interfaces in utility/src/main/java/category/
-     The testcase.groups property contains a csv list of these categories (including the Java package name).
-
-     To run a suite of all test cases annotated with a list of categories, run the command
-     mvn test -P $PROFILE_ID
-
-     E.g.,
-     mvn test -P FastTests
-     -->
-
-    <!-- Tests are are explicitly fast. -->
-    <profile>
-      <id>FastTests</id>
-      <properties>
-        <testcase.groups>category.FastTest</testcase.groups>
-      </properties>
-    </profile>
-
-    <!-- Tests are are explicitly slow. -->
-    <profile>
-      <id>SlowTests</id>
-      <properties>
-        <testcase.groups>category.SlowTest</testcase.groups>
-      </properties>
-    </profile>
-
-    <!-- Slow tests, or tests that are not annotated. -->
-    <profile>
-      <id>NonFastTests</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <excludedGroups>org.apache.ambari.server.FastTest</excludedGroups>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <!-- Unit test Profiles based on features. -->
-    <profile>
-      <id>AlertTests</id>
-      <properties>
-        <testcase.groups>category.AlertTest</testcase.groups>
-      </properties>
-    </profile>
-    <profile>
-      <id>AmbariUpgradeTests</id>
-      <properties>
-        <testcase.groups>category.AmbariUpgradeTest</testcase.groups>
-      </properties>
-    </profile>
-    <profile>
-      <id>BlueprintTests</id>
-      <properties>
-        <testcase.groups>category.BlueprintTest</testcase.groups>
-      </properties>
-    </profile>
-    <profile>
-      <id>KerberosTests</id>
-      <properties>
-        <testcase.groups>category.KerberosTest</testcase.groups>
-      </properties>
-    </profile>
-    <profile>
-      <id>MetricsTests</id>
-      <properties>
-        <testcase.groups>category.MetricsTest</testcase.groups>
-      </properties>
-    </profile>
-    <profile>
-      <id>StackUpgradeTests</id>
-      <properties>
-        <testcase.groups>category.StackUpgradeTest</testcase.groups>
-      </properties>
-    </profile>
   </profiles>
-  <!-- End of profiles for running unit tests. -->
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/pom.xml
----------------------------------------------------------------------
diff --git a/utility/pom.xml b/utility/pom.xml
deleted file mode 100644
index 9f3fe32..0000000
--- a/utility/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<!--
-   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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <artifactId>utility</artifactId>
-  <groupId>utility</groupId>
-  <version>1.0.0.0-SNAPSHOT</version>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
-      <scope>compile</scope>    <!-- has to be compile-time dependency on junit -->
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.2</version>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-          <useIncrementalCompilation>false</useIncrementalCompilation>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/AlertTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/AlertTest.java b/utility/src/main/java/category/AlertTest.java
deleted file mode 100644
index b6a20ec..0000000
--- a/utility/src/main/java/category/AlertTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.AlertTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P AlertTests
- */
-public interface AlertTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/AmbariUpgradeTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/AmbariUpgradeTest.java b/utility/src/main/java/category/AmbariUpgradeTest.java
deleted file mode 100644
index 881107a..0000000
--- a/utility/src/main/java/category/AmbariUpgradeTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.AmbariUpgradeTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P AmbariUpgradeTests
- */
-public interface AmbariUpgradeTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/BlueprintTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/BlueprintTest.java b/utility/src/main/java/category/BlueprintTest.java
deleted file mode 100644
index cb7871d..0000000
--- a/utility/src/main/java/category/BlueprintTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.BlueprintTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P BlueprintTests
- */
-public interface BlueprintTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/FastTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/FastTest.java b/utility/src/main/java/category/FastTest.java
deleted file mode 100644
index a0abddf..0000000
--- a/utility/src/main/java/category/FastTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.FastTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P FastTests
- */
-public interface FastTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/KerberosTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/KerberosTest.java b/utility/src/main/java/category/KerberosTest.java
deleted file mode 100644
index f7cebdf..0000000
--- a/utility/src/main/java/category/KerberosTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.KerberosTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P KerberosTests
- */
-public interface KerberosTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/MetricsTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/MetricsTest.java b/utility/src/main/java/category/MetricsTest.java
deleted file mode 100644
index a352ae2..0000000
--- a/utility/src/main/java/category/MetricsTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.MetricsTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P MetricsTests
- */
-public interface MetricsTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/SlowTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/SlowTest.java b/utility/src/main/java/category/SlowTest.java
deleted file mode 100644
index c1025a9..0000000
--- a/utility/src/main/java/category/SlowTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.SlowTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P SlowTests
- */
-public interface SlowTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a914b3/utility/src/main/java/category/StackUpgradeTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/StackUpgradeTest.java b/utility/src/main/java/category/StackUpgradeTest.java
deleted file mode 100644
index 20a1723..0000000
--- a/utility/src/main/java/category/StackUpgradeTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 category;
-
-/**
- * Category of unit tests that can be annotated. E.g.,
- * {@code @Category({ category.StackUpgradeTest.class}) }
- *
- * A Profile can have csv of categories, in order to run the unit tests like,
- * mvn clean test -P StackUpgradeTests
- */
-public interface StackUpgradeTest {}
\ No newline at end of file


[10/12] ambari git commit: AMBARI-18536. Components can't be started because of failed webhdfs request (aonishuk)

Posted by jo...@apache.org.
AMBARI-18536. Components can't be started because of failed webhdfs request (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8b6e45e6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8b6e45e6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8b6e45e6

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 8b6e45e6220bd0304f3ce1cda1b7245ebb322669
Parents: 714d9b5
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Oct 6 07:34:17 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Oct 6 07:34:17 2016 +0300

----------------------------------------------------------------------
 .../resource_management/libraries/providers/hdfs_resource.py       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b6e45e6/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
index ee41195..f1aa3e1 100644
--- a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
+++ b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
@@ -169,7 +169,7 @@ class WebHDFSUtil:
     cmd = ["curl", "-sS","-L", "-w", "%{http_code}", "-X", method]
     
     if file_to_put:
-      cmd += ["--data-binary", "@"+file_to_put]
+      cmd += ["--data-binary", "@"+file_to_put, "-H", "Content-Type: application/octet-stream"]
     if self.security_enabled:
       cmd += ["--negotiate", "-u", ":"]
     if self.is_https_enabled:


[08/12] ambari git commit: AMBARI-18532. Getting errors with max length 1000byte, when using Mysql db with charset UTF8.(vbrodetskyi)

Posted by jo...@apache.org.
AMBARI-18532. Getting errors with max length 1000byte, when using Mysql db with charset UTF8.(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46cb4023
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46cb4023
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46cb4023

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 46cb40233d3e9762c2b44c1b43f3a0c1cf5c96c2
Parents: bce5dbe
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Thu Oct 6 04:12:58 2016 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Thu Oct 6 04:12:58 2016 +0300

----------------------------------------------------------------------
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql      | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46cb4023/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 1d55515..1c17e1a 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -36,8 +36,8 @@ CREATE TABLE stack(
 
 CREATE TABLE extension(
   extension_id BIGINT NOT NULL,
-  extension_name VARCHAR(255) NOT NULL,
-  extension_version VARCHAR(255) NOT NULL,
+  extension_name VARCHAR(100) NOT NULL,
+  extension_version VARCHAR(100) NOT NULL,
   CONSTRAINT PK_extension PRIMARY KEY (extension_id),
   CONSTRAINT UQ_extension UNIQUE (extension_name, extension_version));
 
@@ -279,8 +279,8 @@ CREATE TABLE users (
   principal_id BIGINT NOT NULL,
   create_time TIMESTAMP DEFAULT NOW(),
   ldap_user INTEGER NOT NULL DEFAULT 0,
-  user_type VARCHAR(255) NOT NULL DEFAULT 'LOCAL',
-  user_name VARCHAR(255) NOT NULL,
+  user_type VARCHAR(100) NOT NULL DEFAULT 'LOCAL',
+  user_name VARCHAR(100) NOT NULL,
   user_password VARCHAR(255),
   active INTEGER NOT NULL DEFAULT 1,
   active_widget_layouts VARCHAR(1024) DEFAULT NULL,
@@ -368,13 +368,13 @@ CREATE TABLE host_role_command (
   host_id BIGINT,
   last_attempt_time BIGINT NOT NULL,
   request_id BIGINT NOT NULL,
-  role VARCHAR(255),
+  role VARCHAR(100),
   role_command VARCHAR(255),
   stage_id BIGINT NOT NULL,
   start_time BIGINT NOT NULL,
   original_start_time BIGINT NOT NULL,
   end_time BIGINT,
-  status VARCHAR(255),
+  status VARCHAR(100),
   auto_skip_on_failure SMALLINT DEFAULT 0 NOT NULL,
   std_error LONGBLOB,
   std_out LONGBLOB,


[12/12] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-18456

Posted by jo...@apache.org.
Merge branch 'trunk' into branch-feature-AMBARI-18456


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/78a875cf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/78a875cf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/78a875cf

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 78a875cf2774457e769d147d2e985de20f6e64b8
Parents: 3870044 56e00ac
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Oct 6 12:00:10 2016 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Oct 6 12:00:10 2016 -0400

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/HostCleanup.py | 32 +++++----
 .../python/ambari_agent/alerts/web_alert.py     | 12 +---
 .../main/python/ambari_commons/inet_utils.py    | 21 ++++++
 .../libraries/providers/hdfs_resource.py        |  2 +-
 ambari-metrics/pom.xml                          |  4 +-
 .../ambari/server/api/services/UserService.java |  2 +-
 .../server/controller/StackServiceResponse.java | 16 ++++-
 .../internal/StackServiceResourceProvider.java  |  6 ++
 .../internal/UserResourceProvider.java          | 25 ++++++-
 .../predicate/ComparisonPredicate.java          | 16 ++++-
 .../controller/predicate/EqualsPredicate.java   | 15 +++++
 .../server/security/authorization/User.java     |  2 +-
 .../server/security/authorization/Users.java    |  8 +--
 .../RangerKerberosConfigCalculation.java        | 32 +++++----
 .../ambari/server/stack/ServiceModule.java      |  6 +-
 .../apache/ambari/server/state/ServiceInfo.java | 27 ++++++++
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  | 12 ++--
 .../HDFS/2.1.0.2.0/package/scripts/utils.py     | 15 +----
 .../src/main/resources/properties.json          |  1 +
 .../resources/stacks/HDP/2.6/repos/repoinfo.xml | 18 ++---
 .../server/api/services/UserServiceTest.java    | 71 --------------------
 .../server/security/SecurityHelperImplTest.java |  4 +-
 .../AmbariUserAuthenticationFilterTest.java     |  2 +-
 .../RangerKerberosConfigCalculationTest.java    |  6 +-
 .../ambari/server/stack/ServiceModuleTest.java  | 19 ++++++
 .../ambari/server/state/ServiceInfoTest.java    | 30 +++++++++
 .../server/upgrade/UpgradeCatalog240Test.java   |  6 +-
 pom.xml                                         |  6 --
 utility/pom.xml                                 | 34 +++++++++-
 29 files changed, 284 insertions(+), 166 deletions(-)
----------------------------------------------------------------------



[02/12] ambari git commit: AMBARI-18520: Ambari usernames should not be converted to lowercase before storing in the DB.

Posted by jo...@apache.org.
AMBARI-18520: Ambari usernames should not be converted to lowercase before storing in the DB.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/76ea14ed
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/76ea14ed
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/76ea14ed

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 76ea14ed31b27204907010100705eeaa2922e00e
Parents: 2fc9a47
Author: Nahappan Somasundaram <ns...@hortonworks.com>
Authored: Mon Oct 3 19:54:16 2016 -0700
Committer: Nahappan Somasundaram <ns...@hortonworks.com>
Committed: Wed Oct 5 08:45:00 2016 -0700

----------------------------------------------------------------------
 .../ambari/server/api/services/UserService.java |  2 +-
 .../internal/UserResourceProvider.java          | 25 ++++++-
 .../predicate/ComparisonPredicate.java          | 16 ++++-
 .../controller/predicate/EqualsPredicate.java   | 15 +++++
 .../server/security/authorization/User.java     |  2 +-
 .../server/security/authorization/Users.java    |  8 +--
 .../server/api/services/UserServiceTest.java    | 71 --------------------
 .../server/security/SecurityHelperImplTest.java |  4 +-
 .../AmbariUserAuthenticationFilterTest.java     |  2 +-
 .../server/upgrade/UpgradeCatalog240Test.java   |  6 +-
 10 files changed, 65 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java
index c46c373..a0fccad 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/UserService.java
@@ -172,6 +172,6 @@ public class UserService extends BaseService {
    */
   private ResourceInstance createUserResource(String userName) {
     return createResource(Resource.Type.User,
-        Collections.singletonMap(Resource.Type.User, StringUtils.lowerCase(userName)));
+        Collections.singletonMap(Resource.Type.User, userName));
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
index 0324d38..adf660b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java
@@ -21,6 +21,7 @@ import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.UserRequest;
 import org.apache.ambari.server.controller.UserResponse;
+import org.apache.ambari.server.controller.predicate.EqualsPredicate;
 import org.apache.ambari.server.controller.spi.*;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.security.authorization.AuthorizationException;
@@ -35,7 +36,7 @@ import java.util.Set;
 /**
  * Resource provider for user resources.
  */
-public class UserResourceProvider extends AbstractControllerResourceProvider {
+public class UserResourceProvider extends AbstractControllerResourceProvider implements ResourcePredicateEvaluator {
 
   // ----- Property ID constants ---------------------------------------------
 
@@ -188,6 +189,28 @@ public class UserResourceProvider extends AbstractControllerResourceProvider {
     return getRequestStatus(null);
   }
 
+  /**
+   * ResourcePredicateEvaluator implementation. If property type is User/user_name,
+   * we do a case insensitive comparison so that we can return the retrieved
+   * username when it differs only in case with respect to the requested username.
+   *
+   * @param predicate  the predicate
+   * @param resource   the resource
+   *
+     * @return
+     */
+  @Override
+  public boolean evaluate(Predicate predicate, Resource resource) {
+    if (predicate instanceof EqualsPredicate) {
+      EqualsPredicate equalsPredicate = (EqualsPredicate)predicate;
+      String propertyId = equalsPredicate.getPropertyId();
+      if (propertyId.equals(USER_USERNAME_PROPERTY_ID)) {
+        return equalsPredicate.evaluateIgnoreCase(resource);
+      }
+    }
+    return predicate.evaluate(resource);
+  }
+
   @Override
   protected Set<String> getPKPropertyIds() {
     return pkPropertyIds;

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ComparisonPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ComparisonPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ComparisonPredicate.java
index a36f0fb..be8016e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ComparisonPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ComparisonPredicate.java
@@ -76,7 +76,15 @@ public abstract class ComparisonPredicate<T> extends PropertyPredicate implement
     visitor.acceptComparisonPredicate(this);
   }
 
+  protected int compareValueToIgnoreCase(Object propertyValue) throws ClassCastException{
+    return compareValueTo(propertyValue, true); // case insensitive
+  }
+
   protected int compareValueTo(Object propertyValue) throws ClassCastException{
+    return compareValueTo(propertyValue, false); // case sensitive
+  }
+
+  private int compareValueTo(Object propertyValue, boolean ignoreCase) throws ClassCastException {
     if (doubleValue != null) {
       if (propertyValue instanceof Number) {
         return doubleValue.compareTo(((Number) propertyValue).doubleValue());
@@ -88,8 +96,14 @@ public abstract class ComparisonPredicate<T> extends PropertyPredicate implement
         }
       }
     }
+
     if (stringValue != null) {
-      return stringValue.compareTo(propertyValue.toString());
+      if (ignoreCase) {
+        return stringValue.compareToIgnoreCase(propertyValue.toString());
+      }
+      else {
+        return stringValue.compareTo(propertyValue.toString());
+      }
     }
 
     return getValue().compareTo((T) propertyValue);

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
index 64f5c6f..7ac0e7a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
@@ -39,6 +39,21 @@ public class EqualsPredicate<T> extends ComparisonPredicate<T> {
         propertyValue != null && compareValueTo(propertyValue) == 0;
   }
 
+  /**
+   * Case insensitive equality support for string types
+   *
+   * @param resource
+   * @return
+     */
+  public boolean evaluateIgnoreCase(Resource resource) {
+    Object propertyValue  = resource.getPropertyValue(getPropertyId());
+    Object predicateValue = getValue();
+
+    return predicateValue == null ?
+            propertyValue == null :
+            propertyValue != null && compareValueToIgnoreCase(propertyValue) == 0;
+  }
+
   @Override
   public String getOperator() {
     return "=";

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/User.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/User.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/User.java
index 85104fc..3064f62 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/User.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/User.java
@@ -46,7 +46,7 @@ public class User {
 
   public User(UserEntity userEntity) {
     userId = userEntity.getUserId();
-    userName = StringUtils.lowerCase(userEntity.getUserName()); // normalize to lower case
+    userName = userEntity.getUserName();
     createTime = userEntity.getCreateTime();
     userType = userEntity.getUserType();
     ldapUser = userEntity.getLdapUser();

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
index e547f05..a4f0031 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java
@@ -282,11 +282,9 @@ public class Users {
       throw new AmbariException("UserType not specified.");
     }
 
-    // store user name in lower case
-    userName = StringUtils.lowerCase(userName);
-
-    if (getUser(userName, userType) != null) {
-      throw new AmbariException("User " + userName + " already exists");
+    User existingUser = getUser(userName, userType);
+    if (existingUser != null) {
+      throw new AmbariException("User " + existingUser.getUserName() + " already exists");
     }
 
     PrincipalTypeEntity principalTypeEntity = principalTypeDAO.findById(PrincipalTypeEntity.USER_PRINCIPAL_TYPE);

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserServiceTest.java
deleted file mode 100644
index 0ed0a66..0000000
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserServiceTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.server.api.services;
-
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.ambari.server.api.resources.ResourceInstance;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.orm.entities.UserEntity;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * Unit tests for UserService.
- */
-public class UserServiceTest {
-
-  @Test
-  public void testCreateResourcesWithUppercaseUsername() {
-    // GIVEN
-    UserService userService = new TestUserService();
-    // WHEN
-    Response response = userService.getUser(null, null, null, "MyUser");
-    // THEN
-    assertEquals("myuser", ((UserEntity) response.getEntity()).getUserName());
-  }
-
-  class TestUserService extends UserService {
-    @Override
-    protected Response handleRequest(HttpHeaders headers, String body, UriInfo uriInfo,
-                                     Request.Type requestType, final ResourceInstance resource) {
-      return new Response() {
-        @Override
-        public Object getEntity() {
-          UserEntity entity = new UserEntity();
-          entity.setUserName(resource.getKeyValueMap().get(Resource.Type.User));
-          return entity;
-        }
-
-        @Override
-        public int getStatus() {
-          return 0;
-        }
-
-        @Override
-        public MultivaluedMap<String, Object> getMetadata() {
-          return null;
-        }
-      };
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/test/java/org/apache/ambari/server/security/SecurityHelperImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/SecurityHelperImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/security/SecurityHelperImplTest.java
index a4bd6c1..3442546 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/SecurityHelperImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/SecurityHelperImplTest.java
@@ -44,13 +44,13 @@ public class SecurityHelperImplTest {
     SecurityContext ctx = SecurityContextHolder.getContext();
     UserEntity userEntity = new UserEntity();
     userEntity.setPrincipal(new PrincipalEntity());
-    userEntity.setUserName("username"); // with user entity, always use lower case
+    userEntity.setUserName("userName");
     userEntity.setUserId(1);
     User user = new User(userEntity);
     Authentication auth = new AmbariUserAuthentication(null, user, null);
     ctx.setAuthentication(auth);
 
-    Assert.assertEquals("username", SecurityHelperImpl.getInstance().getCurrentUserName());
+    Assert.assertEquals("userName", SecurityHelperImpl.getInstance().getCurrentUserName());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariUserAuthenticationFilterTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariUserAuthenticationFilterTest.java b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariUserAuthenticationFilterTest.java
index fda3188..80a66fd 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariUserAuthenticationFilterTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariUserAuthenticationFilterTest.java
@@ -52,7 +52,7 @@ import static org.junit.Assert.assertNull;
 public class AmbariUserAuthenticationFilterTest {
   private static final String TEST_INTERNAL_TOKEN = "test token";
   private static final String TEST_USER_ID_HEADER = "1";
-  private static final String TEST_USER_NAME = "username"; // use lower case with user entity
+  private static final String TEST_USER_NAME = "userName";
   private static final int TEST_USER_ID = 1;
 
   @Before

http://git-wip-us.apache.org/repos/asf/ambari/blob/76ea14ed/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
index 099af7e..958758f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
@@ -2532,17 +2532,17 @@ public class UpgradeCatalog240Test {
     final Users users = createMock(Users.class);
 
     RequestScheduleEntity requestScheduleEntity = new RequestScheduleEntity();
-    requestScheduleEntity.setCreateUser("createduser"); // use lower case user name with request schedule entity
+    requestScheduleEntity.setCreateUser("createdUser");
     requestScheduleEntity.setClusterId(1L);
 
     expect(requestScheduleDAO.findAll()).andReturn(Collections.singletonList(requestScheduleEntity)).once();
 
     UserEntity userEntity = new UserEntity();
-    userEntity.setUserName("createduser"); // use lower case user name with user entity
+    userEntity.setUserName("createdUser");
     userEntity.setUserId(1);
     userEntity.setPrincipal(new PrincipalEntity());
     User user = new User(userEntity);
-    expect(users.getUserIfUnique("createduser")).andReturn(user).once();
+    expect(users.getUserIfUnique("createdUser")).andReturn(user).once();
 
     expect(requestScheduleDAO.merge(requestScheduleEntity)).andReturn(requestScheduleEntity).once();
 


[06/12] ambari git commit: AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)

Posted by jo...@apache.org.
AMBARI-14439. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8f8b26a1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8f8b26a1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8f8b26a1

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 8f8b26a1805e600bd0276733cf73aed9bc130b44
Parents: d7a914b
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Wed Oct 5 16:14:38 2016 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Wed Oct 5 16:14:41 2016 -0700

----------------------------------------------------------------------
 ambari-logsearch/pom.xml                        | 13 +++
 .../ambari-metrics-timelineservice/pom.xml      |  9 ++
 ambari-metrics/pom.xml                          | 30 ++++++-
 ambari-server/pom.xml                           | 11 +++
 .../alerts/AggregateAlertListenerTest.java      |  2 +
 .../alerts/AlertDefinitionEqualityTest.java     |  2 +
 .../state/alerts/AlertDefinitionHashTest.java   |  2 +
 .../state/alerts/AlertEventPublisherTest.java   |  2 +
 .../state/alerts/AlertReceivedListenerTest.java |  2 +
 .../alerts/AlertStateChangedEventTest.java      |  2 +
 .../state/alerts/InitialAlertEventTest.java     |  2 +
 .../KerberosComponentDescriptorTest.java        |  2 +
 .../KerberosConfigurationDescriptorTest.java    |  2 +
 .../state/kerberos/KerberosDescriptorTest.java  |  2 +
 .../KerberosDescriptorUpdateHelperTest.java     |  2 +
 .../KerberosIdentityDescriptorTest.java         |  2 +
 .../kerberos/KerberosKeytabDescriptorTest.java  |  2 +
 .../KerberosPrincipalDescriptorTest.java        |  2 +
 .../kerberos/KerberosServiceDescriptorTest.java |  2 +
 .../kerberos/VariableReplacementHelperTest.java |  2 +
 .../state/stack/ConfigUpgradePackTest.java      |  2 +
 .../state/stack/ConfigUpgradeValidityTest.java  |  2 +
 .../ambari/server/state/stack/OSFamilyTest.java |  3 +
 .../server/state/stack/UpgradePackTest.java     |  2 +
 pom.xml                                         | 86 +++++++++++++++++++-
 utility/pom.xml                                 | 49 +++++++++++
 utility/src/main/java/category/AlertTest.java   | 27 ++++++
 .../main/java/category/AmbariUpgradeTest.java   | 27 ++++++
 .../src/main/java/category/BlueprintTest.java   | 27 ++++++
 utility/src/main/java/category/FastTest.java    | 27 ++++++
 .../src/main/java/category/KerberosTest.java    | 27 ++++++
 utility/src/main/java/category/MetricsTest.java | 27 ++++++
 utility/src/main/java/category/SlowTest.java    | 27 ++++++
 .../main/java/category/StackUpgradeTest.java    | 27 ++++++
 34 files changed, 451 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-logsearch/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml
index 0445c39..a1b6c9d 100644
--- a/ambari-logsearch/pom.xml
+++ b/ambari-logsearch/pom.xml
@@ -70,6 +70,9 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <skip>${skipSurefireTests}</skip>
+
+          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
+          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -174,4 +177,14 @@
     </plugins>
   </build>
 
+  <dependencies>
+    <!-- Dependency in order to annotate unit tests with a category. -->
+    <dependency>
+      <groupId>utility</groupId>
+      <artifactId>utility</artifactId>
+      <version>1.0.0.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-metrics/ambari-metrics-timelineservice/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index 87e3423..6896c6b 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -239,6 +239,8 @@
           <redirectTestOutputToFile>true</redirectTestOutputToFile>
           <forkMode>always</forkMode>
           <argLine>-XX:-UseSplitVerifier</argLine>
+          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
+          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -628,6 +630,13 @@
       <scope>test</scope>
     </dependency>
 
+    <!-- Dependency in order to annotate unit tests with a category. -->
+    <dependency>
+      <groupId>utility</groupId>
+      <artifactId>utility</artifactId>
+      <version>1.0.0.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <profiles>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index 6ab8c60..2d88912 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -14,13 +14,15 @@
    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.
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0                              http://maven.apache.org/xsd/maven-4.0.0.xsd">
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0                              http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <groupId>org.apache.ambari</groupId>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>ambari-metrics</artifactId>
   <version>2.0.0.0-SNAPSHOT</version>
   <packaging>pom</packaging>
   <modules>
+    <module>../utility</module>
     <module>ambari-metrics-common</module>
     <module>ambari-metrics-hadoop-sink</module>
     <module>ambari-metrics-flume-sink</module>
@@ -168,6 +170,9 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <skip>${skipSurefireTests}</skip>
+
+          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
+          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -297,7 +302,28 @@
   </build>
 
   <dependencies>
+    <!-- Dependency in order to annotate unit tests with a category. -->
+    <dependency>
+      <groupId>utility</groupId>
+      <artifactId>utility</artifactId>
+      <version>1.0.0.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
-
+  <profiles>
+    <profile>
+      <id>FastTests</id>
+      <properties>
+        <testcase.groups>category.FastTest</testcase.groups>
+      </properties>
+      <dependencies>
+        <dependency>
+          <groupId>utility</groupId>
+          <artifactId>utility</artifactId>
+          <version>1.0.0.0-SNAPSHOT</version>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index e37accd..d3ec9ad 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -574,6 +574,9 @@
         <configuration>
           <skip>${skipSurefireTests}</skip>
           <argLine>-Xmx1024m -XX:MaxPermSize=512m -Xms512m</argLine>
+
+          <!-- Each profile in the top-level pom.xml defines which test group categories to run. -->
+          <groups>${testcase.groups}</groups>
         </configuration>
       </plugin>
       <plugin>
@@ -1455,6 +1458,14 @@
       <artifactId>metrics-jvm</artifactId>
       <version>3.1.0</version>
     </dependency>
+
+    <!-- Dependency in order to annotate unit tests with a category. -->
+    <dependency>
+      <groupId>utility</groupId>
+      <artifactId>utility</artifactId>
+      <version>1.0.0.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <pluginRepositories>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
index 85dedba..d53857c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
@@ -48,10 +48,12 @@ import com.google.inject.persist.PersistService;
 import com.google.inject.util.Modules;
 
 import junit.framework.Assert;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests the {@link AlertAggregateListener}.
  */
+@Category({ category.AlertTest.class})
 public class AggregateAlertListenerTest {
 
   private Injector m_injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
index 3cc84c0..1a914cd 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionEqualityTest.java
@@ -32,10 +32,12 @@ import org.apache.ambari.server.state.alert.ScriptSource;
 import org.apache.ambari.server.state.alert.Source;
 import org.apache.ambari.server.state.alert.SourceType;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests equality of {@link AlertDefinition} for hashing and merging purposes.
  */
+@Category({ category.AlertTest.class})
 public class AlertDefinitionEqualityTest extends TestCase {
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
index c534c4a..7a24966 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java
@@ -62,10 +62,12 @@ import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests for {@link AlertDefinitionHash}.
  */
+@Category({ category.AlertTest.class})
 public class AlertDefinitionHashTest extends TestCase {
 
   private AlertDefinitionHash m_hash;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
index 76aa2e4..c511f1a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
@@ -56,11 +56,13 @@ import com.google.gson.Gson;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests that {@link AmbariEvent} instances are fired correctly and that alert
  * data is bootstrapped into the database.
  */
+@Category({ category.AlertTest.class})
 public class AlertEventPublisherTest {
 
   private AlertDispatchDAO dispatchDao;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
index 7aef175..1867bda 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
@@ -61,10 +61,12 @@ import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
 import com.google.inject.persist.UnitOfWork;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests the {@link AlertReceivedListener}.
  */
+@Category({ category.AlertTest.class})
 public class AlertReceivedListenerTest {
 
   private static final String ALERT_DEFINITION = "alert_definition_";

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
index 7964d14..15ffef0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
@@ -61,6 +61,7 @@ import com.google.inject.persist.PersistService;
 import com.google.inject.util.Modules;
 
 import junit.framework.Assert;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests that {@link AlertStateChangeEvent} instances cause
@@ -68,6 +69,7 @@ import junit.framework.Assert;
  * should only be created when received alerts which have a firmness of
  * {@link AlertFirmness#HARD}.
  */
+@Category({ category.AlertTest.class})
 public class AlertStateChangedEventTest extends EasyMockSupport {
 
   private AlertEventPublisher eventPublisher;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
index fc4803b..c7a5915 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
@@ -51,10 +51,12 @@ import com.google.inject.persist.PersistService;
 import com.google.inject.util.Modules;
 
 import junit.framework.Assert;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests that {@link InitialAlertEventTest} instances are fired correctly.
  */
+@Category({ category.AlertTest.class })
 public class InitialAlertEventTest {
 
   private AlertsDAO m_alertsDao;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
index 201d84e..814e010 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosComponentDescriptorTest.java
@@ -22,6 +22,7 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -32,6 +33,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
+@Category({ category.KerberosTest.class})
 public class KerberosComponentDescriptorTest {
   public static final String JSON_VALUE =
       " {" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
index 4f2a2f5..47c4f19 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptorTest.java
@@ -22,9 +22,11 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.*;
 
+@Category({ category.KerberosTest.class})
 public class KerberosConfigurationDescriptorTest {
   private static final String JSON_SINGLE_VALUE =
       "{ \"configuration-type\": {" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
index 0070e6d..9e21742 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
@@ -21,6 +21,7 @@ import com.google.gson.*;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.IOException;
@@ -34,6 +35,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
+@Category({ category.KerberosTest.class})
 public class KerberosDescriptorTest {
   private static final KerberosDescriptorFactory KERBEROS_DESCRIPTOR_FACTORY = new KerberosDescriptorFactory();
   private static final KerberosServiceDescriptorFactory KERBEROS_SERVICE_DESCRIPTOR_FACTORY = new KerberosServiceDescriptorFactory();

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
index fca2f1f..3f347dc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelperTest.java
@@ -38,6 +38,7 @@ import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.EasyMock;
 import org.easymock.EasyMockSupport;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import javax.persistence.EntityManager;
 import javax.persistence.TypedQuery;
@@ -47,6 +48,7 @@ import java.util.Properties;
 import static org.easymock.EasyMock.anyString;
 import static org.easymock.EasyMock.expect;
 
+@Category({ category.KerberosTest.class})
 public class KerberosDescriptorUpdateHelperTest extends EasyMockSupport {
   private static final KerberosDescriptorFactory KERBEROS_DESCRIPTOR_FACTORY = new KerberosDescriptorFactory();
   private static final Gson GSON = new Gson();

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
index ef1c7bb..dbf090e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosIdentityDescriptorTest.java
@@ -22,12 +22,14 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.TreeMap;
 
+@Category({ category.KerberosTest.class})
 public class KerberosIdentityDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
index 79350eb..5c82662 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptorTest.java
@@ -22,10 +22,12 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.Map;
 import java.util.TreeMap;
 
+@Category({ category.KerberosTest.class})
 public class KerberosKeytabDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
index 635cc30..54f5c3f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptorTest.java
@@ -22,9 +22,11 @@ import com.google.gson.reflect.TypeToken;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.*;
 
+@Category({ category.KerberosTest.class})
 public class KerberosPrincipalDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
index 9896317..fb341ca 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorTest.java
@@ -21,6 +21,7 @@ import com.google.gson.Gson;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.IOException;
@@ -34,6 +35,7 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
+@Category({ category.KerberosTest.class})
 public class KerberosServiceDescriptorTest {
   public static final String JSON_VALUE =
       "{" +

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
index 8be0eb9..90f7022 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
@@ -21,10 +21,12 @@ package org.apache.ambari.server.state.kerberos;
 import junit.framework.Assert;
 import org.apache.ambari.server.AmbariException;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.HashMap;
 import java.util.Map;
 
+@Category({ category.KerberosTest.class})
 public class VariableReplacementHelperTest {
   VariableReplacementHelper helper = new VariableReplacementHelper();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
index 388a81f..27ee146 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradePackTest.java
@@ -28,6 +28,7 @@ import org.apache.ambari.server.state.stack.upgrade.ClusterGrouping.ExecuteStage
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -43,6 +44,7 @@ import static org.junit.Assert.*;
 /**
  * Tests for the config upgrade pack
  */
+@Category({ category.StackUpgradeTest.class})
 public class ConfigUpgradePackTest {
 
   private Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
index bf716b7..e764781 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/ConfigUpgradeValidityTest.java
@@ -39,6 +39,7 @@ import org.apache.ambari.server.state.stack.upgrade.Task.Type;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,6 +53,7 @@ import junit.framework.Assert;
  * Tests that for every upgrade pack found, that all referenced configuration
  * IDs exist in the {@code config-upgrade.xml} which will be used/created.
  */
+@Category({ category.StackUpgradeTest.class})
 public class ConfigUpgradeValidityTest {
 
   private static final Logger LOG = LoggerFactory.getLogger(ConfigUpgradeValidityTest.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
index 9654dc3..ba41687 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/OSFamilyTest.java
@@ -25,10 +25,13 @@ import junit.framework.Assert;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import java.lang.reflect.Method;
 import java.util.*;
 
 
+@Category({ category.StackUpgradeTest.class})
 public class OSFamilyTest {
    OsFamily os_family = null;
    private Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
index 97e50c3..6c81c61 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/stack/UpgradePackTest.java
@@ -58,6 +58,7 @@ import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -68,6 +69,7 @@ import com.google.inject.persist.PersistService;
 /**
  * Tests for the upgrade pack
  */
+@Category({ category.StackUpgradeTest.class})
 public class UpgradePackTest {
 
   private Injector injector;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7ca4ba4..bd0aa7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -516,7 +516,7 @@
         <module>ambari-client</module>
         <module>ambari-shell</module>
         <module>ambari-logsearch</module>
-      </modules>
+        </modules>
     </profile>
     <profile>
       <id>ambari-metrics</id>
@@ -542,7 +542,7 @@
         <module>ambari-agent</module>
         <module>ambari-client</module>
         <module>ambari-shell</module>
-      </modules>
+        </modules>
     </profile>
     <profile>
       <id>clover</id>
@@ -662,5 +662,87 @@ instead of a SNAPSHOT. -->
         </plugins>
       </build>
     </profile>
+
+    <!-- Start of profiles for running unit tests.
+     The category names are Java interfaces in utility/src/main/java/category/
+     The testcase.groups property contains a csv list of these categories (including the Java package name).
+
+     To run a suite of all test cases annotated with a list of categories, run the command
+     mvn test -P $PROFILE_ID
+
+     E.g.,
+     mvn test -P FastTests
+     -->
+
+    <!-- Tests are are explicitly fast. -->
+    <profile>
+      <id>FastTests</id>
+      <properties>
+        <testcase.groups>category.FastTest</testcase.groups>
+      </properties>
+    </profile>
+
+    <!-- Tests are are explicitly slow. -->
+    <profile>
+      <id>SlowTests</id>
+      <properties>
+        <testcase.groups>category.SlowTest</testcase.groups>
+      </properties>
+    </profile>
+
+    <!-- Slow tests, or tests that are not annotated. -->
+    <profile>
+      <id>NonFastTests</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <excludedGroups>org.apache.ambari.server.FastTest</excludedGroups>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!-- Unit test Profiles based on features. -->
+    <profile>
+      <id>AlertTests</id>
+      <properties>
+        <testcase.groups>category.AlertTest</testcase.groups>
+      </properties>
+    </profile>
+    <profile>
+      <id>AmbariUpgradeTests</id>
+      <properties>
+        <testcase.groups>category.AmbariUpgradeTest</testcase.groups>
+      </properties>
+    </profile>
+    <profile>
+      <id>BlueprintTests</id>
+      <properties>
+        <testcase.groups>category.BlueprintTest</testcase.groups>
+      </properties>
+    </profile>
+    <profile>
+      <id>KerberosTests</id>
+      <properties>
+        <testcase.groups>category.KerberosTest</testcase.groups>
+      </properties>
+    </profile>
+    <profile>
+      <id>MetricsTests</id>
+      <properties>
+        <testcase.groups>category.MetricsTest</testcase.groups>
+      </properties>
+    </profile>
+    <profile>
+      <id>StackUpgradeTests</id>
+      <properties>
+        <testcase.groups>category.StackUpgradeTest</testcase.groups>
+      </properties>
+    </profile>
   </profiles>
+  <!-- End of profiles for running unit tests. -->
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/pom.xml
----------------------------------------------------------------------
diff --git a/utility/pom.xml b/utility/pom.xml
new file mode 100644
index 0000000..9f3fe32
--- /dev/null
+++ b/utility/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+   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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>utility</artifactId>
+  <groupId>utility</groupId>
+  <version>1.0.0.0-SNAPSHOT</version>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>compile</scope>    <!-- has to be compile-time dependency on junit -->
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.2</version>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+          <useIncrementalCompilation>false</useIncrementalCompilation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/AlertTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/AlertTest.java b/utility/src/main/java/category/AlertTest.java
new file mode 100644
index 0000000..b6a20ec
--- /dev/null
+++ b/utility/src/main/java/category/AlertTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.AlertTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P AlertTests
+ */
+public interface AlertTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/AmbariUpgradeTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/AmbariUpgradeTest.java b/utility/src/main/java/category/AmbariUpgradeTest.java
new file mode 100644
index 0000000..881107a
--- /dev/null
+++ b/utility/src/main/java/category/AmbariUpgradeTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.AmbariUpgradeTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P AmbariUpgradeTests
+ */
+public interface AmbariUpgradeTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/BlueprintTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/BlueprintTest.java b/utility/src/main/java/category/BlueprintTest.java
new file mode 100644
index 0000000..cb7871d
--- /dev/null
+++ b/utility/src/main/java/category/BlueprintTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.BlueprintTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P BlueprintTests
+ */
+public interface BlueprintTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/FastTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/FastTest.java b/utility/src/main/java/category/FastTest.java
new file mode 100644
index 0000000..a0abddf
--- /dev/null
+++ b/utility/src/main/java/category/FastTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.FastTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P FastTests
+ */
+public interface FastTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/KerberosTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/KerberosTest.java b/utility/src/main/java/category/KerberosTest.java
new file mode 100644
index 0000000..f7cebdf
--- /dev/null
+++ b/utility/src/main/java/category/KerberosTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.KerberosTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P KerberosTests
+ */
+public interface KerberosTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/MetricsTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/MetricsTest.java b/utility/src/main/java/category/MetricsTest.java
new file mode 100644
index 0000000..a352ae2
--- /dev/null
+++ b/utility/src/main/java/category/MetricsTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.MetricsTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P MetricsTests
+ */
+public interface MetricsTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/SlowTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/SlowTest.java b/utility/src/main/java/category/SlowTest.java
new file mode 100644
index 0000000..c1025a9
--- /dev/null
+++ b/utility/src/main/java/category/SlowTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.SlowTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P SlowTests
+ */
+public interface SlowTest {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f8b26a1/utility/src/main/java/category/StackUpgradeTest.java
----------------------------------------------------------------------
diff --git a/utility/src/main/java/category/StackUpgradeTest.java b/utility/src/main/java/category/StackUpgradeTest.java
new file mode 100644
index 0000000..20a1723
--- /dev/null
+++ b/utility/src/main/java/category/StackUpgradeTest.java
@@ -0,0 +1,27 @@
+/*
+ * 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 category;
+
+/**
+ * Category of unit tests that can be annotated. E.g.,
+ * {@code @Category({ category.StackUpgradeTest.class}) }
+ *
+ * A Profile can have csv of categories, in order to run the unit tests like,
+ * mvn clean test -P StackUpgradeTests
+ */
+public interface StackUpgradeTest {}
\ No newline at end of file


[11/12] ambari git commit: AMBARI-18521. Stack upgrade fix for Ranger in secure env (mugdha)

Posted by jo...@apache.org.
AMBARI-18521. Stack upgrade fix for Ranger in secure env (mugdha)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bce5dbe3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bce5dbe3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bce5dbe3

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: bce5dbe3eacda9d35e645a776f1f9aa3edf06e9c
Parents: 8b6e45e
Author: Mugdha Varadkar <mu...@apache.org>
Authored: Thu Oct 6 10:27:02 2016 +0530
Committer: Mugdha Varadkar <mu...@apache.org>
Committed: Thu Oct 6 11:40:02 2016 +0530

----------------------------------------------------------------------
 .../RangerKerberosConfigCalculation.java        | 32 ++++++++++++--------
 .../RangerKerberosConfigCalculationTest.java    |  6 ++--
 2 files changed, 22 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bce5dbe3/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java
index c3d71c0..ba0da79 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculation.java
@@ -29,6 +29,7 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.SecurityType;
+import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Inject;
 
@@ -47,7 +48,6 @@ public class RangerKerberosConfigCalculation extends AbstractServerAction {
   private static final String KAFKA_ENV_CONFIG_TYPE = "kafka-env";
   private static final String RANGER_KMS_ENV_CONFIG_TYPE = "kms-env";
   private static final String HDFS_SITE_CONFIG_TYPE = "hdfs-site";
-  private static final String RANGER_SPNEGO_PRINCIPAL = "ranger.spnego.kerberos.principal";
   private static final String RANGER_SPNEGO_KEYTAB = "ranger.spnego.kerberos.keytab";
   private static final String RANGER_PLUGINS_HDFS_SERVICE_USER = "ranger.plugins.hdfs.serviceuser";
   private static final String RANGER_PLUGINS_HIVE_SERVICE_USER = "ranger.plugins.hive.serviceuser";
@@ -168,9 +168,27 @@ public class RangerKerberosConfigCalculation extends AbstractServerAction {
     Config stormConfig = cluster.getDesiredConfigByType(STORM_ENV_CONFIG_TYPE);
 
     if (null != stormConfig) {
+      String stormValue = null;
       String stormUser = stormConfig.getProperties().get("storm_user");
+
+      if (cluster.getSecurityType() == SecurityType.KERBEROS) {
+        String stormPrincipal = stormConfig.getProperties().get("storm_principal_name");
+        if (null != stormPrincipal) {
+          String[] stormPrincipalParts = stormPrincipal.split("@");
+          if(null != stormPrincipalParts && stormPrincipalParts.length > 1) {
+            String stormPrincipalBareName = stormPrincipalParts[0];
+            stormValue = stormPrincipalBareName;
+          }
+        }
+      }
+
       if (null != stormUser) {
-        targetValues.put(RANGER_PLUGINS_STORM_SERVICE_USER, stormUser);
+        if(!StringUtils.isBlank(stormValue)) {
+          stormValue = stormValue + "," + stormUser;
+        } else {
+          stormValue = stormUser;
+        }
+        targetValues.put(RANGER_PLUGINS_STORM_SERVICE_USER, stormValue);
         rangerAdminconfig.setProperties(targetValues);
         rangerAdminconfig.persist(false);
         sucessMsg = sucessMsg + MessageFormat.format("{0}\n", RANGER_PLUGINS_STORM_SERVICE_USER);
@@ -220,18 +238,8 @@ public class RangerKerberosConfigCalculation extends AbstractServerAction {
       Config hdfsSiteConfig = cluster.getDesiredConfigByType(HDFS_SITE_CONFIG_TYPE);
 
       if (null != hdfsSiteConfig) {
-        String spnegoPrincipal = hdfsSiteConfig.getProperties().get("dfs.web.authentication.kerberos.principal");
         String spnegoKeytab = hdfsSiteConfig.getProperties().get("dfs.web.authentication.kerberos.keytab");
 
-        if (null != spnegoPrincipal) {
-          targetValues.put(RANGER_SPNEGO_PRINCIPAL, spnegoPrincipal);
-          rangerAdminconfig.setProperties(targetValues);
-          rangerAdminconfig.persist(false);
-          sucessMsg = sucessMsg + MessageFormat.format("{0}\n", RANGER_SPNEGO_PRINCIPAL);
-        } else {
-          errMsg = errMsg + MessageFormat.format("{0} not found in {1}\n", "dfs.web.authentication.kerberos.principal", HDFS_SITE_CONFIG_TYPE);          
-        }
-
         if (null != spnegoKeytab) {
           targetValues.put(RANGER_SPNEGO_KEYTAB, spnegoKeytab);
           rangerAdminconfig.setProperties(targetValues);

http://git-wip-us.apache.org/repos/asf/ambari/blob/bce5dbe3/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculationTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculationTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculationTest.java
index 133a9e3..25acb45 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculationTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerKerberosConfigCalculationTest.java
@@ -118,6 +118,7 @@ public class RangerKerberosConfigCalculationTest {
     Config stormConfig = new ConfigImpl("storm-env") {
       Map<String, String> mockProperties = new HashMap<String, String>() {{
         put("storm_user", "storm");
+        put("storm_principal_name", "storm-c1@EXAMLE.COM");
       }};
 
       @Override
@@ -150,7 +151,6 @@ public class RangerKerberosConfigCalculationTest {
 
     Config hdfsSiteConfig = new ConfigImpl("hdfs-site") {
       Map<String, String> mockProperties = new HashMap<String, String>() {{
-        put("dfs.web.authentication.kerberos.principal", "HTTP/_HOST.COM");
         put("dfs.web.authentication.kerberos.keytab", "/etc/security/keytabs/spnego.kytab");
       }};
 
@@ -236,7 +236,6 @@ public class RangerKerberosConfigCalculationTest {
     assertTrue(map.containsKey("ranger.plugins.storm.serviceuser"));
     assertTrue(map.containsKey("ranger.plugins.kafka.serviceuser"));
     assertTrue(map.containsKey("ranger.plugins.kms.serviceuser"));
-    assertTrue(map.containsKey("ranger.spnego.kerberos.principal"));
     assertTrue(map.containsKey("ranger.spnego.kerberos.keytab"));    
 
 
@@ -245,10 +244,9 @@ public class RangerKerberosConfigCalculationTest {
     assertEquals("yarn", map.get("ranger.plugins.yarn.serviceuser"));
     assertEquals("hbase", map.get("ranger.plugins.hbase.serviceuser"));
     assertEquals("knox", map.get("ranger.plugins.knox.serviceuser"));
-    assertEquals("storm", map.get("ranger.plugins.storm.serviceuser"));
+    assertEquals("storm-c1,storm", map.get("ranger.plugins.storm.serviceuser"));
     assertEquals("kafka", map.get("ranger.plugins.kafka.serviceuser"));
     assertEquals("kms", map.get("ranger.plugins.kms.serviceuser"));
-    assertEquals("HTTP/_HOST.COM", map.get("ranger.spnego.kerberos.principal"));
     assertEquals("/etc/security/keytabs/spnego.kytab", map.get("ranger.spnego.kerberos.keytab"));
 
     report = action.execute(null);


[03/12] ambari git commit: AMBARI-14439. ADDENDUM. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)

Posted by jo...@apache.org.
AMBARI-14439. ADDENDUM. Categorize unit tests so can run mvn test -P $PROFILE (alejandro)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f7edfba
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f7edfba
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f7edfba

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 1f7edfba8358ad3f07b168ec5c7f2245e01016d8
Parents: 76ea14e
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Wed Oct 5 12:53:52 2016 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Wed Oct 5 12:53:55 2016 -0700

----------------------------------------------------------------------
 ambari-metrics/pom.xml |  1 +
 pom.xml                |  6 ------
 utility/pom.xml        | 34 ++++++++++++++++++++++++++++++++--
 3 files changed, 33 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7edfba/ambari-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index a010f47..80c99dc 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -31,6 +31,7 @@
     <module>ambari-metrics-host-monitoring</module>
     <module>ambari-metrics-grafana</module>
     <module>ambari-metrics-assembly</module>
+    <module>../utility</module>
   </modules>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7edfba/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 831089d..bd0aa7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -745,10 +745,4 @@ instead of a SNAPSHOT. -->
     </profile>
   </profiles>
   <!-- End of profiles for running unit tests. -->
-
-  <!-- Must depend on the utility project in order to find the
-  categories (testcase.groups) used in the unit test profiles. -->
-  <modules>
-    <module>utility</module>
-  </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f7edfba/utility/pom.xml
----------------------------------------------------------------------
diff --git a/utility/pom.xml b/utility/pom.xml
index c98e2ed..9f3fe32 100644
--- a/utility/pom.xml
+++ b/utility/pom.xml
@@ -1,4 +1,20 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0"?>
+<!--
+   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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -16,4 +32,18 @@
       <scope>compile</scope>    <!-- has to be compile-time dependency on junit -->
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.2</version>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+          <useIncrementalCompilation>false</useIncrementalCompilation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>