Repository: ambari
Updated Branches:
  refs/heads/trunk 451e61c34 -> bf8fd74e2


AMBARI-6082. ambari-server setup does not check that custom jdk path is jdk. 
Unit tests.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: bf8fd74e24650ed93e267c7819bec68c5e4b3a17
Parents: 451e61c
Author: Vitaly Brodetskyi <vbrodets...@hortonworks.com>
Authored: Wed Jun 11 09:34:42 2014 +0300
Committer: Vitaly Brodetskyi <vbrodets...@hortonworks.com>
Committed: Wed Jun 11 09:34:42 2014 +0300

----------------------------------------------------------------------
 ambari-server/src/test/python/TestAmbariServer.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bf8fd74e/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index 335937d..f169468 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -2016,6 +2016,23 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
     except FatalException as fe:
       # Expected
       pass
+    # Test when custom java home exists but java binary file doesn't exist
+    args.java_home = None
+    path_isfileMock.return_value = False
+    write_property_mock.reset_mock()
+    remove_property_mock.reset_mock()
+    path_existsMock.side_effect = [True,False,False]
+    get_validated_string_input_mock.return_value = "3"
+    get_JAVA_HOME_mock.return_value = False
+    flag = False
+    try:
+      ambari_server.download_jdk(args)
+      self.fail("Should throw exception")
+    except FatalException as fe:
+      # Expected
+      flag = True
+      pass
+    self.assertTrue(flag)
     #Test case: Setup ambari-server with java home passed. Path to java home 
doesn't not exists
     args.java_home = "somewhere"
     path_existsMock.return_value = False

Reply via email to