cvs commit: jakarta-jmeter/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config DataSourceElement.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cvs commit: jakarta-jmeter/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config DataSourceElement.java

sebb-3
sebb        2005/06/04 09:58:52

  Modified:    src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config
                        DataSourceElement.java
  Log:
  make log private+final; tidy error handling and ensure error message is shown in View Results Tree
 
  Revision  Changes    Path
  1.4       +20 -18    jakarta-jmeter/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
 
  Index: DataSourceElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DataSourceElement.java 20 Jun 2004 00:32:53 -0000 1.3
  +++ DataSourceElement.java 4 Jun 2005 16:58:52 -0000 1.4
  @@ -36,7 +36,7 @@
   public class DataSourceElement extends AbstractTestElement implements ConfigElement,
         TestListener,TestBean
   {
  -   static Logger log = LoggingManager.getLoggerForClass();
  +   private static final Logger log = LoggingManager.getLoggerForClass();
      transient String dataSource, driver, dbUrl, username, password, checkQuery, poolMax,
            connectionAge, timeout, trimInterval;
      transient boolean keepAlive, autocommit;
  @@ -147,23 +147,25 @@
         poolController
               .setAttribute("auto-commit", String.valueOf(isAutocommit()));
         config.addChild(poolController);
  -      DefaultConfiguration keepAlive = new DefaultConfiguration("keep-alive");
  -      keepAlive.setAttribute("disable", String.valueOf(!isKeepAlive()));
  -      keepAlive.setAttribute("age", getConnectionAge());
  -      keepAlive.setValue(getCheckQuery());
  -      poolController.addChild(keepAlive);
  -      DefaultConfiguration driver = new DefaultConfiguration("driver");
  -      driver.setValue(getDriver());
  -      config.addChild(driver);
  -      DefaultConfiguration dbUrl = new DefaultConfiguration("dburl");
  -      dbUrl.setValue(getDbUrl());
  -      config.addChild(dbUrl);
  -      DefaultConfiguration username = new DefaultConfiguration("user");
  -      username.setValue(getUsername());
  -      config.addChild(username);
  -      DefaultConfiguration password = new DefaultConfiguration("password");
  -      password.setValue(getPassword());
  -      config.addChild(password);
  +      DefaultConfiguration cfgKeepAlive = new DefaultConfiguration("keep-alive");
  +      cfgKeepAlive.setAttribute("disable", String.valueOf(!isKeepAlive()));
  +      cfgKeepAlive.setAttribute("age", getConnectionAge());
  +      cfgKeepAlive.setValue(getCheckQuery());
  +      poolController.addChild(cfgKeepAlive);
  +      DefaultConfiguration cfgDriver = new DefaultConfiguration("driver");
  +      cfgDriver.setValue(getDriver());
  +      config.addChild(cfgDriver);
  +      DefaultConfiguration cfgDbUrl = new DefaultConfiguration("dburl");
  +      cfgDbUrl.setValue(getDbUrl());
  +      config.addChild(cfgDbUrl);
  +      DefaultConfiguration cfgUsername = new DefaultConfiguration("user");
  +      cfgUsername.setValue(getUsername());
  +      config.addChild(cfgUsername);
  +      DefaultConfiguration cfgPassword = new DefaultConfiguration("password");
  +      cfgPassword.setValue(getPassword());
  +      config.addChild(cfgPassword);
  +      
  +      // log is required to ensure errors are available
         excaliburSource.enableLogging(new LogKitLogger(log));
         excaliburSource.configure(config);
         excaliburSource.setInstrumentableName(getDataSource());
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]