New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message too vague #5319
Comments
@FSchumacher (migrated from Bugzilla): 0001-Bug-64454-more-precise-error-message.patchFrom dedaae2b9ca1e2b379c092e56d11ab17ea23c36e Mon Sep 17 00:00:00 2001
From: Felix Schumacher <felix.schumacher@internetallee.de>
Date: Tue, 19 May 2020 17:22:38 +0200
Subject: [PATCH] Bug 64454 more precise error message
---
.../apache/jmeter/protocol/jdbc/config/DataSourceElement.java | 4 ++--
.../jmeter/protocol/jdbc/processor/AbstractJDBCProcessor.java | 4 ++--
.../org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java | 4 ++--
3 files changed, 6 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 0c0f91233f..50f4535faf 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 abb941d74d..ba019a5ee0 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 22cf01c476..7b00779ed9 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 {
--
2.25.1
|
@FSchumacher (migrated from Bugzilla): commit fe4d4d6
.../org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java | 4 ++-- |
David Balažic (migrated from Bugzilla): When will the nightly be available? |
@FSchumacher (migrated from Bugzilla): You could even try to build the stuff yourself, or look at https://builds.apache.org/job/JMeter-trunk/ where they will be built more often than the nightlies. commit a3128d2
bin/testfiles/JDBC_TESTS.csv | 2 +- |
@FSchumacher (migrated from Bugzilla): |
David Balažic (Bug 64454):
The error message (shown in the Results Tree) is too vague:
Variable Name must not be null in JDBC Request
It is not clear which variable is set to null.
OS: All
The text was updated successfully, but these errors were encountered: