Package org.jmock.integration.junit4

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()


    @Test
    public void testOnException_Interrupted() {
        final Mockery mockCtx = new JUnit4Mockery();
        final JobExecutor jobEx = mockCtx.mock(JobExecutor.class);
        mockCtx.checking(new Expectations(){{
            allowing(jobEx).isShutdown(); will(returnValue(false));
        }});
        Assert.assertEquals(RecoveryStrategy.PROCEED,
            new DefaultExceptionHandler().onException(jobEx, new InterruptedException("foo"), null));
        mockCtx.assertIsSatisfied();
View Full Code Here


    @Test
    public void testOnException_InterruptedShutdown() {
        final Mockery mockCtx = new JUnit4Mockery();
        final JobExecutor jobEx = mockCtx.mock(JobExecutor.class);
        mockCtx.checking(new Expectations(){{
            allowing(jobEx).isShutdown(); will(returnValue(true));
        }});
        Assert.assertEquals(RecoveryStrategy.TERMINATE,
            new DefaultExceptionHandler().onException(jobEx, new InterruptedException("foo"), null));
        mockCtx.assertIsSatisfied();
View Full Code Here

        final DomainMapper followerMapper = mockContext.mock(DomainMapper.class, "followerMapper");
        final DomainMapper followedMapper = mockContext.mock(DomainMapper.class, "followedMapper");

        sut = new AddCachedGroupFollower(followedMapper, followerMapper);
        mockContext.checking(new Expectations()
        {
            {
                allowing(followerMapper).execute(TEST_GROUP_ID_1);
                will(throwException(new PersistenceException()));
                allowing(followedMapper).execute(TEST_GROUP_ID_1);
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.