mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Test connection w/o server
This commit is contained in:
parent
e98f323222
commit
bdbe976396
@ -10,6 +10,7 @@ import com.fsck.k9.endtoend.framework.UserForImap;
|
||||
import com.fsck.k9.mail.AuthType;
|
||||
import com.fsck.k9.mail.AuthenticationFailedException;
|
||||
import com.fsck.k9.mail.ConnectionSecurity;
|
||||
import com.fsck.k9.mail.MessagingException;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
@ -36,6 +37,16 @@ public class ImapConnectionTest extends TestCase {
|
||||
stubMailServer.stop();
|
||||
}
|
||||
|
||||
public void testOpenConnectionWithoutRunningServerThrowsMessagingException() throws Exception {
|
||||
stubMailServer.stop();
|
||||
try {
|
||||
connection.open();
|
||||
fail("expected exception");
|
||||
} catch (MessagingException e) {
|
||||
assertFalse(connection.isOpen());
|
||||
}
|
||||
}
|
||||
|
||||
public void testOpenConnectionWithWrongCredentialsThrowsAuthenticationFailedException() throws Exception {
|
||||
connection = new ImapConnection(new TestImapSettings("wrong", "password"), null, null);
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user