duccio_fabbri
9 years agoNew Contributor
Issue with WsdlMockRunner isRunning()
When a mock service is stopped, it seems getMockRunner() returns "null".
Is it ok?!
Here is my code:
def wsdlMockService = testRunner.testCase.project.mockServices["ServiceSoapBinding MockService"] wsdlMockService.start() try{ if (wsdlMockService.getMockRunner().isRunning()) log.info("+++++++++ Mock is running") else log.info("+++++++++ Mock is NOT running")} catch(Exception e) { log.info("++++ ERROR: " + e.getMessage())} wsdlMockService.getMockRunner().stop() try{ if (wsdlMockService.getMockRunner().isRunning()) log.info("------- Mock is running") else log.info("------- Mock is NOT running")} catch(Exception e) { log.info("---- ERROR: " + e.getMessage())}
RESULTS:
- Wed Sep 14 23:55:35 CEST 2016:INFO:+++++++++ Mock is running
- Wed Sep 14 23:55:35 CEST 2016:INFO:---- ERROR: Cannot invoke method isRunning() on null object