JMeter example source code file (build-ldapext-test-plan.xml)
This example JMeter source code file (build-ldapext-test-plan.xml) is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.
The JMeter build-ldapext-test-plan.xml source code
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE document[
<!ENTITY sect-num '9b'>
]>
<document prev="build-ldap-test-plan.html" next="build-ws-test-plan.html" date="$Date: 2007-08-20 19:07:53 +0100 (Mon, 20 Aug 2007) $">
<properties>
<title>User's Manual: Building an Extended LDAP Test Plan
</properties>
<body>
<section name="§-num;. Building an Extended LDAP Test Plan" anchor="ldapexttest">
<p>
In this section, you will learn how to create a basic Test Plan to test an LDAP
server.</p>
<p>
As the Extended LDAP Sampler is highly configurable, this also means that it takes
some time to build a correct testplan. You can however tune it exactly up to your
needs.
</p>
<p>
You will create four users that send requests for four tests on the LDAP server.Also, you will tell
the users to run their tests twice. So, the total number of requests is (4 users) x (4 requests) x
repeat 2 times) = 32 LDAP requests. To construct the Test Plan, you will use the following elements:<br/>
<a href="test_plan.html#thread_group">Thread Group,
<complink name="Adding LDAP Extended Request Defaults"/>,
<complink name="Adding LDAP Requests"/>, and
<complink name="Adding a Listener to View/Store the Test Results"/>
</p>
<p>
This example assumes that the LDAP Server is installed in your Local machine.
</p>
<p>
For the less experienced LDAP users, I build a <a href="ldapops_tutor.html">small
LDAP tutorial</a> which shortly explains
the several LDAP operations that can be used in building a complex testplan.
</p>
<p>
Take care when using LDAP special characters in the distinghuished name, in that case (eg, you want to use a + sign in a
distinghuished name) you need to escape the character by adding an "\" sign before that character.
extra exeption: if you want to add a \ character in a distinguished name (in an add or rename operation), you need to use 4 backslashes.
examples:
cn=dolf\+smits to add/search an entry with the name like cn=dolf+smits
cn=dolf \\ smits to search an entry with the name cn=dolf \ smits
cn=c:\\\\log.txt to add an entry with a name like cn=c:\log.txt
</p>
<subsection name="§-num;.1 Adding Users" anchor="ext_adding_users">
<p>
The first step you want to do with every JMeter Test Plan is to add a Thread Group element.
The Thread Group tells JMeter the number of users you want to simulate, how often the users should send
requests, and the how many requests they should send.
</p>
<p>
Go ahead and add the ThreadGroup element by first selecting the Test Plan, clicking your
right mouse button to get the Add menu, and then select Add-->ThreadGroup. You should now see the
Thread Group element under Test Plan. If you do not see the element, then "expand" the Test Plan tree by
clicking on the Test Plan element.
</p>
<p>
<figure image="ldaptest/extthreadgroup.png">
Figure §-num;.1. Thread Group with Default Values</figure>
</p>
</subsection>
<subsection name="§-num;.2 Adding LDAP Extended Request Defaults" anchor="add_ldapext_defaults">
<p>
Begin by selecting the Thread Group element. Click your right mouse button
to get the Add menu, and then select Add --> Config Element -->LDAP Extended Request Defaults. Then,
select this new element to view its Control Panel.
</p>
<p>
Like most JMeter elements, the LDAP Extended Request Defaults Control Panel has a name
field that you can modify. In this example, leave this field with the default value.
</p>
<p>
Other JMeter examples (source code examples)
Here is a short list of links related to this JMeter build-ldapext-test-plan.xml source code file: