Skip to content

Commit 0a51438

Browse files
committed
[integeration-tests] Move groovy script in dedicated file for jakarata-ee
1 parent 1170693 commit 0a51438

File tree

2 files changed

+19
-36
lines changed

2 files changed

+19
-36
lines changed

integration-tests/jakarta-ee/pom.xml

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -374,42 +374,7 @@
374374
</goals>
375375
<configuration>
376376
<scripts>
377-
<script><![CDATA[
378-
def executor_number = System.getenv('EXECUTOR_NUMBER')
379-
if (executor_number != null) {
380-
final int port_increment = 100
381-
final int admin_port_increment = 48
382-
int portbase = 4900 + (executor_number as int) * port_increment
383-
int adminPort
384-
// find a free port
385-
for (; portbase < 10000; portbase += port_increment) {
386-
def server_socket
387-
adminPort = portbase + admin_port_increment
388-
try {
389-
server_socket = new ServerSocket()
390-
server_socket.setReuseAddress true
391-
server_socket.bind(new InetSocketAddress(adminPort))
392-
break
393-
} catch (IOException e) {
394-
println "Admin port $adminPort is busy, trying next"
395-
} finally {
396-
server_socket?.close()
397-
}
398-
}
399-
400-
int httpsPort = portbase + 81
401-
402-
project.properties.'payara.portbase' = portbase as String
403-
project.properties.'payara.adminport' = adminPort as String
404-
project.properties.'payara.argLine' = "-DadminPort=$adminPort -Dpayara.https.port=$httpsPort" as String
405-
project.properties.'payara.restart.skip' = project.properties.'payara.start.skip'
406-
println "Payara: portbase = ${project.properties.'payara.portbase'}, " +
407-
"argLine = ${project.properties.'payara.argLine'}"
408-
} else {
409-
project.properties.'payara.argLine' = ''
410-
project.properties.'payara.restart.skip' = 'true'
411-
}
412-
]]></script>
377+
<script>${project.basedir}/src/main/resources/script.groovy</script>
413378
</scripts>
414379
</configuration>
415380
</execution>

integration-tests/jakarta-ee/src/main/resources/script.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
def executor_number = System.getenv('EXECUTOR_NUMBER')
220
if (executor_number != null) {
321
final int port_increment = 100

0 commit comments

Comments
 (0)