|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTransport
com.webmethods.caf.faces.data.email.MockEmailTransport
public class MockEmailTransport
An email Transport
implementation that doesn't send any messages,
just queues them in its MockEmailTransport.getSentMessages()
list
(useful for message-sending functional tests).
Nested Class Summary | |
---|---|
static class |
MockEmailTransport.SentMessage
Container class for message sent through the mock transport. |
Field Summary | |
---|---|
protected List |
sentMessages
|
Constructor Summary | |
---|---|
MockEmailTransport()
Default constructor using the session default instance and a default URLName . |
|
MockEmailTransport(Session session)
Constructor for using a specified session and a default URLName |
|
MockEmailTransport(Session session,
URLName name)
Constructor for using a specified session and URLName. |
Method Summary | |
---|---|
static Transport |
getMockTransport()
Mock transport for EmailDeliverer to use. |
List |
getSentMessages()
Active list of sent messages. |
static boolean |
isUseMockTransport()
Determine if this Transport is using a mock transport. |
protected boolean |
protocolConnect(String host,
int port,
String user,
String password)
The method to perform the actual protocol-specific connection attempt. |
void |
sendMessage(Message message,
Address[] addresses)
Adds a sent message to the list of message sent through the mock transport. |
static void |
setMockTransport(Transport transport)
Mock transport for EmailDeliverer to use
(null to not use a mock transport). |
static void |
setUseMockTransport(boolean use)
Set if this Transport is using a mock transport. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List sentMessages
Constructor Detail |
---|
public MockEmailTransport()
URLName
.
public MockEmailTransport(Session session)
URLName
session
- Session
object for this Transport.public MockEmailTransport(Session session, URLName name)
session
- Session
object for this Transport.name
- URLName
object to be used for this Transport.Method Detail |
---|
public static boolean isUseMockTransport()
Transport
is using a mock transport.
EmailDeliverer
is using a mock transport. Otherwise false.public static void setUseMockTransport(boolean use)
Transport
is using a mock transport.
If the Transport
is already set then continue to use the same Transport
.
Set the use value to false to clear the Transport
.
True
- will set the Transport
to use a mock transport.
False will clear the Transport
to use.public static Transport getMockTransport()
EmailDeliverer
to use.
Transport
used for this class.public static void setMockTransport(Transport transport)
EmailDeliverer
to use
(null to not use a mock transport).
transport
- A Transport
public void sendMessage(Message message, Address[] addresses) throws MessagingException
message
- The message
sent.addresses
- The array of address
contained in the message.
MessagingException
protected boolean protocolConnect(String host, int port, String user, String password) throws MessagingException
host
- String ( ignored )port
- int ( ignored )user
- String ( ignored )password
- String ( ignored )
MessagingException
public List getSentMessages()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |