use of joynr.tests.testTypes.TestEnum in project joynr by bmwcarit.
the class AbstractProviderProxyEnd2EndTest method asyncMethodCallWithEnumListReturned.
@Ignore
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void asyncMethodCallWithEnumListReturned() throws DiscoveryException, JoynrIllegalStateException, InterruptedException {
ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
TestEnum[] enums = proxy.methodWithEnumListReturn(2);
assertArrayEquals(new TestEnum[] { TestEnum.TWO }, enums);
}
use of joynr.tests.testTypes.TestEnum in project joynr by bmwcarit.
the class AbstractProviderProxyEnd2EndTest method testMethodWithNullEnumInputReturnsSomethingSensible.
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void testMethodWithNullEnumInputReturnsSomethingSensible() throws DiscoveryException, JoynrIllegalStateException, InterruptedException {
TestEnum input = null;
ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
int result = proxy.methodWithEnumParameter(input);
assertEquals(42, result);
}
use of joynr.tests.testTypes.TestEnum in project joynr by bmwcarit.
the class AbstractProviderProxyEnd2EndTest method calledMethodReturnsMultipleOutputParametersAsyncFuture.
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void calledMethodReturnsMultipleOutputParametersAsyncFuture() throws Exception {
ProxyBuilder<testProxy> proxyBuilder = consumerRuntime.getProxyBuilder(domain, testProxy.class);
testProxy proxy = proxyBuilder.setMessagingQos(messagingQos).setDiscoveryQos(discoveryQos).build();
Future<MethodWithMultipleOutputParametersReturned> future = proxy.methodWithMultipleOutputParameters(new MethodWithMultipleOutputParametersCallback() {
@Override
public void onFailure(JoynrRuntimeException error) {
logger.error("error in calledMethodReturnsMultipleOutputParametersAsyncCallback", error);
}
@Override
public void onSuccess(String aString, Integer aNumber, GpsLocation aComplexDataType, TestEnum anEnumResult) {
assertEquals(TEST_INTEGER, aNumber);
assertEquals(TEST_STRING, aString);
assertEquals(TEST_COMPLEXTYPE, aComplexDataType);
assertEquals(TEST_ENUM, anEnumResult);
}
});
MethodWithMultipleOutputParametersReturned reply = future.get();
assertEquals(TEST_INTEGER, reply.aNumber);
assertEquals(TEST_STRING, reply.aString);
assertEquals(TEST_COMPLEXTYPE, reply.aComplexDataType);
assertEquals(TEST_ENUM, reply.anEnumResult);
}
use of joynr.tests.testTypes.TestEnum in project joynr by bmwcarit.
the class SerializationTest method serializeEnumTest.
@Test
public void serializeEnumTest() throws Exception {
String valueAsString = objectMapper.writeValueAsString(TestEnum.TWO);
System.out.println(valueAsString);
TestEnum readValue = objectMapper.readValue(valueAsString, TestEnum.class);
assertEquals(TestEnum.TWO, readValue);
}
use of joynr.tests.testTypes.TestEnum in project joynr by bmwcarit.
the class AbstractBroadcastEnd2EndTest method subscribeToBroadcastWithEnumOutput.
@Ignore
@Test(timeout = CONST_DEFAULT_TEST_TIMEOUT)
public void subscribeToBroadcastWithEnumOutput() throws InterruptedException {
final Semaphore broadcastReceived = new Semaphore(0);
final TestEnum expectedTestEnum = TestEnum.TWO;
proxy.subscribeToBroadcastWithEnumOutputBroadcast(new testBroadcastInterface.BroadcastWithEnumOutputBroadcastAdapter() {
@Override
public void onReceive(TestEnum testEnum) {
assertEquals(expectedTestEnum, testEnum);
broadcastReceived.release();
}
@Override
public void onError(SubscriptionException error) {
fail("Error subscribing to broadcast");
}
}, new MulticastSubscriptionQos());
Thread.sleep(300);
provider.fireBroadcastWithEnumOutput(expectedTestEnum);
broadcastReceived.acquire();
}
Aggregations