Exemplo n.º 1
0
 def test_03_should_try_deploy_receive_compare_result(self):
     test_helper.create_apex_metadata(self, "unit test deploy project",
                                      "ApexClass", "test_deployapexclass")
     org_connections = test_util.parse_json_from_file(
         os.path.join(self.settings['user']['mm_workspace'],
                      "unit test deploy project", "config",
                      ".org_connections"))
     stdin = {
         "project_name":
         "unit test deploy project",
         "destinations": [{
             "id": org_connections[0]["id"],
             "username": org_connections[0]["username"],
             "org_type": org_connections[0]["environment"]
         }],
         "check_only":
         True,
         "run_tests":
         False,
         "rollback_on_error":
         True,
         "package": {
             "ApexClass": ["test_deployapexclass"]
         },
         "debug_categories":
         ""
     }
     mm_response = self.runCommand(['mm.py', '-o', 'deploy'], stdin)
     self.assertTrue(test_helper.get_creds()['username'] in mm_response)
     self.assertTrue('unpackaged/classes/test_deployapexclass.cls' in
                     mm_response[test_helper.get_creds()['username']])
Exemplo n.º 2
0
 def test_04_should_attempt_deploy_to_bad_org_connection(self):
     org_connections = test_util.parse_json_from_file(
         os.path.join(self.settings['user']['mm_workspace'],
                      "unit test deploy project", "config",
                      ".org_connections"))
     stdin = {
         "project_name":
         "unit test deploy project",
         "destinations": [{
             "id": org_connections[0]["id"],
             "username": "******",
             "org_type": org_connections[0]["environment"]
         }],
         "check_only":
         True,
         "run_tests":
         False,
         "rollback_on_error":
         True,
         "package": {
             "ApexClass": ["test_deployapexclass"]
         },
         "debug_categories":
         ""
     }
     mm_response = self.runCommand(['mm.py', '-o', 'deploy'], stdin)
     self.assertTrue('*****@*****.**' in mm_response)
     self.assertEquals(False,
                       mm_response['*****@*****.**']['success'])
     result = test_helper.delete_apex_metadata(
         self, "unit test deploy project", [
             os.path.join(test_helper.base_test_directory, "test_workspace",
                          "unit test deploy project", "src", "classes",
                          "test_deployapexclass.cls")
         ])
Exemplo n.º 3
0
 def test_05_should_delete_org_connection(self): 
     org_connections = test_util.parse_json_from_file(os.path.join(self.settings['user']['mm_workspace'],"unit test deploy project","config",".org_connections"))
     stdin = {
         "id"            : org_connections[0]["id"],
         "project_name"  : "unit test deploy project"
     }
     mm_response = self.runCommand('delete_connection', stdin)        
     self.assertTrue(mm_response['success'] == True)
Exemplo n.º 4
0
 def test_05_should_delete_org_connection(self):
     org_connections = test_util.parse_json_from_file(
         os.path.join(self.settings['user']['mm_workspace'],
                      "unit test deploy project", "config",
                      ".org_connections"))
     stdin = {
         "id": org_connections[0]["id"],
         "project_name": "unit test deploy project"
     }
     mm_response = self.runCommand('delete_connection', stdin)
     self.assertTrue(mm_response['success'] == True)
Exemplo n.º 5
0
    def test_04_should_fetch_checkpoint(self): 
        stdin = {
            "project_name"      : "unit test tooling project",
        }
        mm_response = self.runCommand('fetch_checkpoints', stdin)
        self.assertEqual(mm_response['success'],True)  

        ###DELETE CLASS
        client_settings = util.parse_json_from_file(os.path.join(test_helper.base_test_directory,"lib","user_client_settings.json"))
        stdin = {
            "files": [os.path.join(client_settings["mm_workspace"],"unit test tooling project","src","classes","unittesttoolingapexclass.cls")], 
            "project_name": "unit test tooling project"
        }
        mm_response = self.runCommand('delete', stdin)        
        self.assertEqual(mm_response['success'],True)  
Exemplo n.º 6
0
    def test_04_should_fetch_checkpoint(self):
        stdin = {
            "project_name": "unit test tooling project",
        }
        mm_response = self.runCommand('fetch_checkpoints', stdin)
        self.assertEqual(mm_response['success'], True)

        ###DELETE CLASS
        client_settings = util.parse_json_from_file(
            os.path.join(test_helper.base_test_directory, "lib",
                         "user_client_settings.json"))
        stdin = {
            "files": [
                os.path.join(client_settings["mm_workspace"],
                             "unit test tooling project", "src", "classes",
                             "unittesttoolingapexclass.cls")
            ],
            "project_name":
            "unit test tooling project"
        }
        mm_response = self.runCommand('delete', stdin)
        self.assertEqual(mm_response['success'], True)
Exemplo n.º 7
0
 def test_04_should_attempt_deploy_to_bad_org_connection(self): 
     org_connections = test_util.parse_json_from_file(os.path.join(self.settings['user']['mm_workspace'],"unit test deploy project","config",".org_connections"))
     stdin = {
         "project_name"      :   "unit test deploy project",
         "destinations"      :   [
             {
                 "id"            : org_connections[0]["id"],
                 "username"      : "*****@*****.**",
                 "org_type"      : org_connections[0]["environment"]
             }
         ],
         "check_only"        :   True,
         "run_tests"         :   False,
         "rollback_on_error" :   True,
         "package"           :   {
             "ApexClass" : ["test_deployapexclass"]
         },
         "debug_categories"  :   ""
     }
     mm_response = self.runCommand(['mm.py', '-o', 'deploy'], stdin)        
     self.assertTrue('*****@*****.**' in mm_response)
     self.assertEquals(False, mm_response['*****@*****.**']['success'])
     result = test_helper.delete_apex_metadata(self, "unit test deploy project", [os.path.join(test_helper.base_test_directory,"test_workspace","unit test deploy project","src","classes","test_deployapexclass.cls")])
Exemplo n.º 8
0
 def test_03_should_try_deploy_receive_compare_result(self): 
     test_helper.create_apex_metadata(self, "unit test deploy project", "ApexClass", "test_deployapexclass")
     org_connections = test_util.parse_json_from_file(os.path.join(self.settings['user']['mm_workspace'],"unit test deploy project","config",".org_connections"))
     stdin = {
         "project_name"      :   "unit test deploy project",
         "destinations"      :   [
             {
                 "id"            : org_connections[0]["id"],
                 "username"      : org_connections[0]["username"],
                 "org_type"      : org_connections[0]["environment"]
             }
         ],
         "check_only"        :   True,
         "run_tests"         :   False,
         "rollback_on_error" :   True,
         "package"           :   {
             "ApexClass" : ["test_deployapexclass"]
         },
         "debug_categories"  :   ""
     }
     mm_response = self.runCommand(['mm.py', '-o', 'deploy'], stdin)        
     self.assertTrue('*****@*****.**' in mm_response)
     self.assertTrue('unpackaged/classes/test_deployapexclass.cls' in mm_response['*****@*****.**'])