Fixed Debugger API test cases.

refs #5343
This commit is contained in:
Nikhil Mohite 2020-12-17 18:59:44 +05:30 committed by Akshay Joshi
parent 3def9792be
commit a0ff0e30fb
7 changed files with 25 additions and 13 deletions

View File

@ -51,9 +51,9 @@ class DebuggerClearAllBreakpoint(BaseTestGenerator):
if self.init_target:
debugger_utils.initialize_target(self, utils)
debugger_utils.start_listener(self)
debugger_utils.start_listener(self, utils, db_utils)
self.port_no = debugger_utils.messages(self, utils, db_utils)
debugger_utils.start_execution(self)
debugger_utils.start_execution(self, utils, db_utils)
breakpoint = debugger_utils.set_breakpoint(self)
def clear_all_breakpoint(self):

View File

@ -49,10 +49,10 @@ class DebuggerExecuteQuery(BaseTestGenerator):
if self.init_target:
debugger_utils.initialize_target(self, utils)
debugger_utils.start_listener(self)
debugger_utils.start_listener(self, utils, db_utils)
self.port_no = debugger_utils.messages(self, utils, db_utils)
debugger_utils.start_execution(self)
debugger_utils.start_execution(self, utils, db_utils)
def execute_query(self):
return self.tester.get(

View File

@ -51,9 +51,9 @@ class DebuggerPollExecutionResult(BaseTestGenerator):
if self.init_target:
debugger_utils.initialize_target(self, utils)
debugger_utils.start_listener(self)
debugger_utils.start_listener(self, utils, db_utils)
self.port_no = debugger_utils.messages(self, utils, db_utils)
debugger_utils.start_execution(self)
debugger_utils.start_execution(self, utils, db_utils)
def poll_execution_result(self):
return self.tester.get(

View File

@ -51,7 +51,7 @@ class DebuggerPollResult(BaseTestGenerator):
if self.init_target:
debugger_utils.initialize_target(self, utils)
debugger_utils.start_listener(self)
debugger_utils.start_listener(self, utils, db_utils)
def execute_query(self):
return self.tester.get(

View File

@ -51,9 +51,9 @@ class DebuggerSetBreakpoint(BaseTestGenerator):
if self.init_target:
debugger_utils.initialize_target(self, utils)
debugger_utils.start_listener(self)
debugger_utils.start_listener(self, utils, db_utils)
self.port_no = debugger_utils.messages(self, utils, db_utils)
debugger_utils.start_execution(self)
debugger_utils.start_execution(self, utils, db_utils)
if self.query_type == 2:
debugger_utils.set_breakpoint(self)

View File

@ -51,7 +51,7 @@ class DebuggerStartExecution(BaseTestGenerator):
if self.init_target:
debugger_utils.initialize_target(self, utils)
debugger_utils.start_listener(self)
debugger_utils.start_listener(self, utils, db_utils)
self.port_no = debugger_utils.messages(self, utils, db_utils)
def start_execution(self):

View File

@ -126,11 +126,16 @@ def initialize_target(self, utils, close_debugger_instance=True):
'for indirect debugging.')
def start_listener(self):
def start_listener(self, utils, db_utils):
response = self.tester.get(
'debugger/start_listener/' + str(self.trans_id),
content_type='application/json')
if response.status_code != 200:
close_debugger(self)
delete_function(self, utils)
db_utils.disconnect_database(
self, self.server_id, self.db_id)
self.skipTest('Debugger is in Busy state.')
self.assertEqual(response.status_code, 200)
@ -163,11 +168,18 @@ def messages(self, utils, db_utils):
return port
def start_execution(self):
def start_execution(self, utils, db_utils):
response = self.tester.get(
'debugger/start_execution/' + str(self.trans_id) + '/' + str(
self.port_no), content_type='application/json')
if response.status_code != 200:
close_debugger(self)
delete_function(self, utils)
db_utils.disconnect_database(
self, self.server_id, self.db_id)
self.skipTest('Debugger is in Busy state.')
self.assertEqual(response.status_code, 200)