Package org.axonframework.saga

Examples of org.axonframework.saga.Saga


            public Object answer(InvocationOnMock invocation) throws Throwable {
                latch.countDown();
                return null;
            }
        }).when(eventBus).publish(isA(EventMessage.class));
        Saga mockSaga = mock(Saga.class);
        when(mockSaga.getSagaIdentifier()).thenReturn(UUID.randomUUID().toString());
        ScheduleToken token = testSubject.schedule(new Duration(30), new StubEvent());
        assertTrue(token.toString().contains("Quartz"));
        assertTrue(token.toString().contains(GROUP_ID));
        latch.await(1, TimeUnit.SECONDS);
        InOrder inOrder = inOrder(unitOfWorkFactory, unitOfWork, eventBus);
View Full Code Here


        verify(eventBus, never()).publish(isA(EventMessage.class));
    }

    @Test
    public void testCancelJob() throws SchedulerException, InterruptedException {
        Saga mockSaga = mock(Saga.class);
        when(mockSaga.getSagaIdentifier()).thenReturn(UUID.randomUUID().toString());
        ScheduleToken token = testSubject.schedule(new Duration(1000), new StubEvent());
        assertEquals(1, scheduler.getJobKeys(GroupMatcher.<JobKey>groupEquals(GROUP_ID)).size());
        testSubject.cancelSchedule(token);
        assertEquals(0, scheduler.getJobKeys(GroupMatcher.<JobKey>groupEquals(GROUP_ID)).size());
        scheduler.shutdown(true);
View Full Code Here

                .getResultList();
        if (serializedSagaList == null || serializedSagaList.isEmpty()) {
            return null;
        }
        SerializedSaga serializedSaga = serializedSagaList.get(0);
        Saga loadedSaga = serializer.deserialize(serializedSaga);
        if (injector != null) {
            injector.injectResources(loadedSaga);
        }
        if (logger.isDebugEnabled()) {
            logger.debug("Loaded saga id [{}] of type [{}]", sagaId, loadedSaga.getClass().getName());
        }
        return loadedSaga;
    }
View Full Code Here

                serializedSaga = sqldef.readSerializedSaga(resultSet);
            }
            if (serializedSaga == null) {
                return null;
            }
            Saga loadedSaga = serializer.deserialize(serializedSaga);
            if (injector != null) {
                injector.injectResources(loadedSaga);
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Loaded saga id [{}] of type [{}]", sagaId, loadedSaga.getClass().getName());
            }
            return loadedSaga;
        } catch (SQLException e) {
            throw new SagaStorageException("Exception while loading a Saga", e);
        } finally {
View Full Code Here

TOP

Related Classes of org.axonframework.saga.Saga

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.