[java-idp-integration-tests] 04/04: Cleanup - set idp.version as system property

Tom Zeller tzeller at dragonacea.biz
Wed Oct 15 23:04:48 UTC 2025


This is an automated email from the git hooks/post-receive script.

tzeller pushed a commit to branch main
in repository java-idp-integration-tests.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=ee62a96d5e737c439845ba90b92bd51430276900

commit ee62a96d5e737c439845ba90b92bd51430276900
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Tue Oct 14 19:37:33 2025 -0500

    Cleanup - set idp.version as system property
---
 pom.xml                                            |  2 ++
 .../shibboleth/idp/integration/tests/BaseTest.java | 25 +++++-----------------
 2 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/pom.xml b/pom.xml
index 840f5fe..e40062f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -362,6 +362,8 @@
                     <!-- Override parent POM test output - console or file - defaults to false (console). -->
                     <redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
                     <systemPropertyVariables>
+                        <!-- Pass idp.version to tests as system property -->
+                        <idp.version>${idp.version}</idp.version>
                         <!-- Pass jetty.version to tests as system property -->
                         <jetty.version>${jetty.version}</jetty.version>
                         <!-- Pass tomcat.version to tests as system property -->
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/BaseTest.java b/src/test/java/net/shibboleth/idp/integration/tests/BaseTest.java
index ca3a42c..feabf5a 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/BaseTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/BaseTest.java
@@ -33,7 +33,6 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
-import java.nio.file.DirectoryStream;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -462,30 +461,16 @@ public abstract class BaseTest {
         log.debug("Path to build directory '{}'", buildPath.toAbsolutePath());
         Assert.assertTrue(buildPath.toAbsolutePath().toFile().exists(), "Path to build directory not found");
 
+        // Get IdP version from system property populated by Surefire plugin
+        idpVersion = System.getProperty("idp.version");
+        log.debug("Testing IdP version '{}'", idpVersion);
+
         // Path to idp distribution.
-        try (DirectoryStream<Path> stream = Files.newDirectoryStream(buildPath, "*shibboleth-identity-provider-*")) {
-            for (Path entry : stream) {
-                pathToIdPDist = entry;
-                break;
-            }
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
+        pathToIdPDist = buildPath.resolve("shibboleth-identity-provider-" + idpVersion);
         log.debug("Path to idp distribution '{}'", pathToIdPDist.toAbsolutePath());
         Assert.assertNotNull(pathToIdPDist, "IdP distribution not found");
         Assert.assertTrue(pathToIdPDist.toAbsolutePath().toFile().exists(), "IdP distribution does not exist");
 
-        // Determine IdP version from distribution name
-        final Pattern pattern = Pattern.compile("shibboleth-identity-provider-(.*)");
-        final Matcher matcher = pattern.matcher(pathToIdPDist.getFileName().toString());
-        if (matcher.find()) {
-            idpVersion = matcher.group(1);
-        }
-        log.debug("Testing IdP version '{}'", idpVersion);
-        if (idpVersion == null || idpVersion.isBlank()) {
-            log.error("Unable to determine version of IdP");
-        }
-
         // Path to per-test idp.home
         final String timestamp = DateTimeFormatter.ofPattern(idpHomePattern).format(LocalDateTime.now());
         final String perTestDirectoryName = String.join("-", timestamp, getClass().getSimpleName());

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list