step.artefacts.PerformanceAssert Maven / Gradle / Ivy
package step.artefacts;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import step.artefacts.automation.YamlPerformanceAssert;
import step.core.artefacts.AbstractArtefact;
import step.core.artefacts.Artefact;
import step.core.dynamicbeans.ContainsDynamicValues;
import step.core.dynamicbeans.DynamicValue;
import step.core.yaml.YamlModel;
@YamlModel(model = YamlPerformanceAssert.class, name = "performanceAssert")
@Artefact
public class PerformanceAssert extends AbstractArtefact {
private List filters;
private Aggregator aggregator = Aggregator.AVG;
private Comparator comparator = Comparator.LOWER_THAN;
private DynamicValue expectedValue = new DynamicValue(3000l);
public PerformanceAssert() {
super();
}
public PerformanceAssert(Aggregator aggregator, Comparator comparator, Number expectedValue, Filter... filters) {
super();
this.filters = new ArrayList<>(Arrays.asList(filters));
this.aggregator = aggregator;
this.comparator = comparator;
this.expectedValue = new DynamicValue<>(expectedValue);
}
public PerformanceAssert(List filters, Aggregator aggregator, Comparator comparator, Number expectedValue) {
super();
this.filters = filters;
this.aggregator = aggregator;
this.comparator = comparator;
this.expectedValue = new DynamicValue<>(expectedValue);
}
@Override
public boolean isPropertyArtefact() {
return true;
}
@ContainsDynamicValues
public List getFilters() {
return filters;
}
public void setFilters(List filters) {
this.filters = filters;
}
public Aggregator getAggregator() {
return aggregator;
}
public void setAggregator(Aggregator aggregator) {
this.aggregator = aggregator;
}
public Comparator getComparator() {
return comparator;
}
public void setComparator(Comparator comparator) {
this.comparator = comparator;
}
public DynamicValue getExpectedValue() {
return expectedValue;
}
public void setExpectedValue(DynamicValue expectedValue) {
this.expectedValue = expectedValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy