You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by vl...@apache.org on 2019/06/08 18:42:26 UTC
[jmeter] 22/47: Look for user.properties and system.properties in
JMeter bin directory if not found locally
This is an automated email from the ASF dual-hosted git repository.
vladimirsitnikov pushed a commit to annotated tag v2_3
in repository https://gitbox.apache.org/repos/asf/jmeter.git
commit 975a7b1daea1c3e1de9f9e4e6e5768c545948614
Author: Sebastian Bazley <se...@apache.org>
AuthorDate: Fri Sep 21 13:05:23 2007 +0000
Look for user.properties and system.properties in JMeter bin directory if not found locally
git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@578090 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: 4cd8acc69e76e53e2a49354ea78ec4e9fb2bcd4b
---
src/core/org/apache/jmeter/JMeter.java | 8 ++++----
xdocs/changes.xml | 1 +
xdocs/usermanual/get-started.xml | 3 ++-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/core/org/apache/jmeter/JMeter.java b/src/core/org/apache/jmeter/JMeter.java
index b44f457..299f752 100644
--- a/src/core/org/apache/jmeter/JMeter.java
+++ b/src/core/org/apache/jmeter/JMeter.java
@@ -485,9 +485,9 @@ public class JMeter implements JMeterPlugin {
if (userProp.length() > 0){ //$NON-NLS-1$
FileInputStream fis=null;
try {
- File file = new File(userProp);
+ File file = JMeterUtils.findFile(userProp);
if (file.canRead()){
- log.info("Loading user properties from: "+userProp);
+ log.info("Loading user properties from: "+file.getCanonicalPath());
fis = new FileInputStream(file);
Properties tmp = new Properties();
tmp.load(fis);
@@ -506,9 +506,9 @@ public class JMeter implements JMeterPlugin {
if (sysProp.length() > 0){
FileInputStream fis=null;
try {
- File file = new File(sysProp);
+ File file = JMeterUtils.findFile(sysProp);
if (file.canRead()){
- log.info("Loading system properties from: "+sysProp);
+ log.info("Loading system properties from: "+file.getCanonicalPath());
fis = new FileInputStream(file);
System.getProperties().load(fis);
}
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 06c80aa..fc0f661 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -47,6 +47,7 @@
<li>Add NULL parameter option to JDBC sampler</li>
<li>Add documentation links for Rhino and BeanShell to functions; clarify variables and properties</li>
<li>Ensure uncaught exceptions are logged</li>
+<li>Look for user.properties and system.properties in JMeter bin directory if not found locally</li>
</ul>
<h4>Fixes since 2.3RC3</h4>
diff --git a/xdocs/usermanual/get-started.xml b/xdocs/usermanual/get-started.xml
index 25e771b..abd882e 100644
--- a/xdocs/usermanual/get-started.xml
+++ b/xdocs/usermanual/get-started.xml
@@ -377,7 +377,8 @@ These are shown below.</p>
<note>
Note: since 2.2, you can define additional JMeter properties in the file defined by the
JMeter property <b>user.properties</b> which has the default value <b>user.properties</b>.
- The file will be automatically loaded if it is found in the current directory.
+ The file will be automatically loaded if it is found in the current directory
+ or if it is found in the JMeter bin directory.
Similarly, <b>system.properties</b> is used to update system properties.
</note>
<properties>