Class: JmeterPerf::Helpers::DSLGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/jmeter_perf/helpers/dsl_generator.rb

Overview

The DSLGenerator class generates the DSL methods and files for use in JMeter performance testing scripts. It uses a JMeter TestPlan (idl.xml) to generate the methods and files.

Instance Method Summary collapse

Constructor Details

#initialize(dsl_dir:, idl_xml_path:, document_dsl: true) ⇒ DSLGenerator

Initializes the DSLGenerator.

Parameters:

  • dsl_dir (String)

    Path to the directory where DSL files will be generated.

  • idl_xml_path (String)

    Path to the XML file used for generating methods.



16
17
18
19
20
# File 'lib/jmeter_perf/helpers/dsl_generator.rb', line 16

def initialize(dsl_dir:, idl_xml_path:, document_dsl: true)
  @document_dsl = document_dsl
  @dsl_dir = dsl_dir
  @idl_xml_path = idl_xml_path
end

Instance Method Details

#generatevoid

This method returns an undefined value.

Main method to generate DSL files and methods. It parses the XML, generates methods, documents, updates RBS files, and creates individual DSL files.



26
27
28
29
30
31
32
33
# File 'lib/jmeter_perf/helpers/dsl_generator.rb', line 26

def generate
  results = parse_xml
  methods = generate_methods(results)

  write_methods_to_dsl_md(methods) if @document_dsl
  update_rbs(methods) if @document_dsl
  create_dsl_files(results)
end