Search in sources :

Example 1 with JeeJoynrServiceLocator

use of io.joynr.jeeintegration.JeeJoynrServiceLocator in project joynr by bmwcarit.

the class JeeJoynrServiceLocatorTest method testGetNoRuntime.

@Test(expected = IllegalStateException.class)
public void testGetNoRuntime() {
    JeeJoynrServiceLocator subject = new JeeJoynrServiceLocator(mock(JoynrIntegrationBean.class));
    subject.get(MyServiceSync.class, "local");
}
Also used : JeeJoynrServiceLocator(io.joynr.jeeintegration.JeeJoynrServiceLocator) JoynrIntegrationBean(io.joynr.jeeintegration.JoynrIntegrationBean) Test(org.junit.Test)

Example 2 with JeeJoynrServiceLocator

use of io.joynr.jeeintegration.JeeJoynrServiceLocator in project joynr by bmwcarit.

the class JeeJoynrServiceLocatorTest method setupSubject.

@Before
public void setupSubject() {
    when(myJoynrProxy.callMe("one")).thenReturn("two");
    when(proxyBuilder.setMessagingQos(Mockito.any())).thenReturn(proxyBuilder);
    when(proxyBuilder.setDiscoveryQos(Mockito.any())).thenReturn(proxyBuilder);
    when(proxyBuilder.build()).thenReturn(myJoynrProxy);
    when(joynrRuntime.getProxyBuilder(Sets.newHashSet("local"), MyServiceProxy.class)).thenReturn(proxyBuilder);
    when(joynrIntegrationBean.getRuntime()).thenReturn(joynrRuntime);
    subject = new JeeJoynrServiceLocator(joynrIntegrationBean);
}
Also used : JeeJoynrServiceLocator(io.joynr.jeeintegration.JeeJoynrServiceLocator) Before(org.junit.Before)

Example 3 with JeeJoynrServiceLocator

use of io.joynr.jeeintegration.JeeJoynrServiceLocator in project joynr by bmwcarit.

the class JeeJoynrServiceLocatorTest method testGetNoProxyAvailable.

@Test(expected = IllegalArgumentException.class)
public void testGetNoProxyAvailable() {
    JoynrRuntime joynrRuntime = mock(JoynrRuntime.class);
    JoynrIntegrationBean joynrIntegrationBean = mock(JoynrIntegrationBean.class);
    when(joynrIntegrationBean.getRuntime()).thenReturn(joynrRuntime);
    JeeJoynrServiceLocator subject = new JeeJoynrServiceLocator(joynrIntegrationBean);
    subject.get(MyInvalidServiceSync.class, "local");
}
Also used : JoynrRuntime(io.joynr.runtime.JoynrRuntime) JeeJoynrServiceLocator(io.joynr.jeeintegration.JeeJoynrServiceLocator) JoynrIntegrationBean(io.joynr.jeeintegration.JoynrIntegrationBean) Test(org.junit.Test)

Aggregations

JeeJoynrServiceLocator (io.joynr.jeeintegration.JeeJoynrServiceLocator)3 JoynrIntegrationBean (io.joynr.jeeintegration.JoynrIntegrationBean)2 Test (org.junit.Test)2 JoynrRuntime (io.joynr.runtime.JoynrRuntime)1 Before (org.junit.Before)1