@@ -63,11 +63,44 @@ public static void setup() throws FileNotFoundException, IOException
63
63
String configPath = Thread .currentThread ().getContextClassLoader ().getResource ("config.properties" ).getPath ();
64
64
_config .load (new FileInputStream (configPath ));
65
65
66
- _database = _config .getProperty ("database" ).trim ();
67
- _host = _config .getProperty ("host" ).trim ();
66
+ _database = System .getenv ("DB2_DATABASE" );
67
+
68
+ if (_database == null || _database .length () < 1 ) {
69
+ _baselogger .error ("Environment variable DB2_DATABASE not set. Please set it before running test file." );
70
+ }
71
+
72
+ _host = System .getenv ("DB2_HOST" );
73
+ if (_host == null || _host .length () <1 ) {
74
+ _baselogger .error ("Environment variable DB2_HOST not set. Please set it before running test file." );
75
+ }
76
+
77
+ String prt = System .getenv ("DB2_PORT" );
78
+ if (prt == null || prt .length () < 1 ) {
79
+ _baselogger .error ("Environment variable DB2_PORT not set. Please set it before running test file." );
80
+ }
81
+ _port = Integer .parseInt (prt );
82
+
83
+
84
+ _userid = System .getenv ("DB2_USERID" );
85
+ if (_userid == null || _userid .length () <1 ) {
86
+ _baselogger .error ("Environment variable DB2_USERID not set. Please set it before running test file." );
87
+ }
88
+ if (_userid == null || _userid .length () < 1 ) {
89
+
90
+ }
91
+
92
+ _password = System .getenv ("DB2_PASSWORD" );
93
+ if (_password == null || _password .length () <1 ) {
94
+ _baselogger .error ("Environment variable DB2_PASSWORD not set. Please set it before running test file." );
95
+ }
96
+
97
+ /*
98
+
99
+ _host = _config.getProperty("host").trim();
68
100
_port = Integer.parseInt(_config.getProperty("port").trim());
69
101
_userid = _config.getProperty("userid").trim();
70
102
_password = _config.getProperty("password").trim();
103
+ */
71
104
72
105
String value = _config .getProperty ("keepDynamic" );
73
106
if (value != null && value .trim ().equalsIgnoreCase ("true" )) {
0 commit comments