use of joynr.types.ProviderQos in project joynr by bmwcarit.
the class RoutingTableOverwriteEnd2EndTest method createProviderQos.
protected ProviderQos createProviderQos() {
final ProviderQos providerQos = new ProviderQos();
providerQos.setScope(ProviderScope.GLOBAL);
providerQos.setPriority(System.currentTimeMillis());
return providerQos;
}
use of joynr.types.ProviderQos 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());
}
use of joynr.types.ProviderQos in project joynr by bmwcarit.
the class ShutdownTest method unregisterMultibleProvidersBeforeShutdown.
@Test
public void unregisterMultibleProvidersBeforeShutdown() throws JoynrWaitExpiredException, JoynrRuntimeException, InterruptedException, ApplicationException {
int providercount = 10;
JoynrProvider[] providers = new JoynrProvider[providercount];
for (int i = 0; i < providers.length; i++) {
providerQos = new ProviderQos();
providerQos.setScope(ProviderScope.LOCAL);
providerQos.setPriority(System.currentTimeMillis());
providers[i] = new DefaulttestProvider();
Future<Void> registerFinished = dummyApplication.getRuntime().registerProvider("ShutdownTestdomain" + i, providers[i], providerQos);
registerFinished.get();
}
for (int i = 0; i < providers.length; i++) {
dummyApplication.getRuntime().unregisterProvider("ShutdownTestdomain" + i, providers[i]);
}
dummyApplication.shutdown();
}
use of joynr.types.ProviderQos in project joynr by bmwcarit.
the class ProxyErrorsTest method setUp.
@Before
public void setUp() {
// the error callback and NoCompatibleProviderFoundException will each increment the permits.
// The test will wait until 2 permits are available, or fail in the junit test timeout time.
waitOnExceptionAndErrorCallbackSemaphore = new Semaphore(-1, true);
domain = "domain-" + UUID.randomUUID().toString();
domain2 = "domain2-" + UUID.randomUUID().toString();
Properties joynrConfig = new Properties();
joynrConfig.setProperty(MessagingPropertyKeys.CHANNELID, "discoverydirectory_channelid");
// provider and proxy using same runtime to allow local-only communications
runtime = getRuntime(joynrConfig);
ProviderQos providerQos = new ProviderQos();
providerQos.setScope(ProviderScope.LOCAL);
runtime.registerProvider(domain, provider, providerQos);
runtime.registerProvider(domain2, provider, providerQos);
discoveryQos = new DiscoveryQos();
discoveryQos.setDiscoveryScope(DiscoveryScope.LOCAL_ONLY);
discoveryQos.setDiscoveryTimeoutMs(1000);
discoveryQos.setRetryIntervalMs(100);
callback = new ProxyCreatedCallback<ProxyErrorsTest.TestProxyWrongVersion>() {
@Override
public void onProxyCreationFinished(TestProxyWrongVersion result) {
fail("proxy creation should fail with a version exception");
}
@Override
public void onProxyCreationError(JoynrRuntimeException error) {
// adds 1 of 2 permits to the semaphore. The other is provided when the exception is caught
waitOnExceptionAndErrorCallbackSemaphore.release();
}
};
}
use of joynr.types.ProviderQos in project joynr by bmwcarit.
the class AbstractSSLEnd2EndTest method setup.
@Before
public void setup() throws Exception {
MockitoAnnotations.initMocks(this);
String methodName = name.getMethodName();
logger.info("{} setup beginning...", methodName);
domain = "SSLEnd2EndTest." + methodName + System.currentTimeMillis();
provisionPermissiveAccessControlEntry(domain, ProviderAnnotations.getInterfaceName(DefaulttestProvider.class));
// use channelNames = test name
String channelIdProvider = "JavaTest-" + methodName + UUID.randomUUID().getLeastSignificantBits() + "-end2endTestProvider";
String channelIdConsumer = "JavaTest-" + methodName + UUID.randomUUID().getLeastSignificantBits() + "-end2endConsumer";
Properties joynrConfigProvider = PropertyLoader.loadProperties("testMessaging.properties");
joynrConfigProvider.put(AbstractJoynrApplication.PROPERTY_JOYNR_DOMAIN_LOCAL, "localdomain." + UUID.randomUUID().toString());
joynrConfigProvider.put(MessagingPropertyKeys.CHANNELID, channelIdProvider);
joynrConfigProvider.put(MessagingPropertyKeys.RECEIVERID, UUID.randomUUID().toString());
providerRuntime = getRuntime(joynrConfigProvider, new StaticDomainAccessControlProvisioningModule());
Properties joynrConfigConsumer = PropertyLoader.loadProperties("testMessaging.properties");
joynrConfigConsumer.put(AbstractJoynrApplication.PROPERTY_JOYNR_DOMAIN_LOCAL, "localdomain." + UUID.randomUUID().toString());
joynrConfigConsumer.put(MessagingPropertyKeys.CHANNELID, channelIdConsumer);
joynrConfigConsumer.put(MessagingPropertyKeys.RECEIVERID, UUID.randomUUID().toString());
consumerRuntime = getRuntime(joynrConfigConsumer);
provider = new DefaulttestProvider();
ProviderQos providerQos = new ProviderQos();
providerRuntime.registerProvider(domain, provider, providerQos);
messagingQos = new MessagingQos(5000);
discoveryQos = new DiscoveryQos(5000, ArbitrationStrategy.HighestPriority, Long.MAX_VALUE);
// Make sure the channel is created before the first messages sent.
Thread.sleep(200);
logger.info("setup finished");
}
Aggregations