Search in sources :

Example 1 with InMemoryStorageFactory

use of io.spine.server.storage.memory.InMemoryStorageFactory in project core-java by SpineEventEngine.

the class AbstractCommandBusTestSuite method setUp.

@Before
public void setUp() {
    final InMemoryStorageFactory storageFactory = InMemoryStorageFactory.getInstance(this.multitenant);
    final TenantIndex tenantIndex = TenantAwareTest.createTenantIndex(this.multitenant, storageFactory);
    commandStore = spy(new CommandStore(storageFactory, tenantIndex));
    scheduler = spy(new ExecutorCommandScheduler());
    log = spy(new Log());
    failureBus = spy(FailureBus.newBuilder().build());
    commandBus = CommandBus.newBuilder().setMultitenant(this.multitenant).setCommandStore(commandStore).setCommandScheduler(scheduler).setFailureBus(failureBus).setThreadSpawnAllowed(false).setLog(log).setAutoReschedule(false).build();
    eventBus = EventBus.newBuilder().setStorageFactory(storageFactory).build();
    requestFactory = this.multitenant ? TestActorRequestFactory.newInstance(getClass(), newTenantUuid()) : TestActorRequestFactory.newInstance(getClass());
    createProjectHandler = new CreateProjectHandler();
    responseObserver = new TestResponseObserver();
}
Also used : ExecutorCommandScheduler(io.spine.server.commandbus.ExecutorCommandScheduler) TestResponseObserver(io.spine.server.commandbus.TestResponseObserver) Log(io.spine.server.commandbus.Log) InMemoryStorageFactory(io.spine.server.storage.memory.InMemoryStorageFactory) CommandStore(io.spine.server.commandstore.CommandStore) TenantIndex(io.spine.server.tenant.TenantIndex) Before(org.junit.Before)

Example 2 with InMemoryStorageFactory

use of io.spine.server.storage.memory.InMemoryStorageFactory in project core-java by SpineEventEngine.

the class StorageFactorySwitchShould method return_InMemoryStorageFactory_in_tests_if_tests_supplier_was_not_set.

@Test
public void return_InMemoryStorageFactory_in_tests_if_tests_supplier_was_not_set() {
    final StorageFactory storageFactory = storageFactorySwitch.get();
    assertNotNull(storageFactory);
    assertTrue(storageFactory instanceof InMemoryStorageFactory);
}
Also used : StorageFactory(io.spine.server.storage.StorageFactory) InMemoryStorageFactory(io.spine.server.storage.memory.InMemoryStorageFactory) InMemoryStorageFactory(io.spine.server.storage.memory.InMemoryStorageFactory) Test(org.junit.Test)

Example 3 with InMemoryStorageFactory

use of io.spine.server.storage.memory.InMemoryStorageFactory in project core-java by SpineEventEngine.

the class CommandBusBuilderShould method setUp.

@Before
public void setUp() {
    final boolean multitenant = true;
    final InMemoryStorageFactory storageFactory = InMemoryStorageFactory.getInstance(multitenant);
    final TenantIndex tenantIndex = TenantAwareTest.createTenantIndex(multitenant, storageFactory);
    commandStore = new CommandStore(storageFactory, tenantIndex);
}
Also used : InMemoryStorageFactory(io.spine.server.storage.memory.InMemoryStorageFactory) CommandStore(io.spine.server.commandstore.CommandStore) TenantIndex(io.spine.server.tenant.TenantIndex) Before(org.junit.Before)

Aggregations

InMemoryStorageFactory (io.spine.server.storage.memory.InMemoryStorageFactory)3 CommandStore (io.spine.server.commandstore.CommandStore)2 TenantIndex (io.spine.server.tenant.TenantIndex)2 Before (org.junit.Before)2 ExecutorCommandScheduler (io.spine.server.commandbus.ExecutorCommandScheduler)1 Log (io.spine.server.commandbus.Log)1 TestResponseObserver (io.spine.server.commandbus.TestResponseObserver)1 StorageFactory (io.spine.server.storage.StorageFactory)1 Test (org.junit.Test)1