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();
}
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]);
}
}
Aggregations