org.apache.jmeter.protocol.mail.sampler

Class MailReaderSampler

Implemented Interfaces:
Cloneable, Sampler, Serializable, TestElement

public class MailReaderSampler
extends AbstractSampler

Sampler that can read from POP3 and IMAP mail servers

Field Summary

static int
ALL_MESSAGES
static String
TYPE_IMAP
static String
TYPE_IMAPS
static String
TYPE_POP3
static String
TYPE_POP3S

Fields inherited from interface org.apache.jmeter.testelement.TestElement

COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

Constructor Summary

MailReaderSampler()

Method Summary

boolean
getDeleteMessages()
String
getFolder()
int
getNumMessages()
String
getNumMessagesString()
String
getPassword()
String
getServer()
String
getServerType()
Returns the type of the protocol set to use when talking with the remote server.
String
getUserName()
boolean
isStoreMimeMessage()
SampleResult
sample(Entry e)
Obtains statistics about the given Entry, and packages the information into a SampleResult.
void
setDeleteMessages(boolean delete)
void
setFolder(String folder)
void
setNumMessages(String num_messages)
void
setNumMessages(int num_messages)
void
setPassword(String password)
void
setServer(String server)
void
setServerType(String serverType)
Sets the type of protocol to use when talking with the remote mail server.
void
setStoreMimeMessage(boolean storeMimeMessage)
void
setUserName(String username)

Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty

Field Details

ALL_MESSAGES

public static final int ALL_MESSAGES
Field Value:
-1

TYPE_IMAP

public static final String TYPE_IMAP

TYPE_IMAPS

public static final String TYPE_IMAPS

TYPE_POP3

public static final String TYPE_POP3

TYPE_POP3S

public static final String TYPE_POP3S

Constructor Details

MailReaderSampler

public MailReaderSampler()

Method Details

getDeleteMessages

public boolean getDeleteMessages()
Returns:
Whether or not to delete the read messages from the folder.

getFolder

public String getFolder()
Returns:
folder

getNumMessages

public int getNumMessages()
Returns:
The number of messages to retrieve from the mail server. -1 denotes get all messages.

getNumMessagesString

public String getNumMessagesString()
Returns:
The number of messages to retrieve from the mail server. -1 denotes get all messages.

getPassword

public String getPassword()
Returns:
password

getServer

public String getServer()
Returns:
The name or address of the remote server.

getServerType

public String getServerType()
Returns the type of the protocol set to use when talking with the remote server. Either MailReaderSampler.TYPE_IMAP[S] or MailReaderSampler.TYPE_POP3[S].
Returns:
Server Type

getUserName

public String getUserName()
Returns:
The username of the mail account.

isStoreMimeMessage

public boolean isStoreMimeMessage()
Returns:
Whether or not to store the retrieved message as MIME message in the sample result

sample

public SampleResult sample(Entry e)
Obtains statistics about the given Entry, and packages the information into a SampleResult.
Specified by:
sample in interface Sampler

setDeleteMessages

public void setDeleteMessages(boolean delete)
Parameters:
delete - - Whether or not to delete the read messages from the folder.

setFolder

public void setFolder(String folder)
Parameters:
folder - - Name of the folder to read emails from. "INBOX" is the only acceptable value if the server type is POP3.

setNumMessages

public void setNumMessages(String num_messages)
Parameters:
num_messages - - The number of messages to retrieve from the mail server. Set this value to -1 to retrieve all messages.

setNumMessages

public void setNumMessages(int num_messages)
Parameters:
num_messages - - The number of messages to retrieve from the mail server. Set this value to -1 to retrieve all messages.

setPassword

public void setPassword(String password)
Parameters:
password -

setServer

public void setServer(String server)
Parameters:
server - - The name or address of the remote server.

setServerType

public void setServerType(String serverType)
Sets the type of protocol to use when talking with the remote mail server. Either MailReaderSampler.TYPE_IMAP[S] or MailReaderSampler.TYPE_POP3[S]. Default is MailReaderSampler.TYPE_POP3.
Parameters:
serverType -

setStoreMimeMessage

public void setStoreMimeMessage(boolean storeMimeMessage)
Parameters:
storeMimeMessage - Whether or not to store the retrieved message as MIME message in the sample result

setUserName

public void setUserName(String username)
Parameters:
username - - The username of the mail account.

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