Forum Discussion

bobotzzz's avatar
12 years ago

Mock service start whithin a groovy script test step

Hi,
I am trying to do a test step which is supposed to kill any existing instances of an application and then start the mocking service (that I already have set up and which is working as expected if run alone) and then start the same application (with new app properties set in a previous test step) and then sleep. The problem appears when the script is running of the mock service, which outputs this:

13:59:55,923 INFO [SoapUIMockServiceRunner] Running MockService ["fePt_v1_0_SOAPBinding_MockService"] in project [FA]
13:59:55,923 INFO [SoapUIMockServiceRunner] Press any key to terminate
13:59:55,923 INFO [SoapUIMockServiceRunner] Started 0 runners
Press any key to terminate...
13:59:56,923 INFO [SoapUIMockServiceRunner] time taken: 1000ms


As I stated before, when running the MockService alone (sh /home/soapui/bin/mockservicerunner.sh -m"fePt_v1_0_SOAPBinding_MockService" /home/ce/vt/trunk/TestSuite/FA-soapui-project.xml) it starts 2 runners on the expected port and waits for me to "Press any key to terminate".

this is the script I am trying to use:

proc1 = 'ps -ef'.execute()
proc2 = 'grep DO'.execute()
proc3 = 'grep -v grep'.execute()
proc4 = 'cut -c10-15 '.execute()
proc5 = 'xargs kill -9 '.execute()
proc1 | proc2 | proc3 | proc4 | proc5
proc5.waitFor()
if (proc5.exitValue())
print proc5.err.text
else
print proc5.text

log.info("------------ Starting MOCK ---------------");
startAppCommand = 'sh /home/soapui/bin/mockservicerunner.sh -m"fePt_v1_0_SOAPBinding_MockService" /home/ce/vt/trunk/TestSuite/FA-soapui-project.xml'.execute()
startAppCommand.waitFor()
if (startAppCommand.exitValue())
log.info("Received Error -> "+startAppCommand.err.text)
else
log.info("Everything OK! -> "+startAppCommand.text)

log.info("------------ MOCK procedure finished ---------------");

log.info("------------ EXEcuting ---------------");
'/home/ce-e/run_do.sh'.execute();

log.info("------------ sleeping ---------------");
sleep(65000)



PS: all is done headless on a Ubuntu virtual machine
No RepliesBe the first to reply