PageRenderTime 68ms CodeModel.GetById 57ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/sitebricks-mail/src/test/java/com/google/sitebricks/mail/MailClientFailedAuthIntegrationTest.java

http://github.com/dhanji/sitebricks
Java | 24 lines | 15 code | 6 blank | 3 comment | 1 complexity | 1c0a04c98b1f346e435ad443cfea461c MD5 | raw file
 1package com.google.sitebricks.mail;
 2
 3import com.google.inject.Guice;
 4
 5import java.util.concurrent.ExecutionException;
 6
 7/**
 8 * @author dhanji@gmail.com (Dhanji R. Prasanna)
 9 */
10public class MailClientFailedAuthIntegrationTest {
11  public static void main(String...args) throws InterruptedException, ExecutionException {
12    Mail mail = Guice.createInjector().getInstance(Mail.class);
13
14    final MailClient client = mail.clientOf("imap.gmail.com", 993)
15        .prepare(Mail.Auth.SSL, "telnet.imap@gmail.com", System.getProperty("sitebricks-mail.password"));
16
17    if (!client.connect()) {
18      System.out.println("Authentication failed due to " + client.lastError());
19    } else
20      System.out.println("Auth success");
21
22    System.exit(0);
23  }
24}