Class BaseTestElementSchema
-
- All Implemented Interfaces:
@API(status = API.Status.EXPERIMENTAL, since = "5.6") public abstract class BaseTestElementSchema
Describes properties available for configuration of well-known TestElement. Style guide:
avoid using "is" prefixes. The properties are declare PropertyDescriptor rather than property itself, so "is" is not needed
declare default value when declaring a property. It would help users.
declare schemas as abstract classes or make constructor protected. Users might need extending the schema, however, there's no much sense in creating several instances, so instances should be shared as singletones.
TODO: decide if boolean, int, long, etc values must always have a default
- Since:
5.6
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<String, PropertyDescriptor<?, ?>>
properties
private final Map<String, BasePropertyGroupSchema<?>>
groups
-
Constructor Summary
Constructors Constructor Description BaseTestElementSchema()
-
Method Summary
Modifier and Type Method Description final Map<String, PropertyDescriptor<?, ?>>
getProperties()
Associates JMeter property name (e.g. final Map<String, BasePropertyGroupSchema<?>>
getGroups()
Associates subgroup name with the corresponding group schema. final <Schema extends BaseTestElementSchema, Group extends BasePropertyGroupSchema<Schema>> Group
getValue(Group $self, Schema that, KProperty<?> prop)
final <Group extends BasePropertyGroupSchema<?>> Unit
invoke(Group $self, Function1<Group, Unit> body)
It enables configuring a group of properties inside TestElement.props block: httpSampler.props { // this: HttpSamplerBaseSchema, it: PropertiesAccessor<HttpSamplerBase, HttpSamplerBaseSchema> proxy { // <-- this is Group.invoke it[proxyPort] = 8080 } }
final <Schema extends BaseTestElementSchema> BasePropertyGroupSchema<Schema>
getSubgroup(PropertyDescriptor<Schema, ?> property)
final List<String>
getGroupPath(PropertyDescriptor<?, ?> property)
Returns a list of group names that are required to access the property by its short name. final <Schema extends BaseTestElementSchema, Group extends BasePropertyGroupSchema<Schema>> Group
provideDelegate(Group $self, Schema that, KProperty<?> property)
It enables attach a group of properties to the current schema. final <Schema extends BaseTestElementSchema, Group extends BasePropertyGroupSchema<Schema>> Group
provideDelegate(Group $self, BasePropertyGroupSchema<Schema> that, KProperty<?> property)
It enables attach a group of properties to the current group of properties -
-
Method Detail
-
getProperties
final Map<String, PropertyDescriptor<?, ?>> getProperties()
Associates JMeter property name (e.g.
TestPlan.enabled
) with the corresponding PropertyDescriptor
-
getGroups
final Map<String, BasePropertyGroupSchema<?>> getGroups()
Associates subgroup name with the corresponding group schema.
-
getValue
final <Schema extends BaseTestElementSchema, Group extends BasePropertyGroupSchema<Schema>> Group getValue(Group $self, Schema that, KProperty<?> prop)
-
invoke
final <Group extends BasePropertyGroupSchema<?>> Unit invoke(Group $self, Function1<Group, Unit> body)
It enables configuring a group of properties inside TestElement.props block:
httpSampler.props { // this: HttpSamplerBaseSchema, it: PropertiesAccessor<HttpSamplerBase, HttpSamplerBaseSchema> proxy { // <-- this is Group.invoke it[proxyPort] = 8080 } }
-
getSubgroup
final <Schema extends BaseTestElementSchema> BasePropertyGroupSchema<Schema> getSubgroup(PropertyDescriptor<Schema, ?> property)
-
getGroupPath
final List<String> getGroupPath(PropertyDescriptor<?, ?> property)
Returns a list of group names that are required to access the property by its short name. If the property is declared in the current schema, the list is empty.
-
provideDelegate
final <Schema extends BaseTestElementSchema, Group extends BasePropertyGroupSchema<Schema>> Group provideDelegate(Group $self, Schema that, KProperty<?> property)
It enables attach a group of properties to the current schema.
-
provideDelegate
final <Schema extends BaseTestElementSchema, Group extends BasePropertyGroupSchema<Schema>> Group provideDelegate(Group $self, BasePropertyGroupSchema<Schema> that, KProperty<?> property)
It enables attach a group of properties to the current group of properties
-
-
-
-