Sha256: 8793dc42e2607aa89530f9a63f99180dbb2483f5e12aae34e541bab4b9ce2d8b

Contents?: true

Size: 1.79 KB

Versions: 18

Compression:

Stored size: 1.79 KB

Contents

module RubyJmeter
  class DSL
    def jms_publisher(params={}, &block)
      node = RubyJmeter::JmsPublisher.new(params)
      attach_node(node, &block)
    end
  end

  class JmsPublisher
    attr_accessor :doc
    include Helper

    def initialize(params={})
      testname = params.kind_of?(Array) ? 'JmsPublisher' : (params[:name] || 'JmsPublisher')
      @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<PublisherSampler guiclass="JMSPublisherGui" testclass="PublisherSampler" testname="#{testname}" enabled="true">
  <stringProp name="jms.jndi_properties">false</stringProp>
  <stringProp name="jms.initial_context_factory"/>
  <stringProp name="jms.provider_url"/>
  <stringProp name="jms.connection_factory"/>
  <stringProp name="jms.topic"/>
  <stringProp name="jms.security_principle"/>
  <stringProp name="jms.security_credentials"/>
  <stringProp name="jms.text_message"/>
  <stringProp name="jms.input_file"/>
  <stringProp name="jms.random_path"/>
  <stringProp name="jms.config_choice">jms_use_text</stringProp>
  <stringProp name="jms.config_msg_type">jms_text_message</stringProp>
  <stringProp name="jms.iterations">1</stringProp>
  <boolProp name="jms.authenticate">false</boolProp>
  <elementProp name="jms.jmsProperties" elementType="JMSProperties">
    <collectionProp name="JMSProperties.properties">
      <elementProp name="" elementType="JMSProperty">
        <stringProp name="JMSProperty.name"> </stringProp>
        <stringProp name="JMSProperty.value"/>
        <stringProp name="JMSProperty.type">java.lang.String</stringProp>
      </elementProp>
    </collectionProp>
  </elementProp>
  <stringProp name="jms.expiration"/>
  <stringProp name="jms.priority"/>
</PublisherSampler>)
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ruby-jmeter-3.1.04 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.1.03 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.1.02 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.1.01 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.13 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.12 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.11 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.10 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.9 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.8 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.7 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.6 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.5 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.4 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.3 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.2 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.1 lib/ruby-jmeter/dsl/jms_publisher.rb
ruby-jmeter-3.0.0 lib/ruby-jmeter/dsl/jms_publisher.rb