Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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`

Field Summary

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`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### MockTransport

    public MockTransport(javax.mail.Session session,
                         javax.mail.URLName urlname)

Method Detail

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD