org.apache.jmeter.testelement.AbstractTestElement Java Examples

The following examples show how to use org.apache.jmeter.testelement.AbstractTestElement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ParallelSampler.java    From jmeter-bzm-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public void threadFinished(JMeterThread thread) {
    JMeterContextServiceAccessorParallel.incrNumberOfThreads();
    try {
        Field field = AbstractTestElement.class.getDeclaredField("threadContext");
        field.setAccessible(true);
        if (thread instanceof JMeterThreadParallel) {
            JMeterThreadParallel pthr = (JMeterThreadParallel) thread;
            for (TestElement te : pthr.getParallelCompiler().getKnownElements()) {
                field.set(te, null);
            }
        }
    } catch (IllegalAccessException | NoSuchFieldException e) {
        log.warn("Failed to reset context", e);
    }
}
 
Example #2
Source File: TestCompilerParallel.java    From jmeter-bzm-plugins with Apache License 2.0 5 votes vote down vote up
private void addSamplePackage(Sampler sampler, SamplePackage samplePackage) {
    if (sampler instanceof AbstractTestElement) {
        knownElements.add((AbstractTestElement) sampler);
    }

    for (Assertion assertion : samplePackage.getAssertions()) {
        if (assertion instanceof AbstractTestElement) {
            knownElements.add((AbstractTestElement) assertion);
        }
    }

    for (ConfigTestElement config : samplePackage.getConfigs()) {
        knownElements.add(config);
    }

    for (PostProcessor postProcessor : samplePackage.getPostProcessors()) {
        if (postProcessor instanceof AbstractTestElement) {
            knownElements.add((AbstractTestElement) postProcessor);
        }
    }

    for (PreProcessor preProcessor : samplePackage.getPreProcessors()) {
        if (preProcessor instanceof AbstractTestElement) {
            knownElements.add((AbstractTestElement) preProcessor);
        }
    }

    for (Timer timer : samplePackage.getTimers()) {
        if (timer instanceof AbstractTestElement) {
            knownElements.add((AbstractTestElement) timer);
        }
    }
}
 
Example #3
Source File: TestCompilerParallel.java    From jmeter-bzm-plugins with Apache License 2.0 4 votes vote down vote up
public Set<AbstractTestElement> getKnownElements() {
    return knownElements;
}
 
Example #4
Source File: DummyElement.java    From jmeter-plugins with Apache License 2.0 4 votes vote down vote up
public DummyElement(AbstractTestElement model) {
    this.model = model;
}