Template
Template are the best way to create node in three node, template implement interface org.anasoid.jmc.core.wrapper.template.JmcTemplate and teh quick way is the extends org.anasoid.jmc.core.wrapper.template.AbstractJmcTemplate.
All node in JMC can add children as wrapper or as template, template can construct complex content.
AbstractJmcTemplate has 3 methods to override:
abstract JmcWrapperBuilder<?> init() : Create the builder.
void prepareBuilder(T builder) {} : prepare builder adding children node, attribute ....
void prepareWrapper(W wrapper) {}: Alter wrapper after been generated by the builder.
#
ExampleHome Page is a simple template, we can use it whn needed with calling constructor (new HomePageTemplate())
Contact us is Http Sampler with email as input.
In this test we add sampler home as contactus with variable 'email'.
#
SimplePageTemplateorg.anasoid.jmc.core.wrapper.template.samplers.http.SimplePageTemplate is helper to construct template with the following attribute name,domain,path, method
Extend Wrapper
It's recommended to extend from SimplePageTemplate and use constructor without argument.
#
SimplePageControllerTemplateorg.anasoid.jmc.core.wrapper.template.samplers.http.controller.SimplePageControllerTemplate is a helper that can include HttpSampler in a Controller, the controller is of type RecordingControllerWrapper.
The name of controller will be "{samplername} CTRL"
SimplePageControllerTemplate has 3 methods to override:
- void prepareSamplerBuilder(HTTPSamplerProxyWrapperBuilder builder) : prepare main sampler, builder is available and can alter sampler.
- void beforeMainSampler(RecordingControllerWrapperBuilder controller) : called before add man sampler to controller, we Alter controller at this level.
- void afterMainSampler(RecordingControllerWrapperBuilder controller) : called after add man sampler to controller, we Alter controller at this level.