Search in sources :

Example 1 with ConfigurationManagerImpl

use of io.zeebe.broker.system.ConfigurationManagerImpl in project zeebe by zeebe-io.

the class ConfigurationRule method starting.

@Override
protected void starting(final Description description) {
    super.starting(description);
    final ConfigurationFile annotation = description.getAnnotation(ConfigurationFile.class);
    if (annotation != null) {
        final String fileName = annotation.value();
        final InputStream configurationStream = description.getTestClass().getClassLoader().getResourceAsStream(fileName);
        configurationManager = new ConfigurationManagerImpl(configurationStream);
    }
}
Also used : InputStream(java.io.InputStream) ConfigurationManagerImpl(io.zeebe.broker.system.ConfigurationManagerImpl)

Example 2 with ConfigurationManagerImpl

use of io.zeebe.broker.system.ConfigurationManagerImpl in project zeebe by zeebe-io.

the class ConfigurationDirectoryTest method before.

@Before
public void before() {
    final String configuration = scenario.getConfiguration();
    final InputStream is = ConfigurationDirectoryTest.class.getClassLoader().getResourceAsStream(configuration);
    configurationManager = new ConfigurationManagerImpl(is);
}
Also used : InputStream(java.io.InputStream) ConfigurationManagerImpl(io.zeebe.broker.system.ConfigurationManagerImpl) Before(org.junit.Before)

Example 3 with ConfigurationManagerImpl

use of io.zeebe.broker.system.ConfigurationManagerImpl in project zeebe by zeebe-io.

the class BrokerTest method shouldCreateBrokerWithConfigurationManager.

/**
 * This tests the constructor that takes a {@link ConfigurationManager} instance.
 * This is used in the Spring integration.
 */
@Test
public void shouldCreateBrokerWithConfigurationManager() {
    final InputStream configStream = BrokerTest.class.getClassLoader().getResourceAsStream("zeebe.unit-test.cfg.toml");
    final ConfigurationManager configurationManager = new ConfigurationManagerImpl(configStream);
    // when
    broker = new Broker(configurationManager);
    // then I can register a dependency to a broker service successfully
    final ActorFuture<Void> future = broker.getBrokerContext().getServiceContainer().createService(ServiceName.newServiceName("foo", Object.class), new Service<Object>() {

        @Override
        public void start(ServiceStartContext startContext) {
        }

        @Override
        public void stop(ServiceStopContext stopContext) {
        }

        @Override
        public Object get() {
            return null;
        }
    }).dependency(ClusterServiceNames.CLUSTER_MANAGER_SERVICE).install();
    waitUntil(future::isDone);
    assertThat(future).isDone();
}
Also used : ServiceStartContext(io.zeebe.servicecontainer.ServiceStartContext) InputStream(java.io.InputStream) ConfigurationManagerImpl(io.zeebe.broker.system.ConfigurationManagerImpl) ServiceStopContext(io.zeebe.servicecontainer.ServiceStopContext) ConfigurationManager(io.zeebe.broker.system.ConfigurationManager) Test(org.junit.Test)

Aggregations

ConfigurationManagerImpl (io.zeebe.broker.system.ConfigurationManagerImpl)3 InputStream (java.io.InputStream)3 ConfigurationManager (io.zeebe.broker.system.ConfigurationManager)1 ServiceStartContext (io.zeebe.servicecontainer.ServiceStartContext)1 ServiceStopContext (io.zeebe.servicecontainer.ServiceStopContext)1 Before (org.junit.Before)1 Test (org.junit.Test)1