Sha256: c5e4686417ff3bf7bd40d245bb6bb9578872ea164bdadc99b1dae1050507863e

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 KB

Contents

module JmeterPerf
  class DSL
    def jdbc_connection_configuration(params = {}, &)
      node = JmeterPerf::JDBCConnectionConfiguration.new(params)
      attach_node(node, &)
    end
  end

  class JDBCConnectionConfiguration
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "JDBCConnectionConfiguration" : (params[:name] || "JDBCConnectionConfiguration")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="#{testname}" enabled="true">
          <boolProp name="autocommit">true</boolProp>
          <stringProp name="checkQuery">Select 1</stringProp>
          <stringProp name="connectionAge">5000</stringProp>
          <stringProp name="dataSource"/>
          <stringProp name="dbUrl"/>
          <stringProp name="driver"/>
          <boolProp name="keepAlive">true</boolProp>
          <stringProp name="password"/>
          <stringProp name="poolMax">10</stringProp>
          <stringProp name="timeout">10000</stringProp>
          <stringProp name="transactionIsolation">DEFAULT</stringProp>
          <stringProp name="trimInterval">60000</stringProp>
          <stringProp name="username"/>
        </JDBCDataSource>
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jmeter_perf-0.0.6 lib/jmeter_perf/dsl/jdbc_connection_configuration.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/jdbc_connection_configuration.rb