Examples of StubDomainEvent


Examples of org.axonframework.domain.StubDomainEvent

        assertTrue(postProcessedBean instanceof EventListener);
        assertTrue(postProcessedBean instanceof SyncEventListener);

        EventListener eventListener = (EventListener) postProcessedBean;
        SyncEventListener annotatedEventListener = (SyncEventListener) postProcessedBean;
        StubDomainEvent domainEvent = new StubDomainEvent();
        eventListener.handle(new GenericEventMessage<StubDomainEvent>(domainEvent));

        assertEquals(1, annotatedEventListener.getInvocationCount());
    }
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

        testSubject = new StubEntity();
    }

    @Test
    public void testRecursivelyApplyEvent() {
        testSubject.handleRecursively(domainEvent(new StubDomainEvent()));
        assertEquals(1, testSubject.invocationCount);
        testSubject.handleRecursively(domainEvent(new StubDomainEvent()));
        assertEquals(2, testSubject.invocationCount);
        assertEquals(1, testSubject.child.invocationCount);
    }
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

    @Test
    public void testApplyDelegatesToAggregateRoot() {
        AbstractEventSourcedAggregateRoot aggregateRoot = mock(AbstractEventSourcedAggregateRoot.class);
        testSubject.registerAggregateRoot(aggregateRoot);
        StubDomainEvent event = new StubDomainEvent();
        testSubject.apply(event);
        verify(aggregateRoot).apply(event, MetaData.emptyInstance());
    }
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

        verify(mockTransactionManager, times(3)).commitTransaction(any());
    }

    @Test
    public void testEventProcessingDelayed_ScheduledExecutorService() {
        EventMessage<? extends StubDomainEvent> event1 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
        EventMessage<? extends StubDomainEvent> event2 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
        final EventListener listener = mock(EventListener.class);
        ScheduledExecutorService mockExecutorService = mock(ScheduledExecutorService.class);
        testSubject = new EventProcessor(mockExecutorService, new NullShutdownCallback(),
                                         new DefaultErrorHandler(RetryPolicy.retryAfter(500, TimeUnit.MILLISECONDS)),
                                         new DefaultUnitOfWorkFactory(mockTransactionManager),
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

        inOrder.verify(mockTransactionManager).commitTransaction(any());
    }

    @Test
    public void testEventProcessingDelayed_ExecutorDoesNotSupportScheduling() {
        EventMessage<? extends StubDomainEvent> event1 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
        EventMessage<? extends StubDomainEvent> event2 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
        final EventListener listener = mock(EventListener.class);
        ExecutorService mockExecutorService = mock(ExecutorService.class);
        testSubject = new EventProcessor(mockExecutorService, new NullShutdownCallback(),
                                         new DefaultErrorHandler(RetryPolicy.retryAfter(500, TimeUnit.MILLISECONDS)),
                                         new DefaultUnitOfWorkFactory(mockTransactionManager),
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

    /**
     * This test verifies issue #15 (http://code.google.com/p/axonframework/issues/detail?id=15)
     */
    @Test
    public void testEventProcessingRetried_TransactionStartupFails() {
        EventMessage<? extends StubDomainEvent> event1 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
        EventMessage<? extends StubDomainEvent> event2 = new GenericEventMessage<StubDomainEvent>(new StubDomainEvent());
        final EventListener listener = mock(EventListener.class);
        ExecutorService mockExecutorService = mock(ExecutorService.class);
        testSubject = new EventProcessor(mockExecutorService, new NullShutdownCallback(),
                                         new DefaultErrorHandler(RetryPolicy.retryAfter(500, TimeUnit.MILLISECONDS)),
                                         new DefaultUnitOfWorkFactory(mockTransactionManager),
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

                                         new DefaultErrorHandler(policy),
                                         new DefaultUnitOfWorkFactory(mockTransactionManager),
                                         Collections.<EventListener>singleton(listener),
                                         multiplexingEventProcessingMonitor);
        doNothing().doThrow(new RejectedExecutionException()).when(mockExecutorService).execute(isA(Runnable.class));
        testSubject.scheduleEvent(new GenericEventMessage<StubDomainEvent>(new StubDomainEvent()));
        listener.failOnEvent = 2;
        testSubject.scheduleEvent(new GenericEventMessage<StubDomainEvent>(new StubDomainEvent()));
        testSubject.scheduleEvent(new GenericEventMessage<StubDomainEvent>(new StubDomainEvent()));

        testSubject.run();
        return listener;
    }
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

    public JpaEventSourcedAggregate(String identifier) {
        this.identifier = identifier;
    }

    public void increaseCounter() {
        apply(new StubDomainEvent());
    }
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

        assertNotNull(testSubject.getIdentifier());
        assertEquals(0, testSubject.getUncommittedEventCount());
        assertEquals(null, testSubject.getVersion());

        testSubject.apply(new StubDomainEvent());

        assertEquals(1, testSubject.getInvocationCount());
        assertEquals(1, testSubject.getUncommittedEventCount());
        assertEquals(1, testSubject.getSimpleEntity().getInvocationCount());
        assertEquals(1, testSubject.getSimpleEntityList().get(0).getInvocationCount());
View Full Code Here

Examples of org.axonframework.domain.StubDomainEvent

        public int getInvocationCount() {
            return invocationCount;
        }

        public void applyEvent() {
            apply(new StubDomainEvent());
        }
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.