Package org.axonframework.domain

Examples of org.axonframework.domain.GenericEventMessage


        member = mock(AsyncEventListener.class);
    }

    @Test
    public void testMonitorConfirmsImmediateOnUnregisteredEvent() throws Exception {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"));
        testSubject.onEventProcessingCompleted(messages);

        verify(mockMonitor).onEventProcessingCompleted(messages);
    }
View Full Code Here


        verify(mockMonitor).onEventProcessingCompleted(messages);
    }

    @Test
    public void testMonitorReportsFailureImmediateOnUnregisteredEvent() throws Exception {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"));
        final RuntimeException cause = new RuntimeException();
        testSubject.onEventProcessingFailed(messages, cause);

        verify(mockMonitor).onEventProcessingFailed(messages, cause);
    }
View Full Code Here

        verify(mockMonitor).onEventProcessingFailed(messages, cause);
    }

    @Test
    public void testMonitorConfirmsOnOnlyDirectInvocations() {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"));
        testSubject.prepare(messages.get(0));
        testSubject.onEventProcessingCompleted(messages);

        verify(mockMonitor).onEventProcessingCompleted(messages);
    }
View Full Code Here

        verify(mockMonitor).onEventProcessingCompleted(messages);
    }

    @Test
    public void testMonitorReportsFailureOnOnlyDirectInvocations() throws Exception {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"));
        final RuntimeException cause = new RuntimeException();
        testSubject.prepare(messages.get(0));
        testSubject.onEventProcessingFailed(messages, cause);

        verify(mockMonitor).onEventProcessingFailed(messages, cause);
View Full Code Here

        verify(mockMonitor).onEventProcessingFailed(messages, cause);
    }

    @Test
    public void testMonitorConfirmsWhenAllAsyncRequestsConfirm() {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"));
        testSubject.prepare(messages.get(0));
        testSubject.prepareForInvocation(messages.get(0), member);
        testSubject.prepareForInvocation(messages.get(0), member);
        testSubject.prepareForInvocation(messages.get(0), member);
        testSubject.onEventProcessingCompleted(messages);
View Full Code Here

        verify(mockMonitor).onEventProcessingCompleted(messages);
    }

    @Test
    public void testMonitorReportsFailureWhenAllAsyncRequestsFail() {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"));
        final RuntimeException cause = new RuntimeException();

        testSubject.prepare(messages.get(0));
        testSubject.prepareForInvocation(messages.get(0), member);
        testSubject.prepareForInvocation(messages.get(0), member);
View Full Code Here

        verify(mockMonitor, never()).onEventProcessingCompleted(isA(List.class));
    }

    @Test
    public void testMonitorReportsFailureWhenOnlyOneAsyncRequestsFails() {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"));
        final RuntimeException cause = new RuntimeException();

        testSubject.prepare(messages.get(0));
        testSubject.prepareForInvocation(messages.get(0), member);
        testSubject.prepareForInvocation(messages.get(0), member);
View Full Code Here

        verify(mockMonitor, never()).onEventProcessingCompleted(isA(List.class));
    }

    @Test
    public void testMonitorReportsFailureWhenOnlyOneAsyncRequestsFails_Batched() {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"),
                                                                 new GenericEventMessage("test2"));
        final RuntimeException cause = new RuntimeException();

        testSubject.prepare(messages.get(0));
        testSubject.prepare(messages.get(1));
        testSubject.prepareForInvocation(messages.get(0), member);
View Full Code Here

        verify(mockMonitor).onEventProcessingCompleted(messages.subList(1, 2));
    }

    @Test
    public void testMonitorReportsFailureWhenOnlyAllAsyncMessagesFail_Batched() {
        final List<GenericEventMessage> messages = Arrays.asList(new GenericEventMessage("test"),
                                                                 new GenericEventMessage("test2"));
        final RuntimeException cause = new RuntimeException();

        testSubject.prepare(messages.get(0));
        testSubject.prepare(messages.get(1));
        testSubject.prepareForInvocation(messages.get(0), member);
View Full Code Here

        verify(mockMonitor).onEventProcessingFailed(messages, cause);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testPreparingForEventIsRequiredBeforeRegisteringAsyncInvocation() {
        testSubject.prepareForInvocation(new GenericEventMessage("test"), member);
    }
View Full Code Here

TOP

Related Classes of org.axonframework.domain.GenericEventMessage

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.