Package org.apache.commons.net.pop3

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


            String welcomeMessage = client.getReplyString();
           
            // check for valid syntax that include all info needed for APOP
            assertTrue(welcomeMessage.trim().matches("\\+OK \\<\\d+\\.\\d+@.+\\> .+"));
           
            int reply = client.sendCommand("APOP invalid invalid");
            assertEquals(POP3Reply.ERROR, reply);
           
            handler.add("valid", new MockMailbox("id"));
            reply = client.sendCommand("APOP valid valid");
            assertEquals(POP3Reply.OK, reply);
View Full Code Here


           
            int reply = client.sendCommand("APOP invalid invalid");
            assertEquals(POP3Reply.ERROR, reply);
           
            handler.add("valid", new MockMailbox("id"));
            reply = client.sendCommand("APOP valid valid");
            assertEquals(POP3Reply.OK, reply);
           
            assertTrue(client.logout());
          
        } finally {
View Full Code Here

            assertEquals("foo2 has no mails", 0, entries.length);

        } finally {
            // put both to rest, field var is handled by tearDown()
            if (pop3Protocol2 != null) {
                pop3Protocol2.sendCommand("quit");
                pop3Protocol2.disconnect();
            }
        }
    }
View Full Code Here

            assertEquals("foo2 has no mails", 0, entries.length);

        } finally {
            // put both to rest, field var is handled by tearDown()
            if (pop3Protocol2 != null) {
                pop3Protocol2.sendCommand("quit");
                pop3Protocol2.disconnect();
            }
        }
    }
View Full Code Here

        // This both should error and so return null
        assertNull(m_pop3Protocol2.retrieveMessageTop(1, 100));
        assertNull(m_pop3Protocol2.retrieveMessage(1));

        m_pop3Protocol2.sendCommand("quit");
        m_pop3Protocol2.disconnect();

        mailboxManager.deleteMailbox(mailboxPath, session);
       
    }
View Full Code Here

            String welcomeMessage = client.getReplyString();
           
            // check for valid syntax that include all info needed for APOP
            assertTrue(welcomeMessage.trim().matches("\\+OK \\<\\d+\\.\\d+@.+\\> .+"));
           
            int reply = client.sendCommand("APOP invalid invalid");
            assertEquals(POP3Reply.ERROR, reply);
           
            handler.add("valid", new MockMailbox("id"));
            reply = client.sendCommand("APOP valid valid");
            assertEquals(POP3Reply.OK, reply);
View Full Code Here

           
            int reply = client.sendCommand("APOP invalid invalid");
            assertEquals(POP3Reply.ERROR, reply);
           
            handler.add("valid", new MockMailbox("id"));
            reply = client.sendCommand("APOP valid valid");
            assertEquals(POP3Reply.OK, reply);
           
            assertTrue(client.logout());
          
        } finally {
View Full Code Here

            POP3SClient client = createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            // TODO: Make use of client.capa() once possible
            //       See NET-438
            assertEquals(POP3Reply.OK, client.sendCommand("CAPA"));
            client.getAdditionalReply();

            boolean startTlsCapa = false;
            for (String cap: client.getReplyStrings()) {
                if (cap.equalsIgnoreCase("STLS")) {
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.