Package org.apache.commons.net.pop3

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


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

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

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


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

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

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

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

    info = client.listMessages();
    assertThat(info.length, equalTo(0));
View Full Code Here

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

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

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

        // RETR non-existing message
    retrMessage = client.retrieveMessage(10);
        assertThat(retrMessage, nullValue());
       
        // Delete and RETR the message again
    boolean deleteResult = client.deleteMessage(1);
    assertThat(deleteResult, is(true));
   
    retrMessage = client.retrieveMessage(1);
        assertThat(retrMessage, nullValue());
  }
View Full Code Here

    // 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));

    topMessage = client.retrieveMessageTop(1, 1000);
    assertThat(topMessage, nullValue());
  }
View Full Code Here

            reader = client.retrieveMessage(10);
            assertNull(reader);
           
           
            // delete and check for the message again, should now be deleted
            assertTrue(client.deleteMessage(1));
            reader = client.retrieveMessage(1);
            assertNull(reader);

           
            assertTrue(client.logout());
View Full Code Here

            // 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);
            assertNull(reader);

            assertTrue(client.logout());
          
View Full Code Here

           
            assertTrue(client.login("valid", "valid"));
            POP3MessageInfo[] info = client.listMessages();
            assertEquals(2, info.length);
           
            assertTrue(client.deleteMessage(1));
            info = client.listMessages();
            assertEquals(1, info.length);

           
            assertFalse(client.deleteMessage(1));
View Full Code Here

            assertTrue(client.deleteMessage(1));
            info = client.listMessages();
            assertEquals(1, info.length);

           
            assertFalse(client.deleteMessage(1));
            info = client.listMessages();
            assertEquals(1, info.length);
           
           
            assertTrue(client.deleteMessage(2));
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.