Package org.jmock

Examples of org.jmock.Mockery.mock()


    public void testShouldConvertEntityWithManyToOneToPojo() throws Exception {
        Mockery context = new Mockery();
        final Sequence sequence = context.sequence("sequence");

        final IJDTFacade facade = context.mock(IJDTFacade.class);

        context.checking(new Expectations() {
            {
                one(facade).removeAbstractModifierFromClass("org.superbiz.ProductBean");
                inSequence(sequence);
View Full Code Here


    public void testShouldConvertEntityWithBadRelationshipToPojo() throws Exception {
        Mockery context = new Mockery();
        final Sequence sequence = context.sequence("sequence");

        final IJDTFacade facade = context.mock(IJDTFacade.class);

        context.checking(new Expectations() {
            {
                one(facade).removeAbstractModifierFromClass("org.superbiz.OrderBean");
                inSequence(sequence);
View Full Code Here

import java.util.Map;

public class SessionBeanRemoteAnnotationAdderTest extends TestCase {
    public void testShouldAddRemoteAndRemoteHomeAnnotations() throws Exception {
        Mockery context = new Mockery();
        final IJDTFacade facade = context.mock(IJDTFacade.class);


        context.checking(new Expectations() {
            {
                one(facade).addClassAnnotation("org.superbiz.Store", Remote.class, null);
View Full Code Here

        context.assertIsSatisfied();
    }

    public void testNotShouldAddRemoteAndRemoteHomeAnnotationsForLocalBeans() throws Exception {
        Mockery context = new Mockery();
        final IJDTFacade facade = context.mock(IJDTFacade.class);

        AppModule module = new TestFixture().getAppModule("single-session-bean-local.xml", null);
        new SessionBeanRemoteAnnotationAdder(facade).convert(module);

        context.assertIsSatisfied();
View Full Code Here

        context.assertIsSatisfied();
    }

    public void testNotShouldAddRemoteAndRemoteHomeAnnotationsForBadSessionBean() throws Exception {
        Mockery context = new Mockery();
        final IJDTFacade facade = context.mock(IJDTFacade.class);

        AppModule module = new TestFixture().getAppModule("badsession-ejb-jar.xml", null);
        new SessionBeanRemoteAnnotationAdder(facade).convert(module);

        context.assertIsSatisfied();
View Full Code Here

        context.assertIsSatisfied();
    }

    public void testNotShouldAddRemoteAndRemoteHomeAnnotationsForEmptySessionBean() throws Exception {
        Mockery context = new Mockery();
        final IJDTFacade facade = context.mock(IJDTFacade.class);

        AppModule module = new TestFixture().getAppModule("emptysession-ejb-jar.xml", null);
        new SessionBeanRemoteAnnotationAdder(facade).convert(module);

        context.assertIsSatisfied();
View Full Code Here

                LOG.error("unexpected exception {} on thread {}", e, t);
                exceptions.put(t, e);
            }
        });

        final BrokerService brokerService = context.mock(BrokerService.class);
        final JDBCPersistenceAdapter jdbcPersistenceAdapter = context.mock(JDBCPersistenceAdapter.class);
        final Locker locker = context.mock(Locker.class);

        final States jdbcConn = context.states("jdbc").startsAs("down");
        final States broker = context.states("broker").startsAs("started");
View Full Code Here

                exceptions.put(t, e);
            }
        });

        final BrokerService brokerService = context.mock(BrokerService.class);
        final JDBCPersistenceAdapter jdbcPersistenceAdapter = context.mock(JDBCPersistenceAdapter.class);
        final Locker locker = context.mock(Locker.class);

        final States jdbcConn = context.states("jdbc").startsAs("down");
        final States broker = context.states("broker").startsAs("started");
View Full Code Here

            }
        });

        final BrokerService brokerService = context.mock(BrokerService.class);
        final JDBCPersistenceAdapter jdbcPersistenceAdapter = context.mock(JDBCPersistenceAdapter.class);
        final Locker locker = context.mock(Locker.class);

        final States jdbcConn = context.states("jdbc").startsAs("down");
        final States broker = context.states("broker").startsAs("started");

        // simulate jdbc up between hasLock and checkpoint, so hasLock fails to verify
View Full Code Here

    public long callDiffOffset(LeaseDatabaseLocker underTest, final long dbTime) throws Exception {

        Mockery context = new Mockery() {{
            setImposteriser(ClassImposteriser.INSTANCE);
        }};
        final Statements statements = context.mock(Statements.class);
        final JDBCPersistenceAdapter jdbcPersistenceAdapter = context.mock(JDBCPersistenceAdapter.class);
        final Connection connection = context.mock(Connection.class);
        final PreparedStatement preparedStatement = context.mock(PreparedStatement.class);
        final ResultSet resultSet = context.mock(ResultSet.class);
        final Timestamp timestamp = context.mock(Timestamp.class);
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.