IDEA-388916 TestNG: handle empty properties file path

GitOrigin-RevId: 5ededf909cab235b4badddab3ff851794623390e
This commit is contained in:
Aleksey Dobrynin
2026-05-28 16:32:05 +00:00
committed by intellij-monorepo-bot
parent a9399827ea
commit 4662def90f
@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.theoryinpractice.testng.configuration;
@@ -283,13 +283,13 @@ public class SearchingForTestsTask extends SearchForTestsTask {
Map<String, String> testParams = new HashMap<>();
// Override with those from the test runner configuration
if (myData.PROPERTIES_FILE != null) {
if (!StringUtil.isEmptyOrSpaces(myData.PROPERTIES_FILE)) {
File propertiesFile = new File(myData.PROPERTIES_FILE);
if (propertiesFile.exists()) {
if (propertiesFile.isFile()) {
Properties properties = new Properties();
try {
properties.load(new FileInputStream(propertiesFile));
try (FileInputStream inputStream = new FileInputStream(propertiesFile)) {
properties.load(inputStream);
properties.forEach((key, value) -> testParams.put((String)key, (String)value));
}