Forum Discussion

tdrury's avatar
tdrury
Contributor
15 years ago

groovy in mixed pro and non-pro environment

We have 5(ish) pro licenses but also some non-Pro users. I'm trying to write a groovy script which can be usable in both. It would seem easy to simply use the non-Pro classes, but I can't seem to do that in my Pro version.

e.g. I have a groovy script that calls a teststep in another project. To create the project object I use:

def testlibProject = new com.eviware.soapui.impl.wsdl.WsdlProjectPro(testLibraryFilename, workspace)

This is in soapUI Pro 3.6.1. If I change WsdlProjectPro (above) to WsdlProject, I get the following error in the error log when the testcase.run() method is executed:

ERROR:java.lang.ClassCastException: com.eviware.soapui.impl.wsdl.WsdlProject cannot be cast to com.eviware.soapui.impl.wsdl.WsdlProjectPro

If I use soapUI 3.6.1 (non-Pro), I cannot use WsdlProjectPro or else I get a compile error - this is easily understood. When I use just WsdlProject, I get an error later in the script:

groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.teststeps.registry.ProPlaceholderStepFactory$WsdlProPlaceholderTestStep.getDataSource() is applicable for argument types: () values: []

which I don't understand: how is the non-Pro version using ProPlaceholderStepFactory?

I need guidance for writing groovy scripts in a mixed environment so both Pro and non-Pro users can run these groovy scripts.

-tim

3 Replies

  • Hi,

    ProPlaceholderStepFactory is non-pro class used for just "holding place" for TestSteps that are not accessible from the open source version, like DataSource / DataSink, etc. So basically you can only use open source features from both environments , you can not use DataSource for instance at all, even from groovy.
    You can use WsdlProject(testLibraryFilename, workspace) as long as you don't execute pro features.
    What exact script gives you this last error you mention, is it calling a pro test step?

    Regards,
    Dragica
    /www.eviware.com
  • The testcase I'm calling in the other project does use a Datasource (a CSV file). I didn't realize that Datasource was Pro-only. So calling a testcase with a Datasource cannot be done from a non-Pro testcase? That makes sense - unfortunately for me.

    Our Hudson/maven build system will be using a Pro-licensed version of soapUI testrunner. It won't have an issue with this. But not all of our developers will have the Pro version. I'm trying build up a core set of utility "tests" which are not really tests but some common functionality they may leverage to make building their tests easier. One of those core functions uses Datasource. So a non-Pro developer will be unable to run their tests within the UI if any part of their tests call a project built with a Pro feature, right?

    -tim