Apache JMeter
1.9

org.apache.jmeter.protocol.ldap.sampler
Class LDAPSampler

java.lang.Object
  |
  +--org.apache.jmeter.testelement.AbstractTestElement
        |
        +--org.apache.jmeter.samplers.AbstractSampler
              |
              +--org.apache.jmeter.protocol.ldap.sampler.LDAPSampler
All Implemented Interfaces:
Cloneable, Sampler, Serializable, TestElement

public class LDAPSampler
extends AbstractSampler

Ldap Sampler class is main class for the LDAP test. This will control all the test available in the LDAP Test.

See Also:
Serialized Form

Field Summary
static String ADD
           
static String ARGUMENTS
           
static String BASE_ENTRY_DN
           
static int counter
           
static String DELETE
           
static String MODIFY
           
static String PORT
           
static String ROOTDN
           
static String SEARCHBASE
           
static String SEARCHFILTER
           
static String SERVERNAME
           
static String TEST
           
static String USER_DEFINED
           
 
Fields inherited from class org.apache.jmeter.testelement.AbstractTestElement
log
 
Fields inherited from interface org.apache.jmeter.samplers.Sampler
HEADER
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
LDAPSampler()
          !
 
Method Summary
 void addCustomTestElement(TestElement element)
           
 long addTest(LdapClient ldap)
          This will do the add test for the User defined TestCase as well as inbuilt test case
 long deleteTest(LdapClient ldap)
          This will do the delete test for the User defined TestCase as well as inbuilt test case
 Arguments getArguments()
          Gets the Arguments attribute of the LdapConfig object
 String getBaseEntryDN()
          Gets the BaseEntryDN attribute of the LDAPSampler object
 BasicAttribute getBasicAttribute(String name, String value)
          This will create the Basic Attribute for the give name value pair
 BasicAttributes getBasicAttributes()
          This will create the Basic Attributes for the In build TestCase for Add Test
 String getLabel()
          Returns a formatted string label describing this sampler Example output:
 ModificationItem[] getModificationItem()
          This will create the Basic Attributes for the Inbuilt TestCase for Modify test
 String getPassword()
          Gets the password attribute of the LDAP object
 String getPort()
          Gets the Port attribute of the LDAPSampler object
 String getRootdn()
          Gets the Rootdn attribute of the LDAPSampler object
 String getServername()
          Gets the servername attribute of the LDAPSampler object
 String getTest()
          Gets the test attribute of the LDAPSampler object
 BasicAttributes getUserAttributes()
          Collect all the value from the table (Arguments), using this create the basicAttributes This will create the Basic Attributes for the User defined TestCase for Add Test
 boolean getUserDefinedTest()
          Gets the UserDefinedTest attribute of the LDAPSampler object
 ModificationItem[] getUserModAttributes()
          Collect all the value from the table (Arguments), using this create the basicAttributes This will create the Basic Attributes for the User defined TestCase for Modify test
 String getUsername()
          Gets the username attribute of the LDAP object
 long modifyTest(LdapClient ldap)
          This will do the search test for the User defined TestCase as well as inbuilt test case
 SampleResult sample(Entry e)
          !
 long searchTest(LdapClient ldap)
          This will do the search test for the User defined TestCase as well as inbuilt test case
 void setArguments(Arguments value)
          Sets the Arguments attribute of the LdapConfig object This will collect values from the table for user defined test case
 void setBaseEntryDN(String newbaseentry)
          Sets the Base Entry DN attribute of the LDAPSampler object
 void setPort(String port)
          Sets the Port attribute of the ServerConfig object
 void setRootdn(String newRootdn)
          Sets the Rootdn attribute of the LDAPSampler object
 void setServername(String servername)
          Sets the Servername attribute of the ServerConfig object
 void setTest(String newTest)
          Sets the Test attribute of the LdapConfig object
 void setUserDefinedTest(boolean value)
          Sets the UserDefinedTest attribute of the LDAPSampler object
 
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addProperty, addTestElement, clear, clone, equals, getName, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, isRunningVersion, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setProperty, setRunningVersion, traverse, traverseCollection, traverseMap, traverseProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jmeter.testelement.TestElement
addTestElement, clear, clone, getProperty, getPropertyAsBoolean, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, isRunningVersion, propertyIterator, recoverRunningVersion, removeProperty, setProperty, setProperty, setRunningVersion, traverse
 

Field Detail

SERVERNAME

public static final String SERVERNAME
See Also:
Constant Field Values

PORT

public static final String PORT
See Also:
Constant Field Values

ROOTDN

public static final String ROOTDN
See Also:
Constant Field Values

TEST

public static final String TEST
See Also:
Constant Field Values

ADD

public static final String ADD
See Also:
Constant Field Values

MODIFY

public static final String MODIFY
See Also:
Constant Field Values

DELETE

public static final String DELETE
See Also:
Constant Field Values

SEARCHBASE

public static final String SEARCHBASE
See Also:
Constant Field Values

SEARCHFILTER

public static final String SEARCHFILTER
See Also:
Constant Field Values

USER_DEFINED

public static final String USER_DEFINED
See Also:
Constant Field Values

ARGUMENTS

public static final String ARGUMENTS
See Also:
Constant Field Values

BASE_ENTRY_DN

public static final String BASE_ENTRY_DN
See Also:
Constant Field Values

counter

public static int counter
Constructor Detail

LDAPSampler

public LDAPSampler()
!ToDo (Constructor description)

Method Detail

addCustomTestElement

public void addCustomTestElement(TestElement element)

getUsername

public String getUsername()
Gets the username attribute of the LDAP object

Returns:
The username

getPassword

public String getPassword()
Gets the password attribute of the LDAP object

Returns:
The password

setServername

public void setServername(String servername)
Sets the Servername attribute of the ServerConfig object

Parameters:
servername - The new servername value

setPort

public void setPort(String port)
Sets the Port attribute of the ServerConfig object

Parameters:
port - The new Port value

getServername

public String getServername()
Gets the servername attribute of the LDAPSampler object

Returns:
The Servername value

getPort

public String getPort()
Gets the Port attribute of the LDAPSampler object

Returns:
The Port value

setRootdn

public void setRootdn(String newRootdn)
Sets the Rootdn attribute of the LDAPSampler object


getRootdn

public String getRootdn()
Gets the Rootdn attribute of the LDAPSampler object

Returns:
The Rootdn value

setTest

public void setTest(String newTest)
Sets the Test attribute of the LdapConfig object


getTest

public String getTest()
Gets the test attribute of the LDAPSampler object

Returns:
The test value (Add,Modify,Delete and search)

setUserDefinedTest

public void setUserDefinedTest(boolean value)
Sets the UserDefinedTest attribute of the LDAPSampler object

Parameters:
value - The new UserDefinedTest value

getUserDefinedTest

public boolean getUserDefinedTest()
Gets the UserDefinedTest attribute of the LDAPSampler object

Returns:
The test value true or false if true it will do the UserDefinedTest else our own inbuild test case

setBaseEntryDN

public void setBaseEntryDN(String newbaseentry)
Sets the Base Entry DN attribute of the LDAPSampler object


getBaseEntryDN

public String getBaseEntryDN()
Gets the BaseEntryDN attribute of the LDAPSampler object

Returns:
The Base entry DN value

setArguments

public void setArguments(Arguments value)
Sets the Arguments attribute of the LdapConfig object This will collect values from the table for user defined test case

Parameters:
value - The arguments

getArguments

public Arguments getArguments()
Gets the Arguments attribute of the LdapConfig object

Returns:
The arguments user defined test case

getUserAttributes

public BasicAttributes getUserAttributes()
Collect all the value from the table (Arguments), using this create the basicAttributes This will create the Basic Attributes for the User defined TestCase for Add Test

Returns:
The BasicAttributes

getUserModAttributes

public ModificationItem[] getUserModAttributes()
Collect all the value from the table (Arguments), using this create the basicAttributes This will create the Basic Attributes for the User defined TestCase for Modify test

Returns:
The BasicAttributes

getModificationItem

public ModificationItem[] getModificationItem()
This will create the Basic Attributes for the Inbuilt TestCase for Modify test

Returns:
The BasicAttributes

getBasicAttributes

public BasicAttributes getBasicAttributes()
This will create the Basic Attributes for the In build TestCase for Add Test

Returns:
The BasicAttributes

getBasicAttribute

public BasicAttribute getBasicAttribute(String name,
                                        String value)
This will create the Basic Attribute for the give name value pair

Returns:
The BasicAttribute

getLabel

public String getLabel()
Returns a formatted string label describing this sampler Example output:

Returns:
a formatted string label describing this sampler

addTest

public long addTest(LdapClient ldap)
             throws NoPermissionException,
                    NamingException
This will do the add test for the User defined TestCase as well as inbuilt test case

Returns:
executed time for the give test case
NoPermissionException
NamingException

deleteTest

public long deleteTest(LdapClient ldap)
                throws NoPermissionException,
                       NamingException
This will do the delete test for the User defined TestCase as well as inbuilt test case

Returns:
executed time for the give test case
NoPermissionException
NamingException

searchTest

public long searchTest(LdapClient ldap)
                throws NoPermissionException,
                       NamingException
This will do the search test for the User defined TestCase as well as inbuilt test case

Returns:
executed time for the give test case
NoPermissionException
NamingException

modifyTest

public long modifyTest(LdapClient ldap)
                throws NoPermissionException,
                       NamingException
This will do the search test for the User defined TestCase as well as inbuilt test case

Returns:
executed time for the give test case
NoPermissionException
NamingException

sample

public SampleResult sample(Entry e)
!ToDo (Method description)

Parameters:
e - !ToDo (Parameter description)
Returns:
!ToDo (Return description)

Apache JMeter
1.9

Copyright © 1998-2003 Apache Software Foundation. All Rights Reserved.