org.apache.james.postage.mail
Class AbstractMailFactory

java.lang.Object
  extended by org.apache.james.postage.mail.AbstractMailFactory
Direct Known Subclasses:
DefaultMailFactory

public abstract class AbstractMailFactory
extends java.lang.Object

prototype of a mail factory, only missing the use case specific data.
it prepares the message with all Postage specific headers.

See Also:
as a template implementation

Constructor Summary
AbstractMailFactory()
           
 
Method Summary
 javax.mail.Message createMail(javax.mail.Session mailSession, MailSender mailSender, MailProcessingRecord mailProcessingRecord)
          generates a mail containing data common to all test mails: postage headers,
protected  int generateRandomPartSize(int sizeMin, int sizeMax)
           
static byte getRandomByte()
           
static char getRandomChar()
           
protected abstract  java.lang.Class getValidatorClass()
          the class representing the validator
protected abstract  void populateMessage(javax.mail.internet.MimeMessage message, MailSender mailSender, MailProcessingRecord mailProcessingRecord)
          here, the test case specific data must be added to the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMailFactory

public AbstractMailFactory()
Method Detail

getRandomChar

public static char getRandomChar()

getRandomByte

public static byte getRandomByte()

createMail

public javax.mail.Message createMail(javax.mail.Session mailSession,
                                     MailSender mailSender,
                                     MailProcessingRecord mailProcessingRecord)
generates a mail containing data common to all test mails: postage headers,


populateMessage

protected abstract void populateMessage(javax.mail.internet.MimeMessage message,
                                        MailSender mailSender,
                                        MailProcessingRecord mailProcessingRecord)
                                 throws javax.mail.MessagingException
here, the test case specific data must be added to the message.

Parameters:
message -
mailSender -
mailProcessingRecord -
Throws:
javax.mail.MessagingException

getValidatorClass

protected abstract java.lang.Class getValidatorClass()
the class representing the validator

Returns:
validator class

generateRandomPartSize

protected int generateRandomPartSize(int sizeMin,
                                     int sizeMax)


Copyright © 2006-2007 The Apache Software Foundation. All Rights Reserved.