cancel
Showing results for 
Search instead for 
Did you mean: 

Singletons stay alive until soapUI is restarted

Occasional Contributor

Singletons stay alive until soapUI is restarted

Hi,

I´ve several singleton instances in my API that get called via a "Groovy Teststep".

When executing a Groovy Teststep it seems, that no new VM is started - the objects "live" in the VM of the soapUI instance.
That leads to several problems, when restarting a Teststep after changing external resources (files, database values and so on....)

=> is it possible to start a own VM each time I execute a teststep or a testcase?

Thanx,Torsten
3 REPLIES 3

Re: Singletons stay alive until soapUI is restarted

Hi ,

can you consider using SetUp and TearDown groovy scripts to handle you resources?
I think that is what you need.

Hope it helps

Regards
Nebojsa


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Occasional Contributor

Re: Singletons stay alive until soapUI is restarted

no, sorry that´s not what I need....
In normal cases singletons don´t have "destroy", "re-initialize" methods - so I´m not able to "setup" or "tearDown" them.

I would suggest to start a new VM always (or at least to have a switch in the properties to be able to do that) - as a JUnit Testrunner does.

Maybe there´s a "hook-method" in your API ?

Thanx, Torsten

Re: Singletons stay alive until soapUI is restarted

Hi Thorsten,

thanks for this, as you have noticed it isn't currently possible. Running scripts in a seperate jvm/process would impose quite alot of overhead I guess, and wouldn't give you access to the soapUI objects, etc.. but I'll put it in our JIRA for improvements..

As a workaround, could you not spawn a process via the groovy process support; http://groovy.codehaus.org/Process+Management

hope this helps,

regards,

/Ole
eviware.com


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements