]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/testUtils/TestEmailReceiver.java
upd: rename sendmail to sendMail
[gigi.git] / tests / org / cacert / gigi / testUtils / TestEmailReceiver.java
index 77c3e2d6942e333e9a94ecc954a631a763a3c06d..27b166f9667c35109839d9a4fccd404f117831fb 100644 (file)
@@ -21,7 +21,7 @@ import org.cacert.gigi.email.TestEmailProvider;
  * 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.
@@ -124,7 +124,7 @@ public final class TestEmailReceiver extends EmailProvider implements Runnable {
      * @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>();
@@ -136,6 +136,7 @@ public final class TestEmailReceiver extends EmailProvider implements Runnable {
      * @return The intercepted {@link TestMail}
      * @see #poll()
      */
+    @Override
     public TestMail receive() {
         TestMail poll;
 
@@ -143,10 +144,10 @@ public final class TestEmailReceiver extends EmailProvider implements Runnable {
             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;
@@ -232,6 +233,7 @@ public final class TestEmailReceiver extends EmailProvider implements Runnable {
     /**
      * Removes all queued mails.
      */
+    @Override
     public void clearMails() {
         mails.clear();
     }
@@ -271,7 +273,7 @@ public final class TestEmailReceiver extends EmailProvider implements Runnable {
     }
 
     @Override
-    public void sendmail(String to, String subject, String message, String from, String replyto, String toname, String fromname, String errorsto, boolean extra) throws IOException {
+    public void sendMail(String to, String subject, String message, String from, String replyto, String toname, String fromname, String errorsto, boolean extra) throws IOException {
         mails.add(new TestMail(to, subject, message, from, replyto));
     }