This is an automated email from the ASF dual-hosted git repository.

jungm pushed a commit to branch ee11
in repository https://gitbox.apache.org/repos/asf/tomee-tck.git

commit 2cb46d3c9ae523c1d83ad63f6e572eacf653bfe1
Author: Markus Jung <[email protected]>
AuthorDate: Sun Jul 19 16:29:03 2026 +0200

    Run the platform catalog on dynamically selected free ports
    
    run-platform-suite.sh selects free http/https/shutdown/derby/harness-log
    ports once at branch start and passes them as -D overrides. The run pom
    introduces the tomee.*.port and tck.harness.log.port properties, chains
    tck.http.port to tomee.http.port so the failsafe client target can never
    diverge from the container bind, points securedWebServicePort at
    tomee.https.port, filters the arquillian.xml port literals, stages ts.jte
    through a filtered copy so its webServerPort and harness.log.port track the
    chosen ports, and asserts the chosen TomEE ports free at validate.
---
 environment/tck/ts.jte                             |  4 +-
 runner-webprofile/run-platform-suite.sh            | 17 +++++++
 runner-webprofile/run/pom.xml                      | 52 +++++++++++++++++++++-
 .../run/src/test/resources-javatest/arquillian.xml |  9 ++--
 .../run/src/test/resources-servlet/arquillian.xml  |  5 ++-
 5 files changed, 77 insertions(+), 10 deletions(-)

diff --git a/environment/tck/ts.jte b/environment/tck/ts.jte
index 7ac190e..3355258 100644
--- a/environment/tck/ts.jte
+++ b/environment/tck/ts.jte
@@ -14,7 +14,7 @@ bin.dir=${signature.bin.dir}
 sigTestClasspath=${signature.classpath}
 
 webServerHost=localhost
-webServerPort=8080
+webServerPort=${tomee.http.port}
 logical.hostname.servlet=localhost
 
 # Vendor VariableMapper implementation the expression-language TCK's
@@ -45,7 +45,7 @@ longvarbinarySize=50
 db.supports.sequence=false
 db.dml.file=environment/tck/derby.dml.sql
 
-harness.log.port=2000
+harness.log.port=${tck.harness.log.port}
 harness.log.traceflag=false
 harness.socket.retry.count=10
 harness.temp.directory=${java.io.tmpdir}
diff --git a/runner-webprofile/run-platform-suite.sh 
b/runner-webprofile/run-platform-suite.sh
index b888f07..02822e3 100755
--- a/runner-webprofile/run-platform-suite.sh
+++ b/runner-webprofile/run-platform-suite.sh
@@ -36,6 +36,18 @@ if [ "$PROTOCOL" != "servlet" ] && [ "$PROTOCOL" != 
"javatest" ]; then
   exit 2
 fi
 
+# Select free ports once at branch start; all partitions in the loop run
+# sequentially on one node so a single selection covers them. Each preferred
+# port avoids the ones already chosen. The validate-phase guards inside each
+# mvnw run then assert these chosen ports immediately before servers start.
+SELECT_PORT="$ROOT_DIR/environment/ports/select-free-port.sh"
+TOMEE_HTTP_PORT=$(sh "$SELECT_PORT" 8080)
+TOMEE_HTTPS_PORT=$(sh "$SELECT_PORT" 8443 "$TOMEE_HTTP_PORT")
+TOMEE_SHUTDOWN_PORT=$(sh "$SELECT_PORT" 8005 "$TOMEE_HTTP_PORT" 
"$TOMEE_HTTPS_PORT")
+TCK_DERBY_PORT=$(sh "$SELECT_PORT" 1527 "$TOMEE_HTTP_PORT" "$TOMEE_HTTPS_PORT" 
"$TOMEE_SHUTDOWN_PORT")
+TCK_HARNESS_LOG_PORT=$(sh "$SELECT_PORT" 2000 "$TOMEE_HTTP_PORT" 
"$TOMEE_HTTPS_PORT" "$TOMEE_SHUTDOWN_PORT" "$TCK_DERBY_PORT")
+echo "Using ports: http=$TOMEE_HTTP_PORT https=$TOMEE_HTTPS_PORT 
shutdown=$TOMEE_SHUTDOWN_PORT derby=$TCK_DERBY_PORT 
harness-log=$TCK_HARNESS_LOG_PORT"
+
 # Build the shared modules once so the per-partition runs can skip -am and
 # not rebuild the unchanged reactor every iteration.
 "$ROOT_DIR/mvnw" -B -ntp -pl tomee-porting -am install </dev/null
@@ -65,6 +77,11 @@ while IFS="$TAB" read -r partition artifact protocol groups 
source_classes expec
     "-Dtck.groups=$groups" \
     "-Dtck.test=$test_pattern" \
     "-Dtck.exclusions.file=$exclusions_file" \
+    "-Dtomee.http.port=$TOMEE_HTTP_PORT" \
+    "-Dtomee.https.port=$TOMEE_HTTPS_PORT" \
+    "-Dtomee.shutdown.port=$TOMEE_SHUTDOWN_PORT" \
+    "-Dtck.derby.port=$TCK_DERBY_PORT" \
+    "-Dtck.harness.log.port=$TCK_HARNESS_LOG_PORT" \
     verify </dev/null
 
   actual_classes=0
diff --git a/runner-webprofile/run/pom.xml b/runner-webprofile/run/pom.xml
index 694f902..04bdc3c 100644
--- a/runner-webprofile/run/pom.xml
+++ b/runner-webprofile/run/pom.xml
@@ -135,6 +135,26 @@
               </resources>
             </configuration>
           </execution>
+          <execution>
+            <!-- Stage the JavaTest harness config through a filtered copy so
+                 ts.jte's webServerPort/harness.log.port track the chosen 
ports.
+                 derby.dml.sql carries no ${ tokens and copies alongside it.
+                 Unresolvable ts.jte placeholders (${signature.bin.dir},
+                 ${signature.classpath}) pass through untouched for runtime
+                 resolution from the harness props bag. -->
+            <id>stage-tck-harness-configuration</id>
+            <phase>generate-test-resources</phase>
+            <goals><goal>copy-resources</goal></goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/tck</outputDirectory>
+              <resources>
+                <resource>
+                  
<directory>${project.basedir}/../../environment/tck</directory>
+                  <filtering>true</filtering>
+                </resource>
+              </resources>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
       <plugin>
@@ -218,6 +238,25 @@
               <classpathScope>test</classpathScope>
             </configuration>
           </execution>
+          <execution>
+            <!-- New for platform branches: assert the chosen container ports
+                 are free immediately before TomEE starts, closing the 
adapter's
+                 silent attach-to-foreign-server path. The harness log port is
+                 deliberately not passed: servlet-protocol partitions never 
bind
+                 it and a leftover listener on 2000 must not fail them. -->
+            <id>require-free-tomee-ports</id>
+            <phase>validate</phase>
+            <goals><goal>exec</goal></goals>
+            <configuration>
+              <executable>sh</executable>
+              <arguments>
+                
<argument>${project.basedir}/../../environment/tomee/require-tomee-ports-free.sh</argument>
+                <argument>${tomee.http.port}</argument>
+                <argument>${tomee.https.port}</argument>
+                <argument>${tomee.shutdown.port}</argument>
+              </arguments>
+            </configuration>
+          </execution>
           <execution>
             <id>generate-test-certificates</id>
             <phase>generate-test-resources</phase>
@@ -397,7 +436,7 @@
             
<signature.bin.dir>${project.build.directory}/signature/com/sun/ts/tests/signaturetest/signature-repository</signature.bin.dir>
             <signature.classpath>${signature.classpath}</signature.classpath>
             <tck.ts.home>${tck.ts.home}</tck.ts.home>
-            <securedWebServicePort>8443</securedWebServicePort>
+            <securedWebServicePort>${tomee.https.port}</securedWebServicePort>
             <ws_wait>5</ws_wait>
             
<servlet_adaptor>org.apache.openejb.server.rest.OpenEJBRestServlet</servlet_adaptor>
             
<org.apache.cxf.transport.http.forceURLConnection>true</org.apache.cxf.transport.http.forceURLConnection>
@@ -430,7 +469,16 @@
     <tck.test>**/*IT.java</tck.test>
     <tck.groups>web &amp; !tck-javatest</tck.groups>
     <tck.host>localhost</tck.host>
-    <tck.http.port>8080</tck.http.port>
+    <!-- Container bind ports. run-platform-suite.sh selects free values and
+         passes them as -D overrides; the arquillian-tomee-remote adapter
+         rewrites the staged server.xml literals to these. -->
+    <tomee.http.port>8080</tomee.http.port>
+    <tomee.https.port>8443</tomee.https.port>
+    <tomee.shutdown.port>8005</tomee.shutdown.port>
+    <tck.harness.log.port>2000</tck.harness.log.port>
+    <!-- The failsafe client target (webServerPort) must always equal the
+         container bind port, so chain it off tomee.http.port. -->
+    <tck.http.port>${tomee.http.port}</tck.http.port>
     <tck.trace>false</tck.trace>
     <tck.ts.home>${java.io.tmpdir}</tck.ts.home>
     <!-- Matches the datasources in environment/tomee/conf/tomee.xml. -->
diff --git a/runner-webprofile/run/src/test/resources-javatest/arquillian.xml 
b/runner-webprofile/run/src/test/resources-javatest/arquillian.xml
index c4fbca5..44714b2 100644
--- a/runner-webprofile/run/src/test/resources-javatest/arquillian.xml
+++ b/runner-webprofile/run/src/test/resources-javatest/arquillian.xml
@@ -15,8 +15,9 @@
       <property 
name="conf">${project.build.directory}/tomee-overlay/conf</property>
       <property 
name="lib">${project.build.directory}/tomee-overlay/lib</property>
       <property name="host">localhost</property>
-      <property name="httpPort">8080</property>
-      <property name="stopPort">8005</property>
+      <property name="httpPort">${tomee.http.port}</property>
+      <property name="stopPort">${tomee.shutdown.port}</property>
+      <property name="httpsPort">${tomee.https.port}</property>
       <property name="cleanOnStartUp">true</property>
       <property name="removeUnusedWebapps">true</property>
       <property name="simpleLog">true</property>
@@ -25,8 +26,8 @@
     <protocol type="javatest">
       <property name="trace">${tck.trace}</property>
       <property 
name="workDir">${project.build.directory}/javatest-work</property>
-      <property 
name="tsJteFile">${project.basedir}/../../environment/tck/ts.jte</property>
-      <property 
name="tsSqlStmtFile">${project.basedir}/../../environment/tck/derby.dml.sql</property>
+      <property 
name="tsJteFile">${project.build.directory}/tck/ts.jte</property>
+      <property 
name="tsSqlStmtFile">${project.build.directory}/tck/derby.dml.sql</property>
     </protocol>
   </container>
 </arquillian>
diff --git a/runner-webprofile/run/src/test/resources-servlet/arquillian.xml 
b/runner-webprofile/run/src/test/resources-servlet/arquillian.xml
index 4b1e79b..0fa9fdb 100644
--- a/runner-webprofile/run/src/test/resources-servlet/arquillian.xml
+++ b/runner-webprofile/run/src/test/resources-servlet/arquillian.xml
@@ -16,8 +16,9 @@
       <property 
name="conf">${project.build.directory}/tomee-overlay/conf</property>
       <property 
name="lib">${project.build.directory}/tomee-overlay/lib</property>
       <property name="host">localhost</property>
-      <property name="httpPort">8080</property>
-      <property name="stopPort">8005</property>
+      <property name="httpPort">${tomee.http.port}</property>
+      <property name="stopPort">${tomee.shutdown.port}</property>
+      <property name="httpsPort">${tomee.https.port}</property>
       <property name="cleanOnStartUp">true</property>
       <property name="removeUnusedWebapps">true</property>
       <property name="simpleLog">true</property>

Reply via email to