Search in sources :

Example 11 with JoynrProvider

use of io.joynr.provider.JoynrProvider in project joynr by bmwcarit.

the class ProviderWrapperTest method testInvokeVoidReturnMethod.

@Test
public void testInvokeVoidReturnMethod() throws Throwable {
    ProviderWrapper subject = createSubject();
    JoynrProvider proxy = createProxy(subject);
    Method method = TestServiceProviderInterface.class.getMethod("testServiceMethodVoidReturn");
    Object result = subject.invoke(proxy, method, new Object[0]);
    assertTrue(result instanceof Promise);
}
Also used : Promise(io.joynr.provider.Promise) Method(java.lang.reflect.Method) JoynrProvider(io.joynr.provider.JoynrProvider) ProviderWrapper(io.joynr.jeeintegration.ProviderWrapper) Test(org.junit.Test)

Example 12 with JoynrProvider

use of io.joynr.provider.JoynrProvider 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();
}
Also used : DefaulttestProvider(joynr.tests.DefaulttestProvider) JoynrProvider(io.joynr.provider.JoynrProvider) ProviderQos(joynr.types.ProviderQos) Test(org.junit.Test)

Aggregations

JoynrProvider (io.joynr.provider.JoynrProvider)12 Test (org.junit.Test)12 ProviderWrapper (io.joynr.jeeintegration.ProviderWrapper)11 Method (java.lang.reflect.Method)11 Promise (io.joynr.provider.Promise)6 JoynrException (io.joynr.exceptions.JoynrException)3 PromiseListener (io.joynr.provider.PromiseListener)3 ApplicationException (joynr.exceptions.ApplicationException)1 ProviderRuntimeException (joynr.exceptions.ProviderRuntimeException)1 DefaulttestProvider (joynr.tests.DefaulttestProvider)1 ProviderQos (joynr.types.ProviderQos)1