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 (+235 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
63
    private static final Logger log = LoggingManager.getLoggerForClass();
64
65
    private SystemDefaultDnsResolver systemDefaultDnsResolver = null;
66
67
    private Map<String, InetAddress[]> cache = null;
68
69
    private Resolver resolver = null;
70
71
    //++ JMX tag values
72
    public static final String CLEAR_CACHE_EACH_ITER = "DNSCacheManager.clearEachIteration"; // $NON-NLS-1$
73
74
    public static final String SERVERS = "DNSCacheManager.servers"; // $NON-NLS-1$
75
76
    public static final String IS_CUSTOM_RESOLVER = "DNSCacheManager.isCustomResolver"; // $NON-NLS-1$
77
    //-- JMX tag values
78
79
    public static final boolean DEFAULT_CLEAR_CACHE_EACH_ITER = false;
80
81
    public static final String DEFAULT_SERVERS = ""; // $NON-NLS-1$
82
83
    public static final boolean DEFAULT_IS_CUSTOM_RESOLVER = false;
84
85
    private final transient Cache lookupCache;
86
87
    // ensure that the initial DNSServers are copied to the per-thread instances
88
89
    public DNSCacheManager() {
90
        setProperty(new CollectionProperty(SERVERS, new ArrayList<String>()));
91
        //disabling cache
92
        lookupCache = new Cache();
93
        lookupCache.setMaxCache(0);
94
        lookupCache.setMaxEntries(0);
95
    }
96
97
    /**
98
     * {@inheritDoc}
99
     */
100
    @Override
101
    public Object clone() {
102
        DNSCacheManager clone = (DNSCacheManager) super.clone();
103
        clone.systemDefaultDnsResolver = new SystemDefaultDnsResolver();
104
        clone.cache = new LinkedHashMap<String, InetAddress[]>();
105
        CollectionProperty dnsServers = getServers();
106
        try {
107
            clone.resolver = new ExtendedResolver();
108
            PropertyIterator dnsServIt = dnsServers.iterator();
109
            while (dnsServIt.hasNext()) {
110
                String dnsServer = dnsServIt.next().getStringValue();
111
                ((ExtendedResolver) clone.resolver).addResolver(new SimpleResolver(dnsServer));
112
            }
113
            // resolvers will be chosen via round-robin
114
            ((ExtendedResolver) clone.resolver).setLoadBalance(true);
115
        } catch (UnknownHostException uhe) {
116
            log.warn("Failed to create Extended resolver: " + uhe.getMessage());
117
        }
118
        return clone;
119
    }
120
121
    /**
122
     *
123
     * Resolves address using system or custom DNS resolver
124
     */
125
    @Override
126
    public InetAddress[] resolve(String host) throws UnknownHostException {
127
        if (cache.containsKey(host)) {
128
            if (log.isDebugEnabled()) {
129
                log.debug("Cache hit thr#" + JMeterContextService.getContext().getThreadNum() + ": " + host + "=>"
130
                        + Arrays.toString(cache.get(host)));
131
            }
132
            return cache.get(host);
133
        } else {
134
            InetAddress[] addresses = requestLookup(host);
135
            if (log.isDebugEnabled()) {
136
                log.debug("Cache miss thr#" + JMeterContextService.getContext().getThreadNum() + ": " + host + "=>"
137
                        + Arrays.toString(addresses));
138
            }
139
            cache.put(host, addresses);
140
            return addresses;
141
        }
142
    }
143
144
    /**
145
     * Sends DNS request via system or custom DNS resolver
146
     */
147
    private InetAddress[] requestLookup(String host) throws UnknownHostException {
148
        InetAddress[] addresses = null;
149
        if (isCustomResolver() && ((ExtendedResolver) resolver).getResolvers().length > 1) {
150
            try {
151
                Lookup lookup = new Lookup(host, Type.A);
152
                lookup.setCache(lookupCache);
153
                lookup.setResolver(resolver);
154
                Record[] records = lookup.run();
155
                if (records.length == 0) {
156
                    throw new UnknownHostException("Failed to resolve host name: " + host);
157
                }
158
                addresses = new InetAddress[records.length];
159
                for (int i = 0; i < records.length; i++) {
160
                    addresses[i] = ((ARecord) records[i]).getAddress();
161
                }
162
            } catch (TextParseException tpe) {
163
                log.debug("Failed to create Lookup object: " + tpe);
164
            }
165
        } else {
166
            addresses = systemDefaultDnsResolver.resolve(host);
167
            if (log.isDebugEnabled()) {
168
                log.debug("Cache miss: " + host + " Thread #" + JMeterContextService.getContext().getThreadNum()
169
                        + ", resolved with system resolver into " + Arrays.toString(addresses));
170
            }
171
        }
172
        return addresses;
173
    }
174
175
    /**
176
     * {@inheritDoc} Clean DNS cache if appropriate check-box was selected
177
     */
178
    @Override
179
    public void testIterationStart(LoopIterationEvent event) {
180
        if (isClearEachIteration()) {
181
            this.cache.clear();
182
        }
183
    }
184
185
    /**
186
     * {@inheritDoc}
187
     */
188
    @Override
189
    public void clear() {
190
        super.clear();
191
        clearServers(); // ensure data is set up OK initially
192
    }
193
194
    /**
195
     * Remove all the servers.
196
     */
197
    private void clearServers() {
198
        log.debug("Clear all servers from store");
199
        setProperty(new CollectionProperty(SERVERS, new ArrayList<String>()));
200
    }
201
202
    public void addServer(String dnsServer) {
203
        getServers().addItem(dnsServer);
204
    }
205
206
    public CollectionProperty getServers() {
207
        return (CollectionProperty) getProperty(SERVERS);
208
    }
209
210
    /**
211
     * Clean DNS cache each iteration
212
     * 
213
     * @return boolean
214
     */
215
    public boolean isClearEachIteration() {
216
        return this.getPropertyAsBoolean(CLEAR_CACHE_EACH_ITER, DEFAULT_CLEAR_CACHE_EACH_ITER);
217
    }
218
219
    /**
220
     * Clean DNS cache each iteration
221
     *
222
     */
223
    public void setClearEachIteration(boolean clear) {
224
        setProperty(new BooleanProperty(CLEAR_CACHE_EACH_ITER, clear));
225
    }
226
227
    public boolean isCustomResolver() {
228
        return this.getPropertyAsBoolean(IS_CUSTOM_RESOLVER, DEFAULT_IS_CUSTOM_RESOLVER);
229
    }
230
231
    public void setCustomResolver(boolean isCustomResolver) {
232
        this.setProperty(IS_CUSTOM_RESOLVER, isCustomResolver);
233
    }
234
235
}
(-)src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java (+329 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 OPTIONS = JMeterUtils.getResString("option");
62
63
    private static final String ADD_COMMAND = JMeterUtils.getResString("add"); // $NON-NLS-1$
64
65
    private static final String DELETE_COMMAND = JMeterUtils.getResString("delete"); // $NON-NLS-1$
66
67
    private static final String SYS_RES_COMMAND = JMeterUtils.getResString("use_system_dns_resolver"); // $NON-NLS-1$
68
69
    private static final String CUST_RES_COMMAND = JMeterUtils.getResString("use_custom_dns_resolver"); // $NON-NLS-1$
70
71
    private JTable dnsServersTable;
72
73
    private JPanel dnsServersPanel;
74
75
    private JPanel dnsServButPanel;
76
77
    private PowerTableModel dnsServersTableModel;
78
79
    private JRadioButton sysResButton;
80
81
    private JRadioButton custResButton;
82
83
    private JButton deleteButton;
84
85
    private JButton addButton;
86
87
    private ButtonGroup providerDNSradioGroup = new ButtonGroup();
88
89
    private static final String[] COLUMN_RESOURCE_NAMES = {
90
        (JMeterUtils.getResString("dns_hostname_or_ip")), //$NON-NLS-1$
91
    };
92
    private static final Class<?>[] columnClasses = {
93
        String.class };
94
95
    private JCheckBox clearEachIteration;
96
97
    /**
98
     * Default constructor.
99
     */
100
    public DNSCachePanel() {
101
        init();
102
    }
103
104
    @Override
105
    public String getLabelResource() {
106
        return "dns_cache_manager_title";
107
    }
108
109
    /**
110
     * Modifies a given TestElement to mirror the data in the gui components.
111
     *
112
     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(org.apache.jmeter.testelement.TestElement)
113
     */
114
    @Override
115
    public void modifyTestElement(TestElement dnsRes) {
116
        GuiUtils.stopTableEditing(dnsServersTable);
117
        dnsRes.clear();
118
        configureTestElement(dnsRes);
119
        if (dnsRes instanceof DNSCacheManager) {
120
            DNSCacheManager dnsCacheManager = (DNSCacheManager) dnsRes;
121
            for (int i = 0; i < dnsServersTableModel.getRowCount(); i++) {
122
                String server = (String) dnsServersTableModel.getRowData(i)[0];
123
                dnsCacheManager.addServer(server);
124
            }
125
            dnsCacheManager.setClearEachIteration(clearEachIteration.isSelected());
126
            if (providerDNSradioGroup.isSelected(custResButton.getModel())) {
127
                dnsCacheManager.setCustomResolver(true);
128
            } else {
129
                dnsCacheManager.setCustomResolver(false);
130
            }
131
        }
132
    }
133
134
    /**
135
     * Implements JMeterGUIComponent.clearGui
136
     */
137
    @Override
138
    public void clearGui() {
139
        super.clearGui();
140
        clearEachIteration.setSelected(DNSCacheManager.DEFAULT_CLEAR_CACHE_EACH_ITER);
141
        providerDNSradioGroup.setSelected(sysResButton.getModel(), true);
142
        dnsServersTableModel.clearData();
143
        deleteButton.setEnabled(false);
144
145
    }
146
147
    private void populateTable(DNSCacheManager resolver) {
148
        dnsServersTableModel.clearData();
149
        PropertyIterator iter = resolver.getServers().iterator();
150
        while (iter.hasNext()) {
151
            addServerToTable((String) iter.next().getObjectValue());
152
        }
153
    }
154
155
    @Override
156
    public TestElement createTestElement() {
157
        DNSCacheManager dnsCacheManager = new DNSCacheManager();
158
        modifyTestElement(dnsCacheManager);
159
        return dnsCacheManager;
160
    }
161
162
    @Override
163
    public void configure(TestElement el) {
164
        super.configure(el);
165
166
        DNSCacheManager dnsCacheManager = (DNSCacheManager) el;
167
        populateTable(dnsCacheManager);
168
        clearEachIteration.setSelected(dnsCacheManager.isClearEachIteration());
169
        if (dnsCacheManager.isCustomResolver()) {
170
            providerDNSradioGroup.setSelected(custResButton.getModel(), true);
171
            deleteButton.setEnabled(dnsServersTable.getColumnCount() > 0);
172
            addButton.setEnabled(true);
173
        } else {
174
            providerDNSradioGroup.setSelected(sysResButton.getModel(), true);
175
        }
176
    }
177
178
    private void init() {
179
        dnsServersTableModel = new PowerTableModel(COLUMN_RESOURCE_NAMES, columnClasses);
180
181
        clearEachIteration = new JCheckBox(JMeterUtils.getResString("clear_cache_each_iteration"), true); //$NON-NLS-1$
182
        setLayout(new BorderLayout());
183
        setBorder(makeBorder());
184
        JPanel northPanel = new JPanel();
185
        northPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
186
        northPanel.add(makeTitlePanel());
187
        JPanel optionsPane = new JPanel();
188
        optionsPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), OPTIONS)); // $NON-NLS-1$
189
        optionsPane.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
190
        optionsPane.add(clearEachIteration, BorderLayout.WEST);
191
        optionsPane.add(createChooseResPanel(), BorderLayout.SOUTH);
192
        northPanel.add(optionsPane);
193
        add(northPanel, BorderLayout.NORTH);
194
195
        dnsServersPanel = createDnsServersTablePanel();
196
        add(dnsServersPanel, BorderLayout.CENTER);
197
198
    }
199
200
    public JPanel createDnsServersTablePanel() {
201
        // create the JTable that holds header per row
202
        dnsServersTable = new JTable(dnsServersTableModel);
203
        dnsServersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
204
        dnsServersTable.setPreferredScrollableViewportSize(new Dimension(400, 100));
205
206
        JPanel panel = new JPanel(new BorderLayout(0, 5));
207
        panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
208
                JMeterUtils.getResString("dns_servers"))); // $NON-NLS-1$
209
        JScrollPane dnsServScrollPane = new JScrollPane(dnsServersTable);
210
        panel.add(dnsServScrollPane, BorderLayout.CENTER);
211
        dnsServButPanel = createButtonPanel();
212
        panel.add(dnsServButPanel, BorderLayout.SOUTH);
213
        return panel;
214
    }
215
216
    private JPanel createChooseResPanel() {
217
        JPanel chooseResPanel = new JPanel(new BorderLayout(0, 5));
218
        sysResButton = new JRadioButton();
219
        sysResButton.setSelected(true);
220
        sysResButton.setText(SYS_RES_COMMAND);
221
        sysResButton.setToolTipText(SYS_RES_COMMAND);
222
        sysResButton.setEnabled(true);
223
        sysResButton.addActionListener(this);
224
225
        custResButton = new JRadioButton();
226
        custResButton.setSelected(false);
227
        custResButton.setText(CUST_RES_COMMAND);
228
        custResButton.setToolTipText(CUST_RES_COMMAND);
229
        custResButton.setEnabled(true);
230
        custResButton.addActionListener(this);
231
232
        providerDNSradioGroup.add(sysResButton);
233
        providerDNSradioGroup.add(custResButton);
234
235
        chooseResPanel.add(sysResButton, BorderLayout.WEST);
236
        chooseResPanel.add(custResButton, BorderLayout.CENTER);
237
        return chooseResPanel;
238
    }
239
240
    private JPanel createButtonPanel() {
241
        boolean tableEmpty = (dnsServersTableModel.getRowCount() == 0);
242
243
        addButton = createButton("add", 'A', ADD_COMMAND, custResButton.isSelected()); // $NON-NLS-1$
244
        deleteButton = createButton("delete", 'D', DELETE_COMMAND, !tableEmpty); // $NON-NLS-1$
245
246
        JPanel buttonPanel = new JPanel();
247
        buttonPanel.add(addButton, BorderLayout.WEST);
248
        buttonPanel.add(deleteButton, BorderLayout.LINE_END);
249
        return buttonPanel;
250
    }
251
252
    private JButton createButton(String resName, char mnemonic, String command, boolean enabled) {
253
        JButton button = new JButton(JMeterUtils.getResString(resName));
254
        button.setMnemonic(mnemonic);
255
        button.setActionCommand(command);
256
        button.setEnabled(enabled);
257
        button.addActionListener(this);
258
        return button;
259
    }
260
261
    private void addServerToTable(String dnsServer) {
262
        dnsServersTableModel.addRow(new Object[] {
263
            dnsServer });
264
    }
265
266
    @Override
267
    public void actionPerformed(ActionEvent e) {
268
        String action = e.getActionCommand();
269
        dnsServersTable.setEnabled(custResButton.isSelected());
270
        Color greyColor = new Color(240, 240, 240);
271
        Color blueColor = new Color(184, 207, 229);
272
        dnsServersTable.setBackground(sysResButton.isSelected() ? greyColor : Color.WHITE);
273
        dnsServersTable.setSelectionBackground(sysResButton.isSelected() ? greyColor : blueColor);
274
        addButton.setEnabled(custResButton.isSelected());
275
        deleteButton.setEnabled(custResButton.isSelected());
276
        if (custResButton.isSelected() && (dnsServersTableModel.getRowCount() > 0)) {
277
            deleteButton.setEnabled(true);
278
            addButton.setEnabled(true);
279
        }
280
281
        if (action.equals(DELETE_COMMAND)) {
282
            if (dnsServersTableModel.getRowCount() > 0) {
283
                // If a table cell is being edited, we must cancel the editing
284
                // before deleting the row.
285
                if (dnsServersTable.isEditing()) {
286
                    TableCellEditor cellEditor = dnsServersTable.getCellEditor(dnsServersTable.getEditingRow(),
287
                            dnsServersTable.getEditingColumn());
288
                    cellEditor.cancelCellEditing();
289
                }
290
291
                int rowSelected = dnsServersTable.getSelectedRow();
292
293
                if (rowSelected != -1) {
294
                    dnsServersTableModel.removeRow(rowSelected);
295
                    dnsServersTableModel.fireTableDataChanged();
296
297
                    if (dnsServersTableModel.getRowCount() == 0) {
298
                        deleteButton.setEnabled(false);
299
                    }
300
301
                    else {
302
                        int rowToSelect = rowSelected;
303
304
                        if (rowSelected >= dnsServersTableModel.getRowCount()) {
305
                            rowToSelect = rowSelected - 1;
306
                        }
307
308
                        dnsServersTable.setRowSelectionInterval(rowToSelect, rowToSelect);
309
                    }
310
                }
311
            }
312
        } else if (action.equals(ADD_COMMAND)) {
313
            // If a table cell is being edited, we should accept the current
314
            // value and stop the editing before adding a new row.
315
            GuiUtils.stopTableEditing(dnsServersTable);
316
317
            dnsServersTableModel.addNewRow();
318
            dnsServersTableModel.fireTableDataChanged();
319
320
            if (!deleteButton.isEnabled()) {
321
                deleteButton.setEnabled(true);
322
            }
323
324
            // Highlight (select) the appropriate row.
325
            int rowToSelect = dnsServersTableModel.getRowCount() - 1;
326
            dnsServersTable.setRowSelectionInterval(rowToSelect, rowToSelect);
327
        }
328
    }
329
}
(-)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 = new PoolingClientConnectionManager(
646
                    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 (+19 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
838
    public boolean isImageParser() {
857
    public boolean isImageParser() {
839
        return getPropertyAsBoolean(IMAGE_PARSER, false);
858
        return getPropertyAsBoolean(IMAGE_PARSER, false);
840
    }
859
    }
(-)xdocs/changes.xml (+2 lines)
Lines 229-234 Link Here
229
<ul>
229
<ul>
230
<li><bugzilla>56691</bugzilla> - Synchronizing Timer : Add timeout on waiting</li>
230
<li><bugzilla>56691</bugzilla> - Synchronizing Timer : Add timeout on waiting</li>
231
<li><bugzilla>56701</bugzilla> - HTTP Authorization Manager/ Kerberos Authentication: add port to SPN when server port is neither 80 nor 443. Based on patches from Dan Haughey (dan.haughey at swinton.co.uk) and Felix Schumacher (felix.schumacher at internetallee.de)</li>
231
<li><bugzilla>56701</bugzilla> - HTTP Authorization Manager/ Kerberos Authentication: add port to SPN when server port is neither 80 nor 443. Based on patches from Dan Haughey (dan.haughey at swinton.co.uk) and Felix Schumacher (felix.schumacher at internetallee.de)</li>
232
<li><bugzilla>56841</bugzilla> - New configuration element: DNS Cache Manager to improve the testing of CDN. Based on patch from Dzmitry Kashlach (dzmitrykashlach at gmail.com)</li>
232
</ul>
233
</ul>
233
234
234
<h3>Functions</h3>
235
<h3>Functions</h3>
Lines 271-276 Link Here
271
<li>Mikhail Epikhin (epihin-m at yandex.ru)</li>
272
<li>Mikhail Epikhin (epihin-m at yandex.ru)</li>
272
<li>Dan Haughey (dan.haughey at swinton.co.uk)</li>
273
<li>Dan Haughey (dan.haughey at swinton.co.uk)</li>
273
<li>Felix Schumacher (felix.schumacher at internetallee.de)</li>
274
<li>Felix Schumacher (felix.schumacher at internetallee.de)</li>
275
<li>Dzmitry Kashlach (dzmitrykashlach at gmail.com)</li>
274
</ul>
276
</ul>
275
277
276
<br/>
278
<br/>
(-)xdocs/usermanual/component_reference.xml (-17 / +39 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="712" height="387" screenshot="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), 
3474
    when user receives content from different IP's. By default JMeter uses JVM DNS cache. That's why
3475
    only one server from the cluster receives load. DNS Cache Manager resolves name for each thread separately each iteration and
3476
    saves results of resolving to its internal DNS Cache, which independent from both JVM and OS DNS caches.
3477
    </p>
3478
    </description>
3479
    <properties>
3480
    <property name="Name" required="No">Descriptive name for this element that is shown in the tree. </property>
3481
    <property name="Clear cache each Iteration" required="No">If selected, DNS cache of every  Thread is cleared each time new iteration is started.</property>
3482
    <property name="Use system DNS resolver" required="N/A">System DNS resolver will be used. For correct work edit
3483
       $JAVA_HOME/jre/lib/security/java.security and add <pre>networkaddress.cache.ttl=0</pre> 
3484
    </property>
3485
    <property name="Use custom DNS resolver" required="N/A">Custom DNS resolver(from dnsjava library) will be used.</property>
3486
    <property name="Hostname or IP address" required="No">List of DNS servers to use. If empty, network configuration DNS will used.</property>
3487
    <property name="Add Button" required="N/A">Add an entry to the DNS servers table.</property>
3488
    <property name="Delete Button" required="N/A">Delete the currently selected table entry.</property>
3489
    </properties>
3490
</component>
3491
3492
<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,
3493
<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>
3494
there is currently no way to specify which one is to be used.</note>
3473
3495
Lines 3593-3599 Link Here
3593
3615
3594
</component>
3616
</component>
3595
3617
3596
<component name="HTTP Cache Manager" index="&sect-num;.4.4"  width="511" height="196" screenshot="http-config/http-cache-manager.png">
3618
<component name="HTTP Cache Manager" index="&sect-num;.4.5"  width="511" height="196" screenshot="http-config/http-cache-manager.png">
3597
3619
3598
<note>This is a new element, and is liable to change</note>
3620
<note>This is a new element, and is liable to change</note>
3599
3621
Lines 3637-3643 Link Here
3637
</properties>
3659
</properties>
3638
</component>
3660
</component>
3639
3661
3640
<component name="HTTP Cookie Manager" index="&sect-num;.4.5"  width="513" height="383" screenshot="http-config/http-cookie-manager.png">
3662
<component name="HTTP Cookie Manager" index="&sect-num;.4.6"  width="513" height="383" screenshot="http-config/http-cookie-manager.png">
3641
3663
3642
<note>If there is more than one Cookie Manager in the scope of a Sampler,
3664
<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.
3665
there is currently no way to specify which one is to be used.
Lines 3707-3713 Link Here
3707
3729
3708
</component>
3730
</component>
3709
3731
3710
<component name="HTTP Request Defaults" index="&sect-num;.4.6" width="853" height="463" 
3732
<component name="HTTP Request Defaults" index="&sect-num;.4.7" width="853" height="463" 
3711
         screenshot="http-config/http-request-defaults.png">
3733
         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
3734
<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,
3735
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>
3790
</note>
3769
</component>
3791
</component>
3770
3792
3771
<component name="HTTP Header Manager" index="&sect-num;.4.7"  width="767" height="239" screenshot="http-config/http-header-manager.png">
3793
<component name="HTTP Header Manager" index="&sect-num;.4.8"  width="767" height="239" screenshot="http-config/http-header-manager.png">
3772
<description>
3794
<description>
3773
<p>The Header Manager lets you add or override HTTP request headers.</p>
3795
<p>The Header Manager lets you add or override HTTP request headers.</p>
3774
<p>
3796
<p>
Lines 3808-3820 Link Here
3808
3830
3809
</component>
3831
</component>
3810
3832
3811
<component name="Java Request Defaults" index="&sect-num;.4.8"  width="454" height="283" screenshot="java_defaults.png">
3833
<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>
3834
<description><p>The Java Request Defaults component lets you set default values for Java testing.  See the <complink name="Java Request" />.</p>
3813
</description>
3835
</description>
3814
3836
3815
</component>
3837
</component>
3816
3838
3817
<component name="JDBC Connection Configuration" index="&sect-num;.4.9" 
3839
<component name="JDBC Connection Configuration" index="&sect-num;.4.10" 
3818
                 width="474" height="458" screenshot="jdbc-config/jdbc-conn-config.png">
3840
                 width="474" height="458" screenshot="jdbc-config/jdbc-conn-config.png">
3819
    <description>Creates a database connection (used by <complink name="JDBC Request"/>Sampler)
3841
    <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.
3842
     from the supplied JDBC Connection settings. The connection may be optionally pooled between threads.
Lines 3880-3886 Link Here
3880
</component>
3902
</component>
3881
3903
3882
3904
3883
<component name="Keystore Configuration" index="&sect-num;.4.10"  width="441" height="189" screenshot="keystore_config.png">
3905
<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.
3906
<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>
3907
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:
3908
<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>
3943
</note>
3922
</component>
3944
</component>
3923
3945
3924
<component name="Login Config Element" index="&sect-num;.4.11"  width="352" height="112" screenshot="login-config.png">
3946
<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>
3947
<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>
3948
</description>
3927
3949
Lines 3933-3951 Link Here
3933
3955
3934
</component>
3956
</component>
3935
3957
3936
<component name="LDAP Request Defaults" index="&sect-num;.4.12"  width="689" height="232" screenshot="ldap_defaults.png">
3958
<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>
3959
<description><p>The LDAP Request Defaults component lets you set default values for LDAP testing.  See the <complink name="LDAP Request"/>.</p>
3938
</description>
3960
</description>
3939
3961
3940
</component>
3962
</component>
3941
3963
3942
<component name="LDAP Extended Request Defaults" index="&sect-num;.4.13"  width="686" height="184" screenshot="ldapext_defaults.png">
3964
<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>
3965
<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>
3966
</description>
3945
3967
3946
</component>
3968
</component>
3947
3969
3948
<component name="TCP Sampler Config" index="&sect-num;.4.14"  width="826" height="450" screenshot="tcpsamplerconfig.png">
3970
<component name="TCP Sampler Config" index="&sect-num;.4.15"  width="826" height="450" screenshot="tcpsamplerconfig.png">
3949
<description>
3971
<description>
3950
        <p>
3972
        <p>
3951
    The TCP Sampler Config provides default data for the TCP Sampler
3973
    The TCP Sampler Config provides default data for the TCP Sampler
Lines 3967-3973 Link Here
3967
</properties>
3989
</properties>
3968
</component>
3990
</component>
3969
3991
3970
<component name="User Defined Variables" index="&sect-num;.4.15"  width="741" height="266" screenshot="user_defined_variables.png">
3992
<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" />.
3993
<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>
3994
<b>
3973
Note that all the UDV elements in a test plan - no matter where they are - are processed at the start.
3995
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>
4039
</properties>
4018
</component>
4040
</component>
4019
4041
4020
<component name="Random Variable" index="&sect-num;.4.16"  width="495" height="286" screenshot="random_variable.png">
4042
<component name="Random Variable" index="&sect-num;.4.17"  width="495" height="286" screenshot="random_variable.png">
4021
<description>
4043
<description>
4022
<p>
4044
<p>
4023
The Random Variable Config Element is used to generate random numeric strings and store them in variable for use later.
4045
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
4074
4053
</component>
4075
</component>
4054
4076
4055
<component name="Counter" index="&sect-num;.4.17"  width="404" height="262" screenshot="counter.png">
4077
<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
4078
<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,
4079
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
4080
and the increment.  The counter will loop from the start to the max, and then start over
Lines 4083-4089 Link Here
4083
</properties>
4105
</properties>
4084
</component>
4106
</component>
4085
4107
4086
<component name="Simple Config Element" index="&sect-num;.4.18"  width="393" height="245" screenshot="simple_config_element.png">
4108
<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
4109
<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
4110
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>
4111
GUI that they can use while developing new JMeter components.</p>
Lines 4099-4105 Link Here
4099
</component>
4121
</component>
4100
4122
4101
4123
4102
<component name="MongoDB Source Config" index="&sect-num;.4.19" 
4124
<component name="MongoDB Source Config" index="&sect-num;.4.20" 
4103
                 width="1233" height="618" screenshot="mongodb-source-config.png">
4125
                 width="1233" height="618" screenshot="mongodb-source-config.png">
4104
    <description>Creates a MongoDB connection (used by <complink name="MongoDB Script"/>Sampler)
4126
    <description>Creates a MongoDB connection (used by <complink name="MongoDB Script"/>Sampler)
4105
     from the supplied Connection settings. Each thread gets its own connection.
4127
     from the supplied Connection settings. Each thread gets its own connection.

Return to bug 56841