Search in sources :

Example 1 with EchoProxy

use of joynr.tests.performance.EchoProxy in project joynr by bmwcarit.

the class ConsumerApplication method createEchoProxy.

private EchoProxy createEchoProxy() {
    DiscoveryQos discoveryQos = new DiscoveryQos();
    discoveryQos.setDiscoveryTimeoutMs(100000);
    discoveryQos.setCacheMaxAgeMs(Long.MAX_VALUE);
    discoveryQos.setArbitrationStrategy(ArbitrationStrategy.HighestPriority);
    discoveryQos.setDiscoveryScope(invocationParameters.getDiscoveryScope());
    ProxyBuilder<EchoProxy> proxyBuilder = runtime.getProxyBuilder(invocationParameters.getDomainName(), EchoProxy.class);
    return // 1 hour
    proxyBuilder.setMessagingQos(new MessagingQos(3600000)).setDiscoveryQos(discoveryQos).build();
}
Also used : MessagingQos(io.joynr.messaging.MessagingQos) EchoProxy(joynr.tests.performance.EchoProxy) DiscoveryQos(io.joynr.arbitration.DiscoveryQos)

Example 2 with EchoProxy

use of joynr.tests.performance.EchoProxy in project joynr by bmwcarit.

the class ShortCircuitTest method setup.

@Before
public void setup() throws Exception {
    Module runtimeModule = Modules.override(new CCInProcessRuntimeModule()).with(new TestGlobalAddressModule());
    Properties joynrConfig = new Properties();
    DummyJoynrApplication application = (DummyJoynrApplication) new JoynrInjectorFactory(joynrConfig, runtimeModule).createApplication(DummyJoynrApplication.class);
    runtime = application.getRuntime();
    DiscoveryQos discoveryQos = new DiscoveryQos(CONST_DEFAULT_TEST_TIMEOUT, ArbitrationStrategy.HighestPriority, DiscoveryQos.NO_MAX_AGE, DiscoveryScope.LOCAL_ONLY);
    ProxyBuilder<EchoProxy> proxyBuilder = runtime.getProxyBuilder(DOMAIN, EchoProxy.class).setDiscoveryQos(discoveryQos);
    echoProxy = proxyBuilder.build();
    EchoProvider echoProvider = new EchoProviderImpl();
    ProviderQos providerQos = new ProviderQos();
    providerQos.setPriority(System.currentTimeMillis());
    providerQos.setScope(ProviderScope.LOCAL);
    runtime.registerProvider(DOMAIN, echoProvider, providerQos);
    // warmup
    for (int i = 0; i < 100; i++) {
        echoProxy.echoString("warmup");
        echoProxy.echoByteArray(new Byte[1]);
    }
}
Also used : TestGlobalAddressModule(io.joynr.messaging.routing.TestGlobalAddressModule) DummyJoynrApplication(io.joynr.integration.util.DummyJoynrApplication) EchoProvider(joynr.tests.performance.EchoProvider) Properties(java.util.Properties) DiscoveryQos(io.joynr.arbitration.DiscoveryQos) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) Module(com.google.inject.Module) TestGlobalAddressModule(io.joynr.messaging.routing.TestGlobalAddressModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) AbstractModule(com.google.inject.AbstractModule) EchoProxy(joynr.tests.performance.EchoProxy) ProviderQos(joynr.types.ProviderQos) Before(org.junit.Before)

Aggregations

DiscoveryQos (io.joynr.arbitration.DiscoveryQos)2 EchoProxy (joynr.tests.performance.EchoProxy)2 AbstractModule (com.google.inject.AbstractModule)1 Module (com.google.inject.Module)1 DummyJoynrApplication (io.joynr.integration.util.DummyJoynrApplication)1 MessagingQos (io.joynr.messaging.MessagingQos)1 TestGlobalAddressModule (io.joynr.messaging.routing.TestGlobalAddressModule)1 CCInProcessRuntimeModule (io.joynr.runtime.CCInProcessRuntimeModule)1 JoynrInjectorFactory (io.joynr.runtime.JoynrInjectorFactory)1 Properties (java.util.Properties)1 EchoProvider (joynr.tests.performance.EchoProvider)1 ProviderQos (joynr.types.ProviderQos)1 Before (org.junit.Before)1