The error actually has the solution for you, see this "java.lang.String cannot be cast to java.util.Date"
Properties in soapUI are stored as strings (correct me if i am wrong), all you have to do is transform your string to date.
import
//import this
import java.text.SimpleDateFormat
change
baseDate = props.getPropertyValue("data_cap")
to
//get the string "data_cap" and parse it to date()
//if you are not using hours, minutes and sconds, delete hh:mm:ss
baseDate = new SimpleDateFormat("yyyy.MM.dd hh:mm:ss").parse(props.getPropertyValue("data_cap"))
your changed code
//import this
import java.text.SimpleDateFormat
def distretto = context.expand( '${#Global#distretto}' )
def Path_UDB = context.expand( '${#Global#Path_UDB}' )
def testDataSet = []
def failureList = []
def fileName = "${Path_UDB}\\VDCRTG\\data_cap_${distretto}.txt"
new File(fileName).eachLine { line -> testDataSet.add( line.split(",") ) }
context.setProperty( "failureList", failureList )
context.setProperty( "testDataSet", testDataSet )
context.setProperty( "index", 0 )
def testDataSet1 = context.getProperty("testDataSet")
def index = context.getProperty("index")
def testDataLine = testDataSet1[index]
def props = testRunner.testCase.getTestStepByName( "Properties" )
props.setPropertyValue("data_cap", testDataLine[0])
newDate = new Date()
log.info ("newDate = $newDate")
//get the string "data_cap" and parse it to date()
//if you are not using hours, minutes and sconds, delete hh:mm:ss
baseDate = new SimpleDateFormat("yyyy.MM.dd hh:mm:ss").parse(props.getPropertyValue("data_cap"))
if( newDate >= (baseDate + 10)) {
props.setPropertyValue("timer", "25000")
log.info '10 days passed from previous CAP'
f = new File("${Path_UDB}\\VDCRTG\\data_cap_${distretto}.txt")
f.write("$newDate")
} else {
props.setPropertyValue("timer", "1000")
}