jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1700889 - /jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoDBHolder.java
Date Wed, 02 Sep 2015 20:11:13 GMT
Author: pmouawad
Date: Wed Sep  2 20:11:13 2015
New Revision: 1700889

URL: http://svn.apache.org/r1700889
Log:
Improve error message if mongoDB is null

Modified:
    jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoDBHolder.java

Modified: jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoDBHolder.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoDBHolder.java?rev=1700889&r1=1700888&r2=1700889&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoDBHolder.java
(original)
+++ jmeter/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/config/MongoDBHolder.java
Wed Sep  2 20:11:13 2015
@@ -48,6 +48,9 @@ public final class MongoDBHolder {
      */
     public static DB getDBFromSource(String varName, String dbName, String login, String
password) {
         MongoDB mongodb = (MongoDB) JMeterContextService.getContext().getVariables().getObject(varName);
+        if(mongodb==null) {
+            throw new IllegalStateException("You didn't define variable:"+varName +" using
MongoDB Source Config (property:MongoDB Source)");
+        }
         return mongodb.getDB(dbName, login, password);
     }
 }



Mime
View raw message