Package org.jmock

Examples of org.jmock.Sequence


        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



    @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

        // setup
        context.ignoring(mockPersistenceSession);

        context.checking(new Expectations() {
            {
                final Sequence transactionOrdering = context.sequence("transactionOrdering");
                oneOf(mockObjectStore).startTransaction();
                inSequence(transactionOrdering);

                // flushed twice, once before publishing, once after
                exactly(3).of(mockObjectStore).execute(with(equalTo(Collections.<PersistenceCommand>emptyList())));
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);
                oneOf(mockPersistAlgorithm).makePersistent(transientAdapter, persistenceSession);
View Full Code Here

        // setup
        context.ignoring(mockPersistenceSession);

        context.checking(new Expectations() {
            {
                final Sequence transactionOrdering = context.sequence("transactionOrdering");
                one(mockObjectStore).startTransaction();
                inSequence(transactionOrdering);

                // flushed twice, once before publishing, once after
                exactly(2).of(mockObjectStore).execute(with(equalTo(Collections.<PersistenceCommand>emptyList())));
View Full Code Here

    final IncrementalTask[] tasks = new IncrementalTask[taskCount];
    for (int i = 0; i < taskCount; i++) {
      tasks[i] = mock(IncrementalTask.class, "repeating_" + i);
      timer.scheduleRepeating(tasks[i], 1, 0);
    }
    final Sequence seq = sequence("callOrder");
    checking(new Expectations() {{
      for (IncrementalTask task : tasks) {
        one(task).execute();
        will(returnValue(true));
        inSequence(seq);
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.