use of org.apache.jmeter.reporters.MailerModel in project jmeter by apache.
the class MailerVisualizer method clearData.
/**
* Clears any stored sampling-informations.
*/
@Override
public synchronized void clearData() {
if (getModel() != null) {
MailerModel model = ((MailerResultCollector) getModel()).getMailerModel();
model.clear();
updateVisualizer(model);
}
}
use of org.apache.jmeter.reporters.MailerModel in project jmeter by apache.
the class MailerVisualizer method stateChanged.
/**
* {@inheritDoc}
*/
@Override
public void stateChanged(ChangeEvent e) {
if (e.getSource() instanceof MailerModel) {
MailerModel testModel = (MailerModel) e.getSource();
updateVisualizer(testModel);
} else {
super.stateChanged(e);
}
}
use of org.apache.jmeter.reporters.MailerModel in project jmeter by apache.
the class MailerVisualizer method actionPerformed.
// ////////////////////////////////////////////////////////////
//
// Implementation of the ActionListener-Interface.
//
// ////////////////////////////////////////////////////////////
/**
* Reacts on an ActionEvent (like pressing a button).
*
* @param e
* The ActionEvent with information about the event and its
* source.
*/
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == testerButton) {
ResultCollector testElement = getModel();
modifyTestElement(testElement);
try {
MailerModel model = ((MailerResultCollector) testElement).getMailerModel();
model.sendTestMail();
//$NON-NLS-1$
displayMessage(JMeterUtils.getResString("mail_sent"), false);
} catch (AddressException ex) {
log.error("Invalid mail address ", ex);
displayMessage(//$NON-NLS-1$
JMeterUtils.getResString("invalid_mail_address") + "\n" + ex.getMessage(), //$NON-NLS-1$
true);
} catch (MessagingException ex) {
log.error("Couldn't send mail...", ex);
displayMessage(//$NON-NLS-1$
JMeterUtils.getResString("invalid_mail") + "\n" + ex.getMessage(), //$NON-NLS-1$
true);
}
}
}
use of org.apache.jmeter.reporters.MailerModel in project jmeter by apache.
the class MailerVisualizer method modifyTestElement.
/**
* {@inheritDoc}
*/
@Override
public void modifyTestElement(TestElement c) {
super.modifyTestElement(c);
MailerModel mailerModel = ((MailerResultCollector) c).getMailerModel();
mailerModel.setFailureLimit(failureLimitField.getText());
mailerModel.setFailureSubject(failureSubjectField.getText());
mailerModel.setFromAddress(fromField.getText());
mailerModel.setSmtpHost(smtpHostField.getText());
mailerModel.setSmtpPort(smtpPortField.getText());
mailerModel.setLogin(smtpLoginField.getText());
mailerModel.setPassword(smtpPasswordField.getText());
mailerModel.setMailAuthType(authTypeCombo.getSelectedItem().toString());
mailerModel.setSuccessLimit(successLimitField.getText());
mailerModel.setSuccessSubject(successSubjectField.getText());
mailerModel.setToAddress(addressField.getText());
}
Aggregations