Closed alenakag closed 1 year ago
Hello,
Thank you very much for taking the time to submit this PR and propose changes!
Can you further explain how you plan to use the sampler name? Why do you need such feature? Same questions for clone :).
We had something similar in the past and we decided to remove it to keep the API at the minimum to reduce the number of methods to look from (and understand) when using the API from most common users. Would be interesting to understand if there is any other scenario that would be interesting to support and plan to change the API accordingly in that regard.
Here is some explanation of past decisions that relate to this item.
Hello, Thank you for your response. 1) Supplier could work for our project, if you could add method 'clear_children()' for classes: DslHttpSampler (class BaseSampler) and DslJsr223Sampler. Current implemantation 'this.children.addAll(Arrays.asList(children))' just appends new children for the sampler instead of replacement that we need . we use two identical samplers with different children. so it requires to clear or replace initial children. 2) our test logic depends on sampler name. for example: we add general jsr223PostProcessor that runs after every test sampler and checks if the sampler name contains some substring. so if it does it will do something specific. and we don't know when it happens
Hello, I have not been able to follow up on this due to vacations.
Thank you very much for the detailed answer and taking time to give reasons to every request, this helps not only in driving the design of the library with care on reasons and trying to keep it simple but also allows other users to find out different ways of using the library, understand how it works, and think of new improvements as well.
I am closing this PR since had no answer. We can re open it if we see that is still relevant after the comments I left.
The main reason for this change - to get a sampler name. The second reason - to get a cloned sampler. So I added getters and setters for fields in classes: DslBaseHttpSampler, DslHttpSampler, DslJsr223Sampler, DslJsr223TestElement, TestElementContainer, BaseTestElement. And I added method clone() in classes: DslHttpSampler, DslJsr223Sampler. Also I deleted attribute 'final' for fields 'children' and 'headers', so later I could filter sampler children for cloned object (for example, I need cloned sampler without origin sampler postprocessors).