Package org.apache.commons.net.pop3

Examples of org.apache.commons.net.pop3.POP3Client.listMessages()


    // Login
    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // LIST all messages
    POP3MessageInfo[] info = client.listMessages();
    assertThat(info.length, equalTo(2));

    // DELE message 1
    boolean deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(true));
View Full Code Here


    // DELE message 1
    boolean deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(true));

    // LIST remaining
    info = client.listMessages();
    assertThat(info.length, equalTo(1));

    // DELE message 1 again
    deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(false));
View Full Code Here

    // DELE message 1 again
    deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(false));
   
    // LIST remaining
    info = client.listMessages();
    assertThat(info.length, equalTo(1));

    // DELE message 2
    deleteResult = client.deleteMessage(2);
    assertThat(deleteResult, is(true));
View Full Code Here

    // DELE message 2
    deleteResult = client.deleteMessage(2);
    assertThat(deleteResult, is(true));

    info = client.listMessages();
    assertThat(info.length, equalTo(0));

    // QUIT so the messages get expunged
    boolean logoutSuccess = client.logout();
    assertThat(logoutSuccess, is(true));
View Full Code Here

    // Login
    loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    info = client.listMessages();
    assertThat(info.length, equalTo(0));

    logoutSuccess = client.logout();
    assertThat(logoutSuccess, is(true));
  }
View Full Code Here

    // Login
    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // LIST all messages
    POP3MessageInfo[] info = client.listMessages();
    assertThat(info.length, equalTo(1));

    // DELE message 1
    boolean deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(true));
View Full Code Here

    // DELE message 1
    boolean deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(true));

    // LIST remaining
    info = client.listMessages();
    assertThat(info.length, equalTo(0));

    // RSET. After this the deleted mark should be removed again
    boolean resetRestult = client.reset();
    assertThat(resetRestult, is(true));
View Full Code Here

    // RSET. After this the deleted mark should be removed again
    boolean resetRestult = client.reset();
    assertThat(resetRestult, is(true));

    // LIST all messages
    info = client.listMessages();
    assertThat(info.length, equalTo(1));

    // Logout
    boolean logoutSuccess = client.logout();
    assertThat(logoutSuccess, is(true));
View Full Code Here

    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));

    // LIST all messages
    POP3MessageInfo[] info = client.listMessages();
    assertThat(info.length, equalTo(2));
    assertThat((int) mailSizeAttach, equalTo(info[0].size));
    assertThat((int) mailSizeRegular, equalTo(info[1].size));
    assertThat(info[0].number, equalTo(1));
    assertThat(info[1].number, equalTo(2));
View Full Code Here

                System.err.println("Could not login to server.  Check password.");
                pop3.disconnect();
                System.exit(1);
            }

            messages = pop3.listMessages();

            if (messages == null)
            {
                System.err.println("Could not retrieve message list.");
                pop3.disconnect();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.