Search in sources :

Example 11 with DummyJoynrApplication

use of io.joynr.integration.util.DummyJoynrApplication 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 12 with DummyJoynrApplication

use of io.joynr.integration.util.DummyJoynrApplication 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

DummyJoynrApplication (io.joynr.integration.util.DummyJoynrApplication)12 JoynrInjectorFactory (io.joynr.runtime.JoynrInjectorFactory)10 Module (com.google.inject.Module)9 CCInProcessRuntimeModule (io.joynr.runtime.CCInProcessRuntimeModule)8 AbstractModule (com.google.inject.AbstractModule)4 MqttPahoModule (io.joynr.messaging.mqtt.paho.client.MqttPahoModule)4 Properties (java.util.Properties)4 AtmosphereMessagingModule (io.joynr.messaging.AtmosphereMessagingModule)3 MqttModule (io.joynr.messaging.mqtt.MqttModule)3 TestGlobalAddressModule (io.joynr.messaging.routing.TestGlobalAddressModule)2 After (org.junit.After)2 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)1 RawMessagingPreprocessor (io.joynr.messaging.RawMessagingPreprocessor)1 WebsocketModule (io.joynr.messaging.websocket.WebsocketModule)1 CCWebSocketRuntimeModule (io.joynr.runtime.CCWebSocketRuntimeModule)1 ClusterControllerRuntimeModule (io.joynr.runtime.ClusterControllerRuntimeModule)1 LibjoynrWebSocketRuntimeModule (io.joynr.runtime.LibjoynrWebSocketRuntimeModule)1 Map (java.util.Map)1 EchoProvider (joynr.tests.performance.EchoProvider)1 EchoProxy (joynr.tests.performance.EchoProxy)1