use of joynr.tests.performance.EchoProvider 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