View | Details | Raw Unified | Return to bug 56841
Collapse All | Expand All

(-)bin/saveservice.properties (+2 lines)
Lines 114-119 Link Here
114
DebugPostProcessor=org.apache.jmeter.extractor.DebugPostProcessor
114
DebugPostProcessor=org.apache.jmeter.extractor.DebugPostProcessor
115
DebugSampler=org.apache.jmeter.sampler.DebugSampler
115
DebugSampler=org.apache.jmeter.sampler.DebugSampler
116
DistributionGraphVisualizer=org.apache.jmeter.visualizers.DistributionGraphVisualizer
116
DistributionGraphVisualizer=org.apache.jmeter.visualizers.DistributionGraphVisualizer
117
DNSCacheManager=org.apache.jmeter.protocol.http.control.DNSCacheManager
118
DNSCachePanel=org.apache.jmeter.protocol.http.gui.DNSCachePanel
117
DurationAssertion=org.apache.jmeter.assertions.DurationAssertion
119
DurationAssertion=org.apache.jmeter.assertions.DurationAssertion
118
DurationAssertionGui=org.apache.jmeter.assertions.gui.DurationAssertionGui
120
DurationAssertionGui=org.apache.jmeter.assertions.gui.DurationAssertionGui
119
# Should really have been defined as floatProp to agree with other properties
121
# Should really have been defined as floatProp to agree with other properties
(-)build.properties (+6 lines)
Lines 122-127 Link Here
122
commons-net.loc             = ${maven2.repo}/commons-net/commons-net/${commons-net.version}
122
commons-net.loc             = ${maven2.repo}/commons-net/commons-net/${commons-net.version}
123
commons-net.md5             = c077ca61598e9c21f43f8b6488fbbee9
123
commons-net.md5             = c077ca61598e9c21f43f8b6488fbbee9
124
124
125
# dnsjava for DNSCacheManager
126
dnsjava.version             = 2.1.6
127
dnsjava.jar                 = dnsjava-${dnsjava.version}.jar
128
dnsjava.loc                 = ${maven2.repo}/dnsjava/dnsjava/${dnsjava.version}
129
dnsjava.md5                 = 4f95b291e738bb7c5a8773b22749afc3
130
125
excalibur-instrument.version = 1.0
131
excalibur-instrument.version = 1.0
126
excalibur-instrument.jar    = excalibur-instrument-${excalibur-instrument.version}.jar
132
excalibur-instrument.jar    = excalibur-instrument-${excalibur-instrument.version}.jar
127
excalibur-instrument.loc    = ${maven2.repo}/excalibur-instrument/excalibur-instrument/${excalibur-instrument.version}
133
excalibur-instrument.loc    = ${maven2.repo}/excalibur-instrument/excalibur-instrument/${excalibur-instrument.version}
(-)build.xml (+2 lines)
Lines 438-443 Link Here
438
    <pathelement location="${lib.dir}/${commons-lang3.jar}"/>
438
    <pathelement location="${lib.dir}/${commons-lang3.jar}"/>
439
    <pathelement location="${lib.dir}/${commons-logging.jar}"/>
439
    <pathelement location="${lib.dir}/${commons-logging.jar}"/>
440
    <pathelement location="${lib.dir}/${commons-net.jar}"/>
440
    <pathelement location="${lib.dir}/${commons-net.jar}"/>
441
    <pathelement location="${lib.dir}/${dnsjava.jar}"/>
441
    <pathelement location="${lib.dir}/${excalibur-datasource.jar}"/>
442
    <pathelement location="${lib.dir}/${excalibur-datasource.jar}"/>
442
    <pathelement location="${lib.dir}/${excalibur-instrument.jar}"/>
443
    <pathelement location="${lib.dir}/${excalibur-instrument.jar}"/>
443
    <pathelement location="${lib.dir}/${excalibur-logger.jar}"/>
444
    <pathelement location="${lib.dir}/${excalibur-logger.jar}"/>
Lines 2904-2909 Link Here
2904
        <process_jarfile jarname="commons-lang3"/>
2905
        <process_jarfile jarname="commons-lang3"/>
2905
        <process_jarfile jarname="commons-logging"/>
2906
        <process_jarfile jarname="commons-logging"/>
2906
        <process_jarfile jarname="commons-net"/>
2907
        <process_jarfile jarname="commons-net"/>
2908
        <process_jarfile jarname="dnsjava"/>
2907
        <process_jarfile jarname="excalibur-datasource"/>
2909
        <process_jarfile jarname="excalibur-datasource"/>
2908
        <process_jarfile jarname="excalibur-instrument"/>
2910
        <process_jarfile jarname="excalibur-instrument"/>
2909
        <process_jarfile jarname="excalibur-logger"/>
2911
        <process_jarfile jarname="excalibur-logger"/>
(-)eclipse.classpath (+1 lines)
Lines 56-61 Link Here
56
	<classpathentry kind="lib" path="lib/commons-lang3-3.3.2.jar"/>
56
	<classpathentry kind="lib" path="lib/commons-lang3-3.3.2.jar"/>
57
	<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
57
	<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
58
	<classpathentry kind="lib" path="lib/commons-net-3.3.jar"/>
58
	<classpathentry kind="lib" path="lib/commons-net-3.3.jar"/>
59
	<classpathentry kind="lib" path="lib/dnsjava-2.1.6.jar"/>
59
	<classpathentry kind="lib" path="lib/excalibur-datasource-2.1.jar"/>
60
	<classpathentry kind="lib" path="lib/excalibur-datasource-2.1.jar"/>
60
	<classpathentry kind="lib" path="lib/excalibur-instrument-1.0.jar"/>
61
	<classpathentry kind="lib" path="lib/excalibur-instrument-1.0.jar"/>
61
	<classpathentry kind="lib" path="lib/excalibur-logger-1.1.jar"/>
62
	<classpathentry kind="lib" path="lib/excalibur-logger-1.1.jar"/>
(-)res/maven/ApacheJMeter_parent.pom (+6 lines)
Lines 67-72 Link Here
67
      <commons-lang3.version>3.3.2</commons-lang3.version>
67
      <commons-lang3.version>3.3.2</commons-lang3.version>
68
      <commons-logging.version>1.2</commons-logging.version>
68
      <commons-logging.version>1.2</commons-logging.version>
69
      <commons-net.version>3.3</commons-net.version>
69
      <commons-net.version>3.3</commons-net.version>
70
      <dnsjava.version>2.1.6</dnsjava.version>
70
      <excalibur-datasource.version>2.1</excalibur-datasource.version>
71
      <excalibur-datasource.version>2.1</excalibur-datasource.version>
71
      <excalibur-instrument.version>1.0</excalibur-instrument.version>
72
      <excalibur-instrument.version>1.0</excalibur-instrument.version>
72
      <excalibur-logger.version>1.1</excalibur-logger.version>
73
      <excalibur-logger.version>1.1</excalibur-logger.version>
Lines 185-190 Link Here
185
        <version>${commons-net.version}</version>
186
        <version>${commons-net.version}</version>
186
      </dependency>
187
      </dependency>
187
      <dependency>
188
      <dependency>
189
	    <groupId>dnsjava</groupId>
190
	    <artifactId>dnsjava</artifactId>
191
	    <version>${dnsjava.version}</version>
192
      </dependency>
193
      <dependency>
188
        <groupId>excalibur-datasource</groupId>
194
        <groupId>excalibur-datasource</groupId>
189
        <artifactId>excalibur-datasource</artifactId>
195
        <artifactId>excalibur-datasource</artifactId>
190
        <version>${excalibur-datasource.version}</version>
196
        <version>${excalibur-datasource.version}</version>
(-)src/core/org/apache/jmeter/resources/messages.properties (+6 lines)
Lines 163-168 Link Here
163
choose_language=Choose Language
163
choose_language=Choose Language
164
clear=Clear
164
clear=Clear
165
clear_all=Clear All
165
clear_all=Clear All
166
clear_cache_each_iteration=Clear cache each iteration
166
clear_cache_per_iter=Clear cache each iteration?
167
clear_cache_per_iter=Clear cache each iteration?
167
clear_cookies_per_iter=Clear cookies each iteration?
168
clear_cookies_per_iter=Clear cookies each iteration?
168
clipboard_node_read_error=An error occurred while copying node
169
clipboard_node_read_error=An error occurred while copying node
Lines 246-251 Link Here
246
distribution_graph_title=Distribution Graph (alpha)
247
distribution_graph_title=Distribution Graph (alpha)
247
distribution_note1=The graph will update every 10 samples
248
distribution_note1=The graph will update every 10 samples
248
dn=DN
249
dn=DN
250
dns_cache_manager_title=DNS Cache Manager
251
dns_hostname_or_ip=Hostname or IP address
252
dns_servers=DNS Servers
249
domain=Domain
253
domain=Domain
250
done=Done
254
done=Done
251
down=Down
255
down=Down
Lines 1152-1162 Link Here
1152
url_multipart_config_title=HTTP Multipart Request Defaults
1156
url_multipart_config_title=HTTP Multipart Request Defaults
1153
urldecode_string=String with URL encoded chars to decode
1157
urldecode_string=String with URL encoded chars to decode
1154
urlencode_string=String to encode in URL encoded chars
1158
urlencode_string=String to encode in URL encoded chars
1159
use_custom_dns_resolver=Use custom DNS resolver
1155
use_expires=Use Cache-Control/Expires header when processing GET requests
1160
use_expires=Use Cache-Control/Expires header when processing GET requests
1156
use_keepalive=Use KeepAlive
1161
use_keepalive=Use KeepAlive
1157
use_multipart_for_http_post=Use multipart/form-data for POST
1162
use_multipart_for_http_post=Use multipart/form-data for POST
1158
use_multipart_mode_browser=Browser-compatible headers
1163
use_multipart_mode_browser=Browser-compatible headers
1159
use_recording_controller=Use Recording Controller
1164
use_recording_controller=Use Recording Controller
1165
use_system_dns_resolver=Use system DNS resolver
1160
user=User
1166
user=User
1161
user_defined_test=User Defined Test
1167
user_defined_test=User Defined Test
1162
user_defined_variables=User Defined Variables
1168
user_defined_variables=User Defined Variables
(-)src/core/org/apache/jmeter/resources/messages_fr.properties (+6 lines)
Lines 157-162 Link Here
157
choose_language=Choisir une langue
157
choose_language=Choisir une langue
158
clear=Nettoyer
158
clear=Nettoyer
159
clear_all=Nettoyer tout
159
clear_all=Nettoyer tout
160
clear_cache_each_iteration=Vider le cache \u00E0 chaque it\u00E9ration ?
160
clear_cache_per_iter=Nettoyer le cache \u00E0 chaque it\u00E9ration ?
161
clear_cache_per_iter=Nettoyer le cache \u00E0 chaque it\u00E9ration ?
161
clear_cookies_per_iter=Nettoyer les cookies \u00E0 chaque it\u00E9ration ?
162
clear_cookies_per_iter=Nettoyer les cookies \u00E0 chaque it\u00E9ration ?
162
clipboard_node_read_error=Une erreur est survenue lors de la copie du noeud
163
clipboard_node_read_error=Une erreur est survenue lors de la copie du noeud
Lines 240-245 Link Here
240
distribution_graph_title=Graphique de distribution (alpha)
241
distribution_graph_title=Graphique de distribution (alpha)
241
distribution_note1=Ce graphique se mettra \u00E0 jour tous les 10 \u00E9chantillons
242
distribution_note1=Ce graphique se mettra \u00E0 jour tous les 10 \u00E9chantillons
242
dn=Racine DN \:
243
dn=Racine DN \:
244
dns_cache_manager_title=Gestionnaire de cache DNS
245
dns_hostname_or_ip=Nom de machine ou adresse IP
246
dns_servers=Serveurs DNS
243
domain=Domaine \:
247
domain=Domaine \:
244
done=Fait
248
done=Fait
245
down=Descendre
249
down=Descendre
Lines 1146-1156 Link Here
1146
url_multipart_config_title=Requ\u00EAte HTTP Multipart par d\u00E9faut
1150
url_multipart_config_title=Requ\u00EAte HTTP Multipart par d\u00E9faut
1147
urldecode_string=Cha\u00EEne de style URL \u00E0 d\u00E9coder
1151
urldecode_string=Cha\u00EEne de style URL \u00E0 d\u00E9coder
1148
urlencode_string=Cha\u00EEne de caract\u00E8res \u00E0 encoder en style URL
1152
urlencode_string=Cha\u00EEne de caract\u00E8res \u00E0 encoder en style URL
1153
use_custom_dns_resolver=Utiliser un r\u00E9solveur DNS personnalis\u00E9
1149
use_expires=Utiliser les ent\u00EAtes Cache-Control/Expires lors du traitement des requ\u00EAtes GET
1154
use_expires=Utiliser les ent\u00EAtes Cache-Control/Expires lors du traitement des requ\u00EAtes GET
1150
use_keepalive=Connexion persist.
1155
use_keepalive=Connexion persist.
1151
use_multipart_for_http_post=Multipart/form-data
1156
use_multipart_for_http_post=Multipart/form-data
1152
use_multipart_mode_browser=Ent\u00EAtes compat. navigateur
1157
use_multipart_mode_browser=Ent\u00EAtes compat. navigateur
1153
use_recording_controller=Utiliser un contr\u00F4leur enregistreur
1158
use_recording_controller=Utiliser un contr\u00F4leur enregistreur
1159
use_system_dns_resolver=Utiliser le r\u00E9solveur DNS syst\u00E8me (JVM)
1154
user=Utilisateur
1160
user=Utilisateur
1155
user_defined_test=Test d\u00E9fini par l'utilisateur
1161
user_defined_test=Test d\u00E9fini par l'utilisateur
1156
user_defined_variables=Variables pr\u00E9-d\u00E9finies
1162
user_defined_variables=Variables pr\u00E9-d\u00E9finies
(-)src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java (+231 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements. See the NOTICE file distributed with this
4
 * work for additional information regarding copyright ownership. The ASF
5
 * licenses this file to You under the Apache License, Version 2.0 (the
6
 * "License"); you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 * 
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 * 
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
 * License for the specific language governing permissions and limitations under
15
 * the License.
16
 */
17
18
package org.apache.jmeter.protocol.http.control;
19
20
import java.io.Serializable;
21
import java.net.InetAddress;
22
import java.net.UnknownHostException;
23
import java.util.ArrayList;
24
import java.util.Arrays;
25
import java.util.LinkedHashMap;
26
import java.util.Map;
27
28
import org.apache.http.conn.DnsResolver;
29
import org.apache.http.impl.conn.SystemDefaultDnsResolver;
30
import org.apache.jmeter.config.ConfigTestElement;
31
import org.apache.jmeter.engine.event.LoopIterationEvent;
32
import org.apache.jmeter.testelement.TestIterationListener;
33
import org.apache.jmeter.testelement.property.BooleanProperty;
34
import org.apache.jmeter.testelement.property.CollectionProperty;
35
import org.apache.jmeter.testelement.property.PropertyIterator;
36
import org.apache.jmeter.threads.JMeterContextService;
37
import org.apache.jorphan.logging.LoggingManager;
38
import org.apache.log.Logger;
39
import org.xbill.DNS.ARecord;
40
import org.xbill.DNS.Cache;
41
import org.xbill.DNS.ExtendedResolver;
42
import org.xbill.DNS.Lookup;
43
import org.xbill.DNS.Record;
44
import org.xbill.DNS.Resolver;
45
import org.xbill.DNS.SimpleResolver;
46
import org.xbill.DNS.TextParseException;
47
import org.xbill.DNS.Type;
48
49
/**
50
 * This config element provides ability to have flexible control over DNS
51
 * caching function. Depending on option from @see
52
 * {@link org.apache.jmeter.protocol.http.gui.DNSCachePanel}, either system or
53
 * custom resolver can be used. Custom resolver uses dnsjava library, and gives
54
 * ability to bypass both OS and JVM cache. It allows to use paradigm
55
 * "1 virtual user - 1 DNS cache" in performance tests.
56
 *
57
 * @since 2.12
58
 */
59
60
public class DNSCacheManager extends ConfigTestElement implements TestIterationListener, Serializable, DnsResolver {
61
    private static final long serialVersionUID = 2120L;
62
    private static final Logger log = LoggingManager.getLoggerForClass();
63
    private SystemDefaultDnsResolver systemDefaultDnsResolver = null;
64
    private Map<String, InetAddress[]> cache = null;
65
    private Resolver resolver = null;
66
67
    //++ JMX tag values
68
    public static final String CLEAR_CACHE_EACH_ITER = "DNSCacheManager.clearEachIteration"; // $NON-NLS-1$
69
70
    public static final String SERVERS = "DNSCacheManager.servers"; // $NON-NLS-1$
71
72
    public static final String IS_CUSTOM_RESOLVER = "DNSCacheManager.isCustomResolver"; // $NON-NLS-1$
73
    //-- JMX tag values
74
    
75
    public static final boolean DEFAULT_CLEAR_CACHE_EACH_ITER = false;
76
    
77
    public static final String DEFAULT_SERVERS = ""; // $NON-NLS-1$
78
79
    public static final boolean DEFAULT_IS_CUSTOM_RESOLVER = false;
80
81
    private final transient Cache lookupCache;
82
83
    // ensure that the initial DNSServers are copied to the per-thread instances
84
85
    public DNSCacheManager() {
86
        setProperty(new CollectionProperty(SERVERS, new ArrayList<String>()));
87
        //disabling cache
88
        lookupCache = new Cache();
89
        lookupCache.setMaxCache(0);
90
        lookupCache.setMaxEntries(0);
91
    }
92
93
    /**
94
     * {@inheritDoc}
95
     */
96
    @Override
97
    public Object clone() {
98
        DNSCacheManager clone = (DNSCacheManager) super.clone();
99
        clone.systemDefaultDnsResolver = new SystemDefaultDnsResolver();
100
        clone.cache = new LinkedHashMap<String, InetAddress[]>();
101
        CollectionProperty dnsServers = getServers();
102
        try {
103
            clone.resolver = new ExtendedResolver();
104
            PropertyIterator dnsServIt = dnsServers.iterator();
105
            while (dnsServIt.hasNext()) {
106
                String dnsServer = dnsServIt.next().getStringValue();
107
                ((ExtendedResolver) clone.resolver).addResolver(new SimpleResolver(dnsServer));
108
            }
109
            // resolvers will be chosen via round-robin
110
            ((ExtendedResolver) clone.resolver).setLoadBalance(true);
111
        } catch (UnknownHostException uhe) {
112
            log.warn("Failed to create Extended resolver: " + uhe.getMessage());
113
        }
114
        return clone;
115
    }
116
117
    /**
118
     *
119
     * Resolves address using system or custom DNS resolver
120
     */
121
    @Override
122
    public InetAddress[] resolve(String host) throws UnknownHostException {
123
        if (cache.containsKey(host)) {
124
            if (log.isDebugEnabled()) {
125
                log.debug("Cache hit thr#" + JMeterContextService.getContext().getThreadNum() + ": " + host + "=>"
126
                        + Arrays.toString(cache.get(host)));
127
            }
128
            return cache.get(host);
129
        } else {
130
            InetAddress[] addresses = requestLookup(host);
131
            if (log.isDebugEnabled()) {
132
                log.debug("Cache miss thr#" + JMeterContextService.getContext().getThreadNum() + ": " + host + "=>"
133
                        + Arrays.toString(addresses));
134
            }
135
            cache.put(host, addresses);
136
            return addresses;
137
        }
138
    }
139
140
    /**
141
     * Sends DNS request via system or custom DNS resolver
142
     */
143
    private InetAddress[] requestLookup(String host) throws UnknownHostException {
144
        InetAddress[] addresses = null;
145
        if (getIsCustResolver() && ((ExtendedResolver) resolver).getResolvers().length > 1) {
146
            try {
147
                Lookup lookup = new Lookup(host, Type.A);
148
                lookup.setCache(lookupCache);
149
                lookup.setResolver(resolver);
150
                Record[] records = lookup.run();
151
                if (records.length == 0) {
152
                    throw new UnknownHostException("Failed to resolve host name: " + host);
153
                }
154
                addresses = new InetAddress[records.length];
155
                for (int i = 0; i < records.length; i++) {
156
                    addresses[i] = ((ARecord) records[i]).getAddress();
157
                }
158
            } catch (TextParseException tpe) {
159
                log.debug("Failed to create Lookup object: " + tpe);
160
            }
161
        } else {
162
            addresses = systemDefaultDnsResolver.resolve(host);
163
            if (log.isDebugEnabled()) {
164
                log.debug("Cache miss: " + host + " Thread #" + JMeterContextService.getContext().getThreadNum()
165
                        + ", resolved with system resolver into " + Arrays.toString(addresses));
166
            }
167
        }
168
        return addresses;
169
    }
170
171
    /**
172
     * {@inheritDoc} Clean DNS cache if appropriate check-box was selected
173
     */
174
    @Override
175
    public void testIterationStart(LoopIterationEvent event) {
176
        if (getClearEachIteration()) {
177
            this.cache.clear();
178
        }
179
    }
180
181
    /**
182
     * {@inheritDoc}
183
     */
184
    @Override
185
    public void clear() {
186
        super.clear();
187
        clearServers(); // ensure data is set up OK initially
188
    }
189
190
    /**
191
     * Remove all the servers.
192
     */
193
    private void clearServers() {
194
        log.debug("Clear all servers from store");
195
        setProperty(new CollectionProperty(SERVERS, new ArrayList<String>()));
196
    }
197
198
    public void addServer(String dnsServer) {
199
        getServers().addItem(dnsServer);
200
    }
201
202
    /**
203
     * Clean DNS cache each iteration
204
     * 
205
     * @return boolean
206
     */
207
    public boolean getClearEachIteration() {
208
        return getPropertyAsBoolean(CLEAR_CACHE_EACH_ITER);
209
    }
210
211
    /**
212
     * Clean DNS cache each iteration
213
     *
214
     */
215
    public void setClearEachIteration(boolean clear) {
216
        setProperty(new BooleanProperty(CLEAR_CACHE_EACH_ITER, clear));
217
    }
218
219
    public CollectionProperty getServers() {
220
        return (CollectionProperty) getProperty(SERVERS);
221
    }
222
223
    public boolean getIsCustResolver() {
224
        return this.getPropertyAsBoolean(IS_CUSTOM_RESOLVER, true);
225
    }
226
227
    public void setIsCustomResolver(boolean isCustomResolver) {
228
        this.setProperty(IS_CUSTOM_RESOLVER, isCustomResolver);
229
    }
230
231
}
(-)src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java (+310 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements. See the NOTICE file distributed with this
4
 * work for additional information regarding copyright ownership. The ASF
5
 * licenses this file to You under the Apache License, Version 2.0 (the
6
 * "License"); you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 * 
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 * 
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
 * License for the specific language governing permissions and limitations under
15
 * the License.
16
 */
17
18
package org.apache.jmeter.protocol.http.gui;
19
20
import java.awt.BorderLayout;
21
import java.awt.Color;
22
import java.awt.Dimension;
23
import java.awt.event.ActionEvent;
24
import java.awt.event.ActionListener;
25
26
import javax.swing.BorderFactory;
27
import javax.swing.ButtonGroup;
28
import javax.swing.JButton;
29
import javax.swing.JCheckBox;
30
import javax.swing.JPanel;
31
import javax.swing.JRadioButton;
32
import javax.swing.JScrollPane;
33
import javax.swing.JTable;
34
import javax.swing.ListSelectionModel;
35
import javax.swing.table.TableCellEditor;
36
37
import org.apache.jmeter.config.gui.AbstractConfigGui;
38
import org.apache.jmeter.gui.util.PowerTableModel;
39
import org.apache.jmeter.protocol.http.control.DNSCacheManager;
40
import org.apache.jmeter.testelement.TestElement;
41
import org.apache.jmeter.testelement.property.PropertyIterator;
42
import org.apache.jmeter.util.JMeterUtils;
43
import org.apache.jorphan.gui.GuiUtils;
44
import org.apache.jorphan.gui.layout.VerticalLayout;
45
46
/**
47
 * This gui part of @see
48
 * {@link org.apache.jmeter.protocol.http.control.DNSCacheManager}. Using
49
 * radiobuttons, user can switch between using system DNS resolver and custom
50
 * resolver. Custom resolver functionality is provided by dnsjava library.
51
 * "DNS servers" may contain one or more IP/Name of dns server for resolving
52
 * name DNS servers are chosen via round-robin. If table is empty - system
53
 * resolver is used.
54
 *
55
 * @since 2.12
56
 */
57
public class DNSCachePanel extends AbstractConfigGui implements ActionListener {
58
59
    private static final long serialVersionUID = 2120L;
60
61
//    public static final String CLEAR_CACHE_EACH_ITER = JMeterUtils.getResString("clear_cache_each_iteration");
62
    public static final String OPTIONS = JMeterUtils.getResString("option");
63
    private static final String ADD_COMMAND = JMeterUtils.getResString("add"); // $NON-NLS-1$
64
    private static final String DELETE_COMMAND = JMeterUtils.getResString("delete"); // $NON-NLS-1$
65
    private static final String SYS_RES_COMMAND = JMeterUtils.getResString("use_system_dns_resolver"); // $NON-NLS-1$
66
    private static final String CUST_RES_COMMAND = JMeterUtils.getResString("use_custom_dns_resolver"); // $NON-NLS-1$
67
    
68
    private JTable dnsServersTable;
69
    private JPanel dnsServersPanel;
70
    private JPanel dnsServButPanel;
71
    private PowerTableModel dnsServersTableModel;
72
    private JRadioButton sysResButton;
73
    private JRadioButton custResButton;
74
    private JButton deleteButton;
75
    private JButton addButton;
76
77
    private static final String[] COLUMN_RESOURCE_NAMES = {
78
        (JMeterUtils.getResString("dns_hostname_or_ip")), //$NON-NLS-1$
79
    };
80
    private static final Class<?>[] columnClasses = {
81
        String.class };
82
83
    private JCheckBox clearEachIteration;
84
85
    /**
86
     * Default constructor.
87
     */
88
    public DNSCachePanel() {
89
        init();
90
    }
91
92
    @Override
93
    public String getLabelResource() {
94
        return "dns_cache_manager_title";
95
    }
96
97
    /**
98
     * Modifies a given TestElement to mirror the data in the gui components.
99
     *
100
     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(org.apache.jmeter.testelement.TestElement)
101
     */
102
    @Override
103
    public void modifyTestElement(TestElement dnsRes) {
104
        GuiUtils.stopTableEditing(dnsServersTable);
105
        dnsRes.clear();
106
        configureTestElement(dnsRes);
107
        if (dnsRes instanceof DNSCacheManager) {
108
            DNSCacheManager dnsCacheManager = (DNSCacheManager) dnsRes;
109
            for (int i = 0; i < dnsServersTableModel.getRowCount(); i++) {
110
                String server = (String) dnsServersTableModel.getRowData(i)[0];
111
                dnsCacheManager.addServer(server);
112
            }
113
            dnsCacheManager.setClearEachIteration(clearEachIteration.isSelected());
114
            dnsCacheManager.setIsCustomResolver(custResButton.isSelected());
115
        }
116
117
    }
118
119
    /**
120
     * Implements JMeterGUIComponent.clearGui
121
     */
122
    @Override
123
    public void clearGui() {
124
        super.clearGui();
125
        clearEachIteration.setSelected(true);
126
        dnsServersTableModel.clearData();
127
        deleteButton.setEnabled(custResButton.isSelected() && dnsServersTable.getColumnCount() > 0);
128
129
    }
130
131
    private void populateTable(DNSCacheManager resolver) {
132
        dnsServersTableModel.clearData();
133
        PropertyIterator iter = resolver.getServers().iterator();
134
        while (iter.hasNext()) {
135
            addServerToTable((String) iter.next().getObjectValue());
136
        }
137
    }
138
139
    @Override
140
    public TestElement createTestElement() {
141
        DNSCacheManager dnsCacheManager = new DNSCacheManager();
142
        modifyTestElement(dnsCacheManager);
143
        return dnsCacheManager;
144
    }
145
146
    @Override
147
    public void configure(TestElement el) {
148
        super.configure(el);
149
150
        populateTable((DNSCacheManager) el);
151
        clearEachIteration.setSelected(el.getPropertyAsBoolean(DNSCacheManager.CLEAR_CACHE_EACH_ITER, 
152
                DNSCacheManager.DEFAULT_CLEAR_CACHE_EACH_ITER));
153
        custResButton.setSelected(el.getPropertyAsBoolean(DNSCacheManager.IS_CUSTOM_RESOLVER, 
154
                DNSCacheManager.DEFAULT_IS_CUSTOM_RESOLVER));
155
    }
156
157
    private void init() {
158
        dnsServersTableModel = new PowerTableModel(COLUMN_RESOURCE_NAMES, columnClasses);
159
160
        clearEachIteration = new JCheckBox(JMeterUtils.getResString("clear_cache_each_iteration"), true); //$NON-NLS-1$
161
        setLayout(new BorderLayout());
162
        setBorder(makeBorder());
163
        JPanel northPanel = new JPanel();
164
        northPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
165
        northPanel.add(makeTitlePanel());
166
        JPanel optionsPane = new JPanel();
167
        optionsPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), OPTIONS)); // $NON-NLS-1$
168
        optionsPane.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
169
        optionsPane.add(clearEachIteration, BorderLayout.WEST);
170
        optionsPane.add(createChooseResPanel(), BorderLayout.SOUTH);
171
        northPanel.add(optionsPane);
172
        add(northPanel, BorderLayout.NORTH);
173
174
        dnsServersPanel = createDnsServersTablePanel();
175
        add(dnsServersPanel, BorderLayout.CENTER);
176
177
    }
178
179
    public JPanel createDnsServersTablePanel() {
180
        // create the JTable that holds header per row
181
        dnsServersTable = new JTable(dnsServersTableModel);
182
        dnsServersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
183
        dnsServersTable.setPreferredScrollableViewportSize(new Dimension(400, 100));
184
185
        JPanel panel = new JPanel(new BorderLayout(0, 5));
186
        panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
187
                JMeterUtils.getResString("dns_servers"))); // $NON-NLS-1$
188
        JScrollPane dnsServScrollPane = new JScrollPane(dnsServersTable);
189
        panel.add(dnsServScrollPane, BorderLayout.CENTER);
190
        dnsServButPanel = createButtonPanel();
191
        panel.add(dnsServButPanel, BorderLayout.SOUTH);
192
        return panel;
193
    }
194
195
    private JPanel createChooseResPanel() {
196
        JPanel chooseResPanel = new JPanel(new BorderLayout(0, 5));
197
        sysResButton = new JRadioButton();
198
        sysResButton.setSelected(true);
199
        sysResButton.setText(SYS_RES_COMMAND);
200
        sysResButton.setToolTipText(SYS_RES_COMMAND);
201
        sysResButton.setEnabled(true);
202
        sysResButton.addActionListener(this);
203
204
        custResButton = new JRadioButton();
205
        custResButton.setSelected(false);
206
        custResButton.setText(CUST_RES_COMMAND);
207
        custResButton.setToolTipText(CUST_RES_COMMAND);
208
        custResButton.setEnabled(true);
209
        custResButton.addActionListener(this);
210
211
        ButtonGroup buttonGroup;
212
        buttonGroup = new ButtonGroup();
213
        buttonGroup.add(sysResButton);
214
        buttonGroup.add(custResButton);
215
216
        chooseResPanel.add(sysResButton, BorderLayout.WEST);
217
        chooseResPanel.add(custResButton, BorderLayout.CENTER);
218
        return chooseResPanel;
219
    }
220
221
    private JPanel createButtonPanel() {
222
        boolean tableEmpty = (dnsServersTableModel.getRowCount() == 0);
223
224
        addButton = createButton("add", 'A', ADD_COMMAND, custResButton.isSelected()); // $NON-NLS-1$
225
        deleteButton = createButton("delete", 'D', DELETE_COMMAND, !tableEmpty); // $NON-NLS-1$
226
227
        JPanel buttonPanel = new JPanel();
228
        buttonPanel.add(addButton, BorderLayout.WEST);
229
        buttonPanel.add(deleteButton, BorderLayout.LINE_END);
230
        return buttonPanel;
231
    }
232
233
    private JButton createButton(String resName, char mnemonic, String command, boolean enabled) {
234
        JButton button = new JButton(JMeterUtils.getResString(resName));
235
        button.setMnemonic(mnemonic);
236
        button.setActionCommand(command);
237
        button.setEnabled(enabled);
238
        button.addActionListener(this);
239
        return button;
240
    }
241
242
    private void addServerToTable(String dnsServer) {
243
        dnsServersTableModel.addRow(new Object[] {
244
            dnsServer });
245
    }
246
247
    @Override
248
    public void actionPerformed(ActionEvent e) {
249
        String action = e.getActionCommand();
250
        dnsServersTable.setEnabled(custResButton.isSelected());
251
        Color greyColor = new Color(240, 240, 240);
252
        Color blueColor = new Color(184, 207, 229);
253
        dnsServersTable.setBackground(sysResButton.isSelected() ? greyColor : Color.WHITE);
254
        dnsServersTable.setSelectionBackground(sysResButton.isSelected() ? greyColor : blueColor);
255
        addButton.setEnabled(custResButton.isSelected());
256
        deleteButton.setEnabled(custResButton.isSelected());
257
        if (custResButton.isSelected() && (dnsServersTableModel.getRowCount() > 0)) {
258
            deleteButton.setEnabled(true);
259
            addButton.setEnabled(true);
260
        }
261
262
        if (action.equals(DELETE_COMMAND)) {
263
            if (dnsServersTableModel.getRowCount() > 0) {
264
                // If a table cell is being edited, we must cancel the editing
265
                // before deleting the row.
266
                if (dnsServersTable.isEditing()) {
267
                    TableCellEditor cellEditor = dnsServersTable.getCellEditor(dnsServersTable.getEditingRow(),
268
                            dnsServersTable.getEditingColumn());
269
                    cellEditor.cancelCellEditing();
270
                }
271
272
                int rowSelected = dnsServersTable.getSelectedRow();
273
274
                if (rowSelected != -1) {
275
                    dnsServersTableModel.removeRow(rowSelected);
276
                    dnsServersTableModel.fireTableDataChanged();
277
278
                    if (dnsServersTableModel.getRowCount() == 0) {
279
                        deleteButton.setEnabled(false);
280
                    }
281
282
                    else {
283
                        int rowToSelect = rowSelected;
284
285
                        if (rowSelected >= dnsServersTableModel.getRowCount()) {
286
                            rowToSelect = rowSelected - 1;
287
                        }
288
289
                        dnsServersTable.setRowSelectionInterval(rowToSelect, rowToSelect);
290
                    }
291
                }
292
            }
293
        } else if (action.equals(ADD_COMMAND)) {
294
            // If a table cell is being edited, we should accept the current
295
            // value and stop the editing before adding a new row.
296
            GuiUtils.stopTableEditing(dnsServersTable);
297
298
            dnsServersTableModel.addNewRow();
299
            dnsServersTableModel.fireTableDataChanged();
300
301
            if (!deleteButton.isEnabled()) {
302
                deleteButton.setEnabled(true);
303
            }
304
305
            // Highlight (select) the appropriate row.
306
            int rowToSelect = dnsServersTableModel.getRowCount() - 1;
307
            dnsServersTable.setRowSelectionInterval(rowToSelect, rowToSelect);
308
        }
309
    }
310
}
(-)src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (-2 / +13 lines)
Lines 74-79 Link Here
74
import org.apache.http.client.params.CookiePolicy;
74
import org.apache.http.client.params.CookiePolicy;
75
import org.apache.http.client.protocol.ResponseContentEncoding;
75
import org.apache.http.client.protocol.ResponseContentEncoding;
76
import org.apache.http.conn.ConnectionKeepAliveStrategy;
76
import org.apache.http.conn.ConnectionKeepAliveStrategy;
77
import org.apache.http.conn.DnsResolver;
77
import org.apache.http.conn.params.ConnRoutePNames;
78
import org.apache.http.conn.params.ConnRoutePNames;
78
import org.apache.http.conn.scheme.Scheme;
79
import org.apache.http.conn.scheme.Scheme;
79
import org.apache.http.conn.scheme.SchemeRegistry;
80
import org.apache.http.conn.scheme.SchemeRegistry;
Lines 89-94 Link Here
89
import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy;
90
import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy;
90
import org.apache.http.impl.client.DefaultHttpClient;
91
import org.apache.http.impl.client.DefaultHttpClient;
91
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
92
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
93
import org.apache.http.impl.conn.PoolingClientConnectionManager;
94
import org.apache.http.impl.conn.SchemeRegistryFactory;
95
import org.apache.http.impl.conn.SystemDefaultDnsResolver;
92
import org.apache.http.message.BasicNameValuePair;
96
import org.apache.http.message.BasicNameValuePair;
93
import org.apache.http.params.BasicHttpParams;
97
import org.apache.http.params.BasicHttpParams;
94
import org.apache.http.params.CoreConnectionPNames;
98
import org.apache.http.params.CoreConnectionPNames;
Lines 633-640 Link Here
633
        if (httpClient == null){ // One-time init for this client
637
        if (httpClient == null){ // One-time init for this client
634
638
635
            HttpParams clientParams = new DefaultedHttpParams(new BasicHttpParams(), DEFAULT_HTTP_PARAMS);
639
            HttpParams clientParams = new DefaultedHttpParams(new BasicHttpParams(), DEFAULT_HTTP_PARAMS);
636
            
640
637
            httpClient = new DefaultHttpClient(clientParams){
641
            DnsResolver resolver= this.testElement.getDNSResolver();
642
            if (resolver==null) {
643
                resolver= new SystemDefaultDnsResolver();
644
            }
645
            PoolingClientConnectionManager poolingClientConnectionManager=
646
                    new PoolingClientConnectionManager(SchemeRegistryFactory.createDefault(),resolver);
647
648
            httpClient = new DefaultHttpClient(poolingClientConnectionManager, clientParams) {
638
                @Override
649
                @Override
639
                protected HttpRequestRetryHandler createHttpRequestRetryHandler() {
650
                protected HttpRequestRetryHandler createHttpRequestRetryHandler() {
640
                    return new DefaultHttpRequestRetryHandler(RETRY_COUNT, false); // set retry count
651
                    return new DefaultHttpRequestRetryHandler(RETRY_COUNT, false); // set retry count
(-)src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java (+20 lines)
Lines 55-60 Link Here
55
import org.apache.jmeter.protocol.http.control.Cookie;
55
import org.apache.jmeter.protocol.http.control.Cookie;
56
import org.apache.jmeter.protocol.http.control.CookieManager;
56
import org.apache.jmeter.protocol.http.control.CookieManager;
57
import org.apache.jmeter.protocol.http.control.HeaderManager;
57
import org.apache.jmeter.protocol.http.control.HeaderManager;
58
import org.apache.jmeter.protocol.http.control.DNSCacheManager;
58
import org.apache.jmeter.protocol.http.parser.HTMLParseException;
59
import org.apache.jmeter.protocol.http.parser.HTMLParseException;
59
import org.apache.jmeter.protocol.http.parser.HTMLParser;
60
import org.apache.jmeter.protocol.http.parser.HTMLParser;
60
import org.apache.jmeter.protocol.http.util.ConversionUtils;
61
import org.apache.jmeter.protocol.http.util.ConversionUtils;
Lines 105-110 Link Here
105
                    "org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui",
106
                    "org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui",
106
                    "org.apache.jmeter.config.gui.SimpleConfigGui",
107
                    "org.apache.jmeter.config.gui.SimpleConfigGui",
107
                    "org.apache.jmeter.protocol.http.gui.HeaderPanel",
108
                    "org.apache.jmeter.protocol.http.gui.HeaderPanel",
109
                    "org.apache.jmeter.protocol.http.control.DNSCacheManager",
110
                    "org.apache.jmeter.protocol.http.gui.DNSCachePanel",
108
                    "org.apache.jmeter.protocol.http.gui.AuthPanel",
111
                    "org.apache.jmeter.protocol.http.gui.AuthPanel",
109
                    "org.apache.jmeter.protocol.http.gui.CacheManagerGui",
112
                    "org.apache.jmeter.protocol.http.gui.CacheManagerGui",
110
                    "org.apache.jmeter.protocol.http.gui.CookiePanel"}));
113
                    "org.apache.jmeter.protocol.http.gui.CookiePanel"}));
Lines 120-125 Link Here
120
123
121
    public static final String HEADER_MANAGER = "HTTPSampler.header_manager"; // $NON-NLS-1$
124
    public static final String HEADER_MANAGER = "HTTPSampler.header_manager"; // $NON-NLS-1$
122
125
126
    public static final String DNS_CACHE_MANAGER = "HTTPSampler.dns_cache_manager"; // $NON-NLS-1$
127
123
    public static final String DOMAIN = "HTTPSampler.domain"; // $NON-NLS-1$
128
    public static final String DOMAIN = "HTTPSampler.domain"; // $NON-NLS-1$
124
129
125
    public static final String PORT = "HTTPSampler.port"; // $NON-NLS-1$
130
    public static final String PORT = "HTTPSampler.port"; // $NON-NLS-1$
Lines 622-627 Link Here
622
            setHeaderManager((HeaderManager) el);
627
            setHeaderManager((HeaderManager) el);
623
        } else if (el instanceof AuthManager) {
628
        } else if (el instanceof AuthManager) {
624
            setAuthManager((AuthManager) el);
629
            setAuthManager((AuthManager) el);
630
        } else if (el instanceof DNSCacheManager) {
631
            setDNSResolver((DNSCacheManager) el);
625
        } else {
632
        } else {
626
            super.addTestElement(el);
633
            super.addTestElement(el);
627
        }
634
        }
Lines 835-840 Link Here
835
        return (CacheManager) getProperty(CACHE_MANAGER).getObjectValue();
842
        return (CacheManager) getProperty(CACHE_MANAGER).getObjectValue();
836
    }
843
    }
837
844
845
    public DNSCacheManager getDNSResolver() {
846
        return (DNSCacheManager) getProperty(DNS_CACHE_MANAGER).getObjectValue();
847
    }
848
849
    public void setDNSResolver(DNSCacheManager cacheManager) {
850
        DNSCacheManager mgr = getDNSResolver();
851
        if (mgr != null) {
852
            log.warn("Existing DNSCacheManager " + mgr.getName() + " superseded by " + cacheManager.getName());
853
        }
854
        setProperty(new TestElementProperty(DNS_CACHE_MANAGER, cacheManager));
855
    }
856
857
838
    public boolean isImageParser() {
858
    public boolean isImageParser() {
839
        return getPropertyAsBoolean(IMAGE_PARSER, false);
859
        return getPropertyAsBoolean(IMAGE_PARSER, false);
840
    }
860
    }
(-)xdocs/usermanual/component_reference.xml (-17 / +37 lines)
Lines 3467-3473 Link Here
3467
<description></description>
3467
<description></description>
3468
</component>
3468
</component>
3469
3469
3470
<component name="HTTP Authorization Manager" index="&sect-num;.4.3"  width="538" height="340" screenshot="http-config/http-auth-manager.png">
3470
<component name="DNS Cache Manager" index="&sect-num;.4.3"  width="513" height="383" screenshot="http-config/dns-cache-manager.png">
3471
    <note>DNS Cache Manager is designed for using in the root of Thread Group or Test Plan. Do not place it as child element of particular HTTP Sampler
3472
    </note>
3473
    <description><p>The DNS Cache Manager element allows to test applications, which have several servers behind load balancers(CDN,etc), when user receives content from different IP's. By default JMeter uses JVM DNS cache. That's why
3474
    only one server from the cluster receives load. DNS Cache Manager resolves name for each thread separately each iteration and
3475
    saves results of resolving to its internal DNS Cache, which independent from both JVM and OS DNS caches.
3476
    </p>
3477
    </description>
3478
    <properties>
3479
    <property name="Name" required="No">Descriptive name for this element that is shown in the tree. </property>
3480
    <property name="Clear cache each Iteration" required="Yes">If selected, DNS cache of every  Thread is cleared each time new iteration is started.</property>
3481
    <property name="Use system DNS resolver" required="N/A">System DNS resolver will be used. For correct work edit
3482
        $JAVA_HOME/jre/lib/security/java.security: add "networkaddress.cache.ttl=0"
3483
    </property>
3484
    <property name="Use custom DNS resolver" required="N/A">Custom DNS resolver(from dnsjava library) will be used.</property>
3485
    <property name="Add Button" required="N/A">Add an entry to the DNS servers table.</property>
3486
    <property name="Delete Button" required="N/A">Delete the currently selected table entry.</property>
3487
    </properties>
3488
</component>
3489
3490
<component name="HTTP Authorization Manager" index="&sect-num;.4.4"  width="538" height="340" screenshot="http-config/http-auth-manager.png">
3471
<note>If there is more than one Authorization Manager in the scope of a Sampler,
3491
<note>If there is more than one Authorization Manager in the scope of a Sampler,
3472
there is currently no way to specify which one is to be used.</note>
3492
there is currently no way to specify which one is to be used.</note>
3473
3493
Lines 3593-3599 Link Here
3593
3613
3594
</component>
3614
</component>
3595
3615
3596
<component name="HTTP Cache Manager" index="&sect-num;.4.4"  width="511" height="196" screenshot="http-config/http-cache-manager.png">
3616
<component name="HTTP Cache Manager" index="&sect-num;.4.5"  width="511" height="196" screenshot="http-config/http-cache-manager.png">
3597
3617
3598
<note>This is a new element, and is liable to change</note>
3618
<note>This is a new element, and is liable to change</note>
3599
3619
Lines 3637-3643 Link Here
3637
</properties>
3657
</properties>
3638
</component>
3658
</component>
3639
3659
3640
<component name="HTTP Cookie Manager" index="&sect-num;.4.5"  width="513" height="383" screenshot="http-config/http-cookie-manager.png">
3660
<component name="HTTP Cookie Manager" index="&sect-num;.4.6"  width="513" height="383" screenshot="http-config/http-cookie-manager.png">
3641
3661
3642
<note>If there is more than one Cookie Manager in the scope of a Sampler,
3662
<note>If there is more than one Cookie Manager in the scope of a Sampler,
3643
there is currently no way to specify which one is to be used.
3663
there is currently no way to specify which one is to be used.
Lines 3707-3713 Link Here
3707
3727
3708
</component>
3728
</component>
3709
3729
3710
<component name="HTTP Request Defaults" index="&sect-num;.4.6" width="853" height="463" 
3730
<component name="HTTP Request Defaults" index="&sect-num;.4.7" width="853" height="463" 
3711
         screenshot="http-config/http-request-defaults.png">
3731
         screenshot="http-config/http-request-defaults.png">
3712
<description><p>This element lets you set default values that your HTTP Request controllers use.  For example, if you are
3732
<description><p>This element lets you set default values that your HTTP Request controllers use.  For example, if you are
3713
creating a Test Plan with 25 HTTP Request controllers and all of the requests are being sent to the same server,
3733
creating a Test Plan with 25 HTTP Request controllers and all of the requests are being sent to the same server,
Lines 3768-3774 Link Here
3768
</note>
3788
</note>
3769
</component>
3789
</component>
3770
3790
3771
<component name="HTTP Header Manager" index="&sect-num;.4.7"  width="767" height="239" screenshot="http-config/http-header-manager.png">
3791
<component name="HTTP Header Manager" index="&sect-num;.4.8"  width="767" height="239" screenshot="http-config/http-header-manager.png">
3772
<description>
3792
<description>
3773
<p>The Header Manager lets you add or override HTTP request headers.</p>
3793
<p>The Header Manager lets you add or override HTTP request headers.</p>
3774
<p>
3794
<p>
Lines 3808-3820 Link Here
3808
3828
3809
</component>
3829
</component>
3810
3830
3811
<component name="Java Request Defaults" index="&sect-num;.4.8"  width="454" height="283" screenshot="java_defaults.png">
3831
<component name="Java Request Defaults" index="&sect-num;.4.9"  width="454" height="283" screenshot="java_defaults.png">
3812
<description><p>The Java Request Defaults component lets you set default values for Java testing.  See the <complink name="Java Request" />.</p>
3832
<description><p>The Java Request Defaults component lets you set default values for Java testing.  See the <complink name="Java Request" />.</p>
3813
</description>
3833
</description>
3814
3834
3815
</component>
3835
</component>
3816
3836
3817
<component name="JDBC Connection Configuration" index="&sect-num;.4.9" 
3837
<component name="JDBC Connection Configuration" index="&sect-num;.4.10" 
3818
                 width="474" height="458" screenshot="jdbc-config/jdbc-conn-config.png">
3838
                 width="474" height="458" screenshot="jdbc-config/jdbc-conn-config.png">
3819
    <description>Creates a database connection (used by <complink name="JDBC Request"/>Sampler)
3839
    <description>Creates a database connection (used by <complink name="JDBC Request"/>Sampler)
3820
     from the supplied JDBC Connection settings. The connection may be optionally pooled between threads.
3840
     from the supplied JDBC Connection settings. The connection may be optionally pooled between threads.
Lines 3880-3886 Link Here
3880
</component>
3900
</component>
3881
3901
3882
3902
3883
<component name="Keystore Configuration" index="&sect-num;.4.10"  width="441" height="189" screenshot="keystore_config.png">
3903
<component name="Keystore Configuration" index="&sect-num;.4.11"  width="441" height="189" screenshot="keystore_config.png">
3884
<description><p>The Keystore Config Element lets you configure how Keystore will be loaded and which keys it will use.
3904
<description><p>The Keystore Config Element lets you configure how Keystore will be loaded and which keys it will use.
3885
This component is typically used in HTTPS scenarios where you don't want to take into account keystore initialization into account in response time.</p>
3905
This component is typically used in HTTPS scenarios where you don't want to take into account keystore initialization into account in response time.</p>
3886
<p>To use this element, you need to setup first a Java Key Store with the client certificates you want to test, to do that:
3906
<p>To use this element, you need to setup first a Java Key Store with the client certificates you want to test, to do that:
Lines 3921-3927 Link Here
3921
</note>
3941
</note>
3922
</component>
3942
</component>
3923
3943
3924
<component name="Login Config Element" index="&sect-num;.4.11"  width="352" height="112" screenshot="login-config.png">
3944
<component name="Login Config Element" index="&sect-num;.4.12"  width="352" height="112" screenshot="login-config.png">
3925
<description><p>The Login Config Element lets you add or override username and password settings in samplers that use username and password as part of their setup.</p>
3945
<description><p>The Login Config Element lets you add or override username and password settings in samplers that use username and password as part of their setup.</p>
3926
</description>
3946
</description>
3927
3947
Lines 3933-3951 Link Here
3933
3953
3934
</component>
3954
</component>
3935
3955
3936
<component name="LDAP Request Defaults" index="&sect-num;.4.12"  width="689" height="232" screenshot="ldap_defaults.png">
3956
<component name="LDAP Request Defaults" index="&sect-num;.4.13"  width="689" height="232" screenshot="ldap_defaults.png">
3937
<description><p>The LDAP Request Defaults component lets you set default values for LDAP testing.  See the <complink name="LDAP Request"/>.</p>
3957
<description><p>The LDAP Request Defaults component lets you set default values for LDAP testing.  See the <complink name="LDAP Request"/>.</p>
3938
</description>
3958
</description>
3939
3959
3940
</component>
3960
</component>
3941
3961
3942
<component name="LDAP Extended Request Defaults" index="&sect-num;.4.13"  width="686" height="184" screenshot="ldapext_defaults.png">
3962
<component name="LDAP Extended Request Defaults" index="&sect-num;.4.14"  width="686" height="184" screenshot="ldapext_defaults.png">
3943
<description><p>The LDAP Extended Request Defaults component lets you set default values for extended LDAP testing.  See the <complink name="LDAP Extended Request"/>.</p>
3963
<description><p>The LDAP Extended Request Defaults component lets you set default values for extended LDAP testing.  See the <complink name="LDAP Extended Request"/>.</p>
3944
</description>
3964
</description>
3945
3965
3946
</component>
3966
</component>
3947
3967
3948
<component name="TCP Sampler Config" index="&sect-num;.4.14"  width="826" height="450" screenshot="tcpsamplerconfig.png">
3968
<component name="TCP Sampler Config" index="&sect-num;.4.15"  width="826" height="450" screenshot="tcpsamplerconfig.png">
3949
<description>
3969
<description>
3950
        <p>
3970
        <p>
3951
    The TCP Sampler Config provides default data for the TCP Sampler
3971
    The TCP Sampler Config provides default data for the TCP Sampler
Lines 3967-3973 Link Here
3967
</properties>
3987
</properties>
3968
</component>
3988
</component>
3969
3989
3970
<component name="User Defined Variables" index="&sect-num;.4.15"  width="741" height="266" screenshot="user_defined_variables.png">
3990
<component name="User Defined Variables" index="&sect-num;.4.16"  width="741" height="266" screenshot="user_defined_variables.png">
3971
<description><p>The User Defined Variables element lets you define an <b>initial set of variables</b>, just as in the <complink name="Test Plan" />.
3991
<description><p>The User Defined Variables element lets you define an <b>initial set of variables</b>, just as in the <complink name="Test Plan" />.
3972
<b>
3992
<b>
3973
Note that all the UDV elements in a test plan - no matter where they are - are processed at the start.
3993
Note that all the UDV elements in a test plan - no matter where they are - are processed at the start.
Lines 4017-4023 Link Here
4017
</properties>
4037
</properties>
4018
</component>
4038
</component>
4019
4039
4020
<component name="Random Variable" index="&sect-num;.4.16"  width="495" height="286" screenshot="random_variable.png">
4040
<component name="Random Variable" index="&sect-num;.4.17"  width="495" height="286" screenshot="random_variable.png">
4021
<description>
4041
<description>
4022
<p>
4042
<p>
4023
The Random Variable Config Element is used to generate random numeric strings and store them in variable for use later.
4043
The Random Variable Config Element is used to generate random numeric strings and store them in variable for use later.
Lines 4052-4058 Link Here
4052
4072
4053
</component>
4073
</component>
4054
4074
4055
<component name="Counter" index="&sect-num;.4.17"  width="404" height="262" screenshot="counter.png">
4075
<component name="Counter" index="&sect-num;.4.18"  width="404" height="262" screenshot="counter.png">
4056
<description><p>Allows the user to create a counter that can be referenced anywhere
4076
<description><p>Allows the user to create a counter that can be referenced anywhere
4057
in the Thread Group.  The counter config lets the user configure a starting point, a maximum,
4077
in the Thread Group.  The counter config lets the user configure a starting point, a maximum,
4058
and the increment.  The counter will loop from the start to the max, and then start over
4078
and the increment.  The counter will loop from the start to the max, and then start over
Lines 4083-4089 Link Here
4083
</properties>
4103
</properties>
4084
</component>
4104
</component>
4085
4105
4086
<component name="Simple Config Element" index="&sect-num;.4.18"  width="393" height="245" screenshot="simple_config_element.png">
4106
<component name="Simple Config Element" index="&sect-num;.4.19"  width="393" height="245" screenshot="simple_config_element.png">
4087
<description><p>The Simple Config Element lets you add or override arbitrary values in samplers.  You can choose the name of the value
4107
<description><p>The Simple Config Element lets you add or override arbitrary values in samplers.  You can choose the name of the value
4088
and the value itself.  Although some adventurous users might find a use for this element, it's here primarily for developers as a basic
4108
and the value itself.  Although some adventurous users might find a use for this element, it's here primarily for developers as a basic
4089
GUI that they can use while developing new JMeter components.</p>
4109
GUI that they can use while developing new JMeter components.</p>
Lines 4099-4105 Link Here
4099
</component>
4119
</component>
4100
4120
4101
4121
4102
<component name="MongoDB Source Config" index="&sect-num;.4.19" 
4122
<component name="MongoDB Source Config" index="&sect-num;.4.20" 
4103
                 width="1233" height="618" screenshot="mongodb-source-config.png">
4123
                 width="1233" height="618" screenshot="mongodb-source-config.png">
4104
    <description>Creates a MongoDB connection (used by <complink name="MongoDB Script"/>Sampler)
4124
    <description>Creates a MongoDB connection (used by <complink name="MongoDB Script"/>Sampler)
4105
     from the supplied Connection settings. Each thread gets its own connection.
4125
     from the supplied Connection settings. Each thread gets its own connection.

Return to bug 56841