Package org.apache.commons.net.pop3

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


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

            POP3MessageInfo[] messages = pop3.listMessages();

            if (messages == null)
            {
                System.err.println("Could not retrieve message list.");
                pop3.disconnect();
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

           
            POP3Client client =  new POP3Client();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            POP3MessageInfo[] info = client.listMessages();
            assertEquals(0, info.length);
           
            info = client.listUniqueIdentifiers();
            assertEquals(0, info.length);
            assertTrue(client.logout());
View Full Code Here

           
            POP3Client client =  new POP3Client();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            POP3MessageInfo[] info = client.listMessages();
            assertEquals(2, info.length);
            assertEquals((int) MESSAGE1.meta.getSize(), info[0].size);
            assertEquals((int) MESSAGE2.meta.getSize(), info[1].size);
            assertEquals(1, info[0].number);
            assertEquals(2, info[1].number);
View Full Code Here

           
            POP3Client client =  new POP3Client();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            POP3MessageInfo[] info = client.listMessages();
            assertEquals(2, info.length);
           
            assertTrue(client.deleteMessage(1));
            info = client.listMessages();
            assertEquals(1, info.length);
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));
            info = client.listMessages();
View Full Code Here

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

           
            assertFalse(client.deleteMessage(1));
            info = client.listMessages();
            assertEquals(1, info.length);
           
           
            assertTrue(client.deleteMessage(2));
            info = client.listMessages();
View Full Code Here

            info = client.listMessages();
            assertEquals(1, info.length);
           
           
            assertTrue(client.deleteMessage(2));
            info = client.listMessages();
            assertEquals(0, info.length);
           
            // logout so the messages get expunged
            assertTrue(client.logout());
View Full Code Here

            assertTrue(client.logout());

            client.connect(address.getAddress().getHostAddress(), address.getPort());
 
            assertTrue(client.login("valid", "valid"));
            info = client.listMessages();
            assertEquals(0, info.length);

            assertTrue(client.logout());
          
        } finally {
View Full Code Here

           
            POP3Client client =  new POP3Client();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            assertEquals(1, client.listMessages().length);
            assertTrue(client.deleteMessage(1));
            assertEquals(0, client.listMessages().length);
           
            // call RSET. After this the deleted mark should be removed again
            assertTrue(client.reset());
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.