Forum Discussion

mag02's avatar
16 years ago

mock service runner - multiple projects

Hello,

we're trying to run multiple projects via the mockservicerunner script and would like to get to the following state:
- all projects available on the same listener port

The problem is that:
- there can be only one instance started via the mockservicerunner script on the same listener port, if another project is started on the same port, it's inaccessible
- it's possible to specify only one project file to the mockservicerunner script so we can't start them all at once

Via the soapUI GUI we can start multiple projects and they can all listen on the same port - ie. in the GUI the service launch is handled in more intelligent way, but here we need to get rid of the GUI usage and just start several projects on the same port

Does anyone know about such possibility to get it done?
For example specifying some custom property to the mockwervicerunner script which would force it to not attempt to start another jetty instance - if there's one already running on the same port - and just attach to the existing one, or something similar to the soapUI project startup behaviour.

Thanks,

Peter

1 Reply

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    For now it is probably easiest if you create a custom java app that loads the desired projects and runs their mockservices "manually"; something like the following should get you started.

    // load a project and start a mockservice
    WsdlProject project = new WsdlProject( pathToProjectFile );
    WsdlMockService mockService = project.getMockServiceByName( "My MockService" );
    WsdlMockRunner mockRunner = mockService.start();

    regards!

    /Ole
    eviware.com