* intercept the emails. This class resides in the VM that executes the
* testcases and supplies the intercepted emails to the current test case.
*/
-public final class TestEmailReceiver extends EmailProvider implements Runnable {
+public final class TestEmailReceiver extends EmailProvider implements Runnable, MailReceiver {
/**
* An email that has been intercepted.
* @see #destroy()
*/
public void start() {
- new Thread(this, "Mail reciever").start();
+ new Thread(this, "Mail receiver").start();
}
private LinkedBlockingQueue<TestMail> mails = new LinkedBlockingQueue<TestEmailReceiver.TestMail>();
* @return The intercepted {@link TestMail}
* @see #poll()
*/
+ @Override
public TestMail receive() {
TestMail poll;
poll = mails.poll(60, TimeUnit.SECONDS);
} catch (InterruptedException e) {
- throw new AssertionError("Interrupted while recieving mails");
+ throw new AssertionError("Interrupted while receiving mails");
}
if (poll == null) {
- throw new AssertionError("Mail recieving timed out");
+ throw new AssertionError("Mail receiving timed out");
}
return poll;
/**
* Removes all queued mails.
*/
+ @Override
public void clearMails() {
mails.clear();
}