Forum Discussion

Nagravision_SA__1's avatar
12 years ago

SoapUI 5 - MockServices duplicated after restart

Hello,

I am facing a major issue:
I have a project with 2 WADL
I have created 2 Mock Service for those WADL.
Upon every restart of SoapUI, those MockService are duplicated !!
If I restart 2 times i will end up with 6 MockServices, 2 only being the correct one.

So for instance, when correct, my settings.xml look like this:


<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project activeEnvironment="Default" name="WFMServices" resourceRoot="" soapui-version="5.0.0" abortOnError="false" runType="SEQUENTIAL" id="261e8ea1-669e-4f33-8e4e-45d40b51991d" xmlns:con="http://eviware.com/soapui/config"><con:settings><con:setting id="ProjectSettings@hermesConfig">${#System#user.home}\.hermes</con:setting></con:settings><con:requirements/><con:properties><con:property><con:name>harmonic.mock.service.call.timeout</con:name><con:value>300000</con:value></con:property><con:property><con:name>locker.mock.service.source.file.path</con:name><con:value>D:/Users/garmelin/Documents/Customers/CMS4/WFM_Rest_Mockup/GET_capture_response.json</con:value></con:property><con:property><con:name>locker.mock.service.port</con:name><con:value>9091</con:value></con:property><con:property><con:name>cms.server.soap.service.call.timeout</con:name><con:value>300000</con:value></con:property><con:property><con:name>cms.server.soap.service.url</con:name><con:value>http://PC10249:8080/automation-ws/CmsAutomationWS?wsdl</con:value></con:property><con:property><con:name>harmonic.mock.service.source.file.path</con:name><con:value>D:/Users/garmelin/Documents/Customers/CMS4/WFM_Rest_Mockup/HarmonicJobs.xml</con:value></con:property><con:property><con:name>harmonic.mock.service.port</con:name><con:value>9091</con:value></con:property><con:property><con:name>locker.mock.service.call.timeout</con:name><con:value>300000</con:value></con:property></con:properties><con:afterLoadScript>project.getTestSuiteByName("ATC API Methods").getTestCaseByName("LoadConfigurations").run(context, false)</con:afterLoadScript><con:wssContainer/><con:databaseConnectionContainer/><con:oAuth2ProfileContainer/><con:sensitiveInformation/><con:restMockService port="9090" path="/" host="PC10249" name="Harmonic_Mockup" docroot=""><con:settings/><con:startScript>context.getMockService().setPropertyValue("contentIterator", "0")
log.info "Harmonic Mockup Service Started"</con:startScript><con:properties><con:property><con:name>sourceFile</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentTestSuite</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>contentIterator</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentContentResponse</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property></con:properties></con:restMockService><con:restMockService port="9090" path="/" host="PC10249" name="Locker_Mockup" docroot=""><con:settings/><con:startScript>log.info "Locker Mockup Service Started"</con:startScript><con:properties><con:property><con:name>sourceFile</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentTestSuite</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property></con:properties><con:onRequestScript/></con:restMockService></con:soapui-project>


After a restart, it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project activeEnvironment="Default" name="WFMServices" resourceRoot="" soapui-version="5.0.0" abortOnError="false" runType="SEQUENTIAL" id="261e8ea1-669e-4f33-8e4e-45d40b51991d" xmlns:con="http://eviware.com/soapui/config"><con:settings><con:setting id="ProjectSettings@hermesConfig">${#System#user.home}\.hermes</con:setting></con:settings><con:requirements/><con:properties><con:property><con:name>harmonic.mock.service.call.timeout</con:name><con:value>300000</con:value></con:property><con:property><con:name>locker.mock.service.source.file.path</con:name><con:value>D:/Users/garmelin/Documents/Customers/CMS4/WFM_Rest_Mockup/GET_capture_response.json</con:value></con:property><con:property><con:name>locker.mock.service.port</con:name><con:value>9091</con:value></con:property><con:property><con:name>cms.server.soap.service.call.timeout</con:name><con:value>300000</con:value></con:property><con:property><con:name>cms.server.soap.service.url</con:name><con:value>http://PC10249:8080/automation-ws/CmsAutomationWS?wsdl</con:value></con:property><con:property><con:name>harmonic.mock.service.source.file.path</con:name><con:value>D:/Users/garmelin/Documents/Customers/CMS4/WFM_Rest_Mockup/HarmonicJobs.xml</con:value></con:property><con:property><con:name>harmonic.mock.service.port</con:name><con:value>9091</con:value></con:property><con:property><con:name>locker.mock.service.call.timeout</con:name><con:value>300000</con:value></con:property></con:properties><con:afterLoadScript>project.getTestSuiteByName("ATC API Methods").getTestCaseByName("LoadConfigurations").run(context, false)</con:afterLoadScript><con:wssContainer/><con:databaseConnectionContainer/><con:oAuth2ProfileContainer/><con:sensitiveInformation/><con:restMockService port="9090" path="/" host="PC10249" name="Harmonic_Mockup" docroot=""><con:settings/><con:startScript>context.getMockService().setPropertyValue("contentIterator", "0")
log.info "Harmonic Mockup Service Started"</con:startScript><con:properties><con:property><con:name>sourceFile</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentTestSuite</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>contentIterator</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentContentResponse</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property></con:properties></con:restMockService><con:restMockService port="9090" path="/" host="PC10249" name="Locker_Mockup" docroot=""><con:settings/><con:startScript>log.info "Locker Mockup Service Started"</con:startScript><con:properties><con:property><con:name>sourceFile</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentTestSuite</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property></con:properties><con:onRequestScript/></con:restMockService><con:restMockService port="9090" path="/" host="PC10249" name="Harmonic_Mockup" docroot=""><con:settings/><con:startScript>context.getMockService().setPropertyValue("contentIterator", "0")
log.info "Harmonic Mockup Service Started"</con:startScript><con:properties><con:property><con:name>sourceFile</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentTestSuite</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>contentIterator</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentContentResponse</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property></con:properties></con:restMockService><con:restMockService port="9090" path="/" host="PC10249" name="Locker_Mockup" docroot=""><con:settings/><con:startScript>log.info "Locker Mockup Service Started"</con:startScript><con:properties><con:property><con:name>sourceFile</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property><con:property><con:name>currentTestSuite</con:name><con:value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></con:property></con:properties><con:onRequestScript/></con:restMockService></con:soapui-project>


and so on, one of each is added after each restart !! The 2 added one only have the name and port definition, none of the request or scripts....
Can you please advise? Since our scripts are starting mockservice by name, none of the testsuites are working anymore!

3 Replies

  • This only happens when using a composite project.
    Furthermore, I would randomly lost mock action on my mock services when adding new ones...

    Reverting to a non composite fixed the problem. i will open a ticket