Package org.axonframework.commandhandling

Examples of org.axonframework.commandhandling.SimpleCommandBus


    @Before
    public void setUp() throws Exception {
        channel1 = createChannel();
        channel2 = createChannel();
        mockCommandBus1 = spy(new SimpleCommandBus());
        mockCommandBus2 = spy(new SimpleCommandBus());
        clusterName = "test-" + new Random().nextInt(Integer.MAX_VALUE);
        connector1 = new JGroupsConnector(channel1, clusterName, mockCommandBus1, new XStreamSerializer());
        connector2 = new JGroupsConnector(channel2, clusterName, mockCommandBus2, new XStreamSerializer());
    }
View Full Code Here


    @Before
    public void setUp() throws Exception {
        channel1 = createChannel();
        channel2 = createChannel();
        mockCommandBus1 = spy(new SimpleCommandBus());
        mockCommandBus2 = spy(new SimpleCommandBus());
        clusterName = "test-" + new Random().nextInt(Integer.MAX_VALUE);
        serializer = spy(new XStreamSerializer());
        connector1 = new JGroupsConnector(channel1, clusterName, mockCommandBus1, serializer);
        connector2 = new JGroupsConnector(channel2, clusterName, mockCommandBus2, serializer);
        gossipRouter = new GossipRouter(12001, "127.0.0.1");
View Full Code Here

        testSubject.setClusterName("ClusterName");
        testSubject.setConfiguration("custom.xml");
        testSubject.setLoadFactor(200);
        XStreamSerializer serializer = new XStreamSerializer();
        testSubject.setSerializer(serializer);
        SimpleCommandBus localSegment = new SimpleCommandBus();
        testSubject.setLocalSegment(localSegment);
        testSubject.setChannelName("localname");
        testSubject.afterPropertiesSet();
        testSubject.start();
        testSubject.getObject();
View Full Code Here

        JChannel channel = new JChannel(
                "org/axonframework/commandhandling/distributed/jgroups/tcp_" + protocol + ".xml");

        connector = new JGroupsConnector(channel,
                                         "testing",
                                         new SimpleCommandBus(),
                                         new XStreamSerializer());
        dcb = new DistributedCommandBus(connector, new RoutingStrategy() {
            @Override
            public String getRoutingKey(CommandMessage<?> command) {
                return command.getPayload().toString();
View Full Code Here

     *
     * @param aggregateType The aggregate to initialize the test fixture for
     */
    public GivenWhenThenTestFixture(Class<T> aggregateType) {
        eventBus = new RecordingEventBus();
        commandBus = new SimpleCommandBus();
        eventStore = new RecordingEventStore();
        FixtureResourceParameterResolverFactory.clear();
        FixtureResourceParameterResolverFactory.registerResource(eventBus);
        FixtureResourceParameterResolverFactory.registerResource(commandBus);
        FixtureResourceParameterResolverFactory.registerResource(eventStore);
View Full Code Here

    private EventSourcingRepository<StubAggregate> repository;
    private EventStore eventStore;

    @Before
    public void setUp() {
        this.commandBus = new SimpleCommandBus();
        this.eventBus = mock(EventBus.class);
        eventStore = mock(EventStore.class);
        this.repository = new EventSourcingRepository<StubAggregate>(StubAggregate.class, eventStore);
        repository.setEventBus(eventBus);
        StubAggregateCommandHandler target = new StubAggregateCommandHandler();
View Full Code Here

  private ScheduledExecutorService scheduledThreadPool;
  private IntervalRetryScheduler retryScheduler;

    @Before
    public void setUp() {
        this.commandBus = new SimpleCommandBus();
        scheduledThreadPool = Executors.newScheduledThreadPool(1);
        retryScheduler = new IntervalRetryScheduler(scheduledThreadPool, 0, 1);
    }
View Full Code Here

    private CommandCallback<Object> expectErrorCallback;

    @Before
    public void setUp() {
        aggregateIdentifier = UUID.randomUUID();
        commandBus = new SimpleCommandBus();
        eventBus = new SimpleEventBus();
        eventStore = spy(new InMemoryEventStore());
        eventStore.appendEvents("CountingAggregate", new SimpleDomainEventStream(
                new GenericDomainEventMessage<AggregateCreatedEvent>(aggregateIdentifier, 0,
                                                                     new AggregateCreatedEvent(aggregateIdentifier),
View Full Code Here

    private EventSourcingRepository<StubAggregate> repository;
    private EventStore eventStore;

    @Before
    public void setUp() {
        this.commandBus = new SimpleCommandBus();
        this.eventBus = spy(new SimpleEventBus());
        eventStore = mock(EventStore.class);
        this.repository = new EventSourcingRepository<StubAggregate>(StubAggregate.class, eventStore);
        repository.setEventBus(eventBus);
        StubAggregateCommandHandler target = new StubAggregateCommandHandler();
View Full Code Here

TOP

Related Classes of org.axonframework.commandhandling.SimpleCommandBus

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.