rodgersh
13 years agoOccasional Contributor
How do I remove a global property from a Groovy script?
I have a Groovy setup script that programmatically creates/sets global properties. In my associated Groovy tear down script I want to remove/delete those same global properties (rather than just set them to null or an empty string).
How do I do this?
I have tried context.removeProperty( propertyName ) which did nothing (property and its value set in the setup script are still there).
I also tried PropertyExpansionUtils.GlobalPropertyExpansionContext.removeProperty( propertyName ) and get a runtime script error that states:
Wed Sep 26 13:28:25 MST 2012:ERROR:groovy.lang.MissingMethodException: No signature of method: static com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils$GlobalPropertyExpansionContext.removeProperty() is applicable for argument types: (java.lang.String) values: [PROPERTY_NAME]
Possible solutions: removeProperty(java.lang.String), getProperty(java.lang.String)
What am I doing wrong?
Thanks -
Hugh
How do I do this?
I have tried context.removeProperty( propertyName ) which did nothing (property and its value set in the setup script are still there).
I also tried PropertyExpansionUtils.GlobalPropertyExpansionContext.removeProperty( propertyName ) and get a runtime script error that states:
Wed Sep 26 13:28:25 MST 2012:ERROR:groovy.lang.MissingMethodException: No signature of method: static com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils$GlobalPropertyExpansionContext.removeProperty() is applicable for argument types: (java.lang.String) values: [PROPERTY_NAME]
Possible solutions: removeProperty(java.lang.String), getProperty(java.lang.String)
What am I doing wrong?
Thanks -
Hugh