Skip to content

Commit fe91d28

Browse files
Angelthree95atodorov
authored andcommitted
Add override parameter to config path
1 parent 5ae20c8 commit fe91d28

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Minimal config file `~/.tcms.conf`:
5151
username = your-username
5252
password = your-password
5353

54+
You can override the default (user home directory) file location by adding maven option ```tcmsConfigPath```
55+
followed by path to folder containing `.tcms.conf` file.
56+
Example command line usage: ```-DtcmsConfigPath=D:\Path\To\Config\File```
5457

5558
For more info see [tcms-api docs](https://tcms-api.readthedocs.io).
5659

@@ -80,6 +83,10 @@ http://kiwitcms.org/blog/atodorov/2019/02/22/how-to-use-kiwi-tcms-plugins-pt-1/
8083

8184
Files signed with EC1CEB7CDFA79FB5, Kiwi TCMS <info@kiwitcms.org>
8285

86+
### 11.2 (13 Jul 2023)
87+
88+
- Add override parameter to config path
89+
8390
### 11.1 (14 Jul 2022)
8491

8592
- Don't hard-code test execution statuses, fetch them from API

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>org.kiwitcms.java</groupId>
55
<artifactId>kiwitcms-junit-plugin</artifactId>
66
<packaging>jar</packaging>
7-
<version>11.1</version>
7+
<version>11.2</version>
88

99
<name>kiwitcms-junit-plugin</name>
1010
<description>JUnit 5 plugin for Kiwi TCMS.</description>

src/main/java/org/kiwitcms/java/config/Config.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.apache.commons.configuration2.builder.fluent.Configurations;
99
import org.apache.commons.configuration2.ex.ConfigurationException;
1010

11+
import org.apache.commons.lang3.StringUtils;
1112
import org.ini4j.Ini;
1213
import org.ini4j.IniPreferences;
1314

@@ -27,6 +28,9 @@ public class Config {
2728
private Config() {
2829
try {
2930
String home_dir = System.getProperty("user.home");
31+
if (!StringUtils.isBlank(System.getProperty("tcmsConfigPath"))) {
32+
home_dir = System.getProperty("tcmsConfigPath");
33+
}
3034
config = new IniPreferences(new Ini(new File(home_dir + "/.tcms.conf")));
3135
} catch (java.io.IOException fnfe) {
3236
fnfe.printStackTrace();

0 commit comments

Comments
 (0)