Search in sources :

Example 51 with Version

use of joynr.types.Version in project joynr by bmwcarit.

the class VersionCompatibilityCheckerTest method testCallerWithHigherMinorVersionIncompatible.

@Test
public void testCallerWithHigherMinorVersionIncompatible() {
    Version caller = new Version(1, 2);
    Version provider = new Version(1, 0);
    boolean result = subject.check(caller, provider);
    assertFalse(result);
}
Also used : Version(joynr.types.Version) Test(org.junit.Test)

Example 52 with Version

use of joynr.types.Version in project joynr by bmwcarit.

the class VersionCompatibilityCheckerTest method testCallerIsNull.

@Test(expected = IllegalArgumentException.class)
public void testCallerIsNull() {
    Version caller = null;
    Version provider = new Version(0, 0);
    subject.check(caller, provider);
}
Also used : Version(joynr.types.Version) Test(org.junit.Test)

Example 53 with Version

use of joynr.types.Version in project joynr by bmwcarit.

the class VersionCompatibilityCheckerTest method testEqualVersionsAreCompatible.

@Test
public void testEqualVersionsAreCompatible() {
    Version caller = new Version(1, 1);
    Version provider = new Version(1, 1);
    boolean result = subject.check(caller, provider);
    assertTrue(result);
}
Also used : Version(joynr.types.Version) Test(org.junit.Test)

Example 54 with Version

use of joynr.types.Version in project joynr by bmwcarit.

the class CapabilitiesUtilsTest method testConvertDiscoveryEntryWithMetaInfoToDiscoveryEntry.

@Test
public void testConvertDiscoveryEntryWithMetaInfoToDiscoveryEntry() {
    boolean isLocal = true;
    DiscoveryEntryWithMetaInfo discoveryEntry = new DiscoveryEntryWithMetaInfo(new Version(42, 23), "testDomain", "testInterfaceName", "testParticipantId", new ProviderQos(), 4711l, 4712l, "testPublicKeyId", isLocal);
    DiscoveryEntry convertedEntry = CapabilityUtils.convertToDiscoveryEntry(discoveryEntry);
    assertTrue(DiscoveryEntry.class.equals(convertedEntry.getClass()));
    compareDiscoveryEntries(isLocal, convertedEntry, discoveryEntry);
}
Also used : DiscoveryEntry(joynr.types.DiscoveryEntry) GlobalDiscoveryEntry(joynr.types.GlobalDiscoveryEntry) Version(joynr.types.Version) DiscoveryEntryWithMetaInfo(joynr.types.DiscoveryEntryWithMetaInfo) ProviderQos(joynr.types.ProviderQos) Test(org.junit.Test)

Example 55 with Version

use of joynr.types.Version in project joynr by bmwcarit.

the class CapabilitiesUtilsTest method testConvertGlobalDiscoveryEntryToDiscoveryEntryWithMetaInfo.

@Test
public void testConvertGlobalDiscoveryEntryToDiscoveryEntryWithMetaInfo() {
    boolean isLocal = false;
    DiscoveryEntry discoveryEntry = new DiscoveryEntry(new Version(42, 23), "testDomain", "testInterfaceName", "testParticipantId", new ProviderQos(), 4711l, 4712l, "testPublicKeyId");
    GlobalDiscoveryEntry globalDiscoveryEntry = CapabilityUtils.discoveryEntry2GlobalDiscoveryEntry(discoveryEntry, new MqttAddress());
    DiscoveryEntryWithMetaInfo convertedEntry = CapabilityUtils.convertToDiscoveryEntryWithMetaInfo(isLocal, discoveryEntry);
    compareDiscoveryEntries(isLocal, discoveryEntry, convertedEntry);
    DiscoveryEntryWithMetaInfo convertedGlobalEntry = CapabilityUtils.convertToDiscoveryEntryWithMetaInfo(isLocal, globalDiscoveryEntry);
    compareDiscoveryEntries(isLocal, globalDiscoveryEntry, convertedGlobalEntry);
}
Also used : DiscoveryEntry(joynr.types.DiscoveryEntry) GlobalDiscoveryEntry(joynr.types.GlobalDiscoveryEntry) Version(joynr.types.Version) GlobalDiscoveryEntry(joynr.types.GlobalDiscoveryEntry) DiscoveryEntryWithMetaInfo(joynr.types.DiscoveryEntryWithMetaInfo) ProviderQos(joynr.types.ProviderQos) MqttAddress(joynr.system.RoutingTypes.MqttAddress) Test(org.junit.Test)

Aggregations

Version (joynr.types.Version)65 Test (org.junit.Test)47 ProviderQos (joynr.types.ProviderQos)43 DiscoveryEntryWithMetaInfo (joynr.types.DiscoveryEntryWithMetaInfo)29 GlobalDiscoveryEntry (joynr.types.GlobalDiscoveryEntry)24 DiscoveryEntry (joynr.types.DiscoveryEntry)22 ArrayList (java.util.ArrayList)13 ChannelAddress (joynr.system.RoutingTypes.ChannelAddress)13 Matchers.anyString (org.mockito.Matchers.anyString)12 Callback (io.joynr.proxy.Callback)11 HashSet (java.util.HashSet)11 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)10 InvocationOnMock (org.mockito.invocation.InvocationOnMock)10 JoynrVersion (io.joynr.JoynrVersion)9 Address (joynr.system.RoutingTypes.Address)9 HashMap (java.util.HashMap)8 MqttAddress (joynr.system.RoutingTypes.MqttAddress)8 DiscoveryException (io.joynr.exceptions.DiscoveryException)7 Set (java.util.Set)7 DeferredVoid (io.joynr.provider.DeferredVoid)6