Search in sources :

Example 1 with DNSCacheManager

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;
}
Also used : DNSCacheManager(org.apache.jmeter.protocol.http.control.DNSCacheManager)

Example 2 with 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);
    }
}
Also used : DNSCacheManager(org.apache.jmeter.protocol.http.control.DNSCacheManager)

Example 3 with DNSCacheManager

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));
}
Also used : TestElementProperty(org.apache.jmeter.testelement.property.TestElementProperty) DNSCacheManager(org.apache.jmeter.protocol.http.control.DNSCacheManager)

Example 4 with DNSCacheManager

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);
        }
    }
}
Also used : DNSCacheManager(org.apache.jmeter.protocol.http.control.DNSCacheManager)

Aggregations

DNSCacheManager (org.apache.jmeter.protocol.http.control.DNSCacheManager)4 TestElementProperty (org.apache.jmeter.testelement.property.TestElementProperty)1