Search in sources :

Example 21 with JoynrInjectorFactory

use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.

the class ShutdownTest method setup.

@Before
public void setup() {
    Properties factoryPropertiesProvider = new Properties();
    factoryPropertiesProvider.put(AbstractJoynrApplication.PROPERTY_JOYNR_DOMAIN_LOCAL, "localdomain");
    factoryPropertiesProvider.put(MessagingPropertyKeys.CHANNELID, "ShutdownTestChannelId");
    MockitoAnnotations.initMocks(this);
    Module runtimeModule = Modules.override(new CCInProcessRuntimeModule()).with(new TestGlobalAddressModule());
    dummyApplication = (DummyJoynrApplication) new JoynrInjectorFactory(factoryPropertiesProvider, runtimeModule).createApplication(DummyJoynrApplication.class);
    provider = new DefaulttestProvider();
    providerQos = new ProviderQos();
    providerQos.setScope(ProviderScope.LOCAL);
    providerQos.setPriority(System.currentTimeMillis());
}
Also used : TestGlobalAddressModule(io.joynr.messaging.routing.TestGlobalAddressModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) DefaulttestProvider(joynr.tests.DefaulttestProvider) Properties(java.util.Properties) Module(com.google.inject.Module) TestGlobalAddressModule(io.joynr.messaging.routing.TestGlobalAddressModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) ProviderQos(joynr.types.ProviderQos) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory) Before(org.junit.Before)

Example 22 with JoynrInjectorFactory

use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.

the class SSLEnd2EndTest method getRuntime.

@Override
protected JoynrRuntime getRuntime(Properties joynrConfig, Module... modules) {
    DummyJoynrApplication application = (DummyJoynrApplication) new JoynrInjectorFactory(joynrConfig, modules).createApplication(DummyJoynrApplication.class);
    dummyApplications.add(application);
    return application.getRuntime();
}
Also used : DummyJoynrApplication(io.joynr.integration.util.DummyJoynrApplication) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 23 with JoynrInjectorFactory

use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.

the class HTTPProviderProxyEnd2EndTest method getRuntime.

@Override
protected JoynrRuntime getRuntime(Properties joynrConfig, Module... modules) {
    Module runtimeModule = Modules.override(new CCInProcessRuntimeModule()).with(new AtmosphereMessagingModule());
    Module modulesWithRuntime = Modules.override(modules).with(runtimeModule);
    DummyJoynrApplication application = (DummyJoynrApplication) new JoynrInjectorFactory(joynrConfig, modulesWithRuntime).createApplication(DummyJoynrApplication.class);
    return application.getRuntime();
}
Also used : DummyJoynrApplication(io.joynr.integration.util.DummyJoynrApplication) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) Module(com.google.inject.Module) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 24 with JoynrInjectorFactory

use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.

the class WebSocketProviderProxyEnd2EndTest method getRuntime.

@Override
protected JoynrRuntime getRuntime(final Properties joynrConfig, final Module... modules) {
    if (ccJoynrRuntime == null) {
        ccJoynrRuntime = createClusterController(webSocketConfig);
        createdRuntimes.add(ccJoynrRuntime);
    }
    joynrConfig.putAll(webSocketConfig);
    joynrConfig.putAll(baseTestConfig);
    joynrConfig.setProperty(ConfigurableMessagingSettings.PROPERTY_CC_CONNECTION_TYPE, "WEBSOCKET");
    Module modulesWithRuntime = Modules.override(modules).with(Modules.override(new LibjoynrWebSocketRuntimeModule()).with(new AbstractModule() {

        @Override
        protected void configure() {
            // shorten reconnect delay to speed up tests
            bind(long.class).annotatedWith(Names.named(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_RECONNECT_DELAY)).toInstance(100L);
        }
    }));
    DummyJoynrApplication application = (DummyJoynrApplication) new JoynrInjectorFactory(joynrConfig, modulesWithRuntime).createApplication(DummyJoynrApplication.class);
    return application.getRuntime();
}
Also used : LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) DummyJoynrApplication(io.joynr.integration.util.DummyJoynrApplication) Module(com.google.inject.Module) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) WebsocketModule(io.joynr.messaging.websocket.WebsocketModule) AbstractModule(com.google.inject.AbstractModule) AbstractModule(com.google.inject.AbstractModule) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 25 with JoynrInjectorFactory

use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.

the class AccessControllerEnd2EndTest method createRuntime.

private JoynrRuntime createRuntime() {
    Properties properties = new Properties();
    properties.put(MqttModule.PROPERTY_KEY_MQTT_BROKER_URI, "tcp://localhost:1883");
    properties.put(MessagingPropertyKeys.PROPERTY_MESSAGING_PRIMARYGLOBALTRANSPORT, "mqtt");
    Module module = Modules.override(new CCInProcessRuntimeModule()).with(new AbstractModule() {

        @Override
        protected void configure() {
            bindConstant().annotatedWith(Names.named(ClusterControllerRuntimeModule.PROPERTY_ACCESSCONTROL_ENABLE)).to(true);
        }
    }, new MqttPahoModule());
    DummyJoynrApplication app = (DummyJoynrApplication) new JoynrInjectorFactory(properties, module).createApplication(DummyJoynrApplication.class);
    return app.getRuntime();
}
Also used : DummyJoynrApplication(io.joynr.integration.util.DummyJoynrApplication) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) Properties(java.util.Properties) Module(com.google.inject.Module) MqttModule(io.joynr.messaging.mqtt.MqttModule) ClusterControllerRuntimeModule(io.joynr.runtime.ClusterControllerRuntimeModule) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) AbstractModule(com.google.inject.AbstractModule) AbstractModule(com.google.inject.AbstractModule) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Aggregations

JoynrInjectorFactory (io.joynr.runtime.JoynrInjectorFactory)31 Module (com.google.inject.Module)22 CCInProcessRuntimeModule (io.joynr.runtime.CCInProcessRuntimeModule)21 Properties (java.util.Properties)20 MqttPahoModule (io.joynr.messaging.mqtt.paho.client.MqttPahoModule)11 AbstractJoynrApplication (io.joynr.runtime.AbstractJoynrApplication)11 JoynrApplication (io.joynr.runtime.JoynrApplication)11 JoynrApplicationModule (io.joynr.runtime.JoynrApplicationModule)11 DummyJoynrApplication (io.joynr.integration.util.DummyJoynrApplication)10 AtmosphereMessagingModule (io.joynr.messaging.AtmosphereMessagingModule)10 LibjoynrWebSocketRuntimeModule (io.joynr.runtime.LibjoynrWebSocketRuntimeModule)10 WebsocketModule (io.joynr.messaging.websocket.WebsocketModule)9 AbstractModule (com.google.inject.AbstractModule)7 StaticDomainAccessControlProvisioningModule (io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule)7 CCWebSocketRuntimeModule (io.joynr.runtime.CCWebSocketRuntimeModule)7 Injector (com.google.inject.Injector)5 TestGlobalAddressModule (io.joynr.messaging.routing.TestGlobalAddressModule)5 JoynrRuntime (io.joynr.runtime.JoynrRuntime)5 MqttModule (io.joynr.messaging.mqtt.MqttModule)3 ClusterControllerRuntime (io.joynr.runtime.ClusterControllerRuntime)3