This is an automated email from the ASF dual-hosted git repository. benw pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
commit bafa7f74ac10952b6ddc3de268d45b2e12ae7e07 Author: Ben Weidig <[email protected]> AuthorDate: Sun Mar 29 15:17:45 2026 +0200 TAP5-2819: SeleniumTestCase allow paramters from system property as fallback To eventually parallelize the integration testing in the future, the integration tests variant shouldn't all use the default port 9090. Therefore, the parameters should fallback to system properties if the XML value is null, and only if the prop is null, too, return the default value. --- tapestry-core/build.gradle | 24 ++++++++++++++++------ .../apache/tapestry5/test/SeleniumTestCase.java | 8 +++++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/tapestry-core/build.gradle b/tapestry-core/build.gradle index 0940740f5..d50636592 100644 --- a/tapestry-core/build.gradle +++ b/tapestry-core/build.gradle @@ -144,22 +144,34 @@ tasks.register('testWithJqueryAndRequireJsDisabled', Test) { group = 'Verification' description = 'Runs tests with jQuery and Require.js disabled' - systemProperty 'tapestry.javascript-infrastructure-provider', 'jquery' - systemProperty 'tapestry.require-js-enabled', 'false' + systemProperties( + 'tapestry.javascript-infrastructure-provider': 'jquery', + 'tapestry.require-js-enabled': 'false', + 'tapestry.port': '9091', + 'tapestry.ssl-port': '8444' + ) } tasks.register('testWithPrototypeAndRequireJsEnabled', Test) { group = 'Verification' description = 'Runs tests with Prototype and Require.js enabled' - systemProperty 'tapestry.javascript-infrastructure-provider', 'prototype' - systemProperty 'tapestry.require-js-enabled', 'true' + systemProperties( + 'tapestry.javascript-infrastructure-provider': 'prototype', + 'tapestry.require-js-enabled': 'true', + 'tapestry.port': '9092', + 'tapestry.ssl-port': '8445' + ) } tasks.register('testWithPrototypeAndRequireJsDisabled', Test) { group = 'Verification' description = 'Runs tests with Prototype and Require.js disabled' - systemProperty 'tapestry.javascript-infrastructure-provider', 'prototype' - systemProperty 'tapestry.require-js-enabled', 'false' + systemProperties( + 'tapestry.javascript-infrastructure-provider': 'prototype', + 'tapestry.require-js-enabled': 'false', + 'tapestry.port': '9093', + 'tapestry.ssl-port': '8446' + ) } diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java index d9d1f0bf4..83b60031a 100644 --- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java +++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java @@ -360,12 +360,18 @@ public abstract class SeleniumTestCase extends Assert implements Selenium { String value = xmlTest.getParameter(key); + if (value == null) + { + // fall back to JVM system property + value = System.getProperty(key); + } + return value != null ? value : defaultValue; } private final int getIntParameter(XmlTest xmlTest, String key, int defaultValue) { - String value = xmlTest.getParameter(key); + String value = getParameter(xmlTest, key, null); return value != null ? Integer.parseInt(value) : defaultValue; }
