Search in sources :

Example 1 with JoynrIntegrationBean

use of io.joynr.jeeintegration.JoynrIntegrationBean 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)

Example 2 with JoynrIntegrationBean

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

the class JoynrIntegrationBeanTest method setup.

@Before
public void setup() {
    when(joynrRuntimeFactory.getInjector()).thenReturn(Guice.createInjector());
    when(joynrRuntimeFactory.create(any())).thenReturn(joynrRuntime);
    when(joynrRuntimeFactory.getLocalDomain()).thenReturn(LOCAL_DOMAIN);
    doAnswer(new Answer<Object>() {

        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            return MyServiceProvider.class;
        }
    }).when(serviceProviderDiscovery).getProviderInterfaceFor(eq(MyServiceSync.class));
    subject = new JoynrIntegrationBean(beanManager, joynrRuntimeFactory, serviceProviderDiscovery);
}
Also used : InvocationOnMock(org.mockito.invocation.InvocationOnMock) JoynrIntegrationBean(io.joynr.jeeintegration.JoynrIntegrationBean) MyServiceSync(joynr.jeeintegration.servicelocator.MyServiceSync) Before(org.junit.Before)

Example 3 with JoynrIntegrationBean

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

the class JeeMessagingEndpointTest method createSubject.

private SubjectData createSubject() {
    SubjectData result = new SubjectData();
    JoynrIntegrationBean joynrIntegrationBean = mock(JoynrIntegrationBean.class);
    result.injector = mock(Injector.class);
    when(joynrIntegrationBean.getJoynrInjector()).thenReturn(result.injector);
    result.objectMapper = mock(ObjectMapper.class);
    when(result.injector.getInstance(ObjectMapper.class)).thenReturn(result.objectMapper);
    result.messageReceiver = mock(ServletMessageReceiver.class);
    when(result.injector.getInstance(ServletMessageReceiver.class)).thenReturn(result.messageReceiver);
    result.subject = new JeeMessagingEndpoint(joynrIntegrationBean);
    return result;
}
Also used : JeeMessagingEndpoint(io.joynr.jeeintegration.messaging.JeeMessagingEndpoint) Injector(com.google.inject.Injector) JoynrIntegrationBean(io.joynr.jeeintegration.JoynrIntegrationBean) ServletMessageReceiver(io.joynr.dispatcher.ServletMessageReceiver) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

JoynrIntegrationBean (io.joynr.jeeintegration.JoynrIntegrationBean)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Injector (com.google.inject.Injector)1 ServletMessageReceiver (io.joynr.dispatcher.ServletMessageReceiver)1 JeeJoynrServiceLocator (io.joynr.jeeintegration.JeeJoynrServiceLocator)1 JeeMessagingEndpoint (io.joynr.jeeintegration.messaging.JeeMessagingEndpoint)1 JoynrRuntime (io.joynr.runtime.JoynrRuntime)1 MyServiceSync (joynr.jeeintegration.servicelocator.MyServiceSync)1 Before (org.junit.Before)1 Test (org.junit.Test)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1