Examples of retrieveMessageTop()


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

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

    // TOP message with all lines
    Reader topMessage = client.retrieveMessageTop(1, 1000);
    assertThat(topMessage, notNullValue());
    checkMessage(EMAIL_SIMPLE, topMessage);
    topMessage.close();

    // TOP message with 5 lines
View Full Code Here

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

    assertThat(topMessage, notNullValue());
    checkMessage(EMAIL_SIMPLE, topMessage);
    topMessage.close();

    // TOP message with 5 lines
    topMessage = client.retrieveMessageTop(1, 5);
    assertThat(topMessage, notNullValue());
    checkMessage(EMAIL_SIMPLE, topMessage, 5);
    topMessage.close();

    // TOP non-existing message
View Full Code Here

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

    assertThat(topMessage, notNullValue());
    checkMessage(EMAIL_SIMPLE, topMessage, 5);
    topMessage.close();

    // TOP non-existing message
    topMessage = client.retrieveMessageTop(10, 10);
    assertThat(topMessage, nullValue());

    // Delete and TOP the message again
    boolean deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(true));
View Full Code Here

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

    // Delete and TOP the message again
    boolean deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(true));

    topMessage = client.retrieveMessageTop(1, 1000);
    assertThat(topMessage, nullValue());
  }

  private void checkMessage(String message, Reader reader) throws IOException {
    checkMessage(message, reader, null);
View Full Code Here

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

                System.exit(1);
            }

            for (message = 0; message < messages.length; message++)
            {
                reader = pop3.retrieveMessageTop(messages[message].number, 0);

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

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

                pop3.disconnect();
                return;
            }

            for (POP3MessageInfo msginfo : messages) {
                BufferedReader reader = (BufferedReader) pop3.retrieveMessageTop(msginfo.number, 0);

                if (reader == null) {
                    System.err.println("Could not retrieve message header.");
                    pop3.disconnect();
                    System.exit(1);
View Full Code Here

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

                System.exit(1);
            }

            for (message = 0; message < messages.length; message++)
            {
                reader = pop3.retrieveMessageTop(messages[message].number, 0);

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

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

           
            POP3Client client =  new POP3Client();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            Reader reader = client.retrieveMessageTop(1, 1000);
            assertNotNull(reader);
            checkMessage(MESSAGE1, reader);
            reader.close();
           
            reader = client.retrieveMessageTop(2, 1);
View Full Code Here

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

            Reader reader = client.retrieveMessageTop(1, 1000);
            assertNotNull(reader);
            checkMessage(MESSAGE1, reader);
            reader.close();
           
            reader = client.retrieveMessageTop(2, 1);
            assertNotNull(reader);
            checkMessage(MESSAGE2, reader,1);
            reader.close();
           
            // does not exist
View Full Code Here

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

            assertNotNull(reader);
            checkMessage(MESSAGE2, reader,1);
            reader.close();
           
            // does not exist
            reader = client.retrieveMessageTop(10,100);
            assertNull(reader);
           
            // delete and check for the message again, should now be deleted
            assertTrue(client.deleteMessage(1));
            reader = client.retrieveMessageTop(1, 1000);
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.