Package mockit

Examples of mockit.Verifications


    @Test
    public void testOnEntireMailFailurePermanent()
            throws LocalMailSystemException {
        retryPolicy.actOnEntireMailFailure(mail, permanentSendException);

        new Verifications() {
            {
                onInstance(dsnTransmitter).transmit((Mail) any);
            }
        };
    }
View Full Code Here


    @Test
    public void testOnEntireMailFailureTemporary()
            throws LocalMailSystemException {
        retryPolicy.actOnEntireMailFailure(mail, transientSendException);

        new Verifications() {
            {
                onInstance(retryTransmitter).transmit((Mail) any);
            }
        };
    }
View Full Code Here

    @Test
    public void testOnEntireMailFailureGiveUp() throws LocalMailSystemException {
        mail.deliveryAttempts = 100;
        retryPolicy.actOnEntireMailFailure(mail, transientSendException);

        new Verifications() {
            {
                onInstance(dsnTransmitter).transmit((Mail) any);
            }
        };
    }
View Full Code Here

    public void testOnEntireMailFailurePermanentNotification()
            throws LocalMailSystemException {
        mail.from = new NullReversePath();
        retryPolicy.actOnEntireMailFailure(mail, permanentSendException);

        new Verifications() {
            {
                onInstance(dsnTransmitter).transmit((Mail) any);
                times = 0;
            }
        };
View Full Code Here

        RecipientsWereRejectedException exception =
                new RecipientsWereRejectedException(rejections);

        retryPolicy.actOnRecipientsWereRejected(mail, exception);

        new Verifications() {
            {
                onInstance(dsnTransmitter).transmit((Mail) any);
                onInstance(retryTransmitter).transmit((Mail) any);
            }
        };
View Full Code Here

    public void testSend() throws SendException,
            RecipientsWereRejectedException, IOException, PostponeException {

        sender.transmit(mail, IP1);

        new Verifications() {
            {
                smartClient.from(anyString);
                smartClient.to(anyString);
                smartClient.dataEnd();
                smartClient.quit();
View Full Code Here

        } catch (RecipientsWereRejectedException e) {
            assertEquals(e.rejections.size(), 1);
            assertEquals(e.rejections.get(0).recipient, JANE_AS_RECIPIENT);
        }

        new Verifications() {
            {
                smartClient.dataStart();
                times = 0;
            }
        };
View Full Code Here

        } catch (RecipientsWereRejectedException e) {
            assertEquals(1, e.rejections.size());
            assertEquals(JANE_AS_RECIPIENT, e.rejections.get(0).recipient);
        }

        new Verifications() {
            {
                smartClient.dataStart();
            }
        };
    }
View Full Code Here

        }};

        CurrentUserInfo currentUserInfo = new LocalCurrentUserInfo();
        assertEquals(userName, currentUserInfo.getCurrentUser());

        new Verifications() {{
            elResolver.getValue(elContext, null, "currentUser"); times = 1;
        }};
    }
View Full Code Here

        }};

        CurrentUserInfo currentUserInfo = new PrincipalCurrentUserInfo();
        assertEquals(userName, currentUserInfo.getCurrentUser());

        new Verifications() {{
            externalContext.getUserPrincipal(); times = 1;
        }};
    }
View Full Code Here

TOP

Related Classes of mockit.Verifications

Copyright © 2018 www.massapicom. 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.