@@ -61,12 +61,6 @@ def initializeEnvironment() {
6161 . ${JABBA_SHELL}
6262 jabba which 1.8''' , returnStdout : true ). trim()
6363
64- env. TEST_JAVA_HOME = sh(label : ' Get TEST_JAVA_HOME' ,script : ''' #!/bin/bash -le
65- . ${JABBA_SHELL}
66- jabba which ${JABBA_VERSION}''' , returnStdout : true ). trim()
67- env. TEST_JAVA_VERSION = sh(label : ' Get TEST_JAVA_VERSION' ,script : ''' #!/bin/bash -le
68- echo "${JABBA_VERSION##*.}"''' , returnStdout : true ). trim()
69-
7064 sh label : ' Download Apache CassandraⓇ or DataStax Enterprise' ,script : ''' #!/bin/bash -le
7165 . ${JABBA_SHELL}
7266 jabba use 1.8
@@ -115,7 +109,12 @@ def buildDriver(jabbaVersion) {
115109}
116110
117111def executeTests () {
118- sh label : ' Execute tests' , script : ''' #!/bin/bash -le
112+ def testJavaHome = sh(label : ' Get TEST_JAVA_HOME' ,script : ''' #!/bin/bash -le
113+ . ${JABBA_SHELL}
114+ jabba which ${JABBA_VERSION}''' , returnStdout : true ). trim()
115+ def testJavaVersion = (JABBA_VERSION =~ / .*\. (\d +)/ )[0 ][1 ]
116+
117+ def executeTestScript = ''' #!/bin/bash -le
119118 # Load CCM environment variables
120119 set -o allexport
121120 . ${HOME}/environment.txt
@@ -137,8 +136,8 @@ def executeTests() {
137136 printenv | sort
138137
139138 mvn -B -V ${INTEGRATION_TESTS_FILTER_ARGUMENT} -T 1 verify \
140- -Ptest-jdk-${TEST_JAVA_VERSION} \
141- -DtestJavaHome=${TEST_JAVA_HOME} \
139+ -Ptest-jdk-''' + testJavaVersion + ''' \
140+ -DtestJavaHome=''' + testJavaHome + ''' \
142141 -DfailIfNoTests=false \
143142 -Dmaven.test.failure.ignore=true \
144143 -Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
@@ -149,6 +148,8 @@ def executeTests() {
149148 ${ISOLATED_ITS_ARGUMENT} \
150149 ${PARALLELIZABLE_ITS_ARGUMENT}
151150 '''
151+ echo " Invoking Maven with parameters test-jdk-${ testJavaVersion} and testJavaHome = ${ testJavaHome} "
152+ sh label : ' Execute tests' , script : executeTestScript
152153}
153154
154155def executeCodeCoverage () {
0 commit comments