For running some of the other standalone tests I found it helpful to look at the .sh scripts here:
sed -i "s/^impl\\.vi\\.deploy\\.dir=/$(echo impl\\.vi\\.deploy\\.dir=\\${web.home}/domains/domain1/autodeploy | sed -e 's/\\\\/\\\\\\\\/g; s/\\//\\\\\\//g;')/g" ts.jte
Especially for embedding into a groovy (pipeline) script where the escaping becomes a little over the top, I found it easier to just use another delimiter here for sed. E.g. for JASPIC I'm using:
# Change /sun/glassfish4/glassfish to jaspic.home=${ts.home}/../glassfish5/glassfish
sed -i "s#^jaspic.home=.*#$(echo jaspic.home=${SERVER_HOME})#g" ts.jte
sed -i 's#^harness\.log\.traceflag=#harness\.log\.traceflag=true#g' ts.jte
# Change /tmp/JTwork to work.dir=${ts.home}/../JTwork
sed -i "s#^work.dir=/tmp/JTwork#$(echo work\.dir=${HARNESS_WORK_DIR})#g" ts.jte
sed -i "s#^report.dir=/tmp/JTreport#$(echo report\.dir=${HARNESS_REPORT_DIR})#g" ts.jte
# It's an open question why these settings are not just part of ts.jte to begin with.
# It's also an open question why the Authentication TCK insists on these being defined
echo "persistence.unit.name.2=JPATCK2" >> ts.jte
echo "javax.persistence.provider=org.eclipse.persistence.jpa.PersistenceProvider" >> ts.jte
echo "javax.persistence.jdbc.driver=org.apache.derby.jdbc.ClientDriver" >> ts.jte
echo "javax.persistence.jdbc.url="" >> ts.jte
echo "javax.persistence.jdbc.user=cts1" >> ts.jte
echo "javax.persistence.jdbc.password=cts1" >> ts.jte
echo "jpa.provider.implementation.specific.properties=eclipselink.logging.level\=OFF" >> ts.jte
echo "persistence.second.level.caching.supported=true" >> ts.jte