Bug 49552 - Add Message Headers on SMTPSampler
Add Message Headers on SMTPSampler
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
unspecified
PC Linux
: P2 enhancement (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-07-05 10:28 UTC by Luciana Moreira
Modified: 2010-07-06 12:19 UTC (History)
2 users (show)



Attachments
work in progress for header fields (12.21 KB, text/plain)
2010-07-05 10:28 UTC, Luciana Moreira
Details
Patch to add headers to Mail Messages on SMTPSampler (19.79 KB, text/plain)
2010-07-05 14:26 UTC, Luciana Moreira
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luciana Moreira 2010-07-05 10:28:21 UTC
Created attachment 25707 [details]
work in progress for header fields

I was not sure if I should create a new RFE or just post on bug45053, sorry if this is not the right place.

Mail messages can have several headers which are not currently available in the SMTPSampler. It would be very nice to be able to set this parameter in the sampler.

I have already started to work on this, attached you will find my work in progress. 

Currently I am unsure on how to correctly implement a list of variable size of name/value pairs (header fields). I suppose my solution will be similar to the Arguments class, can somebody confirm?

My major concern is: How will the file be loaded and a List (or Map) be created? I know that I have to modify the method SmtpSamplerGUI.configure() but I don't know which method to call on the TestElement. Should I try to cast this element to an SMTPSampler and in there set my List/Map?
Comment 1 Luciana Moreira 2010-07-05 10:39:37 UTC
I just found out that the SendMailCommand already offers support to setting headers, see SendMailCommand.setHeaders(). Nevertheless, this is not linked to the GUI.
Comment 2 Luciana Moreira 2010-07-05 14:26:46 UTC
Created attachment 25710 [details]
Patch to add headers to Mail Messages on SMTPSampler
Comment 3 Sebb 2010-07-06 12:19:26 UTC
Thanks!

Applied with some fixes.
I also changed the GUI layout as the page was getting too long.

URL: http://svn.apache.org/viewvc?rev=960927&view=rev
Log:
Bug 49552 - Add Message Headers on SMTPSampler

Modified:
   jakarta/jmeter/trunk/docs/images/screenshots/smtp_sampler.png
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
   jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/SmtpSampler.java
   jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/SmtpPanel.java
   jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/gui/SmtpSamplerGui.java
   jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/protocol/SendMailCommand.java
   jakarta/jmeter/trunk/xdocs/changes.xml
   jakarta/jmeter/trunk/xdocs/images/screenshots/smtp_sampler.png
   jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml