use of org.apache.jmeter.protocol.http.control.DNSCacheManager in project jmeter by apache.
the class DNSCachePanel method createTestElement.
@Override
public TestElement createTestElement() {
DNSCacheManager dnsCacheManager = new DNSCacheManager();
modifyTestElement(dnsCacheManager);
return dnsCacheManager;
}
use of org.apache.jmeter.protocol.http.control.DNSCacheManager in project jmeter by apache.
the class DNSCachePanel method configure.
@Override
public void configure(TestElement el) {
super.configure(el);
DNSCacheManager dnsCacheManager = (DNSCacheManager) el;
populateTable(dnsCacheManager);
populateHostsTable(dnsCacheManager);
clearEachIteration.setSelected(dnsCacheManager.isClearEachIteration());
if (dnsCacheManager.isCustomResolver()) {
providerDNSradioGroup.setSelected(custResButton.getModel(), true);
deleteButton.setEnabled(dnsServersTable.getColumnCount() > 0);
deleteHostButton.setEnabled(dnsHostsTable.getColumnCount() > 0);
addButton.setEnabled(true);
addHostButton.setEnabled(true);
} else {
providerDNSradioGroup.setSelected(sysResButton.getModel(), true);
}
}
use of org.apache.jmeter.protocol.http.control.DNSCacheManager in project jmeter by apache.
the class HTTPSamplerBase method setDNSResolver.
public void setDNSResolver(DNSCacheManager cacheManager) {
DNSCacheManager mgr = getDNSResolver();
if (mgr != null) {
if (log.isWarnEnabled()) {
log.warn("Existing DNSCacheManager {} superseded by {}", mgr.getName(), cacheManager.getName());
}
}
setProperty(new TestElementProperty(DNS_CACHE_MANAGER, cacheManager));
}
use of org.apache.jmeter.protocol.http.control.DNSCacheManager in project jmeter by apache.
the class DNSCachePanel method modifyTestElement.
/**
* Modifies a given TestElement to mirror the data in the gui components.
*
* @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(org.apache.jmeter.testelement.TestElement)
*/
@Override
public void modifyTestElement(TestElement dnsRes) {
GuiUtils.stopTableEditing(dnsServersTable);
dnsRes.clear();
configureTestElement(dnsRes);
if (dnsRes instanceof DNSCacheManager) {
DNSCacheManager dnsCacheManager = (DNSCacheManager) dnsRes;
for (int i = 0; i < dnsServersTableModel.getRowCount(); i++) {
String server = (String) dnsServersTableModel.getRowData(i)[0];
dnsCacheManager.addServer(server);
}
for (int i = 0; i < dnsHostsTableModel.getRowCount(); i++) {
String host = (String) dnsHostsTableModel.getRowData(i)[0];
String addresses = (String) dnsHostsTableModel.getRowData(i)[1];
dnsCacheManager.addHost(host, addresses);
}
dnsCacheManager.setClearEachIteration(clearEachIteration.isSelected());
if (providerDNSradioGroup.isSelected(custResButton.getModel())) {
dnsCacheManager.setCustomResolver(true);
} else {
dnsCacheManager.setCustomResolver(false);
}
}
}
Aggregations