Package org.apache.james.protocols.smtp.core.fastfail

Examples of org.apache.james.protocols.smtp.core.fastfail.TarpitHandler.doRcpt()


        handler.setTarpitRcptCount(2);
        handler.setTarpitSleepTime(tarpitTime);

        // no tarpit used
        startTime = System.currentTimeMillis();
        handler.doRcpt(setupMockedSession(0),null,new MailAddress("test@test"));
        assertTrue("No tarpit",
                (System.currentTimeMillis() - startTime) < tarpitTime - tarpitTolerance);

        // tarpit used
        startTime = System.currentTimeMillis();
View Full Code Here


        assertTrue("No tarpit",
                (System.currentTimeMillis() - startTime) < tarpitTime - tarpitTolerance);

        // tarpit used
        startTime = System.currentTimeMillis();
        handler.doRcpt(setupMockedSession(3),null,new MailAddress("test@test"));
        assertTrue("tarpit",
                (System.currentTimeMillis() - startTime) >= tarpitTime - tarpitTolerance);
    }
}
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.