Hiya
that was part of it
here's the full script, in the referenced test case its the first test step that's run before any of the data extraction (via jdbc datasource using sql queries) and datasink creation, the datasinks are set to append as multiple rows of data are potentially returned in any iteration
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def CurrentDir = new File(groovyUtils.projectPath).parent
def CurrentDirStr
println()
print '################# Delete Existing DS File - Party Details'
println()
//check to see if we're running under windows
File Windir = new File('\\Windows')
if (!Windir.exists())
{
CurrentDir = (System.getProperty("user.dir"))
def lastChar = CurrentDir[-1]
if (lastChar != '/'){CurrentDir=CurrentDir+'/'}
if (!CurrentDir.contains('/workspace/')){CurrentDir=CurrentDir+'/workspace/'}
CurrentDirStr = CurrentDir.toString()
testRunner.testCase.testSuite.project.setPropertyValue('UsedFilesGenericLocation',CurrentDirStr)
print '#### Current Dir = '+ CurrentDirStr
}
else
{
def lastChar = CurrentDir[-1]
if (lastChar != '\\'){CurrentDir=CurrentDir+'\\'}
CurrentDirStr = CurrentDir.toString()
testRunner.testCase.testSuite.project.setPropertyValue('UsedFilesGenericLocation',CurrentDirStr)
log.info CurrentDirStr
}
log.info ' Deleting files'
def getPartyDetails = context.expand( '${#Project#GetPartyDetails}' )
def getPartyPhoneDetails = context.expand( '${#Project#GetPartyPhoneDetails}' )
def getPartyEmailDetails = context.expand( '${#Project#GetPartyEmailDetails}' )
def getPartyAddressDetails = context.expand( '${#Project#GetPartyAddressDetails}' )
[new File(CurrentDirStr+getPartyDetails),
new File(CurrentDirStr+getPartyPhoneDetails),
new File(CurrentDirStr+getPartyEmailDetails),
new File(CurrentDirStr+getPartyAddressDetails)].
each{ it.delete() } //delete files
log.info ' Checking files deleted'
assert ! new File(CurrentDirStr+getPartyDetails).exists()
assert ! new File(CurrentDirStr+getPartyPhoneDetails).exists()
assert ! new File(CurrentDirStr+getPartyEmailDetails).exists()
assert ! new File(CurrentDirStr+getPartyAddressDetails).exists()