use of joynr.jeeintegration.servicelocator.MyServiceSync in project joynr by bmwcarit.
the class JeeJoynrServiceLocatorTest method testProxyUnwrapsApplicationException.
@Test(expected = ApplicationException.class)
public void testProxyUnwrapsApplicationException() throws Exception {
reset(myJoynrProxy);
doThrow(new ApplicationException(MyService.CallMeWithExceptionErrorEnum.MY_ERROR)).when(myJoynrProxy).callMeWithException();
MyServiceSync proxy = subject.get(MyServiceSync.class, "local");
proxy.callMeWithException();
}
use of joynr.jeeintegration.servicelocator.MyServiceSync in project joynr by bmwcarit.
the class JeeJoynrServiceLocatorTest method testGet.
@Test
public void testGet() {
MyServiceSync result = subject.get(MyServiceSync.class, "local");
assertNotNull(result);
String callResult = result.callMe("one");
assertNotNull(callResult);
assertEquals("two", callResult);
verify(myJoynrProxy).callMe("one");
}
use of joynr.jeeintegration.servicelocator.MyServiceSync in project joynr by bmwcarit.
the class JeeJoynrServiceLocatorTest method testGetWithTtl.
@Test
public void testGetWithTtl() {
MyServiceSync result = subject.get(MyServiceSync.class, "local", 10000L);
assertNotNull(result);
String callResult = result.callMe("one");
assertNotNull(callResult);
assertEquals("two", callResult);
verify(myJoynrProxy).callMe("one");
ArgumentCaptor<MessagingQos> messagingQosCaptor = ArgumentCaptor.forClass(MessagingQos.class);
verify(proxyBuilder).setMessagingQos(messagingQosCaptor.capture());
MessagingQos messagingQosParam = messagingQosCaptor.getValue();
assertEquals(10000L, messagingQosParam.getRoundTripTtl_ms());
}
use of joynr.jeeintegration.servicelocator.MyServiceSync in project joynr by bmwcarit.
the class JeeJoynrServiceLocatorTest method testGetWithMessagingAndDiscoveryQos.
@Test
public void testGetWithMessagingAndDiscoveryQos() {
MessagingQos messagingQos = new MessagingQos();
DiscoveryQos discoveryQos = new DiscoveryQos();
MyServiceSync result = subject.get(MyServiceSync.class, "local", messagingQos, discoveryQos);
assertNotNull(result);
String callResult = result.callMe("one");
assertNotNull(callResult);
assertEquals("two", callResult);
verify(myJoynrProxy).callMe("one");
verify(proxyBuilder).setMessagingQos(messagingQos);
verify(proxyBuilder).setDiscoveryQos(discoveryQos);
}
use of joynr.jeeintegration.servicelocator.MyServiceSync in project joynr by bmwcarit.
the class JeeJoynrServiceLocatorTest method testGetMultiDomain.
@Test
public void testGetMultiDomain() {
Set<String> domains = Sets.newHashSet("one", "two", "three");
when(joynrRuntime.getProxyBuilder(domains, MyServiceProxy.class)).thenReturn(proxyBuilder);
MyServiceSync result = subject.get(MyServiceSync.class, domains);
assertNotNull(result);
String callResult = result.callMe("one");
assertEquals("two", callResult);
verify(joynrRuntime).getProxyBuilder(domains, MyServiceProxy.class);
}
Aggregations