Examples of UpdateStubAggregateCommand


Examples of org.axonframework.integrationtests.commandhandling.UpdateStubAggregateCommand

                        throw new RuntimeException(e);
                    }
                    for (int t = 0; t < COMMAND_PER_THREAD_COUNT; t++) {
                        commandBus.dispatch(asCommandMessage(new ProblematicCommand(aggregateId)),
                                SilentCallback.INSTANCE);
                        commandBus.dispatch(asCommandMessage(new UpdateStubAggregateCommand(aggregateId)),
                                new VoidCallback() {
                                    @Override
                                    protected void onSuccess() {
                                        successCounter.incrementAndGet();
                                    }

                                    @Override
                                    public void onFailure(Throwable cause) {
                                        failCounter.incrementAndGet();
                                    }
                                });
                    }
                    cdl.countDown();
                }
            });
            thread.setUncaughtExceptionHandler(ConcurrentModificationTest_OptimisticLocking.this);
            thread.start();
        }
        starter.countDown();
        cdl.await((THREAD_COUNT * COMMAND_PER_THREAD_COUNT) / 4, TimeUnit.SECONDS);
        if (uncaughtExceptions.size() > 0) {
            System.out.println("*** Uncaught Exceptions ***");
            for (Throwable uncaught : uncaughtExceptions) {
                uncaught.printStackTrace();
            }
        }
        assertEquals("Got exceptions", 0, uncaughtExceptions.size());
        assertEquals(successCounter.get() + 1, registeringEventHandler.getCapturedEvents().size());
        assertEquals(THREAD_COUNT * COMMAND_PER_THREAD_COUNT, successCounter.get(), failCounter.get());

        reportOutOfSyncEvents();

        logger.info("Results: {} successful, {} failed.", successCounter.get(), failCounter.get());

        // to prove that all locks are properly cleared, this command must succeed.
        commandBus.dispatch(asCommandMessage(new UpdateStubAggregateCommand(aggregateId)), new VoidCallback() {
            @Override
            protected void onSuccess() {

            }

View Full Code Here

Examples of org.axonframework.integrationtests.commandhandling.UpdateStubAggregateCommand

        for (int t = 0; t < 30; t++) {
            results.add(service.submit(new Runnable() {
                @Override
                public void run() {
                    try {
                        commandBus.dispatch(asCommandMessage(new UpdateStubAggregateCommand(aggregateId)));
                        commandBus.dispatch(asCommandMessage(new ProblematicCommand(aggregateId)),
                                            SilentCallback.INSTANCE);
                        commandBus.dispatch(asCommandMessage(new LoopingCommand(aggregateId)));
                        counter.incrementAndGet();
                    } catch (Exception ex) {
View Full Code Here

Examples of org.axonframework.integrationtests.commandhandling.UpdateStubAggregateCommand

    private CommandBus commandBus;

    @EventHandler
    public void handleLoopingEvent(LoopingChangeDoneEvent event) {
        commandBus.dispatch(asCommandMessage(new UpdateStubAggregateCommand(event.getAggregateIdentifier())));
    }
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.