Package org.apache.commons.net.pop3

Examples of org.apache.commons.net.pop3.POP3SClient.connect()


        try {
            server = createServer(createProtocol(new TestPassCmdHandler()), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertFalse(client.login("invalid", "invalid"));
          
            assertTrue(client.logout());
          
View Full Code Here


            handler.add("valid", new MockMailbox(identifier));
            server = createServer(createProtocol(handler), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            POP3MessageInfo[] info = client.listMessages();
            assertEquals(0, info.length);
           
View Full Code Here

            handler.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(handler), address);
            server.bind();
           
            POP3Client client =  createClient();
            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);
View Full Code Here

            factory.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(factory), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            Reader reader = client.retrieveMessage(1);
            assertNotNull(reader);
            checkMessage(MESSAGE1, reader);
View Full Code Here

            factory.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(factory), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            assertTrue(client.login("valid", "valid"));
            Reader reader = client.retrieveMessageTop(1, 1000);
            assertNotNull(reader);
            checkMessage(MESSAGE1, reader);
View Full Code Here

        POP3Client pop3 = new POP3Client();
        // We want to timeout if a response takes longer than 60 seconds
        pop3.setDefaultTimeout(60000);

        for (int i = 0; i < 12; i++) {
            pop3.connect(pop3Host);

            if (!pop3.login(pop3User, pop3passwd)) {
                pop3.disconnect();
                AxisFault fault = new AxisFault("POP3", "( Could not login to server.  Check password. )", null, null);
                throw fault;
View Full Code Here

        // We want to timeout if a response takes longer than 60 seconds
        pop3.setDefaultTimeout(60000);

        try
        {
            pop3.connect(server);
        }
        catch (IOException e)
        {
            System.err.println("Could not connect to server.");
            e.printStackTrace();
View Full Code Here

            handler.add("valid", new MockMailbox(identifier));
            server = createServer(createProtocol(handler), address, Encryption.createStartTls(BogusSslContextFactory.getServerContext()));
            server.bind();
           
            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();
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.