org.jboss.seam.mock
Class MockTransport
java.lang.Object
javax.mail.Service
javax.mail.Transport
org.jboss.seam.mock.MockTransport
public class MockTransport
- extends javax.mail.Transport
Provides a MockTransport for integration testing Seam Mail.
getMailMessage()
returns the most recently rendered
message sent using the MockTransport.
To enable the mock transport, set the mailSession.transport property to mock
in components.properties.
- Author:
- Pete Muir
- See Also:
Transport
Fields inherited from class javax.mail.Service |
debug, session, url |
Constructor Summary |
MockTransport(javax.mail.Session session,
javax.mail.URLName urlname)
|
Method Summary |
static void |
clearMailMessage()
Get the most recently rendered message sent using the MockTransport. |
void |
connect()
|
static javax.mail.internet.MimeMessage |
getMailMessage()
Get the most recently rendered message sent using the MockTransport. |
void |
sendMessage(javax.mail.Message message,
javax.mail.Address[] recipients)
|
Methods inherited from class javax.mail.Transport |
addTransportListener, notifyTransportListeners, removeTransportListener, send, send |
Methods inherited from class javax.mail.Service |
addConnectionListener, close, connect, connect, connect, finalize, getURLName, isConnected, notifyConnectionListeners, protocolConnect, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
MockTransport
public MockTransport(javax.mail.Session session,
javax.mail.URLName urlname)
sendMessage
public void sendMessage(javax.mail.Message message,
javax.mail.Address[] recipients)
throws javax.mail.MessagingException
- Specified by:
sendMessage
in class javax.mail.Transport
- Throws:
javax.mail.MessagingException
clearMailMessage
public static void clearMailMessage()
- Get the most recently rendered message sent using the MockTransport.
getMailMessage
public static javax.mail.internet.MimeMessage getMailMessage()
- Get the most recently rendered message sent using the MockTransport.
connect
public void connect()
throws javax.mail.MessagingException
- Overrides:
connect
in class javax.mail.Service
- Throws:
javax.mail.MessagingException
Copyright © 2011 Seam Framework. All Rights Reserved.