jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] branch master updated: More precise error message, when no datasource value can be found in JDBC sampler
Date Thu, 28 May 2020 14:07:00 GMT
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new fe4d4d6  More precise error message, when no datasource value can be found in JDBC
sampler
fe4d4d6 is described below

commit fe4d4d6074f844ff28acaf42f36765104fcf8471
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Thu May 28 16:06:26 2020 +0200

    More precise error message, when no datasource value can be found in JDBC sampler
    
    Bugzilla Id: 64454
---
 .../org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java     | 4 ++--
 .../apache/jmeter/protocol/jdbc/processor/AbstractJDBCProcessor.java  | 4 ++--
 .../java/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java     | 4 ++--
 xdocs/changes.xml                                                     | 1 +
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
b/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
index 0c0f912..50f4535 100644
--- a/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
+++ b/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
@@ -114,8 +114,8 @@ public class DataSourceElement extends AbstractTestElement
         TestBeanHelper.prepare(this);
         JMeterVariables variables = getThreadContext().getVariables();
         String poolName = getDataSource();
-        if(JOrphanUtils.isBlank(poolName)) {
-            throw new IllegalArgumentException("Variable Name must not be empty for element:"+getName());
+        if (JOrphanUtils.isBlank(poolName)) {
+            throw new IllegalArgumentException("Name for DataSoure must not be empty in "
+ getName());
         } else if (variables.getObject(poolName) != null) {
             log.error("JDBC data source already defined for: {}", poolName);
         } else {
diff --git a/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/processor/AbstractJDBCProcessor.java
b/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/processor/AbstractJDBCProcessor.java
index abb941d..ba019a5 100644
--- a/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/processor/AbstractJDBCProcessor.java
+++ b/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/processor/AbstractJDBCProcessor.java
@@ -40,8 +40,8 @@ public abstract class AbstractJDBCProcessor extends AbstractJDBCTestElement
{
      * Calls the JDBC code to be executed.
      */
     protected void process() {
-        if(JOrphanUtils.isBlank(getDataSource())) {
-            throw new IllegalArgumentException("Variable Name must not be null in "+getName());
+        if (JOrphanUtils.isBlank(getDataSource())) {
+            throw new IllegalArgumentException("Name for DataSoure must not be empty in "
+ getName());
         }
         try (Connection conn = DataSourceElement.getConnection(getDataSource())){
             execute(conn);
diff --git a/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
b/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
index 22cf01c..7b00779 100644
--- a/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
+++ b/src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
@@ -72,8 +72,8 @@ public class JDBCSampler extends AbstractJDBCTestElement implements Sampler,
Tes
         Connection conn = null;
 
         try {
-            if(JOrphanUtils.isBlank(getDataSource())) {
-                throw new IllegalArgumentException("Variable Name must not be null in "+getName());
+            if (JOrphanUtils.isBlank(getDataSource())) {
+                throw new IllegalArgumentException("Name for DataSoure must not be empty
in " + getName());
             }
 
             try {
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index e2923a9..cf38d72 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -114,6 +114,7 @@ Summary
 <ch_section>Non-functional changes</ch_section>
 <ul>
     <li><pr>594</pr>Updated neo4j-java-driver to 4.0.1 (from 1.7.5)</li>
+    <li><bug>64454</bug>More precise error message, when no datasource
value can be found in JDBC sampler</li>
 </ul>
 
  <!-- =================== Bug fixes =================== -->


Mime
View raw message