Package org.jmock.integration.junit4

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


        service = new TestServiceObject1();
        servicesList.add(service);
        final IsisSessionFactory executionContextFactory =
            new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, new IsisConfigurationDefault(),
                mockery.mock(TemplateImageLoader.class), mockery.mock(SpecificationLoader.class),
                mockery.mock(AuthenticationManager.class), mockery.mock(AuthorizationManager.class),
                mockery.mock(UserProfileLoader.class), mockery.mock(PersistenceSessionFactory.class), servicesList);

        IsisContextStatic.createRelaxedInstance(executionContextFactory);

        final XMLReader parser = XMLReaderFactory.createXMLReader();
View Full Code Here


        service = new TestServiceObject1();
        servicesList.add(service);
        final IsisSessionFactory executionContextFactory =
            new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, new IsisConfigurationDefault(),
                mockery.mock(TemplateImageLoader.class), mockery.mock(SpecificationLoader.class),
                mockery.mock(AuthenticationManager.class), mockery.mock(AuthorizationManager.class),
                mockery.mock(UserProfileLoader.class), mockery.mock(PersistenceSessionFactory.class), servicesList);

        IsisContextStatic.createRelaxedInstance(executionContextFactory);

        final XMLReader parser = XMLReaderFactory.createXMLReader();
View Full Code Here

        servicesList.add(service);
        final IsisSessionFactory executionContextFactory =
            new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, new IsisConfigurationDefault(),
                mockery.mock(TemplateImageLoader.class), mockery.mock(SpecificationLoader.class),
                mockery.mock(AuthenticationManager.class), mockery.mock(AuthorizationManager.class),
                mockery.mock(UserProfileLoader.class), mockery.mock(PersistenceSessionFactory.class), servicesList);

        IsisContextStatic.createRelaxedInstance(executionContextFactory);

        final XMLReader parser = XMLReaderFactory.createXMLReader();
        final UserProfileDataHandler handler = new UserProfileDataHandler();
View Full Code Here

        servicesList.add(service);
        final IsisSessionFactory executionContextFactory =
            new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, new IsisConfigurationDefault(),
                mockery.mock(TemplateImageLoader.class), mockery.mock(SpecificationLoader.class),
                mockery.mock(AuthenticationManager.class), mockery.mock(AuthorizationManager.class),
                mockery.mock(UserProfileLoader.class), mockery.mock(PersistenceSessionFactory.class), servicesList);

        IsisContextStatic.createRelaxedInstance(executionContextFactory);

        final XMLReader parser = XMLReaderFactory.createXMLReader();
        final UserProfileDataHandler handler = new UserProfileDataHandler();
View Full Code Here

    @Test
    public void testRun() {
        final boolean pause = true;
        final Mockery mockCtx = new JUnit4Mockery();
        final Worker worker = mockCtx.mock(Worker.class);
        mockCtx.checking(new Expectations(){{
            oneOf(worker).togglePause(pause);
        }});
        final PauseCommand pauseCmd = new PauseCommand(pause);
        pauseCmd.setWorker(worker);
View Full Code Here

    @Test
    public void testRun() {
        final boolean shutdown = true;
        final Mockery mockCtx = new JUnit4Mockery();
        final Worker worker = mockCtx.mock(Worker.class);
        mockCtx.checking(new Expectations(){{
            oneOf(worker).end(shutdown);
        }});
        final ShutdownCommand shutdownCmd = new ShutdownCommand(shutdown);
        shutdownCmd.setWorker(worker);
View Full Code Here

    }

    @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));
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));
View Full Code Here

            {
                setImposteriser(ClassImposteriser.INSTANCE);
            }
        };

        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()
        {
View Full Code Here

                setImposteriser(ClassImposteriser.INSTANCE);
            }
        };

        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()
        {
            {
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.