Forum Discussion

PHaegele's avatar
PHaegele
Occasional Contributor
15 years ago

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

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    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
  • torstenreinhard's avatar
    torstenreinhard
    Occasional Contributor
    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
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    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