Package org.jmock

Examples of org.jmock.Sequence


            }

            @Test
            public void raisesEvent() throws Exception {

                final Sequence busRulesThenExec = context.sequence("busRulesThenExec");
                // then
                context.checking(new Expectations() {{
                    oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.HIDE)));
                    inSequence(busRulesThenExec);
                    oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.DISABLE)));
View Full Code Here



    @Test
    public void destroyObjectThenAbort() {
       
        final Sequence tran = context.sequence("tran");
        context.checking(new Expectations() {
            {
                one(mockObjectStore).startTransaction();
                inSequence(tran);
View Full Code Here

    }

    @Test
    public void destroyObject_thenCommit() {

        final Sequence tran = context.sequence("tran");
        context.checking(new Expectations() {
            {
                oneOf(mockObjectStore).startTransaction();
                inSequence(tran);
View Full Code Here

    }

    @Test
    public void makePersistent_happyCase() {

        final Sequence tran = context.sequence("tran");
        context.checking(new Expectations() {
            {
                oneOf(mockObjectStore).startTransaction();
                inSequence(tran);
View Full Code Here

        final List<Method> methods = Arrays.asList(NormalDomainObject.class.getMethod("titleElement1"), NormalDomainObject.class.getMethod("titleElement2"), NormalDomainObject.class.getMethod("titleElement3"));

        final List<TitleComponent> components = Lists.transform(methods, TitleComponent.FROM_METHOD);
        final TitleFacetViaTitleAnnotation facet = new TitleFacetViaTitleAnnotation(components, mockFacetHolder, mockAdapterManager);
        final NormalDomainObject normalPojo = new NormalDomainObject();
        final Sequence sequence = context.sequence("in-title-element-order");
        context.checking(new Expectations() {
            {
                allowing(mockObjectAdapter).getObject();
                will(returnValue(normalPojo));
View Full Code Here

        expectingMetaModelToBeInitialized();
        metaModel = new IsisMetaModel(mockRuntimeContext, mockProgrammingModelFacets);
    }

    private void expectingMetaModelToBeInitialized() {
        final Sequence initSequence = context.sequence("init");
        context.checking(new Expectations() {
            {
                allowing(mockRuntimeContext).injectInto(with(any(Object.class)));
                will(IsisActions.injectInto());
               
View Full Code Here

    public void happyCase() throws Exception {
       
        // given
        final SimpleObject simpleObject = new SimpleObject();
       
        final Sequence seq = context.sequence("create");
        context.checking(new Expectations() {
            {
                oneOf(mockContainer).newTransientInstance(SimpleObject.class);
                inSequence(seq);
                will(returnValue(simpleObject));
View Full Code Here

            }

            @Test
            public void raisesEvent() throws Exception {

                final Sequence busRulesThenExec = context.sequence("busRulesThenExec");
                // then
                context.checking(new Expectations() {{
                    oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.HIDE)));
                    inSequence(busRulesThenExec);
                    oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.DISABLE)));
View Full Code Here

        org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
    }

    @Test
    public void withFixturesNotInstalled() throws Exception {
        final Sequence constructor = context.sequence("<init>");
        context.checking(new Expectations() {
            {
                one(db).open();
                inSequence(constructor);
               
View Full Code Here

        assertFalse(store.isFixturesInstalled());
    }

    @Test
    public void withFixturesInstalled() throws Exception {
        final Sequence constructor = context.sequence("<init>");
        context.checking(new Expectations() {
            {
                one(db).open();
                inSequence(constructor);
               
View Full Code Here

TOP

Related Classes of org.jmock.Sequence

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.