Jala Test

## Class jala.Test.SmtpServer

    Object
       |
       +--jala.Test.SmtpServer

class jala.Test.SmtpServer

Instances of this class represent an SMTP server listening on localhost. By default jala.Test will create a global variable called "smtpServer" that contains an instance of this class. To use the server call start() in a test method (eg. in the basic setup method) and stop() in the cleanup method.
Defined in Global/jala.Test.js

Nested Class Summary
`<static class>` | `jala.Test.SmtpServer.Message`

Constructor Summary
`jala.Test.SmtpServer (<Number> port)` Creates a new SmtpServer instance

Method Summary
`Array` | `getMessages()` Returns an array containing all mails received by the server, where each one is an instance of jala.Test.SmtpServer.Message
`void` | `start()` Starts the SMTP server.
`void` | `stop()` Stops the SMTP server and switches the "smtp" property of the tested application back to the value defined in app or server.properties

Constructor Detail

### jala.Test.SmtpServer

    jala.Test.SmtpServer(<Number> port)

Creates a new SmtpServer instance

Parameters:

`port` - Optional port to listen on (defaults to 25)

Returns:

A newly created SmtpServer instance

Method Detail

### getMessages

    Array getMessages()

Returns an array containing all mails received by the server, where each one is an instance of jala.Test.SmtpServer.Message

Returns:

An array with all messages

### start

    void start()

Starts the SMTP server. Note that this method switches the SMTP server as defined in app.properties of the tested application or server.properties to "localhost" to ensure that all mails sent during tests are received by this server. The SMTP server definition is switched back to the original when stop() is called.

### stop

    void stop()

Stops the SMTP server and switches the "smtp" property of the tested application back to the value defined in app or server.properties

Jala Test

Documentation generated by JSDoc on Tue Jan 8 15:50:17 2008