本文整理汇总了Java中org.apache.jmeter.testelement.TestElement类的典型用法代码示例。如果您正苦于以下问题:Java TestElement类的具体用法?Java TestElement怎么用?Java TestElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TestElement类属于org.apache.jmeter.testelement包,在下文中一共展示了TestElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: modifyTestElement
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void modifyTestElement(TestElement element) {
configureTestElement(element);
if (element instanceof DirectoryListingConfig) {
DirectoryListingConfig directoryListingConfig = (DirectoryListingConfig) element;
directoryListingConfig.setSourceDirectory(this.sourceDirectoryField.getText());
directoryListingConfig.setDestinationVariableName(this.destinationVariableField.getText());
directoryListingConfig.setUseFullPath(this.isUseFullPathCheckBox.isSelected());
directoryListingConfig.setRandomOrder(this.isRandomOrderCheckBox.isSelected());
directoryListingConfig.setRecursiveListing(this.isRecursiveListing.isSelected());
directoryListingConfig.setRewindOnTheEnd(this.isRewindOnTheEndCheckBox.isSelected());
directoryListingConfig.setReReadDirectoryOnTheEndOfList(this.isReReadDirectoryCheckBox.isSelected());
directoryListingConfig.setIndependentListPerThread(this.isIndependentListCheckBox.isSelected());
}
}
示例2: configure
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void configure(TestElement element) {
super.configure(element);
if (element instanceof DirectoryListingConfig) {
DirectoryListingConfig directoryListingConfig = (DirectoryListingConfig) element;
sourceDirectoryField.setText(directoryListingConfig.getSourceDirectory());
destinationVariableField.setText(directoryListingConfig.getDestinationVariableName());
isUseFullPathCheckBox.setSelected(directoryListingConfig.getUseFullPath());
isRandomOrderCheckBox.setSelected(directoryListingConfig.getRandomOrder());
isRecursiveListing.setSelected(directoryListingConfig.getRecursiveListing());
isRewindOnTheEndCheckBox.setSelected(directoryListingConfig.getRewindOnTheEnd());
isReReadDirectoryCheckBox.setSelected(directoryListingConfig.getReReadDirectoryOnTheEndOfList());
isIndependentListCheckBox.setSelected(directoryListingConfig.getIndependentListPerThread());
isReReadDirectoryCheckBox.setEnabled(isRewindOnTheEndCheckBox.isSelected());
}
}
示例3: configure
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void configure(TestElement element) {
super.configure(element);
PubSampler sampler = (PubSampler) element;
connUI.configure(sampler);
if(sampler.getQOS().trim().indexOf(JMETER_VARIABLE_PREFIX) == -1){
this.qosChoice.setSelectedIndex(Integer.parseInt(sampler.getQOS()));
} else {
this.qosChoice.setText(sampler.getQOS());
}
this.topicName.setText(sampler.getTopic());
this.timestamp.setSelected(sampler.isAddTimestamp());
if(MESSAGE_TYPE_STRING.equalsIgnoreCase(sampler.getMessageType())) {
this.messageTypes.setSelectedIndex(0);
this.messagePanel.setVisible(true);
} else if(MESSAGE_TYPE_HEX_STRING.equalsIgnoreCase(sampler.getMessageType())) {
this.messageTypes.setSelectedIndex(1);
} else if(MESSAGE_TYPE_RANDOM_STR_WITH_FIX_LEN.equalsIgnoreCase(sampler.getMessageType())) {
this.messageTypes.setSelectedIndex(2);
}
stringLength.setText(String.valueOf(sampler.getMessageLength()));
sendMessage.setText(sampler.getMessage());
}
示例4: threadFinished
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@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().getKnownSamplers()) {
field.set(te, null);
}
}
} catch (IllegalAccessException | NoSuchFieldException e) {
log.warn("Failed to reset context", e);
}
}
示例5: configure
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void configure(TestElement element) {
super.configure(element);
if (element instanceof WebSocketConnectionSampler) {
WebSocketConnectionSampler WebSocketConnectionSamplerTestElement = (WebSocketConnectionSampler) element;
webSocketConnectionSamplerPanel.setServer(WebSocketConnectionSamplerTestElement.getServer());
webSocketConnectionSamplerPanel.setPort(Integer.toString(WebSocketConnectionSamplerTestElement.getPort()));
webSocketConnectionSamplerPanel.setConnectionTimeout(WebSocketConnectionSamplerTestElement.getConnectionTimeout());
webSocketConnectionSamplerPanel.setProtocol(WebSocketConnectionSamplerTestElement.getProtocol());
webSocketConnectionSamplerPanel.setPath(WebSocketConnectionSamplerTestElement.getPath());
webSocketConnectionSamplerPanel.setContentEncoding(WebSocketConnectionSamplerTestElement.getContentEncoding());
webSocketConnectionSamplerPanel.setConnectionId(WebSocketConnectionSamplerTestElement.getConnectionId());
webSocketConnectionSamplerPanel.setImplementation(WebSocketConnectionSamplerTestElement.getImplementation());
webSocketConnectionSamplerPanel.setCloseConnectionPattern(WebSocketConnectionSamplerTestElement.getCloseConnectionPattern());
Arguments queryStringParameters = WebSocketConnectionSamplerTestElement.getQueryStringParameters();
if (queryStringParameters != null) {
webSocketConnectionSamplerPanel.getAttributePanel().configure(queryStringParameters);
}
Arguments queryStringPatterns = WebSocketConnectionSamplerTestElement.getQueryStringPatterns();
if (queryStringPatterns != null) {
webSocketConnectionSamplerPanel.getPatternsPanel().configure(queryStringParameters);
}
}
}
示例6: modifyTestElement
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void modifyTestElement(TestElement element) {
configureTestElement(element);
if (element instanceof RandomCSVDataSetConfig) {
RandomCSVDataSetConfig randomCSV = (RandomCSVDataSetConfig) element;
randomCSV.setFilename(this.filenameField.getText());
randomCSV.setFileEncoding(this.fileEncodingField.getText());
randomCSV.setDelimiter(this.delimiterField.getText());
randomCSV.setVariableNames(this.variableNamesField.getText());
randomCSV.setRandomOrder(this.isRandomOrderCheckBox.isSelected());
randomCSV.setIgnoreFirstLine(this.isIgnoreFirstLineCheckBox.isSelected());
randomCSV.setRewindOnTheEndOfList(this.isRewindOnTheEndCheckBox.isSelected());
randomCSV.setIndependentListPerThread(this.isIndependentListCheckBox.isSelected());
}
}
示例7: configure
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void configure(TestElement element) {
super.configure(element);
if (element instanceof RandomCSVDataSetConfig) {
RandomCSVDataSetConfig randomCSV = (RandomCSVDataSetConfig) element;
filenameField.setText(randomCSV.getFilename());
fileEncodingField.setText(randomCSV.getFileEncoding());
delimiterField.setText(randomCSV.getDelimiter());
variableNamesField.setText(randomCSV.getVariableNames());
isRandomOrderCheckBox.setSelected(randomCSV.isRandomOrder());
isIgnoreFirstLineCheckBox.setSelected(randomCSV.isIgnoreFirstLine());
isRewindOnTheEndCheckBox.setSelected(randomCSV.isRewindOnTheEndOfList());
isIndependentListCheckBox.setSelected(randomCSV.isIndependentListPerThread());
}
}
示例8: createTestElement
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public TestElement createTestElement() {
TestElement te = new LoadosophiaUploader();
modifyTestElement(te);
te.setComment(JMeterPluginsUtils.getWikiLinkText(WIKIPAGE));
return te;
}
示例9: displayGUI
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
public void displayGUI() throws InterruptedException {
if (!GraphicsEnvironment.isHeadless()) {
LoadosophiaUploaderGui obj = new LoadosophiaUploaderGui();
TestElement te = obj.createTestElement();
obj.configure(te);
obj.clearGui();
obj.modifyTestElement(te);
JFrame frame = new JFrame(obj.getStaticLabel());
frame.setPreferredSize(new Dimension(800, 600));
frame.getContentPane().add(obj, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
while (frame.isVisible()) {
Thread.sleep(1000);
}
}
}
示例10: configure
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void configure(TestElement element) {
super.configure(element);
SubSampler sampler = (SubSampler) element;
connUI.configure(sampler);
if(sampler.getQOS().trim().indexOf(JMETER_VARIABLE_PREFIX) == -1){
this.qosChoice.setSelectedIndex(Integer.parseInt(sampler.getQOS()));
} else {
this.qosChoice.setText(sampler.getQOS());
}
this.topicName.setText(sampler.getTopic());
this.timestamp.setSelected(sampler.isAddTimestamp());
this.debugResponse.setSelected(sampler.isDebugResponse());
this.sampleOnCondition.setText(sampler.getSampleCondition());
if(SAMPLE_ON_CONDITION_OPTION1.equalsIgnoreCase(sampleOnCondition.getText())) {
this.sampleConditionValue.setText(sampler.getSampleElapsedTime());
} else if(SAMPLE_ON_CONDITION_OPTION2.equalsIgnoreCase(sampleOnCondition.getText())) {
this.sampleConditionValue.setText(sampler.getSampleCount());
}
}
示例11: next
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public Sampler next() {
if (chosen) {
Sampler result = super.next();
if (result == null || currentCopy != current ||
(super.getSubControllers().get(current) instanceof TransactionController)) {
reset();
for (TestElement element : super.getSubControllers()) {
if (element instanceof Controller) {
((Controller) element).triggerEndOfLoop();
}
}
return null;
}
return result;
} else {
chosen = true;
choose();
return super.next();
}
}
示例12: configure
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void configure(TestElement element) {
// from model to GUI
super.configure(element);
log.debug("Props: " + this.isShowing() + " " + isVisible() + " " + isEnabled() + " " + isFocusOwner());
GuiPackage gp = GuiPackage.getInstance();
if (gp != null && element instanceof WeightedSwitchController) {
WeightedSwitchController wsc = (WeightedSwitchController) element;
CollectionProperty oldData = wsc.getData();
grid.getModel().clearData();
if (isShowing()) {
fillGridFromTree(wsc, oldData);
} else {
JMeterPluginsUtils.collectionPropertyToTableModelRows(oldData, grid.getModel());
}
}
}
示例13: getChildItems
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
private Map<JMeterTreeNode, Boolean> getChildItems(JMeterTreeNode root, WeightedSwitchController element) {
Map<JMeterTreeNode, Boolean> result = new LinkedHashMap<>();
for (int i = 0; i < root.getChildCount(); i++) {
JMeterTreeNode child = (JMeterTreeNode) root.getChildAt(i);
TestElement te = child.getTestElement();
if (element != root.getTestElement()) {
result.putAll(getChildItems(child, element));
} else {
if (te instanceof Sampler || te instanceof Controller) {
result.put(child, te.isEnabled());
}
}
}
return result;
}
示例14: iterationStart
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
@Override
public void iterationStart(LoopIterationEvent event) {
TestElement source = event.getSource();
JMeterContext threadContext = source.getThreadContext();
JMeterVariables variables = threadContext.getVariables();
iterationStart(variables);
}
示例15: setHeaderManager
import org.apache.jmeter.testelement.TestElement; //导入依赖的package包/类
public void setHeaderManager(HeaderManager value) {
HeaderManager mgr = getHeaderManager();
if (mgr != null) {
value = mgr.merge(value, true);
if (log.isDebugEnabled()) {
log.debug("Existing HeaderManager '" + mgr.getName() + "' merged with '" + value.getName() + "'");
for (int i = 0; i < value.getHeaders().size(); i++) {
log.debug(" " + value.getHeader(i).getName() + "=" + value.getHeader(i).getValue());
}
}
}
setProperty(new TestElementProperty(HEADER_MANAGER, (TestElement) value));
}