use of joynr.types.Version in project joynr by bmwcarit.
the class DiscoveryEntryVersionFilterTest method testEmptySetUnchanged.
@Test
public void testEmptySetUnchanged() {
Version callerVersion = new Version(0, 0);
Set<DiscoveryEntryWithMetaInfo> discoveryEntries = new HashSet<>();
Set<DiscoveryEntryWithMetaInfo> result = subject.filter(callerVersion, discoveryEntries, null);
assertNotNull(result);
assertEquals(discoveryEntries, result);
}
use of joynr.types.Version in project joynr by bmwcarit.
the class DiscoveryEntryVersionFilterTest method testIncompatibleVersionFilteredOut.
@Test
public void testIncompatibleVersionFilteredOut() {
Version callerVersion = new Version(1, 0);
DiscoveryEntryWithMetaInfo discoveryEntry = mock(DiscoveryEntryWithMetaInfo.class);
Version providerVersion = new Version(2, 0);
when(discoveryEntry.getProviderVersion()).thenReturn(providerVersion);
Set<DiscoveryEntryWithMetaInfo> discoveryEntries = Sets.newHashSet(discoveryEntry);
Set<DiscoveryEntryWithMetaInfo> result = subject.filter(callerVersion, discoveryEntries, null);
assertNotNull(result);
assertTrue(result.isEmpty());
}
use of joynr.types.Version in project joynr by bmwcarit.
the class DiscoveryEntryVersionFilterTest method testCompatibleVersionLeftIn.
@Test
public void testCompatibleVersionLeftIn() {
Version callerVersion = new Version(1, 0);
DiscoveryEntryWithMetaInfo discoveryEntry = mock(DiscoveryEntryWithMetaInfo.class);
Version providerVersion = new Version(1, 0);
when(discoveryEntry.getProviderVersion()).thenReturn(providerVersion);
Set<DiscoveryEntryWithMetaInfo> discoveryEntries = Sets.newHashSet(discoveryEntry);
when(versionCompatibilityChecker.check(eq(callerVersion), eq(providerVersion))).thenReturn(true);
Set<DiscoveryEntryWithMetaInfo> result = subject.filter(callerVersion, discoveryEntries, null);
assertNotNull(result);
assertEquals(1, result.size());
assertEquals(discoveryEntries, result);
}
use of joynr.types.Version in project joynr by bmwcarit.
the class VersionCompatibilityCheckerTest method testProviderIsNull.
@Test(expected = IllegalArgumentException.class)
public void testProviderIsNull() {
Version caller = new Version(0, 0);
Version provider = null;
subject.check(caller, provider);
}
use of joynr.types.Version in project joynr by bmwcarit.
the class VersionCompatibilityCheckerTest method testDifferentMajorVersionsIncompatible.
@Test
public void testDifferentMajorVersionsIncompatible() {
Version caller = new Version(2, 0);
Version provider = new Version(3, 0);
boolean result = subject.check(caller, provider);
assertFalse(result);
}
Aggregations