今天研究的核心元素是Config

同样的道理在jmeter中每个testelement元素都对应着他的gui,Config也不例外,可以定位到包org.apache.jmeter.config和org.apache.jmeter.config.gui

包下面的类全部都是有关于Config这个元素,Config的元素的界面使用到了Jmete的两种界面策略(用到了TestBean和继承AbstractJMeterGuiComponent的实现方式)

前面分析了AbstractJMeterGuiComponent,TestBean后面会独立开篇分析

Config元素的TestElement的接口

 1 package org.apache.jmeter.config;
 2 
 3 public interface ConfigElement extends Cloneable {
 4 
 5     /**
 6      * Add a configuration element to this one. This allows config elements to
 7      * combine and give a "layered" effect. For example,
 8      * HTTPConfigElements have properties for domain, path, method, and
 9      * parameters. If element A has everything filled in, but null for domain,
10      * and element B is added, which has only domain filled in, then after
11      * adding B to A, A will have the domain from B. If A already had a domain,
12      * then the correct behavior is for A to ignore the addition of element B.
13      *
14      * @param config
15      *            the element to be added to this ConfigElement
16      */
17     void addConfigElement(ConfigElement config);
18 
19     /**
20      * If your config element expects to be modified in the process of a test
21      * run, and you want those modifications to carry over from sample to sample
22      * (as in a cookie manager - you want to save all cookies that get set
23      * throughout the test), then return true for this method. Your config
24      * element will not be cloned for each sample. If your config elements are
25      * more static in nature, return false. If in doubt, return false.
26      *
27      * @return true if the element expects to be modified over the course of a
28      *         test run
29      */
30     boolean expectsModification();
31 
32     Object clone();
33 }
View Code

相关文章:

  • 2021-09-15
  • 2021-07-28
  • 2022-12-23
  • 2022-01-13
  • 2021-06-11
  • 2021-07-20
猜你喜欢
  • 2021-07-30
  • 2021-10-27
  • 2021-11-27
  • 2021-07-30
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案