DATAREDIS-563 - Migrate ticket references in test code to Spring Framework style.
Fix license headers by removing the dot after the year.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -103,10 +103,7 @@ public class RedisCacheManagerTransactionalUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-375
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-375
|
||||
public void testCacheIsNotDecoratedTwiceWithTransactionAwareCacheDecorator() {
|
||||
|
||||
Cache cache = cacheManager.getCache(cacheName);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -68,38 +68,26 @@ public class RedisCacheManagerUnitTests {
|
||||
cacheManager.afterPropertiesSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void testGetCacheReturnsNewCacheWhenRequestedCacheIsNotAvailable() {
|
||||
|
||||
Cache cache = cacheManager.getCache("not-available");
|
||||
assertThat(cache, notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void testGetCacheReturnsExistingCacheWhenRequested() {
|
||||
|
||||
Cache cache = cacheManager.getCache("cache");
|
||||
assertThat(cacheManager.getCache("cache"), sameInstance(cache));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void testCacheInitSouldNotRequestRemoteKeysByDefault() {
|
||||
Mockito.verifyZeroInteractions(redisConnectionMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void testCacheInitShouldFetchAllCacheKeysWhenLoadingRemoteCachesOnStartupIsEnabled() {
|
||||
|
||||
cacheManager = new RedisCacheManager(redisTemplate);
|
||||
@@ -111,11 +99,8 @@ public class RedisCacheManagerUnitTests {
|
||||
assertThat(redisTemplate.getKeySerializer().deserialize(captor.getValue()).toString(), is("*~keys"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void testCacheInitShouldInitializeRemoteCachesCorrectlyWhenLoadingRemoteCachesOnStartupIsEnabled() {
|
||||
|
||||
Set<byte[]> keys = new HashSet<byte[]>(Arrays.asList(redisTemplate.getKeySerializer()
|
||||
@@ -129,10 +114,7 @@ public class RedisCacheManagerUnitTests {
|
||||
assertThat(cacheManager.getCacheNames(), IsCollectionContaining.hasItem("remote-cache"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void testCacheInitShouldNotInitialzeCachesWhenLoadingRemoteCachesOnStartupIsEnabledAndNoCachesAvailableOnRemoteServer() {
|
||||
|
||||
when(redisConnectionMock.keys(any(byte[].class))).thenReturn(Collections.<byte[]> emptySet());
|
||||
@@ -184,10 +166,7 @@ public class RedisCacheManagerUnitTests {
|
||||
assertThat(cacheManager.getCache("redis"), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-283
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-283
|
||||
public void testRetainConfiguredCachesAfterBeanInitialization() {
|
||||
|
||||
cacheManager = new RedisCacheManager(redisTemplate);
|
||||
@@ -198,10 +177,7 @@ public class RedisCacheManagerUnitTests {
|
||||
assertThat(cacheManager.getCache("data"), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-283
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-283
|
||||
public void testRetainConfiguredCachesAfterBeanInitializationWithLoadingOfRemoteKeys() {
|
||||
|
||||
Set<byte[]> keys = new HashSet<byte[]>(Arrays.asList(redisTemplate.getKeySerializer()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -229,10 +229,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertFalse(monitorStateException.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-243
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-243
|
||||
public void testCacheGetShouldReturnCachedInstance() {
|
||||
assumeThat(cache, instanceOf(RedisCache.class));
|
||||
|
||||
@@ -243,10 +240,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(value, isEqual(((RedisCache) cache).get(key, Object.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-243
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-243
|
||||
public void testCacheGetShouldRetunInstanceOfCorrectType() {
|
||||
assumeThat(cache, instanceOf(RedisCache.class));
|
||||
|
||||
@@ -258,10 +252,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(redisCache.get(key, value.getClass()), IsInstanceOf.<Object>instanceOf(value.getClass()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-243
|
||||
*/
|
||||
@Test(expected = ClassCastException.class)
|
||||
@Test(expected = ClassCastException.class) // DATAREDIS-243
|
||||
public void testCacheGetShouldThrowExceptionOnInvalidType() {
|
||||
assumeThat(cache, instanceOf(RedisCache.class));
|
||||
|
||||
@@ -274,10 +265,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
Cache retrievedObject = redisCache.get(key, Cache.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-243
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-243
|
||||
public void testCacheGetShouldReturnNullIfNoCachedValueFound() {
|
||||
assumeThat(cache, instanceOf(RedisCache.class));
|
||||
|
||||
@@ -291,11 +279,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(redisCache.get(invalidKey, value.getClass()), nullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-344
|
||||
* @see DATAREDIS-416
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-344, DATAREDIS-416
|
||||
public void putIfAbsentShouldSetValueOnlyIfNotPresent() {
|
||||
|
||||
assumeThat(cache, instanceOf(RedisCache.class));
|
||||
@@ -318,10 +302,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(wrapper.get(), equalTo(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-510
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-510
|
||||
public void cachePutWithNullShouldNotAddStuffToRedis() {
|
||||
|
||||
assumeThat(getAllowCacheNullValues(), is(false));
|
||||
@@ -334,10 +315,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(cache.get(key), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-510
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-510
|
||||
public void cachePutWithNullShouldRemoveKeyIfExists() {
|
||||
|
||||
assumeThat(getAllowCacheNullValues(), is(false));
|
||||
@@ -354,11 +332,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(cache.get(key), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-443
|
||||
* @see DATAREDIS-452
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-443, DATAREDIS-452
|
||||
public void testCacheGetSynchronized() throws Throwable {
|
||||
|
||||
assumeThat(cache, instanceOf(RedisCache.class));
|
||||
@@ -367,10 +341,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
runOnce(new CacheGetWithValueLoaderIsThreadSafe((RedisCache) cache));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-553
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-553
|
||||
public void cachePutWithNullShouldAddStuffToRedisWhenCachingNullIsEnabled() {
|
||||
|
||||
assumeThat(getAllowCacheNullValues(), is(true));
|
||||
@@ -383,10 +354,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(cache.get(key, String.class), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-553
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-553
|
||||
public void testCacheGetSynchronizedNullAllowingNull() {
|
||||
|
||||
assumeThat(getAllowCacheNullValues(), is(true));
|
||||
@@ -404,10 +372,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(cache.get(key).get(), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-553
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-553
|
||||
public void testCacheGetSynchronizedNullNotAllowingNull() {
|
||||
|
||||
assumeThat(getAllowCacheNullValues(), is(false));
|
||||
@@ -426,10 +391,7 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
|
||||
assertThat(cache.get(key), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-553
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-553
|
||||
public void testCacheGetSynchronizedNullWithStoredNull() {
|
||||
|
||||
assumeThat(getAllowCacheNullValues(), is(true));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -95,10 +95,7 @@ public class RedisCacheUnitTests {
|
||||
when(valueSerializerMock.deserialize(eq(VALUE_BYTES))).thenReturn(VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-369
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-369
|
||||
public void putShouldNotKeepTrackOfKnownKeysWhenPrefixIsSet() {
|
||||
|
||||
cache = new RedisCache(CACHE_NAME, PREFIX_BYTES, templateSpy, EXPIRATION);
|
||||
@@ -109,10 +106,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, never()).zAdd(eq(KNOWN_KEYS_SET_NAME_BYTES), eq(0D), any(byte[].class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-369
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-369
|
||||
public void putShouldKeepTrackOfKnownKeysWhenNoPrefixIsSet() {
|
||||
|
||||
cache = new RedisCache(CACHE_NAME, NO_PREFIX_BYTES, templateSpy, EXPIRATION);
|
||||
@@ -123,10 +117,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, times(1)).zAdd(eq(KNOWN_KEYS_SET_NAME_BYTES), eq(0D), eq(KEY_BYTES));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-369
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-369
|
||||
public void clearShouldRemoveKeysUsingKnownKeysWhenNoPrefixIsSet() {
|
||||
|
||||
cache = new RedisCache(CACHE_NAME, NO_PREFIX_BYTES, templateSpy, EXPIRATION);
|
||||
@@ -135,10 +126,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, times(1)).zRange(eq(KNOWN_KEYS_SET_NAME_BYTES), eq(0L), eq(127L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-369
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-369
|
||||
public void clearShouldCallLuaScriptToRemoveKeysWhenPrefixIsSet() {
|
||||
|
||||
cache = new RedisCache(CACHE_NAME, PREFIX_BYTES, templateSpy, EXPIRATION);
|
||||
@@ -148,10 +136,7 @@ public class RedisCacheUnitTests {
|
||||
eq((PREFIX + "*").getBytes()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-402
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-402
|
||||
public void putShouldNotExpireKnownKeysSetWhenTtlIsZero() {
|
||||
|
||||
cache = new RedisCache(CACHE_NAME, NO_PREFIX_BYTES, templateSpy, 0L);
|
||||
@@ -160,10 +145,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, never()).expire(eq(KNOWN_KEYS_SET_NAME_BYTES), anyLong());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-542
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-542
|
||||
public void putIfAbsentShouldExpireWhenValueWasSet() {
|
||||
|
||||
when(connectionMock.setNX(KEY_BYTES, VALUE_BYTES)).thenReturn(true);
|
||||
@@ -176,10 +158,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock).expire(eq(KEY_BYTES), anyLong());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-542
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-542
|
||||
public void putIfAbsentShouldNotExpireWhenValueWasNotSetAndRedisContainsOtherData() {
|
||||
|
||||
String other = "other";
|
||||
@@ -194,10 +173,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, never()).expire(eq(KEY_BYTES), anyLong());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-542
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-542
|
||||
public void putIfAbsentShouldNotSetExpireWhenValueWasNotSetAndRedisContainsSameData() {
|
||||
|
||||
when(connectionMock.setNX(KEY_BYTES, VALUE_BYTES)).thenReturn(false);
|
||||
@@ -210,10 +186,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, never()).expire(eq(KEY_BYTES), anyLong());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-443
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-443
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getWithCallable() throws ClassNotFoundException {
|
||||
|
||||
@@ -236,10 +209,7 @@ public class RedisCacheUnitTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-553
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-553
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getWithCallableShouldStoreNullNotAllowingNull() throws ClassNotFoundException {
|
||||
|
||||
@@ -258,10 +228,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, times(1)).exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-553
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-553
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getWithCallableShouldStoreNullAllowingNull() throws ClassNotFoundException {
|
||||
|
||||
@@ -281,10 +248,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, times(1)).exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-443
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-443
|
||||
public void getWithCallableShouldReadValueFromCallableAddToCache() {
|
||||
|
||||
cache = new RedisCache(CACHE_NAME, NO_PREFIX_BYTES, templateSpy, 0L);
|
||||
@@ -302,10 +266,7 @@ public class RedisCacheUnitTests {
|
||||
verify(connectionMock, times(1)).exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-443
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-443
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getWithCallableShouldNotReadValueFromCallableWhenAlreadyPresent() {
|
||||
|
||||
@@ -319,10 +280,7 @@ public class RedisCacheUnitTests {
|
||||
verifyZeroInteractions(callableMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-468
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-468
|
||||
public void noMultiExecForCluster() {
|
||||
|
||||
RedisClusterConnection clusterConnectionMock = mock(RedisClusterConnection.class);
|
||||
@@ -341,10 +299,7 @@ public class RedisCacheUnitTests {
|
||||
verifyZeroInteractions(connectionMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-468
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-468
|
||||
public void getWithCallableForCluster() {
|
||||
|
||||
RedisClusterConnection clusterConnectionMock = mock(RedisClusterConnection.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -129,11 +129,8 @@ public class TransactionalRedisCacheManagerWithCommitUnitTests {
|
||||
IsEqual.equalTo("bar~keys"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@Rollback(false)
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void testValuesAddedToCacheWhenTransactionIsCommited() {
|
||||
transactionalService.foo();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -119,11 +119,8 @@ public class TransactionalRedisCacheManagerWithRollbackUnitTests {
|
||||
any(byte[].class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-246
|
||||
*/
|
||||
@Rollback(true)
|
||||
@Test
|
||||
@Test // DATAREDIS-246
|
||||
public void tesValuesNotAddedToCacheWhenTransactionIsRolledBack() {
|
||||
transactionalService.foo();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -421,10 +421,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertTrue(waitFor(new KeyExpired("expy"), 2500l));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-271
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-271
|
||||
@IfProfileValue(name = "runLongTests", value = "true")
|
||||
public void testPsetEx() throws Exception {
|
||||
|
||||
@@ -980,10 +977,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
verifyResults(Arrays.asList(new Object[] { -1L }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
public void testTtlWithTimeUnit() {
|
||||
|
||||
connection.set("whatup", "yo");
|
||||
@@ -1017,10 +1011,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertTrue((Long) results.get(1) > -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
@IfProfileValue(name = "redisVersion", value = "2.6+")
|
||||
public void testPTtlWithTimeUnit() {
|
||||
|
||||
@@ -1970,11 +1961,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertNotNull(results.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-206
|
||||
* @see DATAREDIS-513
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-206, DATAREDIS-513
|
||||
public void testGetTimeShouldRequestServerTime() {
|
||||
|
||||
actual.add(connection.time());
|
||||
@@ -1985,18 +1972,12 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat((Long) results.get(0) > 0, equalTo(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-269
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-269
|
||||
public void clientSetNameWorksCorrectly() {
|
||||
connection.setClientName("foo".getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-268
|
||||
public void testListClientsContainsAtLeastOneElement() {
|
||||
|
||||
actual.add(connection.getClientList());
|
||||
@@ -2012,10 +1993,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(info.getDatabaseId(), is(notNullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-290
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
public void scanShouldReadEntireValueRange() {
|
||||
|
||||
@@ -2046,10 +2024,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(i, is(itemCount));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-417
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-417
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection() {
|
||||
@@ -2067,10 +2042,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(i, is(10));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-306
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-306
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
public void zScanShouldReadEntireValueRange() {
|
||||
|
||||
@@ -2102,10 +2074,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(count, equalTo(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-304
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-304
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
public void sScanShouldReadEntireValueRange() {
|
||||
|
||||
@@ -2131,10 +2100,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(i, is(6));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-305
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-305
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
public void hScanShouldReadEntireValueRange() {
|
||||
|
||||
@@ -2169,10 +2135,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(i, is(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8.9+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void pfAddShouldAddToNonExistingKeyCorrectly() {
|
||||
@@ -2183,10 +2146,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat((Long) results.get(0), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8.9+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void pfAddShouldReturnZeroWhenValueAlreadyExists() {
|
||||
@@ -2201,10 +2161,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat((Long) results.get(2), is(0L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8.9+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void pfCountShouldReturnCorrectly() {
|
||||
@@ -2217,10 +2174,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat((Long) results.get(1), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8.9+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void pfCountWithMultipleKeysShouldReturnCorrectly() {
|
||||
@@ -2235,21 +2189,15 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat((Long) results.get(2), is(6L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-308
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8.9+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void pfCountWithNullKeysShouldThrowIllegalArgumentException() {
|
||||
actual.add(connection.pfCount((String[]) null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-378
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@Test // DATAREDIS-378
|
||||
@IfProfileValue(name = "redisVersion", value = "2.9.0+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void zRangeByLexTest() {
|
||||
@@ -2287,10 +2235,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(values, not(hasItems("a", "b", "c", "d")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithExpirationAndNullOpionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2305,10 +2250,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Long) result.get(1)).doubleValue(), is(closeTo(500d, 499d)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithExpirationAndUpsertOpionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2323,10 +2265,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Long) result.get(1)).doubleValue(), is(closeTo(500d, 499d)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithExpirationAndUpsertOpionShouldSetTtlWhenKeyDoesExist() {
|
||||
|
||||
@@ -2344,10 +2283,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("data")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithExpirationAndAbsentOptionShouldSetTtlWhenKeyDoesExist() {
|
||||
|
||||
@@ -2365,10 +2301,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("spring")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithExpirationAndAbsentOptionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2385,10 +2318,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("data")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithExpirationAndPresentOptionShouldSetTtlWhenKeyDoesExist() {
|
||||
|
||||
@@ -2406,10 +2336,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("data")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithExpirationAndPresentOptionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2425,10 +2352,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Long) result.get(1)).doubleValue(), is(closeTo(-2, 0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithNullExpirationAndUpsertOpionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2443,10 +2367,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Long) result.get(1)).doubleValue(), is(closeTo(-1, 0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithoutExpirationAndUpsertOpionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2461,10 +2382,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Long) result.get(1)).doubleValue(), is(closeTo(-1, 0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithoutExpirationAndUpsertOpionShouldSetTtlWhenKeyDoesExist() {
|
||||
|
||||
@@ -2482,10 +2400,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("data")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithoutExpirationAndAbsentOptionShouldSetTtlWhenKeyDoesExist() {
|
||||
|
||||
@@ -2503,10 +2418,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("spring")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithoutExpirationAndAbsentOptionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2523,10 +2435,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("data")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithoutExpirationAndPresentOptionShouldSetTtlWhenKeyDoesExist() {
|
||||
|
||||
@@ -2544,10 +2453,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((String) result.get(2)), is(equalTo("data")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void setWithoutExpirationAndPresentOptionShouldSetTtlWhenKeyDoesNotExist() {
|
||||
|
||||
@@ -2563,10 +2469,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Long) result.get(1)).doubleValue(), is(closeTo(-2, 0)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoAddSingleGeoLocation() {
|
||||
@@ -2578,10 +2481,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat((Long) result.get(0), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoAddMultipleGeoLocations() {
|
||||
@@ -2593,10 +2493,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat((Long) result.get(0), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoDist() {
|
||||
@@ -2610,10 +2507,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Distance) result.get(1)).getUnit(), is("m"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoDistWithMetric() {
|
||||
@@ -2627,10 +2521,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((Distance) result.get(1)).getUnit(), is("km"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS })
|
||||
public void geoHash() {
|
||||
@@ -2644,10 +2535,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((List<String>) result.get(1)).get(1), is("sqdtr74hyu0"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS })
|
||||
public void geoHashNonExisting() {
|
||||
@@ -2662,10 +2550,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((List<String>) result.get(1)).get(2), is("sqdtr74hyu0"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoPosition() {
|
||||
@@ -2683,10 +2568,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((List<Point>) result.get(1)).get(1).getY(), is(closeTo(POINT_CATANIA.getY(), 0.005)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoPositionNonExisting() {
|
||||
@@ -2706,10 +2588,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((List<Point>) result.get(1)).get(2).getY(), is(closeTo(POINT_CATANIA.getY(), 0.005)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoRadiusShouldReturnMembersCorrectly() {
|
||||
@@ -2725,10 +2604,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((GeoResults<GeoLocation<String>>) results.get(2)).getContent(), hasSize(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoRadiusShouldReturnDistanceCorrectly() {
|
||||
@@ -2747,10 +2623,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
is("km"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoRadiusShouldApplyLimit() {
|
||||
@@ -2765,10 +2638,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
assertThat(((GeoResults<GeoLocation<String>>) results.get(1)).getContent(), hasSize(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoRadiusByMemberShouldReturnMembersCorrectly() {
|
||||
@@ -2786,10 +2656,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
is(ARIGENTO.getName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoRadiusByMemberShouldReturnDistanceCorrectly() {
|
||||
@@ -2808,10 +2675,7 @@ public abstract class AbstractConnectionIntegrationTests {
|
||||
is("km"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
@IfProfileValue(name = "redisVersion", value = "3.2+")
|
||||
@WithRedisDriver({ RedisDriver.JEDIS, RedisDriver.LETTUCE })
|
||||
public void geoRadiusByMemberShouldApplyLimit() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2015 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -120,10 +120,7 @@ abstract public class AbstractConnectionPipelineIntegrationTests extends Abstrac
|
||||
assertTrue(results.isEmpty());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-417
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-417
|
||||
@Ignore
|
||||
@Override
|
||||
public void scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2015 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -107,10 +107,7 @@ abstract public class AbstractConnectionTransactionIntegrationTests extends Abst
|
||||
connection.scriptKill();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-417
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-417
|
||||
@Ignore
|
||||
@Override
|
||||
public void scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmptyCollection() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -112,11 +112,8 @@ public abstract class AbstractTransactionalTestBase {
|
||||
connection.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Rollback(true)
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void valueOperationSetShouldBeRolledBackCorrectly() {
|
||||
|
||||
for (String key : KEYS) {
|
||||
@@ -124,11 +121,8 @@ public abstract class AbstractTransactionalTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Rollback(false)
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void valueOperationSetShouldBeCommittedCorrectly() {
|
||||
|
||||
this.valuesShouldHaveBeenPersisted = true;
|
||||
@@ -137,10 +131,7 @@ public abstract class AbstractTransactionalTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-548
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-548
|
||||
@Transactional(readOnly = true)
|
||||
public void valueOperationShouldWorkWithReadOnlyTransactions() {
|
||||
|
||||
@@ -150,11 +141,8 @@ public abstract class AbstractTransactionalTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Rollback(true)
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void listOperationLPushShoudBeRolledBackCorrectly() {
|
||||
|
||||
for (String key : KEYS) {
|
||||
@@ -162,11 +150,8 @@ public abstract class AbstractTransactionalTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Rollback(false)
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void listOperationLPushShouldBeCommittedCorrectly() {
|
||||
|
||||
this.valuesShouldHaveBeenPersisted = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -131,10 +131,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
this.executor.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeShouldBeExecutedCorrectly() {
|
||||
|
||||
executor.executeCommandOnSingleNode(COMMAND_CALLBACK, CLUSTER_NODE_2);
|
||||
@@ -142,10 +139,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con2, times(1)).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeByHostAndPortShouldBeExecutedCorrectly() {
|
||||
|
||||
executor.executeCommandOnSingleNode(COMMAND_CALLBACK,
|
||||
@@ -154,10 +148,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con2, times(1)).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeByNodeIdShouldBeExecutedCorrectly() {
|
||||
|
||||
executor.executeCommandOnSingleNode(COMMAND_CALLBACK, new RedisClusterNode(CLUSTER_NODE_2.id));
|
||||
@@ -165,34 +156,22 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con2, times(1)).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeShouldThrowExceptionWhenNodeIsNull() {
|
||||
executor.executeCommandOnSingleNode(COMMAND_CALLBACK, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeShouldThrowExceptionWhenCommandCallbackIsNull() {
|
||||
executor.executeCommandOnSingleNode(null, CLUSTER_NODE_1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeShouldThrowExceptionWhenNodeIsUnknown() {
|
||||
executor.executeCommandOnSingleNode(COMMAND_CALLBACK, UNKNOWN_CLUSTER_NODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandAsyncOnNodesShouldExecuteCommandOnGivenNodes() {
|
||||
|
||||
ClusterCommandExecutor executor = new ClusterCommandExecutor(new MockClusterNodeProvider(),
|
||||
@@ -206,10 +185,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con3, never()).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandAsyncOnNodesShouldExecuteCommandOnGivenNodesByHostAndPort() {
|
||||
|
||||
ClusterCommandExecutor executor = new ClusterCommandExecutor(new MockClusterNodeProvider(),
|
||||
@@ -225,10 +201,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con3, never()).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandAsyncOnNodesShouldExecuteCommandOnGivenNodesByNodeId() {
|
||||
|
||||
ClusterCommandExecutor executor = new ClusterCommandExecutor(new MockClusterNodeProvider(),
|
||||
@@ -243,10 +216,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con3, never()).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void executeCommandAsyncOnNodesShouldFailOnGivenUnknownNodes() {
|
||||
|
||||
ClusterCommandExecutor executor = new ClusterCommandExecutor(new MockClusterNodeProvider(),
|
||||
@@ -257,10 +227,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
Arrays.asList(new RedisClusterNode("unknown"), CLUSTER_NODE_2_LOOKUP));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandOnAllNodesShouldExecuteCommandOnEveryKnownClusterNode() {
|
||||
|
||||
ClusterCommandExecutor executor = new ClusterCommandExecutor(new MockClusterNodeProvider(),
|
||||
@@ -274,10 +241,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con3, times(1)).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandAsyncOnNodesShouldCompleteAndCollectErrorsOfAllNodes() {
|
||||
|
||||
when(con1.theWheelWeavesAsTheWheelWills()).thenReturn("rand");
|
||||
@@ -297,10 +261,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con3, times(1)).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandAsyncOnNodesShouldCollectResultsCorrectly() {
|
||||
|
||||
when(con1.theWheelWeavesAsTheWheelWills()).thenReturn("rand");
|
||||
@@ -312,11 +273,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
assertThat(result.resultsAsList(), hasItems("rand", "mat", "perrin"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
* @see DATAREDIS-467
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315, DATAREDIS-467
|
||||
public void executeMultikeyCommandShouldRunCommandAcrossCluster() {
|
||||
|
||||
// key-1 and key-9 map both to node1
|
||||
@@ -335,10 +292,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
assertThat(captor.getAllValues().size(), is(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeAndFollowRedirect() {
|
||||
|
||||
when(con1.theWheelWeavesAsTheWheelWills()).thenThrow(new MovedException(CLUSTER_NODE_3_HOST, CLUSTER_NODE_3_PORT));
|
||||
@@ -350,10 +304,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con2, never()).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandOnSingleNodeAndFollowRedirectButStopsAfterMaxRedirects() {
|
||||
|
||||
when(con1.theWheelWeavesAsTheWheelWills()).thenThrow(new MovedException(CLUSTER_NODE_3_HOST, CLUSTER_NODE_3_PORT));
|
||||
@@ -372,10 +323,7 @@ public class ClusterCommandExecutorUnitTests {
|
||||
verify(con2, times(1)).theWheelWeavesAsTheWheelWills();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeCommandOnArbitraryNodeShouldPickARandomNode() {
|
||||
|
||||
executor.executeCommandOnArbitraryNode(COMMAND_CALLBACK);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -974,9 +974,7 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testTtl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
// DATAREDIS-526
|
||||
@Override
|
||||
public void testTtlWithTimeUnit() {
|
||||
doReturn(Arrays.asList(new Object[] { 5L })).when(nativeConnection).closePipeline();
|
||||
@@ -1322,29 +1320,21 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testZUnionStore();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddBytes() {
|
||||
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAdd() {
|
||||
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithGeoLocationBytes() {
|
||||
|
||||
@@ -1352,9 +1342,7 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testGeoAddWithGeoLocationBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithGeoLocation() {
|
||||
|
||||
@@ -1362,29 +1350,21 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testGeoAddWithGeoLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMapBytes() {
|
||||
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddCoordinateMapBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMap() {
|
||||
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddCoordinateMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithIterableOfGeoLocationBytes() {
|
||||
|
||||
@@ -1392,9 +1372,7 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testGeoAddWithIterableOfGeoLocationBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithIterableOfGeoLocation() {
|
||||
|
||||
@@ -1402,180 +1380,126 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
super.testGeoAddWithIterableOfGeoLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDistBytes() {
|
||||
|
||||
doReturn(Arrays.asList(new Distance(102121.12d, DistanceUnit.METERS))).when(nativeConnection).closePipeline();
|
||||
super.testGeoDistBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDist() {
|
||||
doReturn(Arrays.asList(new Distance(102121.12d, DistanceUnit.METERS))).when(nativeConnection).closePipeline();
|
||||
super.testGeoDist();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHashBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(bar))).when(nativeConnection).closePipeline();
|
||||
super.testGeoHashBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHash() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(bar))).when(nativeConnection).closePipeline();
|
||||
super.testGeoHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPosBytes() {
|
||||
|
||||
doReturn(Arrays.asList(points)).when(nativeConnection).closePipeline();
|
||||
super.testGeoPosBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPos() {
|
||||
|
||||
doReturn(Arrays.asList(points)).when(nativeConnection).closePipeline();
|
||||
super.testGeoPos();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParamBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithoutParamBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParam() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithoutParam();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDistBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithDistBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDist() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithDist();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithCoordAndDescBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithCoordAndDescBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithCoordAndDesc() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithCoordAndDesc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParamBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithoutParamBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParam() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithoutParam();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAscBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithDistAndAscBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAsc() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithDistAndAsc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCountBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithCoordAndCountBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCount() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).closePipeline();
|
||||
@@ -1705,10 +1629,7 @@ public class DefaultStringRedisConnectionPipelineTests extends DefaultStringRedi
|
||||
verifyResults(Arrays.asList(new Object[] { barBytes, 3l }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-206
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-206
|
||||
@Override
|
||||
public void testTimeIsDelegatedCorrectlyToNativeConnection() {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -1048,9 +1048,7 @@ public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRe
|
||||
super.testTtl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
// DATAREDIS-526
|
||||
@Override
|
||||
public void testTtlWithTimeUnit() {
|
||||
|
||||
@@ -1567,90 +1565,63 @@ public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRe
|
||||
results);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAdd() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithGeoLocationBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddWithGeoLocationBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithGeoLocation() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddWithGeoLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMapBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddCoordinateMapBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMap() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddCoordinateMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithIterableOfGeoLocationBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddWithIterableOfGeoLocationBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithIterableOfGeoLocation() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(1L))).when(nativeConnection).closePipeline();
|
||||
super.testGeoAddWithIterableOfGeoLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDistBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(new Distance(102121.12d, DistanceUnit.METERS)))).when(nativeConnection)
|
||||
@@ -1658,10 +1629,7 @@ public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRe
|
||||
super.testGeoDistBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDist() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(new Distance(102121.12d, DistanceUnit.METERS)))).when(nativeConnection)
|
||||
@@ -1669,160 +1637,112 @@ public class DefaultStringRedisConnectionPipelineTxTests extends DefaultStringRe
|
||||
super.testGeoDist();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHashBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(Collections.singletonList(bar)))).when(nativeConnection).closePipeline();
|
||||
super.testGeoHashBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHash() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(Collections.singletonList(bar)))).when(nativeConnection).closePipeline();
|
||||
super.testGeoHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPosBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(points))).when(nativeConnection).closePipeline();
|
||||
super.testGeoPosBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPos() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(points))).when(nativeConnection).closePipeline();
|
||||
super.testGeoPos();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParamBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithoutParamBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParam() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithoutParam();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDistBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithDistBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDist() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithDist();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithCoordAndDescBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithCoordAndDescBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithCoordAndDesc() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusWithCoordAndDesc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParamBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithoutParamBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParam() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithoutParam();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAscBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithDistAndAscBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAsc() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithDistAndAsc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCountBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
super.testGeoRadiusByMemberWithCoordAndCountBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCount() {
|
||||
|
||||
doReturn(Arrays.asList(Arrays.asList(geoResults))).when(nativeConnection).closePipeline();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -932,10 +932,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(new Object[] { true }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-271
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-271
|
||||
public void testPSetExShouldDelegateCallToNativeConnection() {
|
||||
|
||||
connection.pSetEx(fooBytes, 10L, barBytes);
|
||||
@@ -1194,10 +1191,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(new Object[] { 5l }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
public void testTtlWithTimeUnit() {
|
||||
|
||||
doReturn(5L).when(nativeConnection).ttl(fooBytes, TimeUnit.SECONDS);
|
||||
@@ -1724,10 +1718,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(new Object[] { "foo" }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-206
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-206
|
||||
public void testTimeIsDelegatedCorrectlyToNativeConnection() {
|
||||
|
||||
doReturn(1L).when(nativeConnection).time();
|
||||
@@ -1735,30 +1726,21 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-184
|
||||
public void testShutdownInDelegatedCorrectlyToNativeConnection() {
|
||||
|
||||
connection.shutdown(ShutdownOption.NOSAVE);
|
||||
verify(nativeConnection, times(1)).shutdown(eq(ShutdownOption.NOSAVE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-269
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-269
|
||||
public void settingClientNameShouldDelegateToNativeConnection() {
|
||||
|
||||
connection.setClientName("foo");
|
||||
verify(nativeConnection, times(1)).setClientName(eq("foo".getBytes()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
public void pfAddShouldDelegateToNativeConnectionCorrectly() {
|
||||
|
||||
connection.pfAdd("hll", "spring", "data", "redis");
|
||||
@@ -1766,20 +1748,14 @@ public class DefaultStringRedisConnectionTests {
|
||||
"redis".getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
public void pfCountShouldDelegateToNativeConnectionCorrectly() {
|
||||
|
||||
connection.pfCount("hll", "hyperLogLog");
|
||||
verify(nativeConnection, times(1)).pfCount("hll".getBytes(), "hyperLogLog".getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
public void pfMergeShouldDelegateToNativeConnectionCorrectly() {
|
||||
|
||||
connection.pfMerge("merged", "spring", "data", "redis");
|
||||
@@ -1787,20 +1763,14 @@ public class DefaultStringRedisConnectionTests {
|
||||
"redis".getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-270
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-270
|
||||
public void testGetClientNameIsDelegatedCorrectlyToNativeConnection() {
|
||||
|
||||
actual.add(connection.getClientName());
|
||||
verify(nativeConnection, times(1)).getClientName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddBytes() {
|
||||
|
||||
doReturn(1l).when(nativeConnection).geoAdd(fooBytes, new Point(1.23232, 34.2342434), barBytes);
|
||||
@@ -1809,10 +1779,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAdd() {
|
||||
|
||||
doReturn(1l).when(nativeConnection).geoAdd(fooBytes, new Point(1.23232, 34.2342434), barBytes);
|
||||
@@ -1821,10 +1788,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithGeoLocationBytes() {
|
||||
|
||||
doReturn(1l).when(nativeConnection).geoAdd(fooBytes,
|
||||
@@ -1834,10 +1798,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithGeoLocation() {
|
||||
|
||||
doReturn(1l).when(nativeConnection).geoAdd(fooBytes, new Point(1.23232, 34.2342434), barBytes);
|
||||
@@ -1846,10 +1807,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMapBytes() {
|
||||
|
||||
Map<byte[], Point> memberGeoCoordinateMap = Collections.singletonMap(barBytes, new Point(1.23232, 34.2342434));
|
||||
@@ -1859,10 +1817,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMap() {
|
||||
|
||||
doReturn(1l).when(nativeConnection).geoAdd(any(byte[].class), anyMapOf(byte[].class, Point.class));
|
||||
@@ -1871,10 +1826,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithIterableOfGeoLocationBytes() {
|
||||
|
||||
List<GeoLocation<byte[]>> values = Collections.singletonList(new GeoLocation<byte[]>(barBytes, new Point(1, 2)));
|
||||
@@ -1884,10 +1836,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithIterableOfGeoLocation() {
|
||||
|
||||
doReturn(1l).when(nativeConnection).geoAdd(eq(fooBytes), anyMapOf(byte[].class, Point.class));
|
||||
@@ -1896,10 +1845,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDistBytes() {
|
||||
|
||||
doReturn(new Distance(102121.12d, DistanceUnit.METERS)).when(nativeConnection).geoDist(fooBytes, barBytes,
|
||||
@@ -1909,10 +1855,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(new Distance(102121.12d, DistanceUnit.METERS)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDist() {
|
||||
|
||||
doReturn(new Distance(102121.12d, DistanceUnit.METERS)).when(nativeConnection).geoDist(fooBytes, barBytes,
|
||||
@@ -1922,10 +1865,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Collections.singletonList(new Distance(102121.12d, DistanceUnit.METERS)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHashBytes() {
|
||||
|
||||
doReturn(stringList).when(nativeConnection).geoHash(fooBytes, barBytes);
|
||||
@@ -1934,10 +1874,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(Collections.singletonList(bar)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHash() {
|
||||
|
||||
doReturn(stringList).when(nativeConnection).geoHash(fooBytes, barBytes);
|
||||
@@ -1946,10 +1883,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(Collections.singletonList(bar)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPosBytes() {
|
||||
|
||||
doReturn(points).when(nativeConnection).geoPos(fooBytes, barBytes);
|
||||
@@ -1958,10 +1892,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(points));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPos() {
|
||||
|
||||
doReturn(points).when(nativeConnection).geoPos(fooBytes, barBytes);
|
||||
@@ -1969,10 +1900,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(points));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParamBytes() {
|
||||
|
||||
doReturn(geoResults).when(nativeConnection).geoRadius(eq(fooBytes), any(Circle.class));
|
||||
@@ -1981,10 +1909,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(geoResults));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParam() {
|
||||
|
||||
doReturn(geoResults).when(nativeConnection).geoRadius(eq(fooBytes), any(Circle.class));
|
||||
@@ -1994,10 +1919,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(Converters.deserializingGeoResultsConverter(serializer).convert(geoResults)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDistBytes() {
|
||||
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance();
|
||||
@@ -2008,10 +1930,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(geoResults));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDist() {
|
||||
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance();
|
||||
@@ -2022,10 +1941,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(Converters.deserializingGeoResultsConverter(serializer).convert(geoResults)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithCoordAndDescBytes() {
|
||||
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeCoordinates().sortDescending();
|
||||
@@ -2036,10 +1952,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(geoResults));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithCoordAndDesc() {
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeCoordinates().sortDescending();
|
||||
doReturn(geoResults).when(nativeConnection).geoRadius(eq(fooBytes), any(Circle.class), eq(geoRadiusParam));
|
||||
@@ -2049,10 +1962,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(Converters.deserializingGeoResultsConverter(serializer).convert(geoResults)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParamBytes() {
|
||||
|
||||
doReturn(geoResults).when(nativeConnection).geoRadiusByMember(fooBytes, barBytes,
|
||||
@@ -2062,10 +1972,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(geoResults));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParam() {
|
||||
|
||||
doReturn(geoResults).when(nativeConnection).geoRadiusByMember(fooBytes, barBytes,
|
||||
@@ -2075,10 +1982,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(Converters.deserializingGeoResultsConverter(serializer).convert(geoResults)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAscBytes() {
|
||||
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance().sortAscending();
|
||||
@@ -2090,10 +1994,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(geoResults));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAsc() {
|
||||
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance().sortAscending();
|
||||
@@ -2104,10 +2005,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(Converters.deserializingGeoResultsConverter(serializer).convert(geoResults)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCountBytes() {
|
||||
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance().limit(23);
|
||||
@@ -2119,10 +2017,7 @@ public class DefaultStringRedisConnectionTests {
|
||||
verifyResults(Arrays.asList(geoResults));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCount() {
|
||||
|
||||
GeoRadiusCommandArgs geoRadiusParam = GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance().limit(23);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -959,9 +959,7 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
super.testTtl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
// DATAREDIS-526
|
||||
@Override
|
||||
public void testTtlWithTimeUnit() {
|
||||
|
||||
@@ -1444,10 +1442,7 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
verifyResults(Arrays.asList(new Object[] { foo }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-206
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-206
|
||||
@Override
|
||||
public void testTimeIsDelegatedCorrectlyToNativeConnection() {
|
||||
|
||||
@@ -1456,28 +1451,20 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
super.testTimeIsDelegatedCorrectlyToNativeConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddBytes() {
|
||||
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).exec();
|
||||
super.testGeoAddBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAdd() {
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).exec();
|
||||
super.testGeoAddBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithGeoLocationBytes() {
|
||||
|
||||
@@ -1485,9 +1472,7 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
super.testGeoAddWithGeoLocationBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithGeoLocation() {
|
||||
|
||||
@@ -1495,27 +1480,19 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
super.testGeoAddWithGeoLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMapBytes() {
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).exec();
|
||||
super.testGeoAddCoordinateMapBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddCoordinateMap() {
|
||||
doReturn(Collections.singletonList(1L)).when(nativeConnection).exec();
|
||||
super.testGeoAddCoordinateMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithIterableOfGeoLocationBytes() {
|
||||
|
||||
@@ -1523,9 +1500,7 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
super.testGeoAddWithIterableOfGeoLocationBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
// DATAREDIS-438
|
||||
@Override
|
||||
public void testGeoAddWithIterableOfGeoLocation() {
|
||||
|
||||
@@ -1533,100 +1508,70 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
super.testGeoAddWithIterableOfGeoLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDistBytes() {
|
||||
|
||||
doReturn(Arrays.asList(new Distance(102121.12d, DistanceUnit.METERS))).when(nativeConnection).exec();
|
||||
super.testGeoDistBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoDist() {
|
||||
|
||||
doReturn(Arrays.asList(new Distance(102121.12d, DistanceUnit.METERS))).when(nativeConnection).exec();
|
||||
super.testGeoDist();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHashBytes() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(bar))).when(nativeConnection).exec();
|
||||
super.testGeoHashBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHash() {
|
||||
|
||||
doReturn(Arrays.asList(Collections.singletonList(bar))).when(nativeConnection).exec();
|
||||
super.testGeoHash();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPosBytes() {
|
||||
|
||||
doReturn(Arrays.asList(points)).when(nativeConnection).exec();
|
||||
super.testGeoPosBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPos() {
|
||||
|
||||
doReturn(Arrays.asList(points)).when(nativeConnection).exec();
|
||||
super.testGeoPos();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParamBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusWithoutParamBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithoutParam() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusWithoutParam();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDistBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusWithDistBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithDist() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
@@ -1640,70 +1585,49 @@ public class DefaultStringRedisConnectionTxTests extends DefaultStringRedisConne
|
||||
super.testGeoRadiusWithCoordAndDescBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusWithCoordAndDesc() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusWithCoordAndDesc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParamBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusByMemberWithoutParamBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithoutParam() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusByMemberWithoutParam();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAscBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusByMemberWithDistAndAscBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithDistAndAsc() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusByMemberWithDistAndAsc();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCountBytes() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
super.testGeoRadiusByMemberWithCoordAndCountBytes();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRadiusByMemberWithCoordAndCount() {
|
||||
|
||||
doReturn(Arrays.asList(geoResults)).when(nativeConnection).exec();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,10 +40,7 @@ public class RedisClusterConfigurationUnitTests {
|
||||
static final String HOST_AND_PORT_3 = "localhost:789";
|
||||
static final String HOST_AND_NO_PORT = "localhost";
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldCreateRedisClusterConfigurationCorrectly() {
|
||||
|
||||
RedisClusterConfiguration config = new RedisClusterConfiguration(Collections.singleton(HOST_AND_PORT_1));
|
||||
@@ -53,10 +50,7 @@ public class RedisClusterConfigurationUnitTests {
|
||||
assertThat(config.getMaxRedirects(), nullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldCreateRedisClusterConfigurationCorrectlyGivenMultipleHostAndPortStrings() {
|
||||
|
||||
RedisClusterConfiguration config = new RedisClusterConfiguration(new HashSet<String>(Arrays.asList(HOST_AND_PORT_1,
|
||||
@@ -67,26 +61,17 @@ public class RedisClusterConfigurationUnitTests {
|
||||
hasItems(new RedisNode("127.0.0.1", 123), new RedisNode("localhost", 456), new RedisNode("localhost", 789)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void shouldThrowExecptionOnInvalidHostAndPortString() {
|
||||
new RedisClusterConfiguration(Collections.singleton(HOST_AND_NO_PORT));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void shouldThrowExceptionWhenListOfHostAndPortIsNull() {
|
||||
new RedisClusterConfiguration(Collections.<String> singleton(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldNotFailWhenListOfHostAndPortIsEmpty() {
|
||||
|
||||
RedisClusterConfiguration config = new RedisClusterConfiguration(Collections.<String> emptySet());
|
||||
@@ -94,18 +79,12 @@ public class RedisClusterConfigurationUnitTests {
|
||||
assertThat(config.getClusterNodes().size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void shouldThrowExceptionGivenNullPropertySource() {
|
||||
new RedisClusterConfiguration((PropertySource<?>) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldNotFailWhenGivenPropertySourceNotContainingRelevantProperties() {
|
||||
|
||||
RedisClusterConfiguration config = new RedisClusterConfiguration(new MockPropertySource());
|
||||
@@ -114,10 +93,7 @@ public class RedisClusterConfigurationUnitTests {
|
||||
assertThat(config.getClusterNodes().size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldBeCreatedCorrecltyGivenValidPropertySourceWithSingleHostPort() {
|
||||
|
||||
MockPropertySource propertySource = new MockPropertySource();
|
||||
@@ -130,10 +106,7 @@ public class RedisClusterConfigurationUnitTests {
|
||||
assertThat(config.getClusterNodes(), hasItems(new RedisNode("127.0.0.1", 123)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldBeCreatedCorrecltyGivenValidPropertySourceWithMultipleHostPort() {
|
||||
|
||||
MockPropertySource propertySource = new MockPropertySource();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -62,10 +62,7 @@ public class RedisConnectionUnitTests {
|
||||
connection.setSentinelConnection(sentinelConnectionMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldCloseSentinelConnectionAlongWithRedisConnection() throws IOException {
|
||||
|
||||
when(sentinelConnectionMock.isOpen()).thenReturn(true).thenReturn(false);
|
||||
@@ -77,10 +74,7 @@ public class RedisConnectionUnitTests {
|
||||
verify(sentinelConnectionMock, times(1)).close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldNotTryToCloseSentinelConnectionsWhenAlreadyClosed() throws IOException {
|
||||
|
||||
when(sentinelConnectionMock.isOpen()).thenReturn(true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,10 +39,7 @@ public class RedisSentinelConfigurationUnitTests {
|
||||
static final String HOST_AND_PORT_3 = "localhost:789";
|
||||
static final String HOST_AND_NO_PORT = "localhost";
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-372
|
||||
public void shouldCreateRedisSentinelConfigurationCorrectlyGivenMasterAndSingleHostAndPortString() {
|
||||
|
||||
RedisSentinelConfiguration config = new RedisSentinelConfiguration("mymaster",
|
||||
@@ -52,10 +49,7 @@ public class RedisSentinelConfigurationUnitTests {
|
||||
assertThat(config.getSentinels(), hasItems(new RedisNode("127.0.0.1", 123)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-372
|
||||
public void shouldCreateRedisSentinelConfigurationCorrectlyGivenMasterAndMultipleHostAndPortStrings() {
|
||||
|
||||
RedisSentinelConfiguration config = new RedisSentinelConfiguration("mymaster", new HashSet<String>(Arrays.asList(
|
||||
@@ -66,26 +60,17 @@ public class RedisSentinelConfigurationUnitTests {
|
||||
hasItems(new RedisNode("127.0.0.1", 123), new RedisNode("localhost", 456), new RedisNode("localhost", 789)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-372
|
||||
public void shouldThrowExecptionOnInvalidHostAndPortString() {
|
||||
new RedisSentinelConfiguration("mymaster", Collections.singleton(HOST_AND_NO_PORT));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-372
|
||||
public void shouldThrowExceptionWhenListOfHostAndPortIsNull() {
|
||||
new RedisSentinelConfiguration("mymaster", Collections.<String> singleton(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-372
|
||||
public void shouldNotFailWhenListOfHostAndPortIsEmpty() {
|
||||
|
||||
RedisSentinelConfiguration config = new RedisSentinelConfiguration("mymaster", Collections.<String> emptySet());
|
||||
@@ -93,18 +78,12 @@ public class RedisSentinelConfigurationUnitTests {
|
||||
assertThat(config.getSentinels().size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-372
|
||||
public void shouldThrowExceptionGivenNullPropertySource() {
|
||||
new RedisSentinelConfiguration((PropertySource<?>) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-372
|
||||
public void shouldNotFailWhenGivenPropertySourceNotContainingRelevantProperties() {
|
||||
|
||||
RedisSentinelConfiguration config = new RedisSentinelConfiguration(new MockPropertySource());
|
||||
@@ -113,10 +92,7 @@ public class RedisSentinelConfigurationUnitTests {
|
||||
assertThat(config.getSentinels().size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-372
|
||||
public void shouldBeCreatedCorrecltyGivenValidPropertySourceWithMasterAndSingleHostPort() {
|
||||
|
||||
MockPropertySource propertySource = new MockPropertySource();
|
||||
@@ -130,10 +106,7 @@ public class RedisSentinelConfigurationUnitTests {
|
||||
assertThat(config.getSentinels(), hasItems(new RedisNode("127.0.0.1", 123)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-372
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-372
|
||||
public void shouldBeCreatedCorrecltyGivenValidPropertySourceWithMasterAndMultipleHostPort() {
|
||||
|
||||
MockPropertySource propertySource = new MockPropertySource();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -58,10 +58,7 @@ public class ConvertersUnitTests {
|
||||
|
||||
private static final String CLUSTER_NODE_IMPORTING_SLOT = "ef570f86c7b1a953846668debc177a3a16733420 127.0.0.1:6379 myself,master - 0 0 1 connected [5461-<-0f2ee5df45d18c50aca07228cc18b1da96fd5e84]";
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void toSetOfRedis30ClusterNodesShouldConvertSingleStringNodesResponseCorrectly() {
|
||||
|
||||
Iterator<RedisClusterNode> nodes = Converters.toSetOfRedisClusterNodes(REDIS_3_0_CLUSTER_NODES_RESPONSE).iterator();
|
||||
@@ -111,10 +108,7 @@ public class ConvertersUnitTests {
|
||||
assertThat(node.getLinkState(), is(LinkState.CONNECTED));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void toSetOfRedis32ClusterNodesShouldConvertSingleStringNodesResponseCorrectly() {
|
||||
|
||||
Iterator<RedisClusterNode> nodes = Converters.toSetOfRedisClusterNodes(REDIS_3_2_CLUSTER_NODES_RESPONSE).iterator();
|
||||
@@ -164,10 +158,7 @@ public class ConvertersUnitTests {
|
||||
assertThat(node.getLinkState(), is(LinkState.CONNECTED));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void toSetOfRedisClusterNodesShouldConvertNodesWithSingleSlotCorrectly() {
|
||||
|
||||
Iterator<RedisClusterNode> nodes = Converters.toSetOfRedisClusterNodes(CLUSTER_NODE_WITH_SINGLE_SLOT_RESPONSE)
|
||||
@@ -181,10 +172,7 @@ public class ConvertersUnitTests {
|
||||
assertThat(node.getSlotRange().contains(3456), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void toSetOfRedisClusterNodesShouldParseLinkStateAndDisconnectedCorrectly() {
|
||||
|
||||
Iterator<RedisClusterNode> nodes = Converters.toSetOfRedisClusterNodes(
|
||||
@@ -200,10 +188,7 @@ public class ConvertersUnitTests {
|
||||
assertThat(node.getSlotRange().getSlots().size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void toSetOfRedisClusterNodesShouldIgnoreImportingSlot() {
|
||||
|
||||
Iterator<RedisClusterNode> nodes = Converters.toSetOfRedisClusterNodes(CLUSTER_NODE_IMPORTING_SLOT).iterator();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -103,10 +103,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
connection = new JedisClusterConnection(clusterMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void thowsExceptionWhenClusterCommandExecturorIsNull() {
|
||||
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
@@ -114,10 +111,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
new JedisClusterConnection(clusterMock, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterMeetShouldSendCommandsToExistingNodesCorrectly() {
|
||||
|
||||
connection.clusterMeet(UNKNOWN_CLUSTER_NODE);
|
||||
@@ -127,10 +121,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con2Mock, times(1)).clusterMeet(UNKNOWN_CLUSTER_NODE.getHost(), UNKNOWN_CLUSTER_NODE.getPort());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterMeetShouldThrowExceptionWhenNodeIsNull() {
|
||||
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
@@ -138,10 +129,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
connection.clusterMeet(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterForgetShouldSendCommandsToRemainingNodesCorrectly() {
|
||||
|
||||
connection.clusterForget(CLUSTER_NODE_2);
|
||||
@@ -151,10 +139,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con3Mock, times(1)).clusterForget(CLUSTER_NODE_2.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterReplicateShouldSendCommandsCorrectly() {
|
||||
|
||||
connection.clusterReplicate(CLUSTER_NODE_1, CLUSTER_NODE_2);
|
||||
@@ -164,10 +149,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verifyZeroInteractions(con1Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void closeShouldNotCloseUnderlyingClusterPool() throws IOException {
|
||||
|
||||
connection.close();
|
||||
@@ -175,10 +157,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(clusterMock, never()).close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void isClosedShouldReturnConnectionStateCorrectly() {
|
||||
|
||||
assertThat(connection.isClosed(), is(false));
|
||||
@@ -188,10 +167,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
assertThat(connection.isClosed(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterInfoShouldBeReturnedCorrectly() {
|
||||
|
||||
when(con1Mock.clusterInfo()).thenReturn(CLUSTER_INFO_RESPONSE);
|
||||
@@ -204,10 +180,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verifyInvocationsAcross("clusterInfo", times(1), con1Mock, con2Mock, con3Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotImportingShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.IMPORTING);
|
||||
@@ -215,10 +188,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con1Mock, times(1)).clusterSetSlotImporting(eq(100), eq(CLUSTER_NODE_1.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotMigratingShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.MIGRATING);
|
||||
@@ -226,10 +196,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con1Mock, times(1)).clusterSetSlotMigrating(eq(100), eq(CLUSTER_NODE_1.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotStableShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.STABLE);
|
||||
@@ -237,10 +204,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con1Mock, times(1)).clusterSetSlotStable(eq(100));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotNodeShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.NODE);
|
||||
@@ -248,10 +212,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con1Mock, times(1)).clusterSetSlotNode(eq(100), eq(CLUSTER_NODE_1.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotShouldBeExecutedOnTargetNodeWhenNodeIdNotSet() {
|
||||
|
||||
connection.clusterSetSlot(new RedisClusterNode(CLUSTER_HOST, MASTER_NODE_2_PORT), 100, AddSlots.IMPORTING);
|
||||
@@ -259,18 +220,12 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con2Mock, times(1)).clusterSetSlotImporting(eq(100), eq(CLUSTER_NODE_2.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void clusterSetSlotShouldThrowExceptionWhenModeIsNull() {
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterDeleteSlotsShouldBeExecutedCorrectly() {
|
||||
|
||||
int[] slots = new int[] { 9000, 10000 };
|
||||
@@ -279,18 +234,12 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con2Mock, times(1)).clusterDelSlots((int[]) anyVararg());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void clusterDeleteSlotShouldThrowExceptionWhenNodeIsNull() {
|
||||
connection.clusterDeleteSlots(null, new int[] { 1 });
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void timeShouldBeExecutedOnArbitraryNode() {
|
||||
|
||||
List<String> values = Arrays.asList("1449655759", "92217");
|
||||
@@ -303,10 +252,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verifyInvocationsAcross("time", times(1), con1Mock, con2Mock, con3Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void timeShouldBeExecutedOnSingleNode() {
|
||||
|
||||
when(con2Mock.time()).thenReturn(Arrays.asList("1449655759", "92217"));
|
||||
@@ -318,10 +264,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verifyZeroInteractions(con1Mock, con3Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void resetConfigStatsShouldBeExecutedOnAllNodes() {
|
||||
|
||||
connection.resetConfigStats();
|
||||
@@ -331,10 +274,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con3Mock, times(1)).configResetStat();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void resetConfigStatsShouldBeExecutedOnSingleNodeCorrectly() {
|
||||
|
||||
connection.resetConfigStats(CLUSTER_NODE_2);
|
||||
@@ -344,10 +284,7 @@ public class JedisClusterConnectionUnitTests {
|
||||
verify(con3Mock, never()).configResetStat();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterTopologyProviderShouldCollectErrorsWhenLoadingNodes() {
|
||||
|
||||
expectedException.expect(ClusterStateFailureException.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -49,18 +49,12 @@ public class JedisConnectionFactoryTests {
|
||||
factory.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-324
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-324
|
||||
public void shouldSendCommandCorrectlyViaConnectionFactoryUsingSentinel() {
|
||||
assertThat(factory.getConnection().ping(), equalTo("PONG"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-552
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-552
|
||||
public void getClientNameShouldEqualWithFactorySetting() {
|
||||
assertThat(factory.getConnection().getClientName(), equalTo("clientName"));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,10 +42,7 @@ public class JedisConnectionFactoryUnitTests {
|
||||
private static final RedisClusterConfiguration CLUSTER_CONFIG = new RedisClusterConfiguration().clusterNode(
|
||||
"127.0.0.1", 6379).clusterNode("127.0.0.1", 6380);
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-324
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-324
|
||||
public void shouldInitSentinelPoolWhenSentinelConfigPresent() {
|
||||
|
||||
connectionFactory = initSpyedConnectionFactory(SINGLE_SENTINEL_CONFIG, new JedisPoolConfig());
|
||||
@@ -55,10 +52,7 @@ public class JedisConnectionFactoryUnitTests {
|
||||
verify(connectionFactory, never()).createRedisPool();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-324
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-324
|
||||
public void shouldInitJedisPoolWhenNoSentinelConfigPresent() {
|
||||
|
||||
connectionFactory = initSpyedConnectionFactory((RedisSentinelConfiguration) null, new JedisPoolConfig());
|
||||
@@ -68,10 +62,7 @@ public class JedisConnectionFactoryUnitTests {
|
||||
verify(connectionFactory, never()).createRedisSentinelPool(Matchers.any(RedisSentinelConfiguration.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldInitConnectionCorrectlyWhenClusterConfigPresent() {
|
||||
|
||||
connectionFactory = initSpyedConnectionFactory(CLUSTER_CONFIG, new JedisPoolConfig());
|
||||
@@ -82,11 +73,7 @@ public class JedisConnectionFactoryUnitTests {
|
||||
verify(connectionFactory, never()).createRedisPool();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws IOException
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldClostClusterCorrectlyOnFactoryDestruction() throws IOException {
|
||||
|
||||
JedisCluster clusterMock = mock(JedisCluster.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -343,11 +343,8 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
|
||||
factory2.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-285
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@Test // DATAREDIS-285
|
||||
public void testExecuteShouldConvertArrayReplyCorrectly() {
|
||||
connection.set("spring", "awesome");
|
||||
connection.set("data", "cool");
|
||||
@@ -359,10 +356,7 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
|
||||
"cool".getBytes(), "supercalifragilisticexpialidocious".getBytes())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-286
|
||||
public void expireShouldSupportExiprationForValuesLargerThanInteger() {
|
||||
|
||||
connection.set("expireKey", "foo");
|
||||
@@ -374,10 +368,7 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
|
||||
assertThat(ttl, is(seconds));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-286
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-286
|
||||
public void pExpireShouldSupportExiprationForValuesLargerThanInteger() {
|
||||
|
||||
connection.set("pexpireKey", "foo");
|
||||
@@ -390,10 +381,7 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
|
||||
millis, ttl, millis - ttl), millis - ttl < 20L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
@RequiresRedisSentinel(SentinelsAvailable.ONE_ACTIVE)
|
||||
public void shouldReturnSentinelCommandsWhenWhenActiveSentinelFound() {
|
||||
|
||||
@@ -402,18 +390,12 @@ public class JedisConnectionIntegrationTests extends AbstractConnectionIntegrati
|
||||
assertThat(connection.getSentinelConnection(), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-552
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-552
|
||||
public void shouldSetClientName() {
|
||||
assertThat(connection.getClientName(), is(equalTo("jedis-client")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-106
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-106
|
||||
public void zRangeByScoreTest() {
|
||||
|
||||
connection.zAdd("myzset", 1, "one");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2014 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -255,27 +255,18 @@ public class JedisConnectionPipelineIntegrationTests extends AbstractConnectionP
|
||||
super.testZAddMultiple();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-269
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-269
|
||||
public void clientSetNameWorksCorrectly() {
|
||||
super.clientSetNameWorksCorrectly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-268
|
||||
public void testListClientsContainsAtLeastOneElement() {
|
||||
super.testListClientsContainsAtLeastOneElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-296
|
||||
*/
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class)
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class) // DATAREDIS-296
|
||||
public void testExecWithoutMulti() {
|
||||
super.testExecWithoutMulti();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -69,11 +69,8 @@ public class JedisConnectionPipelineTxIntegrationTests extends JedisConnectionTr
|
||||
return txResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-268
|
||||
public void testListClientsContainsAtLeastOneElement() {
|
||||
super.testListClientsContainsAtLeastOneElement();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2013 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -198,19 +198,13 @@ public class JedisConnectionTransactionIntegrationTests extends AbstractConnecti
|
||||
super.testRestoreExistingKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-269
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-269
|
||||
public void clientSetNameWorksCorrectly() {
|
||||
super.clientSetNameWorksCorrectly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-268
|
||||
public void testListClientsContainsAtLeastOneElement() {
|
||||
super.testListClientsContainsAtLeastOneElement();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -63,10 +63,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
connection = new JedisConnection(jedisSpy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-184
|
||||
public void shutdownWithNullShouldDelegateCommandCorrectly() {
|
||||
|
||||
connection.shutdown(null);
|
||||
@@ -74,10 +71,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verifyNativeConnectionInvocation().shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-184
|
||||
public void shutdownNosaveShouldBeSentCorrectlyUsingLuaScript() {
|
||||
|
||||
connection.shutdown(ShutdownOption.NOSAVE);
|
||||
@@ -88,10 +82,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
assertThat(captor.getValue(), equalTo("return redis.call('SHUTDOWN','NOSAVE')".getBytes()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-184
|
||||
public void shutdownSaveShouldBeSentCorrectlyUsingLuaScript() {
|
||||
|
||||
connection.shutdown(ShutdownOption.SAVE);
|
||||
@@ -102,122 +93,80 @@ public class JedisConnectionUnitTestSuite {
|
||||
assertThat(captor.getValue(), equalTo("return redis.call('SHUTDOWN','SAVE')".getBytes()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-267
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-267
|
||||
public void killClientShouldDelegateCallCorrectly() {
|
||||
|
||||
connection.killClient("127.0.0.1", 1001);
|
||||
verifyNativeConnectionInvocation().clientKill(eq("127.0.0.1:1001"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-270
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-270
|
||||
public void getClientNameShouldSendRequestCorrectly() {
|
||||
|
||||
connection.getClientName();
|
||||
verifyNativeConnectionInvocation().clientGetname();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-277
|
||||
public void slaveOfShouldThrowExectpionWhenCalledForNullHost() {
|
||||
connection.slaveOf(null, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-277
|
||||
public void slaveOfShouldBeSentCorrectly() {
|
||||
|
||||
connection.slaveOf("127.0.0.1", 1001);
|
||||
verifyNativeConnectionInvocation().slaveof(eq("127.0.0.1"), eq(1001));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-277
|
||||
public void slaveOfNoOneShouldBeSentCorrectly() {
|
||||
|
||||
connection.slaveOfNoOne();
|
||||
verifyNativeConnectionInvocation().slaveofNoOne();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = InvalidDataAccessResourceUsageException.class)
|
||||
@Test(expected = InvalidDataAccessResourceUsageException.class) // DATAREDIS-330
|
||||
public void shouldThrowExceptionWhenAccessingRedisSentinelsCommandsWhenNoSentinelsConfigured() {
|
||||
connection.getSentinelConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-472
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-472
|
||||
public void restoreShouldThrowExceptionWhenTtlInMillisExceedsIntegerRange() {
|
||||
connection.restore("foo".getBytes(), new Long(Integer.MAX_VALUE) + 1L, "bar".getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-472
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-472
|
||||
public void setExShouldThrowExceptionWhenTimeExceedsIntegerRange() {
|
||||
connection.setEx("foo".getBytes(), new Long(Integer.MAX_VALUE) + 1L, "bar".getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-472
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-472
|
||||
public void getRangeShouldThrowExceptionWhenStartExceedsIntegerRange() {
|
||||
connection.getRange("foo".getBytes(), new Long(Integer.MAX_VALUE) + 1L, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-472
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-472
|
||||
public void getRangeShouldThrowExceptionWhenEndExceedsIntegerRange() {
|
||||
connection.getRange("foo".getBytes(), Integer.MAX_VALUE, new Long(Integer.MAX_VALUE) + 1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-472
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-472
|
||||
public void sRandMemberShouldThrowExceptionWhenCountExceedsIntegerRange() {
|
||||
connection.sRandMember("foo".getBytes(), new Long(Integer.MAX_VALUE) + 1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-472
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-472
|
||||
public void zRangeByScoreShouldThrowExceptionWhenOffsetExceedsIntegerRange() {
|
||||
connection.zRangeByScore("foo".getBytes(), "foo", "bar", new Long(Integer.MAX_VALUE) + 1L, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-472
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-472
|
||||
public void zRangeByScoreShouldThrowExceptionWhenCountExceedsIntegerRange() {
|
||||
connection.zRangeByScore("foo".getBytes(), "foo", "bar", Integer.MAX_VALUE, new Long(Integer.MAX_VALUE) + 1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void scanShouldKeepTheConnectionOpen() {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).scan(anyString(),
|
||||
@@ -228,10 +177,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verify(jedisSpy, never()).quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void scanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).scan(anyString(),
|
||||
@@ -243,10 +189,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verify(jedisSpy, times(1)).quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void sScanShouldKeepTheConnectionOpen() {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).sscan(any(byte[].class),
|
||||
@@ -257,10 +200,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verify(jedisSpy, never()).quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void sScanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).sscan(any(byte[].class),
|
||||
@@ -272,10 +212,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verify(jedisSpy, times(1)).quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void zScanShouldKeepTheConnectionOpen() {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).zscan(any(byte[].class),
|
||||
@@ -286,10 +223,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verify(jedisSpy, never()).quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void zScanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).zscan(any(byte[].class),
|
||||
@@ -301,10 +235,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verify(jedisSpy, times(1)).quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void hScanShouldKeepTheConnectionOpen() {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).hscan(any(byte[].class),
|
||||
@@ -315,10 +246,7 @@ public class JedisConnectionUnitTestSuite {
|
||||
verify(jedisSpy, never()).quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void hScanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
|
||||
doReturn(new ScanResult<String>("0", Collections.<String> emptyList())).when(jedisSpy).hscan(any(byte[].class),
|
||||
@@ -340,118 +268,76 @@ public class JedisConnectionUnitTestSuite {
|
||||
connection.openPipeline();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-184
|
||||
public void shutdownNosaveShouldBeSentCorrectlyUsingLuaScript() {
|
||||
super.shutdownNosaveShouldBeSentCorrectlyUsingLuaScript();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-184
|
||||
public void shutdownSaveShouldBeSentCorrectlyUsingLuaScript() {
|
||||
super.shutdownSaveShouldBeSentCorrectlyUsingLuaScript();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-267
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-267
|
||||
public void killClientShouldDelegateCallCorrectly() {
|
||||
super.killClientShouldDelegateCallCorrectly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-270
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-270
|
||||
public void getClientNameShouldSendRequestCorrectly() {
|
||||
super.getClientNameShouldSendRequestCorrectly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-277
|
||||
public void slaveOfShouldBeSentCorrectly() {
|
||||
super.slaveOfShouldBeSentCorrectly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-277
|
||||
public void slaveOfNoOneShouldBeSentCorrectly() {
|
||||
super.slaveOfNoOneShouldBeSentCorrectly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void scanShouldKeepTheConnectionOpen() {
|
||||
super.scanShouldKeepTheConnectionOpen();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void scanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
super.scanShouldCloseTheConnectionWhenCursorIsClosed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void sScanShouldKeepTheConnectionOpen() {
|
||||
super.sScanShouldKeepTheConnectionOpen();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void sScanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
super.sScanShouldCloseTheConnectionWhenCursorIsClosed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void zScanShouldKeepTheConnectionOpen() {
|
||||
super.zScanShouldKeepTheConnectionOpen();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void zScanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
super.zScanShouldCloseTheConnectionWhenCursorIsClosed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void hScanShouldKeepTheConnectionOpen() {
|
||||
super.hScanShouldKeepTheConnectionOpen();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-531
|
||||
public void hScanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException {
|
||||
super.hScanShouldCloseTheConnectionWhenCursorIsClosed();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -41,26 +41,17 @@ public class JedisConvertersUnitTests {
|
||||
|
||||
private static final String CLIENT_ALL_SINGLE_LINE_RESPONSE = "addr=127.0.0.1:60311 fd=6 name= age=4059 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client";
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-268
|
||||
public void convertingEmptyStringToListOfRedisClientInfoShouldReturnEmptyList() {
|
||||
assertThat(JedisConverters.toListOfRedisClientInformation(""), equalTo(Collections.<RedisClientInfo> emptyList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-268
|
||||
public void convertingNullToListOfRedisClientInfoShouldReturnEmptyList() {
|
||||
assertThat(JedisConverters.toListOfRedisClientInformation(null), equalTo(Collections.<RedisClientInfo> emptyList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-268
|
||||
public void convertingMultipleLiesToListOfRedisClientInfoReturnsListCorrectly() {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -71,10 +62,7 @@ public class JedisConvertersUnitTests {
|
||||
assertThat(JedisConverters.toListOfRedisClientInformation(sb.toString()).size(), equalTo(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void convertsSingleMapToRedisServerReturnsCollectionCorrectly() {
|
||||
|
||||
Map<String, String> values = getRedisServerInfoMap("mymaster", 23697);
|
||||
@@ -84,10 +72,7 @@ public class JedisConvertersUnitTests {
|
||||
verifyRedisServerInfo(servers.get(0), values);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void convertsMultipleMapsToRedisServerReturnsCollectionCorrectly() {
|
||||
|
||||
List<Map<String, String>> vals = Arrays.asList(getRedisServerInfoMap("mymaster", 23697),
|
||||
@@ -100,18 +85,12 @@ public class JedisConvertersUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void convertsRedisServersCorrectlyWhenGivenAnEmptyList() {
|
||||
assertThat(JedisConverters.toListOfRedisServer(Collections.<Map<String, String>> emptyList()), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void convertsRedisServersCorrectlyWhenGivenNull() {
|
||||
assertThat(JedisConverters.toListOfRedisServer(null), notNullValue());
|
||||
}
|
||||
@@ -126,10 +105,7 @@ public class JedisConvertersUnitTests {
|
||||
assertThat(JedisConverters.boundaryToBytesForZRangeByLex(null, defaultValue), is(defaultValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-378
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-378
|
||||
public void boundaryToBytesForZRangeByLexShouldReturnDefaultValueWhenBoundaryValueIsNull() {
|
||||
|
||||
byte[] defaultValue = "tyrion".getBytes();
|
||||
@@ -138,10 +114,7 @@ public class JedisConvertersUnitTests {
|
||||
is(defaultValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-378
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-378
|
||||
public void boundaryToBytesForZRangeByLexShouldReturnValueCorrectlyWhenBoundaryIsIncluing() {
|
||||
|
||||
assertThat(
|
||||
@@ -149,10 +122,7 @@ public class JedisConvertersUnitTests {
|
||||
is(JedisConverters.toBytes("[a")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-378
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-378
|
||||
public void boundaryToBytesForZRangeByLexShouldReturnValueCorrectlyWhenBoundaryIsExcluding() {
|
||||
|
||||
assertThat(
|
||||
@@ -160,38 +130,26 @@ public class JedisConvertersUnitTests {
|
||||
is(JedisConverters.toBytes("(a")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-378
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-378
|
||||
public void boundaryToBytesForZRangeByLexShouldReturnValueCorrectlyWhenBoundaryIsAString() {
|
||||
|
||||
assertThat(JedisConverters.boundaryToBytesForZRangeByLex(Range.range().gt("a").getMin(), null),
|
||||
is(JedisConverters.toBytes("(a")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-378
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-378
|
||||
public void boundaryToBytesForZRangeByLexShouldReturnValueCorrectlyWhenBoundaryIsANumber() {
|
||||
|
||||
assertThat(JedisConverters.boundaryToBytesForZRangeByLex(Range.range().gt(1L).getMin(), null),
|
||||
is(JedisConverters.toBytes("(1")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-378
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-378
|
||||
public void boundaryToBytesForZRangeByLexShouldThrowExceptionWhenBoundaryHoldsUnknownType() {
|
||||
JedisConverters.boundaryToBytesForZRangeByLex(Range.range().gt(new Date()).getMin(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-352
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-352
|
||||
public void boundaryToBytesForZRangeByShouldReturnDefaultValueWhenBoundaryIsNull() {
|
||||
|
||||
byte[] defaultValue = "tyrion".getBytes();
|
||||
@@ -199,10 +157,7 @@ public class JedisConvertersUnitTests {
|
||||
assertThat(JedisConverters.boundaryToBytesForZRange(null, defaultValue), is(defaultValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-352
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-352
|
||||
public void boundaryToBytesForZRangeByShouldReturnDefaultValueWhenBoundaryValueIsNull() {
|
||||
|
||||
byte[] defaultValue = "tyrion".getBytes();
|
||||
@@ -210,10 +165,7 @@ public class JedisConvertersUnitTests {
|
||||
assertThat(JedisConverters.boundaryToBytesForZRange(Range.unbounded().getMax(), defaultValue), is(defaultValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-352
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-352
|
||||
public void boundaryToBytesForZRangeByShouldReturnValueCorrectlyWhenBoundaryIsIncluing() {
|
||||
|
||||
assertThat(
|
||||
@@ -221,90 +173,60 @@ public class JedisConvertersUnitTests {
|
||||
is(JedisConverters.toBytes("a")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-352
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-352
|
||||
public void boundaryToBytesForZRangeByShouldReturnValueCorrectlyWhenBoundaryIsExcluding() {
|
||||
|
||||
assertThat(JedisConverters.boundaryToBytesForZRange(Range.range().gt(JedisConverters.toBytes("a")).getMin(), null),
|
||||
is(JedisConverters.toBytes("(a")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-352
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-352
|
||||
public void boundaryToBytesForZRangeByShouldReturnValueCorrectlyWhenBoundaryIsAString() {
|
||||
|
||||
assertThat(JedisConverters.boundaryToBytesForZRange(Range.range().gt("a").getMin(), null),
|
||||
is(JedisConverters.toBytes("(a")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-352
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-352
|
||||
public void boundaryToBytesForZRangeByShouldReturnValueCorrectlyWhenBoundaryIsANumber() {
|
||||
|
||||
assertThat(JedisConverters.boundaryToBytesForZRange(Range.range().gt(1L).getMin(), null),
|
||||
is(JedisConverters.toBytes("(1")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-352
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-352
|
||||
public void boundaryToBytesForZRangeByShouldThrowExceptionWhenBoundaryHoldsUnknownType() {
|
||||
JedisConverters.boundaryToBytesForZRange(Range.range().gt(new Date()).getMin(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetCommandExPxOptionShouldReturnEXforSeconds() {
|
||||
assertThat(JedisConverters.toSetCommandExPxArgument(Expiration.seconds(100)), equalTo(JedisConverters.toBytes("EX")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetCommandExPxOptionShouldReturnEXforMilliseconds() {
|
||||
|
||||
assertThat(JedisConverters.toSetCommandExPxArgument(Expiration.milliseconds(100)),
|
||||
equalTo(JedisConverters.toBytes("PX")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetCommandExPxOptionShouldReturnEmptyArrayForNull() {
|
||||
assertThat(JedisConverters.toSetCommandExPxArgument(null), equalTo(new byte[] {}));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetCommandNxXxOptionShouldReturnNXforAbsent() {
|
||||
assertThat(JedisConverters.toSetCommandNxXxArgument(SetOption.ifAbsent()), equalTo(JedisConverters.toBytes("NX")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetCommandNxXxOptionShouldReturnXXforAbsent() {
|
||||
assertThat(JedisConverters.toSetCommandNxXxArgument(SetOption.ifPresent()), equalTo(JedisConverters.toBytes("XX")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetCommandNxXxOptionShouldReturnEmptyArrayforUpsert() {
|
||||
assertThat(JedisConverters.toSetCommandNxXxArgument(SetOption.upsert()), equalTo(new byte[] {}));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,10 +42,7 @@ public class JedisExceptionConverterUnitTests {
|
||||
converter = new JedisExceptionConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldConvertMovedDataException() {
|
||||
|
||||
DataAccessException converted = converter.convert(new JedisMovedDataException("MOVED 3999 127.0.0.1:6381",
|
||||
@@ -57,10 +54,7 @@ public class JedisExceptionConverterUnitTests {
|
||||
assertThat(((ClusterRedirectException) converted).getTargetPort(), is(6381));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldConvertAskDataException() {
|
||||
|
||||
DataAccessException converted = converter.convert(new JedisAskDataException("ASK 3999 127.0.0.1:6381",
|
||||
@@ -72,10 +66,7 @@ public class JedisExceptionConverterUnitTests {
|
||||
assertThat(((ClusterRedirectException) converted).getTargetPort(), is(6381));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldConvertMaxRedirectException() {
|
||||
|
||||
DataAccessException converted = converter
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,19 +44,13 @@ public class JedisSentinelConnectionUnitTests {
|
||||
this.connection = new JedisSentinelConnection(jedisMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldConnectAfterCreation() {
|
||||
verify(jedisMock, times(1)).connect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldNotConnectIfAlreadyConnected() {
|
||||
|
||||
Jedis yetAnotherJedisMock = mock(Jedis.class);
|
||||
@@ -67,124 +61,82 @@ public class JedisSentinelConnectionUnitTests {
|
||||
verify(yetAnotherJedisMock, never()).connect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void failoverShouldBeSentCorrectly() {
|
||||
|
||||
connection.failover(new RedisNodeBuilder().withName("mymaster").build());
|
||||
verify(jedisMock, times(1)).sentinelFailover(eq("mymaster"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void failoverShouldThrowExceptionIfMasterNodeIsNull() {
|
||||
connection.failover(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void failoverShouldThrowExceptionIfMasterNodeNameIsEmpty() {
|
||||
connection.failover(new RedisNodeBuilder().build());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void mastersShouldReadMastersCorrectly() {
|
||||
|
||||
connection.masters();
|
||||
verify(jedisMock, times(1)).sentinelMasters();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldReadSlavesCorrectly() {
|
||||
|
||||
connection.slaves("mymaster");
|
||||
verify(jedisMock, times(1)).sentinelSlaves(eq("mymaster"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldReadSlavesCorrectlyWhenGivenNamedNode() {
|
||||
|
||||
connection.slaves(new RedisNodeBuilder().withName("mymaster").build());
|
||||
verify(jedisMock, times(1)).sentinelSlaves(eq("mymaster"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void readSlavesShouldThrowExceptionWhenGivenEmptyMasterName() {
|
||||
connection.slaves("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void readSlavesShouldThrowExceptionWhenGivenNull() {
|
||||
connection.slaves((RedisNode) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void readSlavesShouldThrowExceptionWhenNodeWithoutName() {
|
||||
connection.slaves(new RedisNodeBuilder().build());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldRemoveMasterCorrectlyWhenGivenNamedNode() {
|
||||
|
||||
connection.remove(new RedisNodeBuilder().withName("mymaster").build());
|
||||
verify(jedisMock, times(1)).sentinelRemove(eq("mymaster"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void removeShouldThrowExceptionWhenGivenEmptyMasterName() {
|
||||
connection.remove("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void removeShouldThrowExceptionWhenGivenNull() {
|
||||
connection.remove((RedisNode) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-330
|
||||
public void removeShouldThrowExceptionWhenNodeWithoutName() {
|
||||
connection.remove(new RedisNodeBuilder().build());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void monitorShouldBeSentCorrectly() {
|
||||
|
||||
RedisServer server = new RedisServer("127.0.0.1", 6382);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -127,10 +127,7 @@ public class JedisSentinelIntegrationTests extends AbstractConnectionIntegration
|
||||
super.testErrorInTx();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldReadMastersCorrectly() {
|
||||
|
||||
List<RedisServer> servers = (List<RedisServer>) connectionFactory.getSentinelConnection().masters();
|
||||
@@ -138,10 +135,7 @@ public class JedisSentinelIntegrationTests extends AbstractConnectionIntegration
|
||||
assertThat(servers.get(0).getName(), is(MASTER_NAME));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-330
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-330
|
||||
public void shouldReadSlavesOfMastersCorrectly() {
|
||||
|
||||
RedisSentinelConnection sentinelConnection = connectionFactory.getSentinelConnection();
|
||||
@@ -154,10 +148,7 @@ public class JedisSentinelIntegrationTests extends AbstractConnectionIntegration
|
||||
assertThat(slaves, hasItems(SLAVE_0, SLAVE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-552
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-552
|
||||
public void shouldSetClientName() {
|
||||
|
||||
RedisSentinelConnection sentinelConnection = connectionFactory.getSentinelConnection();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -50,37 +50,25 @@ public class JedisTransactionalConnectionStarvationTest extends AbstractTransact
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-332
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-332
|
||||
@Rollback
|
||||
public void testNumberOfOperationsIsOne() {
|
||||
tryOperations(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-332
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-332
|
||||
@Rollback
|
||||
public void testNumberOfOperationsEqualToNumberOfConnections() {
|
||||
tryOperations(MAX_CONNECTIONS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-332
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-332
|
||||
@Rollback
|
||||
public void testNumberOfOperationsGreaterThanNumberOfConnections() {
|
||||
tryOperations(MAX_CONNECTIONS + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-548
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-548
|
||||
@Transactional(readOnly = true)
|
||||
public void readonlyTransactionSyncShouldNotExcceedMaxConnections() {
|
||||
tryOperations(MAX_CONNECTIONS + 1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -205,10 +205,7 @@ public class DefaultLettucePoolTests {
|
||||
pool.getResource();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-524
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-524
|
||||
public void testCreateSentinelWithPassword() {
|
||||
|
||||
pool = new DefaultLettucePool(new RedisSentinelConfiguration("mymaster", Collections.singleton("host:1234")));
|
||||
@@ -221,10 +218,7 @@ public class DefaultLettucePoolTests {
|
||||
assertThat(redisUri.getPassword(), is(equalTo(pool.getPassword().toCharArray())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-462
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-462
|
||||
public void poolWorksWithoutClientResources() {
|
||||
|
||||
pool = new DefaultLettucePool(SettingsUtils.getHost(), SettingsUtils.getPort());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -122,18 +122,12 @@ public class LettuceClusterConnectionUnitTests {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void thowsExceptionWhenClusterCommandExecturorIsNull() {
|
||||
new LettuceClusterConnection(clusterMock, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterMeetShouldSendCommandsToExistingNodesCorrectly() {
|
||||
|
||||
connection.clusterMeet(UNKNOWN_CLUSTER_NODE);
|
||||
@@ -146,18 +140,12 @@ public class LettuceClusterConnectionUnitTests {
|
||||
UNKNOWN_CLUSTER_NODE.getPort());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void clusterMeetShouldThrowExceptionWhenNodeIsNull() {
|
||||
connection.clusterMeet(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterForgetShouldSendCommandsToRemainingNodesCorrectly() {
|
||||
|
||||
connection.clusterForget(CLUSTER_NODE_2);
|
||||
@@ -167,10 +155,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection3Mock, times(1)).clusterForget(CLUSTER_NODE_2.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterReplicateShouldSendCommandsCorrectly() {
|
||||
|
||||
connection.clusterReplicate(CLUSTER_NODE_1, CLUSTER_NODE_2);
|
||||
@@ -179,10 +164,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verifyZeroInteractions(clusterConnection1Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void closeShouldNotCloseUnderlyingClusterPool() throws IOException {
|
||||
|
||||
connection.close();
|
||||
@@ -190,10 +172,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterMock, never()).shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void isClosedShouldReturnConnectionStateCorrectly() {
|
||||
|
||||
assertThat(connection.isClosed(), is(false));
|
||||
@@ -203,10 +182,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
assertThat(connection.isClosed(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void keysShouldBeRunOnAllClusterNodes() {
|
||||
|
||||
when(clusterConnection1Mock.keys(any(byte[].class))).thenReturn(Collections.<byte[]>emptyList());
|
||||
@@ -222,10 +198,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection3Mock, times(1)).keys(pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void keysShouldOnlyBeRunOnDedicatedNodeWhenPinned() {
|
||||
|
||||
when(clusterConnection2Mock.keys(any(byte[].class))).thenReturn(Collections.<byte[]>emptyList());
|
||||
@@ -239,10 +212,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection3Mock, never()).keys(pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void randomKeyShouldReturnAnyKeyFromRandomNode() {
|
||||
|
||||
when(clusterConnection1Mock.randomkey()).thenReturn(KEY_1_BYTES);
|
||||
@@ -254,10 +224,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
clusterConnection3Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void randomKeyShouldReturnKeyWhenAvailableOnAnyNode() {
|
||||
|
||||
when(clusterConnection3Mock.randomkey()).thenReturn(KEY_3_BYTES);
|
||||
@@ -267,10 +234,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void randomKeyShouldReturnNullWhenNoKeysPresentOnAllNodes() {
|
||||
|
||||
when(clusterConnection1Mock.randomkey()).thenReturn(null);
|
||||
@@ -280,10 +244,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
assertThat(connection.randomKey(), nullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotImportingShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.IMPORTING);
|
||||
@@ -291,10 +252,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection1Mock, times(1)).clusterSetSlotImporting(eq(100), eq(CLUSTER_NODE_1.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotMigratingShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.MIGRATING);
|
||||
@@ -302,10 +260,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection1Mock, times(1)).clusterSetSlotMigrating(eq(100), eq(CLUSTER_NODE_1.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotStableShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.STABLE);
|
||||
@@ -313,10 +268,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection1Mock, times(1)).clusterSetSlotStable(eq(100));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotNodeShouldBeExecutedCorrectly() {
|
||||
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, AddSlots.NODE);
|
||||
@@ -324,10 +276,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection1Mock, times(1)).clusterSetSlotNode(eq(100), eq(CLUSTER_NODE_1.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterSetSlotShouldBeExecutedOnTargetNodeWhenNodeIdNotSet() {
|
||||
|
||||
connection.clusterSetSlot(new RedisClusterNode(CLUSTER_HOST, MASTER_NODE_2_PORT), 100, AddSlots.IMPORTING);
|
||||
@@ -335,18 +284,12 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection2Mock, times(1)).clusterSetSlotImporting(eq(100), eq(CLUSTER_NODE_2.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void clusterSetSlotShouldThrowExceptionWhenModeIsNull() {
|
||||
connection.clusterSetSlot(CLUSTER_NODE_1, 100, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void clusterDeleteSlotsShouldBeExecutedCorrectly() {
|
||||
|
||||
int[] slots = new int[] { 9000, 10000 };
|
||||
@@ -355,18 +298,12 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection2Mock, times(1)).clusterDelSlots((int[]) anyVararg());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void clusterDeleteSlotShouldThrowExceptionWhenNodeIsNull() {
|
||||
connection.clusterDeleteSlots(null, new int[] { 1 });
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void timeShouldBeExecutedOnArbitraryNode() {
|
||||
|
||||
List<byte[]> values = Arrays.asList("1449655759".getBytes(), "92217".getBytes());
|
||||
@@ -379,10 +316,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verifyInvocationsAcross("time", times(1), clusterConnection1Mock, clusterConnection2Mock, clusterConnection3Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void timeShouldBeExecutedOnSingleNode() {
|
||||
|
||||
when(clusterConnection2Mock.time()).thenReturn(Arrays.asList("1449655759".getBytes(), "92217".getBytes()));
|
||||
@@ -393,10 +327,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verifyZeroInteractions(clusterConnection1Mock, clusterConnection3Mock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void resetConfigStatsShouldBeExecutedOnAllNodes() {
|
||||
|
||||
connection.resetConfigStats();
|
||||
@@ -406,10 +337,7 @@ public class LettuceClusterConnectionUnitTests {
|
||||
verify(clusterConnection3Mock, times(1)).configResetstat();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void resetConfigStatsShouldBeExecutedOnSingleNodeCorrectly() {
|
||||
|
||||
connection.resetConfigStats(CLUSTER_NODE_2);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -280,10 +280,7 @@ public class LettuceConnectionFactoryTests {
|
||||
conn.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-431
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-431
|
||||
public void dbIndexShouldBePropagatedCorrectly() {
|
||||
|
||||
LettuceConnectionFactory factory = new LettuceConnectionFactory();
|
||||
@@ -307,10 +304,7 @@ public class LettuceConnectionFactoryTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-462
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-462
|
||||
public void factoryWorksWithoutClientResources() {
|
||||
|
||||
LettuceConnectionFactory factory = new LettuceConnectionFactory();
|
||||
@@ -328,10 +322,7 @@ public class LettuceConnectionFactoryTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void factoryShouldReturnReactiveConnectionWhenCorrectly() {
|
||||
|
||||
LettuceConnectionFactory factory = new LettuceConnectionFactory();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -57,10 +57,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
ConnectionFactoryTracker.cleanUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shouldInitClientCorrectlyWhenClusterConfigPresent() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(clusterConfig);
|
||||
@@ -71,10 +68,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(getField(connectionFactory, "client"), instanceOf(RedisClusterClient.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
@SuppressWarnings("unchecked")
|
||||
public void timeoutShouldBeSetCorrectlyOnClusterClient() {
|
||||
|
||||
@@ -95,10 +89,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
@SuppressWarnings("unchecked")
|
||||
public void passwordShouldBeSetCorrectlyOnClusterClient() {
|
||||
|
||||
@@ -118,10 +109,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-524
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-524
|
||||
public void passwordShouldBeSetCorrectlyOnSentinelClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(
|
||||
@@ -139,10 +127,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(redisUri.getPassword(), is(equalTo(connectionFactory.getPassword().toCharArray())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-462
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-462
|
||||
public void clusterClientShouldInitializeWithoutClientResources() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(clusterConfig);
|
||||
@@ -154,10 +139,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(client, instanceOf(RedisClusterClient.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-480
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-480
|
||||
public void sslOptionsShouldBeDisabledByDefaultOnClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory();
|
||||
@@ -178,10 +160,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(connectionFactory.isVerifyPeer(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-476
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-476
|
||||
public void sslShouldBeSetCorrectlyOnClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory();
|
||||
@@ -201,10 +180,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(connectionFactory.isVerifyPeer(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-480
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-480
|
||||
public void verifyPeerOptionShouldBeSetCorrectlyOnClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory();
|
||||
@@ -222,10 +198,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(connectionFactory.isVerifyPeer(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-480
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-480
|
||||
public void startTLSOptionShouldBeSetCorrectlyOnClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory();
|
||||
@@ -243,10 +216,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
assertThat(connectionFactory.isStartTls(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-537
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-537
|
||||
public void sslShouldBeSetCorrectlyOnClusterClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(
|
||||
@@ -266,10 +236,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-537
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-537
|
||||
public void startTLSOptionShouldBeSetCorrectlyOnClusterClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(
|
||||
@@ -289,10 +256,7 @@ public class LettuceConnectionFactoryUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-537
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-537
|
||||
public void verifyPeerTLSOptionShouldBeSetCorrectlyOnClusterClient() {
|
||||
|
||||
LettuceConnectionFactory connectionFactory = new LettuceConnectionFactory(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2016 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -298,11 +298,8 @@ public class LettuceConnectionIntegrationTests extends AbstractConnectionIntegra
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-285
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@Test // DATAREDIS-285
|
||||
public void testExecuteShouldConvertArrayReplyCorrectly() {
|
||||
|
||||
connection.set("spring", "awesome");
|
||||
@@ -329,10 +326,7 @@ public class LettuceConnectionIntegrationTests extends AbstractConnectionIntegra
|
||||
Arrays.asList(new Object[] { new String(scriptResults.get(0)), new String(scriptResults.get(1)) }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-106
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-106
|
||||
public void zRangeByScoreTest() {
|
||||
|
||||
connection.zAdd("myzset", 1, "one");
|
||||
@@ -344,10 +338,7 @@ public class LettuceConnectionIntegrationTests extends AbstractConnectionIntegra
|
||||
assertEquals("two", new String(zRangeByScore.iterator().next()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
@RequiresRedisSentinel(RedisSentinelRule.SentinelsAvailable.ONE_ACTIVE)
|
||||
public void shouldReturnSentinelCommandsWhenWhenActiveSentinelFound() {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2015 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -110,11 +110,8 @@ public class LettuceConnectionPipelineIntegrationTests extends AbstractConnectio
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-268
|
||||
public void testListClientsContainsAtLeastOneElement() {
|
||||
super.testListClientsContainsAtLeastOneElement();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -83,11 +83,8 @@ public class LettuceConnectionPipelineTxIntegrationTests extends LettuceConnecti
|
||||
return txResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Override
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-268
|
||||
public void testListClientsContainsAtLeastOneElement() {
|
||||
super.testListClientsContainsAtLeastOneElement();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -70,40 +70,28 @@ public class LettuceConnectionUnitTestSuite {
|
||||
connection = new LettuceConnection(0, clientMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-184
|
||||
public void shutdownWithNullOptionsIsCalledCorrectly() {
|
||||
|
||||
connection.shutdown(null);
|
||||
verify(syncCommandsMock, times(1)).shutdown(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-184
|
||||
public void shutdownWithNosaveOptionIsCalledCorrectly() {
|
||||
|
||||
connection.shutdown(ShutdownOption.NOSAVE);
|
||||
verify(syncCommandsMock, times(1)).shutdown(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-184
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-184
|
||||
public void shutdownWithSaveOptionIsCalledCorrectly() {
|
||||
|
||||
connection.shutdown(ShutdownOption.SAVE);
|
||||
verify(syncCommandsMock, times(1)).shutdown(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-267
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-267
|
||||
public void killClientShouldDelegateCallCorrectly() {
|
||||
|
||||
String ipPort = "127.0.0.1:1001";
|
||||
@@ -111,56 +99,38 @@ public class LettuceConnectionUnitTestSuite {
|
||||
verify(syncCommandsMock, times(1)).clientKill(eq(ipPort));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-270
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-270
|
||||
public void getClientNameShouldSendRequestCorrectly() {
|
||||
|
||||
connection.getClientName();
|
||||
verify(syncCommandsMock, times(1)).clientGetname();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-277
|
||||
public void slaveOfShouldThrowExectpionWhenCalledForNullHost() {
|
||||
connection.slaveOf(null, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-277
|
||||
public void slaveOfShouldBeSentCorrectly() {
|
||||
|
||||
connection.slaveOf("127.0.0.1", 1001);
|
||||
verify(syncCommandsMock, times(1)).slaveof(eq("127.0.0.1"), eq(1001));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-277
|
||||
public void slaveOfNoOneShouldBeSentCorrectly() {
|
||||
|
||||
connection.slaveOfNoOne();
|
||||
verify(syncCommandsMock, times(1)).slaveofNoOne();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = InvalidDataAccessResourceUsageException.class)
|
||||
@Test(expected = InvalidDataAccessResourceUsageException.class) // DATAREDIS-348
|
||||
public void shouldThrowExceptionWhenAccessingRedisSentinelsCommandsWhenNoSentinelsConfigured() {
|
||||
connection.getSentinelConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-431
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-431
|
||||
public void dbIndexShouldBeSetWhenObtainingConnection() {
|
||||
|
||||
connection = new LettuceConnection(null, 0, clientMock, null, 1);
|
||||
@@ -179,50 +149,35 @@ public class LettuceConnectionUnitTestSuite {
|
||||
this.connection.openPipeline();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-528
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-528
|
||||
public void shutdownWithSaveOptionIsCalledCorrectly() {
|
||||
|
||||
connection.shutdown(ShutdownOption.SAVE);
|
||||
verify(asyncCommandsMock, times(1)).shutdown(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-528
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-528
|
||||
public void shutdownWithNosaveOptionIsCalledCorrectly() {
|
||||
|
||||
connection.shutdown(ShutdownOption.NOSAVE);
|
||||
verify(asyncCommandsMock, times(1)).shutdown(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-528
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-528
|
||||
public void slaveOfShouldBeSentCorrectly() {
|
||||
|
||||
connection.slaveOf("127.0.0.1", 1001);
|
||||
verify(asyncCommandsMock, times(1)).slaveof(eq("127.0.0.1"), eq(1001));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-528
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-528
|
||||
public void shutdownWithNullOptionsIsCalledCorrectly() {
|
||||
|
||||
connection.shutdown(null);
|
||||
verify(asyncCommandsMock, times(1)).shutdown(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-528
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-528
|
||||
public void killClientShouldDelegateCallCorrectly() {
|
||||
|
||||
String ipPort = "127.0.0.1:1001";
|
||||
@@ -230,20 +185,14 @@ public class LettuceConnectionUnitTestSuite {
|
||||
verify(asyncCommandsMock, times(1)).clientKill(eq(ipPort));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-528
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-528
|
||||
public void slaveOfNoOneShouldBeSentCorrectly() {
|
||||
|
||||
connection.slaveOfNoOne();
|
||||
verify(asyncCommandsMock, times(1)).slaveofNoOne();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-528
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-528
|
||||
public void getClientNameShouldSendRequestCorrectly() {
|
||||
|
||||
connection.getClientName();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,27 +48,18 @@ public class LettuceConvertersUnitTests {
|
||||
|
||||
private static final String CLIENT_ALL_SINGLE_LINE_RESPONSE = "addr=127.0.0.1:60311 fd=6 name= age=4059 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client";
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-268
|
||||
public void convertingEmptyStringToListOfRedisClientInfoShouldReturnEmptyList() {
|
||||
assertThat(LettuceConverters.toListOfRedisClientInformation(""), equalTo(Collections.<RedisClientInfo>emptyList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-268
|
||||
public void convertingNullToListOfRedisClientInfoShouldReturnEmptyList() {
|
||||
assertThat(LettuceConverters.toListOfRedisClientInformation(null),
|
||||
equalTo(Collections.<RedisClientInfo>emptyList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-268
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-268
|
||||
public void convertingMultipleLiesToListOfRedisClientInfoReturnsListCorrectly() {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -79,18 +70,12 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat(LettuceConverters.toListOfRedisClientInformation(sb.toString()).size(), equalTo(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void partitionsToClusterNodesShouldReturnEmptyCollectionWhenPartionsDoesNotContainElements() {
|
||||
assertThat(LettuceConverters.partitionsToClusterNodes(new Partitions()), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void partitionsToClusterNodesShouldConvertPartitionCorrctly() {
|
||||
|
||||
Partitions partitions = new Partitions();
|
||||
@@ -116,10 +101,7 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat(node.getSlotRange().getSlots(), hasItems(1, 2, 3, 4, 5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetArgsShouldReturnEmptyArgsForNullValues() {
|
||||
|
||||
SetArgs args = LettuceConverters.toSetArgs(null, null);
|
||||
@@ -130,10 +112,7 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat((Boolean) getField(args, "xx"), is(Boolean.FALSE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetArgsShouldNotSetExOrPxForPersistent() {
|
||||
|
||||
SetArgs args = LettuceConverters.toSetArgs(Expiration.persistent(), null);
|
||||
@@ -144,10 +123,7 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat((Boolean) getField(args, "xx"), is(Boolean.FALSE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetArgsShouldSetExForSeconds() {
|
||||
|
||||
SetArgs args = LettuceConverters.toSetArgs(Expiration.seconds(10), null);
|
||||
@@ -158,10 +134,7 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat((Boolean) getField(args, "xx"), is(Boolean.FALSE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetArgsShouldSetPxForMilliseconds() {
|
||||
|
||||
SetArgs args = LettuceConverters.toSetArgs(Expiration.milliseconds(100), null);
|
||||
@@ -172,10 +145,7 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat((Boolean) getField(args, "xx"), is(Boolean.FALSE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetArgsShouldSetNxForAbsent() {
|
||||
|
||||
SetArgs args = LettuceConverters.toSetArgs(null, SetOption.ifAbsent());
|
||||
@@ -186,10 +156,7 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat((Boolean) getField(args, "xx"), is(Boolean.FALSE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetArgsShouldSetXxForPresent() {
|
||||
|
||||
SetArgs args = LettuceConverters.toSetArgs(null, SetOption.ifPresent());
|
||||
@@ -200,10 +167,7 @@ public class LettuceConvertersUnitTests {
|
||||
assertThat((Boolean) getField(args, "xx"), is(Boolean.TRUE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void toSetArgsShouldNotSetNxOrXxForUpsert() {
|
||||
|
||||
SetArgs args = LettuceConverters.toSetArgs(null, SetOption.upsert());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.redis.connection.lettuce;
|
||||
|
||||
import static org.hamcrest.core.Is.*;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,23 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.redis.connection.lettuce;
|
||||
|
||||
import static org.hamcrest.core.Is.*;
|
||||
@@ -45,10 +28,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class LettuceReactiveClusterHyperLogLogCommandsTests extends LettuceReactiveClusterCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pfCountWithMultipleKeysShouldReturnCorrectlyWhenKeysMapToSameSlot() {
|
||||
|
||||
nativeCommands.pfadd(SAME_SLOT_KEY_1, new String[] { VALUE_1, VALUE_2 });
|
||||
@@ -58,10 +38,7 @@ public class LettuceReactiveClusterHyperLogLogCommandsTests extends LettuceReact
|
||||
.block(), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pfMergeShouldWorkCorrectlyWhenKeysMapToSameSlot() {
|
||||
|
||||
nativeCommands.pfadd(SAME_SLOT_KEY_1, new String[] { VALUE_1, VALUE_2 });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.redis.connection.lettuce;
|
||||
|
||||
import static org.hamcrest.collection.IsCollectionWithSize.*;
|
||||
@@ -39,10 +38,7 @@ public class LettuceReactiveClusterKeyCommandsTests extends LettuceReactiveClust
|
||||
|
||||
static final RedisClusterNode NODE_1 = newRedisClusterNode().listeningAt("127.0.0.1", 7379).build();
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void keysShouldReturnOnlyKeysFromSelectedNode() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -53,10 +49,7 @@ public class LettuceReactiveClusterKeyCommandsTests extends LettuceReactiveClust
|
||||
assertThat(result, contains(KEY_1_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void randomkeyShouldReturnOnlyKeysFromSelectedNode() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,23 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.redis.connection.lettuce;
|
||||
|
||||
import static org.hamcrest.core.Is.*;
|
||||
@@ -49,10 +32,7 @@ import org.springframework.data.redis.connection.ReactiveListCommands;
|
||||
*/
|
||||
public class LettuceReactiveClusterListCommandsTests extends LettuceReactiveClusterCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void bRPopLPushShouldWorkCorrectlyWhenAllKeysMapToSameSlot() {
|
||||
|
||||
nativeCommands.rpush(SAME_SLOT_KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -66,10 +46,7 @@ public class LettuceReactiveClusterListCommandsTests extends LettuceReactiveClus
|
||||
assertThat(nativeCommands.lindex(SAME_SLOT_KEY_2, 0), is(equalTo(VALUE_3)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void blPopShouldReturnFirstAvailableWhenAllKeysMapToTheSameSlot() {
|
||||
|
||||
nativeCommands.rpush(SAME_SLOT_KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.redis.connection.lettuce;
|
||||
|
||||
import static org.hamcrest.core.Is.*;
|
||||
@@ -35,10 +34,7 @@ import org.springframework.data.redis.connection.RedisStringCommands;
|
||||
*/
|
||||
public class LettuceReactiveClusterStringCommandsTests extends LettuceReactiveClusterCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mSetNXShouldAddMultipleKeyValueParisWhenMappedToSameSlot() {
|
||||
|
||||
Map<ByteBuffer, ByteBuffer> map = new LinkedHashMap<>();
|
||||
@@ -51,10 +47,7 @@ public class LettuceReactiveClusterStringCommandsTests extends LettuceReactiveCl
|
||||
assertThat(nativeCommands.get(SAME_SLOT_KEY_2), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mSetNXShouldNotAddMultipleKeyValueParisWhenAlreadyExitAndMapToSameSlot() {
|
||||
|
||||
nativeCommands.set(SAME_SLOT_KEY_2, VALUE_2);
|
||||
@@ -69,10 +62,7 @@ public class LettuceReactiveClusterStringCommandsTests extends LettuceReactiveCl
|
||||
assertThat(nativeCommands.get(SAME_SLOT_KEY_2), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void bitOpAndShouldWorkAsExpectedWhenKeysMapToSameSlot() {
|
||||
|
||||
nativeCommands.set(SAME_SLOT_KEY_1, VALUE_1);
|
||||
@@ -83,10 +73,7 @@ public class LettuceReactiveClusterStringCommandsTests extends LettuceReactiveCl
|
||||
assertThat(nativeCommands.get(SAME_SLOT_KEY_3), is(equalTo("value-0")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void bitOpOrShouldWorkAsExpectedWhenKeysMapToSameSlot() {
|
||||
|
||||
nativeCommands.set(SAME_SLOT_KEY_1, VALUE_1);
|
||||
@@ -97,10 +84,7 @@ public class LettuceReactiveClusterStringCommandsTests extends LettuceReactiveCl
|
||||
assertThat(nativeCommands.get(SAME_SLOT_KEY_3), is(equalTo(VALUE_3)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-525
|
||||
public void bitNotShouldThrowExceptionWhenMoreThanOnSourceKeyAndKeysMapToSameSlot() {
|
||||
|
||||
connection.stringCommands().bitOp(Arrays.asList(SAME_SLOT_KEY_1_BBUFFER, SAME_SLOT_KEY_2_BBUFFER),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,23 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2016. the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.redis.connection.lettuce;
|
||||
|
||||
import static org.hamcrest.core.Is.*;
|
||||
@@ -45,10 +28,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class LettuceReactiveClusterZSetCommandsTests extends LettuceReactiveClusterCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zUnionStoreShouldWorkWhenAllKeysMapToSameSlot() {
|
||||
|
||||
nativeCommands.zadd(SAME_SLOT_KEY_1, 1D, VALUE_1);
|
||||
@@ -62,10 +42,7 @@ public class LettuceReactiveClusterZSetCommandsTests extends LettuceReactiveClus
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zInterStoreShouldWorkCorrectlyWhenKeysMapToSameSlot() {
|
||||
|
||||
nativeCommands.zadd(SAME_SLOT_KEY_1, 1D, VALUE_1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -57,27 +57,18 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
private static final GeoLocation<ByteBuffer> PALERMO = new GeoLocation<>(
|
||||
ByteBuffer.wrap(PALERMO_MEMBER_NAME.getBytes(Charset.forName("UTF-8"))), POINT_PALERMO);
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoAddShouldAddSingleGeoLocationCorrectly() {
|
||||
assertThat(connection.geoCommands().geoAdd(KEY_1_BBUFFER, ARIGENTO).block(), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoAddShouldAddMultipleGeoLocationsCorrectly() {
|
||||
assertThat(connection.geoCommands().geoAdd(KEY_1_BBUFFER, Arrays.asList(ARIGENTO, CATANIA, PALERMO)).block(),
|
||||
is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoDistShouldReturnDistanceInMetersByDefault() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -87,10 +78,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
is(closeTo(166274.15156960033D, 0.005)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoDistShouldReturnDistanceInDesiredMetric() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -100,10 +88,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
.block().getValue(), is(closeTo(166.27415156960033D, 0.005)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoHash() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -114,10 +99,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
contains("sqc8b49rny0", "sqdtr74hyu0"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoHashNotExisting() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -129,10 +111,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
contains("sqc8b49rny0", null, "sqdtr74hyu0"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoPos() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -147,10 +126,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.get(1).getY(), is(closeTo(POINT_CATANIA.getY(), 0.005)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoPosNonExisting() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -167,10 +143,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.get(2).getY(), is(closeTo(POINT_CATANIA.getY(), 0.005)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoRadiusShouldReturnMembersCorrectly() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -187,10 +160,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
hasSize(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoRadiusShouldReturnDistanceCorrectly() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -204,10 +174,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.getContent().get(0).getDistance().getUnit(), is("km"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoRadiusShouldApplyLimit() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -220,10 +187,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.getContent(), hasSize(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoRadiusByMemberShouldReturnMembersCorrectly() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -237,10 +201,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.get(1).getName(), is(PALERMO.getName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoRadiusByMemberShouldReturnDistanceCorrectly() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
@@ -255,10 +216,7 @@ public class LettuceReactiveGeoCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.getContent().get(0).getDistance().getUnit(), is("km"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void geoRadiusByMemberShouldApplyLimit() {
|
||||
|
||||
nativeCommands.geoadd(KEY_1, PALERMO.getPoint().getX(), PALERMO.getPoint().getY(), PALERMO_MEMBER_NAME);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -49,26 +49,17 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
static final ByteBuffer FIELD_2_BBUFFER = ByteBuffer.wrap(FIELD_2_BYTES);
|
||||
static final ByteBuffer FIELD_3_BBUFFER = ByteBuffer.wrap(FIELD_3_BYTES);
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hSetShouldOperateCorrectly() {
|
||||
assertThat(connection.hashCommands().hSet(KEY_1_BBUFFER, FIELD_1_BBUFFER, VALUE_1_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hSetNxShouldOperateCorrectly() {
|
||||
assertThat(connection.hashCommands().hSetNX(KEY_1_BBUFFER, FIELD_1_BBUFFER, VALUE_1_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hSetNxShouldReturnFalseIfFieldAlreadyExists() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -76,10 +67,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.hashCommands().hSetNX(KEY_1_BBUFFER, FIELD_1_BBUFFER, VALUE_1_BBUFFER).block(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hGetShouldReturnValueForExistingField() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -89,10 +77,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.hashCommands().hGet(KEY_1_BBUFFER, FIELD_1_BBUFFER).block(), is(equalTo(VALUE_1_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hGetShouldReturnNullForNotExistingField() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -100,10 +85,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.hashCommands().hGet(KEY_1_BBUFFER, FIELD_2_BBUFFER).block(), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hMGetShouldReturnValueForFields() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -114,10 +96,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
contains(VALUE_1_BBUFFER, VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hMGetShouldReturnNullValueForFieldsThatHaveNoValue() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -128,10 +107,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
contains(VALUE_1_BBUFFER, null, VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hMSetSouldSetValuesCorrectly() {
|
||||
|
||||
Map<ByteBuffer, ByteBuffer> fieldValues = new LinkedHashMap<>();
|
||||
@@ -143,10 +119,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(nativeCommands.hget(KEY_1, FIELD_2), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hExistsShouldReturnTrueForExistingField() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -154,18 +127,12 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.hashCommands().hExists(KEY_1_BBUFFER, FIELD_1_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hExistsShouldReturnFalseForNonExistingField() {
|
||||
assertThat(connection.hashCommands().hExists(KEY_1_BBUFFER, FIELD_1_BBUFFER).block(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hDelShouldRemoveSingleFieldsCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -175,10 +142,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.hashCommands().hDel(KEY_1_BBUFFER, FIELD_2_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hDelShouldRemoveMultipleFieldsCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -189,10 +153,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hLenShouldReturnSizeCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -202,10 +163,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.hashCommands().hLen(KEY_1_BBUFFER).block(), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hKeysShouldReturnFieldsCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -216,10 +174,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
containsInAnyOrder(FIELD_1_BBUFFER, FIELD_2_BBUFFER, FIELD_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hValsShouldReturnValuesCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
@@ -230,10 +185,7 @@ public class LettuceReactiveHashCommandsTests extends LettuceReactiveCommandsTes
|
||||
containsInAnyOrder(VALUE_1_BBUFFER, VALUE_2_BBUFFER, VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hGetAllShouldReturnEntriesCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, FIELD_1, VALUE_1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,20 +29,14 @@ import org.springframework.data.redis.test.util.LettuceRedisClientProvider;
|
||||
*/
|
||||
public class LettuceReactiveHyperLogLogCommandsTests extends LettuceReactiveCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pfAddShouldAddToNonExistingKeyCorrectly() {
|
||||
|
||||
assertThat(connection.hyperLogLogCommands()
|
||||
.pfAdd(KEY_1_BBUFFER, Arrays.asList(VALUE_1_BBUFFER, VALUE_2_BBUFFER, VALUE_3_BBUFFER)).block(), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pfAddShouldReturnZeroWhenValueAlreadyExists() {
|
||||
|
||||
nativeCommands.pfadd(KEY_1, new String[] { VALUE_1, VALUE_2 });
|
||||
@@ -51,10 +45,7 @@ public class LettuceReactiveHyperLogLogCommandsTests extends LettuceReactiveComm
|
||||
assertThat(connection.hyperLogLogCommands().pfAdd(KEY_1_BBUFFER, Arrays.asList(VALUE_1_BBUFFER)).block(), is(0L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pfCountShouldReturnCorrectly() {
|
||||
|
||||
nativeCommands.pfadd(KEY_1, new String[] { VALUE_1, VALUE_2 });
|
||||
@@ -62,10 +53,7 @@ public class LettuceReactiveHyperLogLogCommandsTests extends LettuceReactiveComm
|
||||
assertThat(connection.hyperLogLogCommands().pfCount(KEY_1_BBUFFER).block(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pfCountWithMultipleKeysShouldReturnCorrectly() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -76,10 +64,7 @@ public class LettuceReactiveHyperLogLogCommandsTests extends LettuceReactiveComm
|
||||
assertThat(connection.hyperLogLogCommands().pfCount(Arrays.asList(KEY_1_BBUFFER, KEY_2_BBUFFER)).block(), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pfMergeShouldWorkCorrectly() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,10 +37,7 @@ import reactor.test.TestSubscriber;
|
||||
*/
|
||||
public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void existsShouldReturnTrueForExistingKeys() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -48,18 +45,12 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.keyCommands().exists(KEY_1_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void existsShouldReturnFalseForNonExistingKeys() {
|
||||
assertThat(connection.keyCommands().exists(KEY_1_BBUFFER).block(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void typeShouldReturnTypeCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_2);
|
||||
@@ -71,10 +62,7 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.keyCommands().type(KEY_3_BBUFFER).block(), is(DataType.HASH));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void keysShouldReturnCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_2);
|
||||
@@ -89,10 +77,7 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.keyCommands().keys(ByteBuffer.wrap("key*".getBytes())).block(), hasSize(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void randomKeyShouldReturnAnyKey() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_2);
|
||||
@@ -102,18 +87,12 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.keyCommands().randomKey().block(), is(notNullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void randomKeyShouldReturnNullWhenNoKeyExists() {
|
||||
assertThat(connection.keyCommands().randomKey().block(), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void renameShouldAlterKeyNameCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_2);
|
||||
@@ -123,18 +102,12 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.exists(KEY_1), is(0L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test(expected = RedisSystemException.class)
|
||||
@Test(expected = RedisSystemException.class) // DATAREDIS-525
|
||||
public void renameShouldThrowErrorWhenKeyDoesNotExit() {
|
||||
assertThat(connection.keyCommands().rename(KEY_1_BBUFFER, KEY_2_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void renameNXShouldAlterKeyNameCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_2);
|
||||
@@ -145,10 +118,7 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.exists(KEY_1), is(0L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void renameNXShouldNotAlterExistingKeyName() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_2);
|
||||
@@ -157,10 +127,7 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.keyCommands().renameNX(KEY_1_BBUFFER, KEY_2_BBUFFER).block(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void shouldDeleteKeyCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -169,10 +136,7 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.block(), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void shouldDeleteKeysCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -188,10 +152,7 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
subscriber.assertValueCount(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void shouldDeleteKeysInBatchCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -202,10 +163,7 @@ public class LettuceReactiveKeyCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.block(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void shouldDeleteKeysInMultipleBatchesCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -41,10 +41,7 @@ import reactor.core.publisher.Mono;
|
||||
*/
|
||||
public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void rPushShouldAppendValuesCorrectly() {
|
||||
|
||||
nativeCommands.lpush(KEY_1, VALUE_1);
|
||||
@@ -54,10 +51,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_1, VALUE_2, VALUE_3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lPushShouldPrependValuesCorrectly() {
|
||||
|
||||
nativeCommands.lpush(KEY_1, VALUE_1);
|
||||
@@ -67,10 +61,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_3, VALUE_2, VALUE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void rPushXShouldAppendValuesCorrectly() {
|
||||
|
||||
nativeCommands.lpush(KEY_1, VALUE_1);
|
||||
@@ -79,10 +70,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_1, VALUE_2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lPushXShouldPrependValuesCorrectly() {
|
||||
|
||||
nativeCommands.lpush(KEY_1, VALUE_1);
|
||||
@@ -91,10 +79,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_2, VALUE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class)
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class) // DATAREDIS-525
|
||||
public void pushShouldThrowErrorForMoreThanOneValueWhenUsingExistsOption() {
|
||||
|
||||
connection.listCommands()
|
||||
@@ -103,10 +88,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
.blockFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lLenShouldReturnSizeCorrectly() {
|
||||
|
||||
nativeCommands.lpush(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -114,10 +96,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.listCommands().lLen(KEY_1_BBUFFER).block(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lRangeShouldReturnValuesCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -126,10 +105,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
contains(VALUE_2_BBUFFER, VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lTrimShouldReturnValuesCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -138,10 +114,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), not(contains(VALUE_1_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lIndexShouldReturnValueCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -149,10 +122,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.listCommands().lIndex(KEY_1_BBUFFER, 1).block(), is(equalTo(VALUE_2_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lInsertShouldAddValueCorrectlyBeforeExisting() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -163,10 +133,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_1, VALUE_3, VALUE_2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lInsertShouldAddValueCorrectlyAfterExisting() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -177,10 +144,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_1, VALUE_2, VALUE_3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lSetSouldSetValueCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -190,10 +154,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), not(contains(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lRemSouldRemoveAllValuesCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_1, VALUE_3);
|
||||
@@ -203,10 +164,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), not(contains(VALUE_1)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lRemSouldRemoveFirstValuesCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_1, VALUE_3);
|
||||
@@ -215,10 +173,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_2, VALUE_1, VALUE_3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lRemSouldRemoveLastValuesCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_1, VALUE_3);
|
||||
@@ -227,10 +182,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_1, VALUE_2, VALUE_3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void lPopSouldRemoveFirstValueCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -239,10 +191,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_2, VALUE_3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void rPopSouldRemoveFirstValueCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -251,10 +200,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lrange(KEY_1, 0, -1), contains(VALUE_1, VALUE_2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void blPopShouldReturnFirstAvailable() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -267,10 +213,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.getValue(), is(equalTo(VALUE_1_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void brPopShouldReturnLastAvailable() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -283,10 +226,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result.getValue(), is(equalTo(VALUE_3_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void rPopLPushShouldWorkCorrectly() {
|
||||
|
||||
nativeCommands.rpush(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -299,10 +239,7 @@ public class LettuceReactiveListCommandTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.lindex(KEY_2, 0), is(equalTo(VALUE_3)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void brPopLPushShouldWorkCorrectly() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,42 +26,27 @@ import org.junit.Test;
|
||||
*/
|
||||
public class LettuceReactiveNumberCommandsTests extends LettuceReactiveCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void incrByDoubleShouldIncreaseValueCorrectly() {
|
||||
assertThat(connection.numberCommands().incrBy(KEY_1_BBUFFER, 1.5D).block(), is(closeTo(1.5D, 0D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void incrByIntegerShouldIncreaseValueCorrectly() {
|
||||
assertThat(connection.numberCommands().incrBy(KEY_1_BBUFFER, 3).block(), is(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void decrByDoubleShouldDecreaseValueCorrectly() {
|
||||
assertThat(connection.numberCommands().decrBy(KEY_1_BBUFFER, 1.5D).block(), is(closeTo(-1.5D, 0D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void decrByIntegerShouldDecreaseValueCorrectly() {
|
||||
assertThat(connection.numberCommands().decrBy(KEY_1_BBUFFER, 3).block(), is(-3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hIncrByDoubleShouldIncreaseValueCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, KEY_1, "2");
|
||||
@@ -69,10 +54,7 @@ public class LettuceReactiveNumberCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(connection.numberCommands().hIncrBy(KEY_1_BBUFFER, KEY_1_BBUFFER, 1.5D).block(), is(closeTo(3.5D, 0D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void hIncrByIntegerShouldIncreaseValueCorrectly() {
|
||||
|
||||
nativeCommands.hset(KEY_1, KEY_1, "2");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,27 +32,18 @@ import org.junit.Test;
|
||||
|
||||
public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sAddShouldAddSingleValue() {
|
||||
assertThat(connection.setCommands().sAdd(KEY_1_BBUFFER, VALUE_1_BBUFFER).block(), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sAddShouldAddValues() {
|
||||
assertThat(connection.setCommands().sAdd(KEY_1_BBUFFER, Arrays.asList(VALUE_1_BBUFFER, VALUE_2_BBUFFER)).block(),
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sRemShouldRemoveSingleValue() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -61,10 +52,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.sismember(KEY_1, VALUE_1), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sRemShouldRemoveValues() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -75,10 +63,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.sismember(KEY_1, VALUE_2), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sPopShouldRetrieveRandomValue() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -86,18 +71,12 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.setCommands().sPop(KEY_1_BBUFFER).block(), is(notNullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sPopShouldReturnNullWhenNotPresent() {
|
||||
assertThat(connection.setCommands().sPop(KEY_1_BBUFFER).block(), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sMoveShouldMoveValueCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -107,10 +86,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.sismember(KEY_2, VALUE_3), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sMoveShouldReturnFalseIfValueIsNotAMember() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -120,10 +96,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.sismember(KEY_2, VALUE_3), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sMoveShouldReturnOperateCorrectlyWhenValueAlreadyPresentInTarget() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -134,10 +107,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.sismember(KEY_2, VALUE_3), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sCardShouldCountValuesCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -145,10 +115,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.setCommands().sCard(KEY_1_BBUFFER).block(), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sIsMemberShouldReturnTrueWhenValueContainedInKey() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -156,10 +123,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.setCommands().sIsMember(KEY_1_BBUFFER, VALUE_1_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sIsMemberShouldReturnFalseWhenValueNotContainedInKey() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -167,10 +131,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(connection.setCommands().sIsMember(KEY_1_BBUFFER, VALUE_3_BBUFFER).block(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sInterShouldIntersectSetsCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -181,10 +142,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result, not(containsInAnyOrder(VALUE_1_BBUFFER, VALUE_3_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sInterStoreShouldReturnSizeCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -195,10 +153,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(nativeCommands.sismember(KEY_3, VALUE_2), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sUnionShouldCombineSetsCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -208,10 +163,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result, containsInAnyOrder(VALUE_1_BBUFFER, VALUE_3_BBUFFER, VALUE_2_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sUnionStoreShouldReturnSizeCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -221,10 +173,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sDiffShouldBeExcecutedCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -235,10 +184,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
assertThat(result, not(containsInAnyOrder(VALUE_2_BBUFFER, VALUE_3_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sDiffStoreShouldBeExcecutedCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2);
|
||||
@@ -248,10 +194,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sMembersReadsValuesFromSetCorrectly() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -260,10 +203,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
containsInAnyOrder(VALUE_1_BBUFFER, VALUE_2_BBUFFER, VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sRandMemberReturnsRandomMember() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
@@ -272,10 +212,7 @@ public class LettuceReactiveSetCommandsTests extends LettuceReactiveCommandsTest
|
||||
anyOf(equalTo(VALUE_1_BBUFFER), equalTo(VALUE_2_BBUFFER), equalTo(VALUE_3_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void sRandMemberReturnsRandomMembers() {
|
||||
|
||||
nativeCommands.sadd(KEY_1, VALUE_1, VALUE_2, VALUE_3);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,10 +48,7 @@ import reactor.test.TestSubscriber;
|
||||
*/
|
||||
public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getSetShouldReturnPreviousValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -62,10 +59,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_1), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getSetShouldReturnPreviousValueCorrectlyWhenNoExists() {
|
||||
|
||||
Mono<ByteBuffer> result = connection.stringCommands().getSet(KEY_1_BBUFFER, VALUE_2_BBUFFER);
|
||||
@@ -76,10 +70,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_1), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void setShouldAddValueCorrectly() {
|
||||
|
||||
Mono<Boolean> result = connection.stringCommands().set(KEY_1_BBUFFER, VALUE_1_BBUFFER);
|
||||
@@ -88,10 +79,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_1), is(equalTo(VALUE_1)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void setShouldAddValuesCorrectly() {
|
||||
|
||||
Flux<BooleanResponse<SetCommand>> result = connection.stringCommands()
|
||||
@@ -107,10 +95,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_2), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getShouldRetriveValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -119,20 +104,14 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(result.block(), is(equalTo(VALUE_1_BBUFFER)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getShouldRetriveNullValueCorrectly() {
|
||||
|
||||
Mono<ByteBuffer> result = connection.stringCommands().get(KEY_1_BBUFFER);
|
||||
assertThat(result.block(), is(equalTo(ByteBuffer.allocate(0))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getShouldRetriveValuesCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -148,10 +127,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
subscriber.assertValueCount(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getShouldRetriveValuesWithNullCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -167,10 +143,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
subscriber.assertValueCount(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mGetShouldRetriveValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -180,10 +153,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(result.block(), contains(VALUE_1_BBUFFER, VALUE_2_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mGetShouldRetriveNullValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -195,10 +165,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(result.block(), contains(VALUE_1_BBUFFER, ByteBuffer.allocate(0), VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mGetShouldRetriveValuesCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -218,18 +185,12 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
new HashSet<>(Arrays.asList(Arrays.asList(VALUE_1_BBUFFER, VALUE_2_BBUFFER), Arrays.asList(VALUE_2_BBUFFER))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void setNXshouldOnlySetValueWhenNotPresent() {
|
||||
assertThat(connection.stringCommands().setNX(KEY_1_BBUFFER, VALUE_1_BBUFFER).block(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void setNXshouldNotSetValueWhenAlreadyPresent() {
|
||||
|
||||
nativeCommands.setnx(KEY_1, VALUE_1);
|
||||
@@ -237,10 +198,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(connection.stringCommands().setNX(KEY_1_BBUFFER, VALUE_2_BBUFFER).block(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void setEXshouldSetKeyAndExpirationTime() {
|
||||
|
||||
connection.stringCommands().setEX(KEY_1_BBUFFER, VALUE_1_BBUFFER, Expiration.seconds(3)).block();
|
||||
@@ -248,10 +206,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.ttl(KEY_1) > 1, is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void pSetEXshouldSetKeyAndExpirationTime() {
|
||||
|
||||
connection.stringCommands().pSetEX(KEY_1_BBUFFER, VALUE_1_BBUFFER, Expiration.milliseconds(600)).block();
|
||||
@@ -259,10 +214,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.pttl(KEY_1) > 1, is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mSetShouldAddMultipleKeyValueParis() {
|
||||
|
||||
Map<ByteBuffer, ByteBuffer> map = new LinkedHashMap<>();
|
||||
@@ -275,10 +227,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_2), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mSetNXShouldAddMultipleKeyValueParis() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -293,10 +242,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_2), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void mSetNXShouldNotAddMultipleKeyValueParisWhenAlreadyExit() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -313,20 +259,14 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_2), is(equalTo(VALUE_2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void appendShouldDoItsThing() {
|
||||
|
||||
assertThat(connection.stringCommands().append(KEY_1_BBUFFER, VALUE_1_BBUFFER).block(), is(7L));
|
||||
assertThat(connection.stringCommands().append(KEY_1_BBUFFER, VALUE_2_BBUFFER).block(), is(14L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getRangeShouldReturnSubstringCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -335,10 +275,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
is(equalTo(ByteBuffer.wrap("lu".getBytes()))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void setRangeShouldReturnNewStringLengthCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -346,10 +283,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(connection.stringCommands().setRange(KEY_1_BBUFFER, VALUE_2_BBUFFER, 3).block(), is(10L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void getBitShouldReturnValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -358,10 +292,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(connection.stringCommands().getBit(KEY_1_BBUFFER, 7).block(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void setBitShouldReturnValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -370,10 +301,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.getbit(KEY_1, 1), is(0L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void bitCountShouldReturnValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -381,10 +309,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(connection.stringCommands().bitCount(KEY_1_BBUFFER).block(), is(28L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void bitCountShouldCountInRangeCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
@@ -392,10 +317,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(connection.stringCommands().bitCount(KEY_1_BBUFFER, 2, 4).block(), is(13L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void bitOpAndShouldWorkAsExpected() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -408,10 +330,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_3), is(equalTo("value-0")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void bitOpOrShouldWorkAsExpected() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -424,10 +343,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
assertThat(nativeCommands.get(KEY_3), is(equalTo(VALUE_3)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-525
|
||||
public void bitNotShouldThrowExceptionWhenMoreThanOnSourceKey() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -436,10 +352,7 @@ public class LettuceReactiveStringCommandsTests extends LettuceReactiveCommandsT
|
||||
.block();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void strLenShouldReturnValueCorrectly() {
|
||||
|
||||
nativeCommands.set(KEY_1, VALUE_1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,18 +34,12 @@ import org.springframework.data.redis.test.util.LettuceRedisClientProvider;
|
||||
*/
|
||||
public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTestsBase {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zAddShouldAddValuesWithScores() {
|
||||
assertThat(connection.zSetCommands().zAdd(KEY_1_BBUFFER, 3.5D, VALUE_1_BBUFFER).block(), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRemShouldRemoveValuesFromSet() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -56,10 +50,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zIncrByShouldInreaseAndReturnScore() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -67,10 +58,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zIncrBy(KEY_1_BBUFFER, 3.5D, VALUE_1_BBUFFER).block(), is(4.5D));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRankShouldReturnIndexCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -80,10 +68,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zRank(KEY_1_BBUFFER, VALUE_3_BBUFFER).block(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRankShouldReturnIndexCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -93,10 +78,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zRevRank(KEY_1_BBUFFER, VALUE_3_BBUFFER).block(), is(0L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeShouldReturnValuesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -107,10 +89,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_2_BBUFFER, VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeWithScoreShouldReturnTuplesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -122,10 +101,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
new DefaultTuple(VALUE_3_BBUFFER.array(), 3D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeShouldReturnValuesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -136,10 +112,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_2_BBUFFER, VALUE_1_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeWithScoreShouldReturnTuplesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -151,10 +124,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
new DefaultTuple(VALUE_1_BBUFFER.array(), 1D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeByScoreShouldReturnValuesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -165,10 +135,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_2_BBUFFER, VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeByScoreShouldReturnValuesCorrectlyWithMinExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -179,10 +146,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeByScoreShouldReturnValuesCorrectlyWithMaxExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -193,10 +157,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_2_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeByScoreWithScoreShouldReturnTuplesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -208,10 +169,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
new DefaultTuple(VALUE_3_BBUFFER.array(), 3D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeByScoreWithScoreShouldReturnTuplesCorrectlyWithMinExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -223,10 +181,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(new DefaultTuple(VALUE_3_BBUFFER.array(), 3D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeByScoreWithScoreShouldReturnTuplesCorrectlyWithMaxExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -238,10 +193,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(new DefaultTuple(VALUE_2_BBUFFER.array(), 2D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeByScoreShouldReturnValuesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -252,10 +204,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_3_BBUFFER, VALUE_2_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeByScoreShouldReturnValuesCorrectlyWithMinExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -266,10 +215,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_3_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeByScoreShouldReturnValuesCorrectlyWithMaxExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -280,10 +226,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(VALUE_2_BBUFFER));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeByScoreWithScoreShouldReturnTuplesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -295,10 +238,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
new DefaultTuple(VALUE_2_BBUFFER.array(), 2D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeByScoreWithScoreShouldReturnTuplesCorrectlyWithMinExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -310,10 +250,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(new DefaultTuple(VALUE_3_BBUFFER.array(), 3D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeByScoreWithScoreShouldReturnTuplesCorrectlyWithMaxExclusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -325,10 +262,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
IsIterableContainingInOrder.contains(new DefaultTuple(VALUE_2_BBUFFER.array(), 2D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zCountShouldCountValuesInRange() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -338,10 +272,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zCount(KEY_1_BBUFFER, new Range<>(2D, 3D)).block(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zCountShouldCountValuesInRangeWithMinExlusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -351,10 +282,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zCount(KEY_1_BBUFFER, new Range<>(2D, 3D, false, true)).block(), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zCountShouldCountValuesInRangeWithMaxExlusion() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -364,10 +292,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zCount(KEY_1_BBUFFER, new Range<>(2D, 3D, true, false)).block(), is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zCountShouldCountValuesInRangeWithNegativeInfinity() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -378,10 +303,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zCountShouldCountValuesInRangeWithPositiveInfinity() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -392,10 +314,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zCardShouldReturnSizeCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -405,10 +324,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zCard(KEY_1_BBUFFER).block(), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zScoreShouldReturnScoreCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 2D, VALUE_2);
|
||||
@@ -416,10 +332,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zScore(KEY_1_BBUFFER, VALUE_2_BBUFFER).block(), is(2D));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRemRangeByRankShouldRemoveValuesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -429,10 +342,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zRemRangeByRank(KEY_1_BBUFFER, new Range<>(1L, 2L)).block(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRemRangeByScoreShouldRemoveValuesCorrectly() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -442,10 +352,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
assertThat(connection.zSetCommands().zRemRangeByScore(KEY_1_BBUFFER, new Range<>(1D, 2D)).block(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRemRangeByScoreShouldRemoveValuesCorrectlyWithNegativeInfinity() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -457,10 +364,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRemRangeByScoreShouldRemoveValuesCorrectlyWithPositiveInfinity() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -472,10 +376,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRemRangeByScoreShouldRemoveValuesCorrectlyWithExcludingMinRange() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -486,10 +387,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRemRangeByScoreShouldRemoveValuesCorrectlyWithExcludingMaxRange() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 1D, VALUE_1);
|
||||
@@ -500,10 +398,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zUnionStoreShouldWorkCorrectly() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -520,10 +415,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zInterStoreShouldWorkCorrectly() {
|
||||
|
||||
assumeThat(clientProvider instanceof LettuceRedisClientProvider, is(true));
|
||||
@@ -540,10 +432,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRangeByLex() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 0D, "a");
|
||||
@@ -566,10 +455,7 @@ public class LettuceReactiveZSetCommandsTests extends LettuceReactiveCommandsTes
|
||||
ByteBuffer.wrap("d".getBytes()), ByteBuffer.wrap("e".getBytes()), ByteBuffer.wrap("f".getBytes())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-525
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-525
|
||||
public void zRevRangeByLex() {
|
||||
|
||||
nativeCommands.zadd(KEY_1, 0D, "a");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -62,44 +62,29 @@ public class LettuceSentinelConnectionUnitTests {
|
||||
this.connection = new LettuceSentinelConnection(redisClientMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void shouldConnectAfterCreation() {
|
||||
verify(redisClientMock, times(1)).connectSentinel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void failoverShouldBeSentCorrectly() {
|
||||
|
||||
connection.failover(new RedisNodeBuilder().withName(MASTER_ID).build());
|
||||
verify(sentinelCommandsMock, times(1)).failover(eq(MASTER_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void failoverShouldThrowExceptionIfMasterNodeIsNull() {
|
||||
connection.failover(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void failoverShouldThrowExceptionIfMasterNodeNameIsEmpty() {
|
||||
connection.failover(new RedisNodeBuilder().build());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void mastersShouldReadMastersCorrectly() {
|
||||
|
||||
when(sentinelCommandsMock.masters()).thenReturn(Collections.<Map<String, String>>emptyList());
|
||||
@@ -107,10 +92,7 @@ public class LettuceSentinelConnectionUnitTests {
|
||||
verify(sentinelCommandsMock, times(1)).masters();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void shouldReadSlavesCorrectly() {
|
||||
|
||||
when(sentinelCommandsMock.slaves(MASTER_ID)).thenReturn(Collections.<Map<String, String>>emptyList());
|
||||
@@ -118,10 +100,7 @@ public class LettuceSentinelConnectionUnitTests {
|
||||
verify(sentinelCommandsMock, times(1)).slaves(eq(MASTER_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void shouldReadSlavesCorrectlyWhenGivenNamedNode() {
|
||||
|
||||
when(sentinelCommandsMock.slaves(MASTER_ID)).thenReturn(Collections.<Map<String, String>>emptyList());
|
||||
@@ -129,68 +108,44 @@ public class LettuceSentinelConnectionUnitTests {
|
||||
verify(sentinelCommandsMock, times(1)).slaves(eq(MASTER_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void readSlavesShouldThrowExceptionWhenGivenEmptyMasterName() {
|
||||
connection.slaves("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void readSlavesShouldThrowExceptionWhenGivenNull() {
|
||||
connection.slaves((RedisNode) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void readSlavesShouldThrowExceptionWhenNodeWithoutName() {
|
||||
connection.slaves(new RedisNodeBuilder().build());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void shouldRemoveMasterCorrectlyWhenGivenNamedNode() {
|
||||
|
||||
connection.remove(new RedisNodeBuilder().withName(MASTER_ID).build());
|
||||
verify(sentinelCommandsMock, times(1)).remove(eq(MASTER_ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void removeShouldThrowExceptionWhenGivenEmptyMasterName() {
|
||||
connection.remove("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void removeShouldThrowExceptionWhenGivenNull() {
|
||||
connection.remove((RedisNode) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-348
|
||||
public void removeShouldThrowExceptionWhenNodeWithoutName() {
|
||||
connection.remove(new RedisNodeBuilder().build());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void monitorShouldBeSentCorrectly() {
|
||||
|
||||
RedisServer server = new RedisServer("127.0.0.1", 6382);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -77,10 +77,7 @@ public class LettuceSentinelIntegrationTests extends AbstractConnectionIntegrati
|
||||
((LettuceConnectionFactory) connectionFactory).destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void shouldReadMastersCorrectly() {
|
||||
|
||||
List<RedisServer> servers = (List<RedisServer>) connectionFactory.getSentinelConnection().masters();
|
||||
@@ -88,10 +85,7 @@ public class LettuceSentinelIntegrationTests extends AbstractConnectionIntegrati
|
||||
assertThat(servers.get(0).getName(), is(MASTER_NAME));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-348
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-348
|
||||
public void shouldReadSlavesOfMastersCorrectly() {
|
||||
|
||||
RedisSentinelConnection sentinelConnection = connectionFactory.getSentinelConnection();
|
||||
@@ -104,10 +98,7 @@ public class LettuceSentinelIntegrationTests extends AbstractConnectionIntegrati
|
||||
assertThat(slaves, hasItems(SLAVE_0, SLAVE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-462
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-462
|
||||
public void factoryWorksWithoutClientResources() {
|
||||
|
||||
LettuceConnectionFactory factory = new LettuceConnectionFactory(SENTINEL_CONFIG);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 - 2015 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,9 +44,7 @@ import org.springframework.oxm.xstream.XStreamMarshaller;
|
||||
*/
|
||||
abstract public class AbstractOperationsTestParams {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-241
|
||||
*/
|
||||
// DATAREDIS-241
|
||||
public static Collection<Object[]> testParams() {
|
||||
|
||||
ObjectFactory<String> stringFactory = new StringObjectFactory();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -61,10 +61,7 @@ public class ConnectionSplittingInterceptorUnitTests {
|
||||
Mockito.when(connectionFactoryMock.getConnection()).thenReturn(freshConnectionMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void interceptorShouldRequestFreshConnectionForReadonlyCommand() throws Throwable {
|
||||
|
||||
interceptor.intercept(boundConnectionMock, READONLY_METHOD, new Object[] { new byte[] {} }, null);
|
||||
@@ -72,10 +69,7 @@ public class ConnectionSplittingInterceptorUnitTests {
|
||||
Mockito.verifyZeroInteractions(boundConnectionMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void interceptorShouldUseBoundConnectionForWriteOperations() throws Throwable {
|
||||
|
||||
interceptor.intercept(boundConnectionMock, WRITE_METHOD, new Object[] { new byte[] {}, 0L }, null);
|
||||
@@ -83,11 +77,8 @@ public class ConnectionSplittingInterceptorUnitTests {
|
||||
Mockito.verifyZeroInteractions(connectionFactoryMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class)
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class) // DATAREDIS-73
|
||||
public void interceptorShouldNotWrapException() throws Throwable {
|
||||
|
||||
Mockito.when(freshConnectionMock.keys(Mockito.any(byte[].class))).thenThrow(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -79,10 +79,7 @@ public class DefaultClusterOperationsUnitTests {
|
||||
this.clusterOps = new DefaultClusterOperations<String, String>(template);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void keysShouldDelegateToConnectionCorrectly() {
|
||||
|
||||
Set<byte[]> keys = new HashSet<byte[]>(Arrays.asList(serializer.serialize("key-1"), serializer.serialize("key-2")));
|
||||
@@ -91,18 +88,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
assertThat(clusterOps.keys(NODE_1, "*"), hasItems("key-1", "key-2"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void keysShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.keys(null, "*");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void keysShouldReturnEmptySetWhenNoKeysAvailable() {
|
||||
|
||||
when(connection.keys(any(RedisClusterNode.class), any(byte[].class))).thenReturn(null);
|
||||
@@ -110,10 +101,7 @@ public class DefaultClusterOperationsUnitTests {
|
||||
assertThat(clusterOps.keys(NODE_1, "*"), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void randomKeyShouldDelegateToConnection() {
|
||||
|
||||
when(connection.randomKey(any(RedisClusterNode.class))).thenReturn(serializer.serialize("key-1"));
|
||||
@@ -121,18 +109,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
assertThat(clusterOps.randomKey(NODE_1), is("key-1"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void randomKeyShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.randomKey(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void randomKeyShouldReturnNullWhenNoKeyAvailable() {
|
||||
|
||||
when(connection.randomKey(any(RedisClusterNode.class))).thenReturn(null);
|
||||
@@ -140,10 +122,7 @@ public class DefaultClusterOperationsUnitTests {
|
||||
assertThat(clusterOps.randomKey(NODE_1), nullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void pingShouldDelegateToConnection() {
|
||||
|
||||
when(connection.ping(any(RedisClusterNode.class))).thenReturn("PONG");
|
||||
@@ -151,18 +130,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
assertThat(clusterOps.ping(NODE_1), is("PONG"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void pingShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.ping(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void addSlotsShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.addSlots(NODE_1, 1, 2, 3);
|
||||
@@ -170,18 +143,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).clusterAddSlots(eq(NODE_1), Mockito.<int[]> anyVararg());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void addSlotsShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.addSlots(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void addSlotsWithRangeShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.addSlots(NODE_1, new SlotRange(1, 3));
|
||||
@@ -189,18 +156,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).clusterAddSlots(eq(NODE_1), Mockito.<int[]> anyVararg());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void addSlotsWithRangeShouldThrowExceptionWhenRangeIsNull() {
|
||||
clusterOps.addSlots(NODE_1, (SlotRange) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void bgSaveShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.bgSave(NODE_1);
|
||||
@@ -208,18 +169,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).bgSave(eq(NODE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void bgSaveShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.bgSave(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void meetShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.meet(NODE_1);
|
||||
@@ -227,18 +182,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).clusterMeet(eq(NODE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void meetShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.meet(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void forgetShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.forget(NODE_1);
|
||||
@@ -246,18 +195,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).clusterForget(eq(NODE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void forgetShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.forget(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void flushDbShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.flushDb(NODE_1);
|
||||
@@ -265,18 +208,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).flushDb(eq(NODE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void flushDbShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.flushDb(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void getSlavesShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.getSlaves(NODE_1);
|
||||
@@ -284,18 +221,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).clusterGetSlaves(eq(NODE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void getSlavesShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.getSlaves(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void saveShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.save(NODE_1);
|
||||
@@ -303,18 +234,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).save(eq(NODE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void saveShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.save(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void shutdownShouldDelegateToConnection() {
|
||||
|
||||
clusterOps.shutdown(NODE_1);
|
||||
@@ -322,18 +247,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).shutdown(eq(NODE_1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void shutdownShouldThrowExceptionWhenNodeIsNull() {
|
||||
clusterOps.shutdown(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void executeShouldDelegateToConnection() {
|
||||
|
||||
final byte[] key = serializer.serialize("foo");
|
||||
@@ -348,18 +267,12 @@ public class DefaultClusterOperationsUnitTests {
|
||||
verify(connection, times(1)).get(eq(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-315
|
||||
public void executeShouldThrowExceptionWhenCallbackIsNull() {
|
||||
clusterOps.execute(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-315
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-315
|
||||
public void reshardShouldExecuteCommandsCorrectly() {
|
||||
|
||||
byte[] key = "foo".getBytes();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -113,10 +113,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAdd() {
|
||||
|
||||
Long numAdded = geoOperations.geoAdd(keyFactory.instance(), POINT_PALERMO, valueFactory.instance());
|
||||
@@ -124,10 +121,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(numAdded, is(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoAddWithLocationMap() {
|
||||
|
||||
Map<M, Point> memberCoordinateMap = new HashMap<M, Point>();
|
||||
@@ -139,10 +133,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(numAdded, is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoDistShouldReturnDistanceInMetersByDefault() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -157,10 +148,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(dist.getUnit(), is(equalTo("m")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoDistShouldReturnDistanceInKilometersCorrectly() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -175,10 +163,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(dist.getUnit(), is(equalTo("km")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoDistShouldReturnDistanceInMilesCorrectly() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -193,10 +178,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(dist.getUnit(), is(equalTo("mi")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoDistShouldReturnDistanceInFeeCorrectly() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -211,10 +193,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(dist.getUnit(), is(equalTo("ft")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoHash() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -233,10 +212,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.get(1), is(equalTo("sqdtr74hyu0")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoPos() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -259,10 +235,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.get(2), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusShouldReturnMembersCorrectly() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -278,10 +251,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent(), hasSize(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusShouldReturnLocationsWithDistance() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -305,10 +275,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent().get(1).getContent().getName(), is(member2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusShouldReturnLocationsWithCoordinates() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -332,10 +299,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent().get(1).getContent().getName(), is(member1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusShouldReturnLocationsWithCoordinatesAndDistance() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -363,10 +327,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent().get(1).getContent().getName(), is(member1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusByMemberShouldReturnMembersCorrectly() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -382,10 +343,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent(), hasSize(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusByMemberShouldReturnDistanceCorrectly() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -407,10 +365,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent().get(1).getContent().getName(), is(member3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusByMemberShouldReturnCoordinates() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -435,10 +390,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent().get(1).getContent().getName(), is(member1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void geoRadiusByMemberShouldReturnCoordinatesAndDistance() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -466,10 +418,7 @@ public class DefaultGeoOperationsTests<K, M> {
|
||||
assertThat(result.getContent().get(1).getContent().getName(), is(member3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-438
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-438
|
||||
public void testGeoRemove() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -149,10 +149,7 @@ public class DefaultHashOperationsTests<K, HK, HV> {
|
||||
assertEquals(2L, numDeleted.longValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-305
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-305
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
public void testHScanReadsValuesFully() throws IOException {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -86,10 +86,7 @@ public class DefaultHyperLogLogOperationsTests<K, V> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addShouldAddDistinctValuesCorrectly() {
|
||||
|
||||
@@ -101,10 +98,7 @@ public class DefaultHyperLogLogOperationsTests<K, V> {
|
||||
assertThat(hyperLogLogOps.add(key, v1, v2, v3), equalTo(1L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addShouldNotAddExistingValuesCorrectly() {
|
||||
|
||||
@@ -117,10 +111,7 @@ public class DefaultHyperLogLogOperationsTests<K, V> {
|
||||
assertThat(hyperLogLogOps.add(key, v2), equalTo(0L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@SuppressWarnings("unchecked")
|
||||
public void sizeShouldCountValuesCorrectly() {
|
||||
|
||||
@@ -133,10 +124,7 @@ public class DefaultHyperLogLogOperationsTests<K, V> {
|
||||
assertThat(hyperLogLogOps.size(key), equalTo(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@SuppressWarnings("unchecked")
|
||||
public void sizeShouldCountValuesOfMultipleKeysCorrectly() {
|
||||
|
||||
@@ -153,11 +141,7 @@ public class DefaultHyperLogLogOperationsTests<K, V> {
|
||||
assertThat(hyperLogLogOps.size(key, key2), equalTo(4L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InterruptedException
|
||||
* @see DATAREDIS-308
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-308
|
||||
@SuppressWarnings("unchecked")
|
||||
public void unionShouldMergeValuesOfMultipleKeysCorrectly() throws InterruptedException {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -186,10 +186,7 @@ public class DefaultListOperationsTests<K, V> {
|
||||
assertThat(listOps.range(key, 0, -1), isEqual(Arrays.asList(new Object[] { v1, v2, v3 })));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-288
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testRightPushAllCollection() {
|
||||
|
||||
@@ -203,35 +200,23 @@ public class DefaultListOperationsTests<K, V> {
|
||||
assertThat(listOps.range(key, 0, -1), isEqual(Arrays.asList(new Object[] { v1, v2, v3 })));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-288
|
||||
public void rightPushAllShouldThrowExceptionWhenCalledWithEmptyCollection() {
|
||||
listOps.rightPushAll(keyFactory.instance(), Collections.<V> emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-288
|
||||
public void rightPushAllShouldThrowExceptionWhenCollectionContainsNullValue() {
|
||||
listOps.rightPushAll(keyFactory.instance(), Arrays.asList(valueFactory.instance(), null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-288
|
||||
public void rightPushAllShouldThrowExceptionWhenCalledWithNull() {
|
||||
listOps.rightPushAll(keyFactory.instance(), (Collection<V>) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-288
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testLeftPushAllCollection() {
|
||||
|
||||
@@ -245,27 +230,18 @@ public class DefaultListOperationsTests<K, V> {
|
||||
assertThat(listOps.range(key, 0, -1), isEqual(Arrays.asList(new Object[] { v3, v2, v1 })));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-288
|
||||
public void leftPushAllShouldThrowExceptionWhenCalledWithEmptyCollection() {
|
||||
listOps.leftPushAll(keyFactory.instance(), Collections.<V> emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-288
|
||||
public void leftPushAllShouldThrowExceptionWhenCollectionContainsNullValue() {
|
||||
listOps.leftPushAll(keyFactory.instance(), Arrays.asList(valueFactory.instance(), null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-288
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-288
|
||||
public void leftPushAllShouldThrowExceptionWhenCalledWithNull() {
|
||||
listOps.leftPushAll(keyFactory.instance(), (Collection<V>) null);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 - 2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -210,10 +210,7 @@ public class DefaultSetOperationsTests<K, V> {
|
||||
assertThat(setOps.members(key), isEqual(Collections.singleton(v3)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-304
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-304
|
||||
@SuppressWarnings("unchecked")
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
public void testSSCanReadsValuesFully() throws IOException {
|
||||
@@ -234,10 +231,7 @@ public class DefaultSetOperationsTests<K, V> {
|
||||
assertThat(count, is(setOps.size(key)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-448
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-448
|
||||
public void intersectAndStoreShouldReturnNumberOfElementsInDestination() {
|
||||
|
||||
K sourceKey1 = keyFactory.instance();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,10 +31,7 @@ public class DefaultTypedTupleUnitTests {
|
||||
private static final TypedTuple<String> WITH_SCORE_2 = new DefaultTypedTuple<String>("bar", 2D);
|
||||
private static final TypedTuple<String> WITH_SCORE_NULL = new DefaultTypedTuple<String>("foo", null);
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-294
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-294
|
||||
public void compareToShouldUseScore() {
|
||||
|
||||
assertThat(WITH_SCORE_1.compareTo(WITH_SCORE_2), equalTo(-1));
|
||||
@@ -42,20 +39,14 @@ public class DefaultTypedTupleUnitTests {
|
||||
assertThat(WITH_SCORE_1.compareTo(ANOTHER_ONE_WITH_SCORE_1), equalTo(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-294
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-294
|
||||
public void compareToShouldConsiderGivenNullAsZeroScore() {
|
||||
|
||||
assertThat(WITH_SCORE_1.compareTo(null), equalTo(1));
|
||||
assertThat(WITH_SCORE_NULL.compareTo(null), equalTo(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-294
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-294
|
||||
public void compareToShouldConsiderNullScoreAsZeroScore() {
|
||||
|
||||
assertThat(WITH_SCORE_1.compareTo(WITH_SCORE_NULL), equalTo(1));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -108,10 +108,7 @@ public class DefaultValueOperationsTests<K, V> {
|
||||
assertEquals(Long.valueOf((Long) v1 - 20), (Long) valueOps.get(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-247
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-247
|
||||
public void testIncrementDouble() {
|
||||
|
||||
assumeTrue(RedisTestProfileValueSource.matches("redisVersion", "2.6"));
|
||||
@@ -197,10 +194,7 @@ public class DefaultValueOperationsTests<K, V> {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-271
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-271
|
||||
public void testSetWithExpirationWithTimeUnitMilliseconds() {
|
||||
|
||||
assumeTrue(RedisTestProfileValueSource.matches("runLongTests", "true"));
|
||||
@@ -287,10 +281,7 @@ public class DefaultValueOperationsTests<K, V> {
|
||||
assertNotNull(((DefaultValueOperations) valueOps).deserializeKey((byte[]) key1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-197
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-197
|
||||
public void testSetAndGetBit() {
|
||||
|
||||
assumeTrue(redisTemplate instanceof StringRedisTemplate);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -183,10 +183,7 @@ public class DefaultZSetOperationsTests<K, V> {
|
||||
assertThat(tuple, isEqual(new DefaultTypedTuple<V>(value2, 3.7)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-407
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-407
|
||||
public void testRangeByLexUnbounded() {
|
||||
|
||||
assumeThat(valueFactory, anyOf(instanceOf(DoubleObjectFactory.class), instanceOf(DoubleAsStringObjectFactory.class),
|
||||
@@ -207,10 +204,7 @@ public class DefaultZSetOperationsTests<K, V> {
|
||||
assertThat(tuple, isEqual(value1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-407
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-407
|
||||
public void testRangeByLexBounded() {
|
||||
|
||||
assumeThat(valueFactory, anyOf(instanceOf(DoubleObjectFactory.class), instanceOf(DoubleAsStringObjectFactory.class),
|
||||
@@ -231,10 +225,7 @@ public class DefaultZSetOperationsTests<K, V> {
|
||||
assertThat(tuple, isEqual(value2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-407
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-407
|
||||
public void testRangeByLexUnboundedWithLimit() {
|
||||
|
||||
assumeThat(valueFactory, anyOf(instanceOf(DoubleObjectFactory.class), instanceOf(DoubleAsStringObjectFactory.class),
|
||||
@@ -256,10 +247,7 @@ public class DefaultZSetOperationsTests<K, V> {
|
||||
assertThat(tuple, isEqual(value2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-407
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-407
|
||||
public void testRangeByLexBoundedWithLimit() {
|
||||
|
||||
assumeThat(valueFactory, anyOf(instanceOf(DoubleObjectFactory.class), instanceOf(DoubleAsStringObjectFactory.class),
|
||||
@@ -350,10 +338,7 @@ public class DefaultZSetOperationsTests<K, V> {
|
||||
assertThat(zSetOps.size(key), equalTo(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-306
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-306
|
||||
@IfProfileValue(name = "redisVersion", value = "2.8+")
|
||||
public void testZScanShouldReadEntireValueRange() throws IOException {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -70,10 +70,7 @@ public class IndexWriterUnitTests {
|
||||
writer = new IndexWriter(connectionMock, converter);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void addKeyToIndexShouldInvokeSaddCorrectly() {
|
||||
|
||||
writer.addKeyToIndex(KEY_BIN, new SimpleIndexedPropertyValue(KEYSPACE, "firstname", "Rand"));
|
||||
@@ -83,18 +80,12 @@ public class IndexWriterUnitTests {
|
||||
eq("persons:firstname:Rand".getBytes(CHARSET)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void addKeyToIndexShouldThrowErrorWhenIndexedDataIsNull() {
|
||||
writer.addKeyToIndex(KEY_BIN, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void removeKeyFromExistingIndexesShouldCheckForExistingIndexesForPath() {
|
||||
|
||||
writer.removeKeyFromExistingIndexes(KEY_BIN, new StubIndxedData());
|
||||
@@ -103,10 +94,7 @@ public class IndexWriterUnitTests {
|
||||
verifyNoMoreInteractions(connectionMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void removeKeyFromExistingIndexesShouldRemoveKeyFromAllExistingIndexesForPath() {
|
||||
|
||||
byte[] indexKey1 = "persons:firstname:rand".getBytes(CHARSET);
|
||||
@@ -121,18 +109,12 @@ public class IndexWriterUnitTests {
|
||||
verify(connectionMock).sRem(indexKey2, KEY_BIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void removeKeyFromExistingIndexesShouldThrowExecptionForNullIndexedData() {
|
||||
writer.removeKeyFromExistingIndexes(KEY_BIN, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void removeAllIndexesShouldDeleteAllIndexKeys() {
|
||||
|
||||
byte[] indexKey1 = "persons:firstname:rand".getBytes(CHARSET);
|
||||
@@ -149,19 +131,13 @@ public class IndexWriterUnitTests {
|
||||
assertThat(captor.getAllValues(), hasItems(indexKey1, indexKey2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class)
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class) // DATAREDIS-425
|
||||
public void addToIndexShouldThrowDataAccessExceptionWhenAddingDataThatConnotBeConverted() {
|
||||
writer.addKeyToIndex(KEY_BIN, new SimpleIndexedPropertyValue(KEYSPACE, "firstname", new DummyObject()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void addToIndexShouldUseRegisteredConverterWhenAddingData() {
|
||||
|
||||
DummyObject value = new DummyObject();
|
||||
@@ -180,10 +156,7 @@ public class IndexWriterUnitTests {
|
||||
verify(connectionMock).sAdd(eq(("persons:firstname:" + identityHexString).getBytes(CHARSET)), eq(KEY_BIN));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-512
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-512
|
||||
public void createIndexShouldNotTryToRemoveExistingValues() {
|
||||
|
||||
when(connectionMock.keys(any(byte[].class)))
|
||||
@@ -198,10 +171,7 @@ public class IndexWriterUnitTests {
|
||||
verify(connectionMock, never()).sRem(any(byte[].class), eq(KEY_BIN));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-512
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-512
|
||||
public void updateIndexShouldRemoveExistingValues() {
|
||||
|
||||
when(connectionMock.keys(any(byte[].class)))
|
||||
@@ -216,10 +186,7 @@ public class IndexWriterUnitTests {
|
||||
verify(connectionMock, times(1)).sRem(any(byte[].class), eq(KEY_BIN));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void removeGeoIndexShouldCallGeoRemove() {
|
||||
|
||||
byte[] indexKey1 = "persons:location".getBytes(CHARSET);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -69,10 +69,7 @@ public class MultithreadedRedisTemplateTests {
|
||||
return Arrays.asList(new Object[][] { { jedis }, { lettuce } });
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-300
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-300
|
||||
public void assertResouresAreReleasedProperlyWhenSharingRedisTemplate() throws InterruptedException {
|
||||
|
||||
final RedisTemplate<Object, Object> template = new RedisTemplate<Object, Object>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,66 +30,42 @@ public class RedisCommandUnitTests {
|
||||
|
||||
public @Rule ExpectedException expectedException = ExpectedException.none();
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldIdentifyAliasCorrectly() {
|
||||
assertThat(RedisCommand.CONFIG_SET.isRepresentedBy("setconfig"), equalTo(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldIdentifyAliasCorrectlyWhenNamePassedInMixedCase() {
|
||||
assertThat(RedisCommand.CONFIG_SET.isRepresentedBy("SetConfig"), equalTo(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldNotThrowExceptionWhenUsingNullKeyForRepresentationCheck() {
|
||||
assertThat(RedisCommand.CONFIG_SET.isRepresentedBy(null), equalTo(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldIdentifyAliasCorrectlyViaLookup() {
|
||||
assertThat(RedisCommand.failsafeCommandLookup("setconfig"), is(RedisCommand.CONFIG_SET));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldIdentifyAliasCorrectlyWhenNamePassedInMixedCaseViaLookup() {
|
||||
assertThat(RedisCommand.failsafeCommandLookup("SetConfig"), is(RedisCommand.CONFIG_SET));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldReturnUnknownCommandForUnknownCommandString() {
|
||||
assertThat(RedisCommand.failsafeCommandLookup("strangecommand"), is(RedisCommand.UNKNOWN));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldNotThrowExceptionOnValidArgumentCount() {
|
||||
RedisCommand.AUTH.validateArgumentCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldThrowExceptionOnInvalidArgumentCountWhenExpectedExcatMatch() {
|
||||
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
@@ -97,10 +73,7 @@ public class RedisCommandUnitTests {
|
||||
RedisCommand.AUTH.validateArgumentCount(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-73
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-73
|
||||
public void shouldThrowExceptionOnInvalidArgumentCountWhenExpectedMinimalMatch() {
|
||||
|
||||
expectedException.expect(IllegalArgumentException.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -114,10 +114,7 @@ public class RedisKeyValueAdapterTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void putWritesDataCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -131,10 +128,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForHash().entries("persons:1").size(), is(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void putWritesSimpleIndexDataCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -146,10 +140,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForSet().members("persons:firstname:rand"), hasItems("1"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void putWritesNestedDataCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -162,10 +153,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForHash().entries("persons:1").size(), is(2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void putWritesSimpleNestedIndexValuesCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -178,10 +166,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForSet().members("persons:address.country:Andor"), hasItems("1"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getShouldReadSimpleObjectCorrectly() {
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
@@ -195,10 +180,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(((Person) loaded).age, is(24));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getShouldReadNestedObjectCorrectly() {
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
@@ -212,10 +194,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(((Person) loaded).address.country, is("Andor"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void couldReadsKeyspaceSizeCorrectly() {
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
@@ -228,10 +207,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(adapter.count("persons"), is(3L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void deleteRemovesEntriesCorrectly() {
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
@@ -246,10 +222,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.hasKey("persons:1"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void deleteCleansIndexedDataCorrectly() {
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
@@ -266,10 +239,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForSet().members("persons:firstname:rand"), not(hasItem("1")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void keyExpiredEventShouldRemoveHelperStructures() {
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
@@ -288,10 +258,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForSet().members("persons"), not(hasItem("1")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-512
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-512
|
||||
public void putWritesIndexDataCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -327,10 +294,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForSet().isMember("persons:mat:idx", "persons:firstname:mat"), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldAlterIndexDataCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -349,10 +313,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.hasKey("persons:firstname:mat"), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldAlterIndexDataOnNestedObjectCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -375,10 +336,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.hasKey("persons:address.country:tear"), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldAlterIndexDataOnNestedObjectPathCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -398,10 +356,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.hasKey("persons:address.country:tear"), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldRemoveComplexObjectCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -421,10 +376,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForSet().isMember("persons:address.country:andor", "1"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldRemoveSimpleListValuesCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -441,10 +393,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForHash().hasKey("persons:1", "nicknames.[1]"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldRemoveComplexListValuesCorrectly() {
|
||||
|
||||
Person mat = new Person();
|
||||
@@ -471,10 +420,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForHash().hasKey("persons:1", "coworkers.[1].nicknames.[0]"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldRemoveSimpleMapValuesCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -490,10 +436,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForHash().hasKey("persons:1", "physicalAttributes.[eye-color]"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void updateShouldRemoveComplexMapValuesCorrectly() {
|
||||
|
||||
Person tam = new Person();
|
||||
@@ -512,10 +455,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForHash().hasKey("persons:1", "relatives.[stepfather].firstname"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void putShouldCreateGeoIndexCorrectly() {
|
||||
|
||||
Person tam = new Person();
|
||||
@@ -529,10 +469,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForZSet().score("persons:address:location", "1"), is(notNullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void deleteShouldRemoveGeoIndexCorrectly() {
|
||||
|
||||
Person tam = new Person();
|
||||
@@ -548,10 +485,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForZSet().score("persons:address:location", "1"), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void updateShouldAlterGeoIndexCorrectlyOnDelete() {
|
||||
|
||||
Person tam = new Person();
|
||||
@@ -570,10 +504,7 @@ public class RedisKeyValueAdapterTests {
|
||||
assertThat(template.opsForZSet().score("persons:address:location", "1"), is(nullValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void updateShouldAlterGeoIndexCorrectlyOnUpdate() {
|
||||
|
||||
Person tam = new Person();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -84,10 +84,7 @@ public class RedisKeyValueAdapterUnitTests {
|
||||
adapter.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-507
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-507
|
||||
public void destroyShouldNotDestroyConnectionFactory() throws Exception {
|
||||
|
||||
adapter.destroy();
|
||||
@@ -95,11 +92,7 @@ public class RedisKeyValueAdapterUnitTests {
|
||||
verify(jedisConnectionFactoryMock, never()).destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-512
|
||||
* @see DATAREDIS-530
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-512, DATAREDIS-530
|
||||
public void putShouldRemoveExistingIndexValuesWhenUpdating() {
|
||||
|
||||
RedisData rd = new RedisData(Bucket.newBucketFromStringMap(Collections.singletonMap("_id", "1")));
|
||||
@@ -115,10 +108,7 @@ public class RedisKeyValueAdapterUnitTests {
|
||||
org.mockito.Matchers.any(byte[].class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-512
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-512
|
||||
public void putShouldNotTryToRemoveExistingIndexValuesWhenInsertingNew() {
|
||||
|
||||
RedisData rd = new RedisData(Bucket.newBucketFromStringMap(Collections.singletonMap("_id", "1")));
|
||||
@@ -133,10 +123,7 @@ public class RedisKeyValueAdapterUnitTests {
|
||||
verify(redisConnectionMock, never()).sRem(org.mockito.Matchers.any(byte[].class), (byte[][]) anyVararg());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-491
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-491
|
||||
public void shouldInitKeyExpirationListenerOnStartup() throws Exception {
|
||||
|
||||
adapter.destroy();
|
||||
@@ -150,10 +137,7 @@ public class RedisKeyValueAdapterUnitTests {
|
||||
assertThat(listener, notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-491
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-491
|
||||
public void shouldInitKeyExpirationListenerOnFirstPutWithTtl() throws Exception {
|
||||
|
||||
adapter.destroy();
|
||||
@@ -177,10 +161,7 @@ public class RedisKeyValueAdapterUnitTests {
|
||||
assertThat(listener, notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-491
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-491
|
||||
public void shouldNeverInitKeyExpirationListener() throws Exception {
|
||||
|
||||
adapter.destroy();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -115,10 +115,7 @@ public class RedisKeyValueTemplateTests {
|
||||
adapter.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void savesObjectCorrectly() {
|
||||
|
||||
final Person rand = new Person();
|
||||
@@ -137,10 +134,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void findProcessesCallbackReturningSingleIdCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -164,10 +158,7 @@ public class RedisKeyValueTemplateTests {
|
||||
assertThat(result, hasItems(mat));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void findProcessesCallbackReturningMultipleIdsCorrectly() {
|
||||
|
||||
final Person rand = new Person();
|
||||
@@ -191,10 +182,7 @@ public class RedisKeyValueTemplateTests {
|
||||
assertThat(result, hasItems(rand, mat));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void findProcessesCallbackReturningNullCorrectly() {
|
||||
|
||||
Person rand = new Person();
|
||||
@@ -217,10 +205,7 @@ public class RedisKeyValueTemplateTests {
|
||||
assertThat(result.size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdate() {
|
||||
|
||||
final Person rand = new Person();
|
||||
@@ -313,10 +298,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateSimpleType() {
|
||||
|
||||
final VariousTypes source = new VariousTypes();
|
||||
@@ -343,10 +325,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateComplexType() {
|
||||
|
||||
Item callandor = new Item();
|
||||
@@ -390,10 +369,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateObjectType() {
|
||||
|
||||
Item callandor = new Item();
|
||||
@@ -440,10 +416,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateSimpleTypedMap() {
|
||||
|
||||
final VariousTypes source = new VariousTypes();
|
||||
@@ -477,10 +450,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateComplexTypedMap() {
|
||||
|
||||
final VariousTypes source = new VariousTypes();
|
||||
@@ -543,10 +513,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateObjectTypedMap() {
|
||||
|
||||
final VariousTypes source = new VariousTypes();
|
||||
@@ -626,10 +593,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateSimpleTypedList() {
|
||||
|
||||
final VariousTypes source = new VariousTypes();
|
||||
@@ -664,10 +628,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateComplexTypedList() {
|
||||
|
||||
final VariousTypes source = new VariousTypes();
|
||||
@@ -723,10 +684,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void partialUpdateObjectTypedList() {
|
||||
|
||||
final VariousTypes source = new VariousTypes();
|
||||
@@ -795,10 +753,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-530
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-530
|
||||
public void partialUpdateShouldLeaveIndexesNotInvolvedInUpdateUntouched() {
|
||||
|
||||
final Person rand = new Person();
|
||||
@@ -830,10 +785,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-530
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-530
|
||||
public void updateShouldAlterIndexesCorrectlyWhenValuesGetRemovedFromHash() {
|
||||
|
||||
final Person rand = new Person();
|
||||
@@ -870,10 +822,7 @@ public class RedisKeyValueTemplateTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-523
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-523
|
||||
public void shouldReadBackExplicitTimeToLive() throws InterruptedException {
|
||||
|
||||
WithTtl source = new WithTtl();
|
||||
@@ -890,10 +839,7 @@ public class RedisKeyValueTemplateTests {
|
||||
assertThat(target.ttl.doubleValue(), is(closeTo(3D, 1D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-523
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-523
|
||||
public void shouldReadBackExplicitTimeToLiveToPrimitiveField() throws InterruptedException {
|
||||
|
||||
WithPrimitiveTtl source = new WithPrimitiveTtl();
|
||||
@@ -909,10 +855,7 @@ public class RedisKeyValueTemplateTests {
|
||||
assertThat((double) target.ttl, is(closeTo(3D, 1D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-523
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-523
|
||||
public void shouldReadBackExplicitTimeToLiveWhenFetchingList() throws InterruptedException {
|
||||
|
||||
WithTtl source = new WithTtl();
|
||||
@@ -930,10 +873,7 @@ public class RedisKeyValueTemplateTests {
|
||||
assertThat(target.ttl.doubleValue(), is(closeTo(3D, 1D)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-523
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-523
|
||||
public void shouldReadBackExplicitTimeToLiveAndSetItToMinusOnelIfPersisted() throws InterruptedException {
|
||||
|
||||
WithTtl source = new WithTtl();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -326,10 +326,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertEquals(Arrays.asList(new Object[] { 5l, 1l, 2l, Arrays.asList(new Long[] { 10l, 11l }) }), results);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-500
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-500
|
||||
public void testExecutePipelinedWidthDifferentHashKeySerializerAndHashValueSerializer() {
|
||||
|
||||
assumeTrue(redisTemplate instanceof StringRedisTemplate);
|
||||
@@ -512,20 +509,14 @@ public class RedisTemplateTests<K, V> {
|
||||
assertEquals(Long.valueOf(1), redisTemplate.getExpire(key1, TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
public void testGetExpireSecondsForKeyDoesNotExist() {
|
||||
|
||||
Long expire = redisTemplate.getExpire(keyFactory.instance(), TimeUnit.SECONDS);
|
||||
assertTrue(expire < 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
public void testGetExpireSecondsForKeyExistButHasNoAssociatedExpire() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -534,10 +525,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertTrue(expire < 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
public void testGetExpireMillisForKeyDoesNotExist() {
|
||||
|
||||
Long expire = redisTemplate.getExpire(keyFactory.instance(), TimeUnit.MILLISECONDS);
|
||||
@@ -545,10 +533,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertTrue(expire < 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
public void testGetExpireMillisForKeyExistButHasNoAssociatedExpire() {
|
||||
|
||||
K key = keyFactory.instance();
|
||||
@@ -559,10 +544,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertTrue(expire < 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
public void testGetExpireMillis() {
|
||||
|
||||
assumeTrue(redisTemplate.getConnectionFactory() instanceof JedisConnectionFactory
|
||||
@@ -578,10 +560,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertThat(ttl, lessThan(25L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void testGetExpireMillisUsingTransactions() {
|
||||
|
||||
@@ -608,10 +587,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertThat(((Long) result.get(1)), lessThan(25L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-526
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-526
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void testGetExpireMillisUsingPipelining() {
|
||||
|
||||
@@ -739,10 +715,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertEquals(DataType.STRING, redisTemplate.type(key1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-506
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-506
|
||||
public void testWatch() {
|
||||
final K key1 = keyFactory.instance();
|
||||
V value1 = valueFactory.instance();
|
||||
@@ -818,10 +791,7 @@ public class RedisTemplateTests<K, V> {
|
||||
assertThat(redisTemplate.opsForValue().get(key1), isEqual(value3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-506
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-506
|
||||
public void testWatchMultipleKeys() {
|
||||
|
||||
final K key1 = keyFactory.instance();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,30 +55,21 @@ public class RedisTemplateUnitTests {
|
||||
template.afterPropertiesSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-277
|
||||
public void slaveOfIsDelegatedToConnectionCorrectly() {
|
||||
|
||||
template.slaveOf("127.0.0.1", 1001);
|
||||
verify(redisConnectionMock, times(1)).slaveOf(eq("127.0.0.1"), eq(1001));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-277
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-277
|
||||
public void slaveOfNoOneIsDelegatedToConnectionCorrectly() {
|
||||
|
||||
template.slaveOfNoOne();
|
||||
verify(redisConnectionMock, times(1)).slaveOfNoOne();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-501
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-501
|
||||
public void templateShouldPassOnAndUseResoureLoaderClassLoaderToDefaultJdkSerializerWhenNotAlreadySet() {
|
||||
|
||||
ShadowingClassLoader scl = new ShadowingClassLoader(ClassLoader.getSystemClassLoader());
|
||||
@@ -96,10 +87,7 @@ public class RedisTemplateUnitTests {
|
||||
assertThat(deserialized.getClass().getClassLoader(), is((ClassLoader) scl));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-531
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-531
|
||||
public void executeWithStickyConnectionShouldNotCloseConnectionWhenDone() {
|
||||
|
||||
CapturingCallback callback = new CapturingCallback();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -41,28 +41,19 @@ public class ScanCursorUnitTests {
|
||||
|
||||
public @Rule ExpectedException exception = ExpectedException.none();
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-290
|
||||
public void cursorShouldNotLoopWhenNoValuesFound() {
|
||||
|
||||
CapturingCursorDummy cursor = initCursor(new LinkedList<ScanIteration<String>>());
|
||||
assertThat(cursor.hasNext(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test(expected = NoSuchElementException.class)
|
||||
@Test(expected = NoSuchElementException.class) // DATAREDIS-290
|
||||
public void cursorShouldReturnNullWhenNoNextElementAvailable() {
|
||||
initCursor(new LinkedList<ScanIteration<String>>()).next();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-290
|
||||
public void cursorShouldNotLoopWhenReachingStartingPointInFistLoop() {
|
||||
|
||||
LinkedList<ScanIteration<String>> values = new LinkedList<ScanIteration<String>>();
|
||||
@@ -82,10 +73,7 @@ public class ScanCursorUnitTests {
|
||||
assertThat(cursor.hasNext(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-290
|
||||
public void cursorShouldStopLoopWhenReachingStartingPoint() {
|
||||
|
||||
LinkedList<ScanIteration<String>> values = new LinkedList<ScanIteration<String>>();
|
||||
@@ -107,10 +95,7 @@ public class ScanCursorUnitTests {
|
||||
assertThat(cursor.hasNext(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-290
|
||||
public void shouldThrowExceptionWhenAccessingClosedCursor() {
|
||||
|
||||
CapturingCursorDummy cursor = new CapturingCursorDummy(null);
|
||||
@@ -123,10 +108,7 @@ public class ScanCursorUnitTests {
|
||||
cursor.next();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class)
|
||||
@Test(expected = InvalidDataAccessApiUsageException.class) // DATAREDIS-290
|
||||
public void repoeningCursorShouldHappenAtLastPosition() throws IOException {
|
||||
|
||||
LinkedList<ScanIteration<String>> values = new LinkedList<ScanIteration<String>>();
|
||||
@@ -146,10 +128,7 @@ public class ScanCursorUnitTests {
|
||||
cursor.open();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-290
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-290
|
||||
public void positionShouldBeIncrementedCorrectly() throws IOException {
|
||||
|
||||
LinkedList<ScanIteration<String>> values = new LinkedList<ScanIteration<String>>();
|
||||
@@ -167,10 +146,7 @@ public class ScanCursorUnitTests {
|
||||
assertThat(cursor.getPosition(), is(2L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-417
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-417
|
||||
public void hasNextShouldCallScanUntilFinishedWhenScanResultIsAnEmptyCollection() {
|
||||
|
||||
LinkedList<ScanIteration<String>> values = new LinkedList<ScanIteration<String>>();
|
||||
@@ -191,10 +167,7 @@ public class ScanCursorUnitTests {
|
||||
assertThat(result, hasItems("spring", "redis"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-417
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-417
|
||||
public void hasNextShouldStopWhenScanResultIsAnEmptyCollectionAndStateIsFinished() {
|
||||
|
||||
LinkedList<ScanIteration<String>> values = new LinkedList<ScanIteration<String>>();
|
||||
@@ -217,10 +190,7 @@ public class ScanCursorUnitTests {
|
||||
assertThat(result, hasItems("spring", "data"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-417
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-417
|
||||
public void hasNextShouldStopCorrectlyWhenWholeScanIterationDoesNotReturnResultsAndStateIsFinished() {
|
||||
|
||||
LinkedList<ScanIteration<String>> values = new LinkedList<ScanIteration<String>>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,26 +39,17 @@ public class CompositeIndexResolverUnitTests {
|
||||
@Mock IndexResolver resolver2;
|
||||
@Mock TypeInformation<?> typeInfoMock;
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void shouldRejectNull() {
|
||||
new CompositeIndexResolver(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void shouldRejectCollectionWithNullValues() {
|
||||
new CompositeIndexResolver(Arrays.asList(resolver1, null, resolver2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldCollectionIndexesFromResolvers() {
|
||||
|
||||
when(resolver1.resolveIndexesFor(any(TypeInformation.class), anyObject())).thenReturn(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -80,18 +80,12 @@ public class PathIndexResolverUnitTests {
|
||||
new RedisMappingContext(new MappingConfiguration(indexConfig, new KeyspaceConfiguration())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void shouldThrowExceptionOnNullMappingContext() {
|
||||
new PathIndexResolver(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldResolveAnnotatedIndexOnRootWhenValueIsNotNull() {
|
||||
|
||||
Address address = new Address();
|
||||
@@ -103,10 +97,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes, hasItem(new SimpleIndexedPropertyValue(Address.class.getName(), "country", "andor")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldNotResolveAnnotatedIndexOnRootWhenValueIsNull() {
|
||||
|
||||
Address address = new Address();
|
||||
@@ -117,10 +108,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes.size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldResolveAnnotatedIndexOnNestedObjectWhenValueIsNotNull() {
|
||||
|
||||
Person person = new Person();
|
||||
@@ -133,10 +121,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes, hasItem(new SimpleIndexedPropertyValue(KEYSPACE_PERSON, "address.country", "andor")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldResolveMultipleAnnotatedIndexesInLists() {
|
||||
|
||||
TheWheelOfTime twot = new TheWheelOfTime();
|
||||
@@ -162,10 +147,7 @@ public class PathIndexResolverUnitTests {
|
||||
new SimpleIndexedPropertyValue(KEYSPACE_TWOT, "mainCharacters.address.country", "saldaea")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldResolveAnnotatedIndexesInMap() {
|
||||
|
||||
TheWheelOfTime twot = new TheWheelOfTime();
|
||||
@@ -186,10 +168,7 @@ public class PathIndexResolverUnitTests {
|
||||
hasItem(new SimpleIndexedPropertyValue(KEYSPACE_TWOT, "places.stone-of-tear.address.country", "illian")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldResolveConfiguredIndexesInMapOfSimpleTypes() {
|
||||
|
||||
indexConfig.addIndexDefinition(new SimpleIndexDefinition(KEYSPACE_PERSON, "physicalAttributes.eye-color"));
|
||||
@@ -205,10 +184,7 @@ public class PathIndexResolverUnitTests {
|
||||
hasItem(new SimpleIndexedPropertyValue(KEYSPACE_PERSON, "physicalAttributes.eye-color", "grey")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldResolveConfiguredIndexesInMapOfComplexTypes() {
|
||||
|
||||
indexConfig.addIndexDefinition(new SimpleIndexDefinition(KEYSPACE_PERSON, "relatives.father.firstname"));
|
||||
@@ -228,11 +204,7 @@ public class PathIndexResolverUnitTests {
|
||||
hasItem(new SimpleIndexedPropertyValue(KEYSPACE_PERSON, "relatives.father.firstname", "janduin")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425, DATAREDIS-471
|
||||
public void shouldIgnoreConfiguredIndexesInMapWhenValueIsNull() {
|
||||
|
||||
indexConfig.addIndexDefinition(new SimpleIndexDefinition(KEYSPACE_PERSON, "physicalAttributes.eye-color"));
|
||||
@@ -247,10 +219,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes.iterator().next(), IsInstanceOf.instanceOf(RemoveIndexedData.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void shouldNotResolveIndexOnReferencedEntity() {
|
||||
|
||||
PersonWithAddressReference rand = new PersonWithAddressReference();
|
||||
@@ -264,20 +233,14 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes.size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldReturnNullWhenNoIndexConfigured() {
|
||||
|
||||
when(propertyMock.isAnnotationPresent(eq(Indexed.class))).thenReturn(false);
|
||||
assertThat(resolve("foo", "rand"), nullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldReturnDataWhenIndexConfigured() {
|
||||
|
||||
when(propertyMock.isAnnotationPresent(eq(Indexed.class))).thenReturn(false);
|
||||
@@ -286,10 +249,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(resolve("foo", "rand"), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldReturnDataWhenNoIndexConfiguredButPropertyAnnotated() {
|
||||
|
||||
when(propertyMock.isAnnotationPresent(eq(Indexed.class))).thenReturn(true);
|
||||
@@ -298,10 +258,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(resolve("foo", "rand"), notNullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldRemovePositionIndicatorForValuesInLists() {
|
||||
|
||||
when(propertyMock.isCollectionLike()).thenReturn(true);
|
||||
@@ -313,10 +270,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(index.getIndexName(), is("list.name"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldRemoveKeyIndicatorForValuesInMap() {
|
||||
|
||||
when(propertyMock.isMap()).thenReturn(true);
|
||||
@@ -328,10 +282,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(index.getIndexName(), is("map.foo.name"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldKeepNumericalKeyForValuesInMap() {
|
||||
|
||||
when(propertyMock.isMap()).thenReturn(true);
|
||||
@@ -343,10 +294,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(index.getIndexName(), is("map.0.name"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldInspectObjectTypeProperties() {
|
||||
|
||||
Item hat = new Item();
|
||||
@@ -361,10 +309,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes, hasItem(new SimpleIndexedPropertyValue(KEYSPACE_PERSON, "feature.type", "hat")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldInspectObjectTypePropertiesButIgnoreNullValues() {
|
||||
|
||||
Item hat = new Item();
|
||||
@@ -378,10 +323,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes.size(), is(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldInspectObjectTypeValuesInMapProperties() {
|
||||
|
||||
Item hat = new Item();
|
||||
@@ -399,10 +341,7 @@ public class PathIndexResolverUnitTests {
|
||||
hasItem(new SimpleIndexedPropertyValue(KEYSPACE_PERSON, "characteristics.clothing.type", "hat")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexShouldInspectObjectTypeValuesInListProperties() {
|
||||
|
||||
Item hat = new Item();
|
||||
@@ -419,10 +358,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes, hasItem(new SimpleIndexedPropertyValue(KEYSPACE_PERSON, "items.type", "hat")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexAllowCustomIndexName() {
|
||||
|
||||
indexConfig.addIndexDefinition(new SimpleIndexDefinition(KEYSPACE_PERSON, "items.type", "itemsType"));
|
||||
@@ -441,10 +377,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes, hasItem(new SimpleIndexedPropertyValue(KEYSPACE_PERSON, "itemsType", "hat")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexForTypeThatHasNoIndexDefined() {
|
||||
|
||||
Size size = new Size();
|
||||
@@ -456,10 +389,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(indexes, is(empty()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexOnMapField() {
|
||||
|
||||
IndexedOnMapField source = new IndexedOnMapField();
|
||||
@@ -478,10 +408,7 @@ public class PathIndexResolverUnitTests {
|
||||
new SimpleIndexedPropertyValue(IndexedOnMapField.class.getName(), "values.arya", "stark")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveIndexOnListField() {
|
||||
|
||||
IndexedOnListField source = new IndexedOnListField();
|
||||
@@ -500,10 +427,7 @@ public class PathIndexResolverUnitTests {
|
||||
new SimpleIndexedPropertyValue(IndexedOnListField.class.getName(), "values", "arya")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-509
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-509
|
||||
public void resolveIndexOnPrimitiveArrayField() {
|
||||
|
||||
IndexedOnPrimitiveArrayField source = new IndexedOnPrimitiveArrayField();
|
||||
@@ -520,10 +444,7 @@ public class PathIndexResolverUnitTests {
|
||||
new SimpleIndexedPropertyValue(IndexedOnPrimitiveArrayField.class.getName(), "values", 3)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void resolveGeoIndexShouldMapNameCorrectly() {
|
||||
|
||||
when(propertyMock.isMap()).thenReturn(true);
|
||||
@@ -535,10 +456,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(index.getIndexName(), is("location"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void resolveGeoIndexShouldMapNameForNestedPropertyCorrectly() {
|
||||
|
||||
when(propertyMock.isMap()).thenReturn(true);
|
||||
@@ -550,10 +468,7 @@ public class PathIndexResolverUnitTests {
|
||||
assertThat(index.getIndexName(), is("property:location"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void resolveGeoIndexOnPointField() {
|
||||
|
||||
GeoIndexedOnPoint source = new GeoIndexedOnPoint();
|
||||
@@ -567,10 +482,7 @@ public class PathIndexResolverUnitTests {
|
||||
new GeoIndexedPropertyValue(GeoIndexedOnPoint.class.getName(), "location", source.location)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-533
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-533
|
||||
public void resolveGeoIndexOnArrayFieldThrowsError() {
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -73,28 +73,19 @@ public class SpelIndexResolverUnitTests {
|
||||
resolver = createWithExpression("getAttribute('" + securityContextAttrName + "')?.authentication?.name");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void constructorNullRedisMappingContext() {
|
||||
|
||||
mappingContext = null;
|
||||
new SpelIndexResolver(mappingContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void constructorNullSpelExpressionParser() {
|
||||
new SpelIndexResolver(mappingContext, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void nullValue() {
|
||||
|
||||
Set<IndexedData> indexes = resolver.resolveIndexesFor(typeInformation, null);
|
||||
@@ -102,10 +93,7 @@ public class SpelIndexResolverUnitTests {
|
||||
assertThat(indexes.size(), equalTo(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void wrongKeyspace() {
|
||||
|
||||
typeInformation = ClassTypeInformation.from(String.class);
|
||||
@@ -114,10 +102,7 @@ public class SpelIndexResolverUnitTests {
|
||||
assertThat(indexes.size(), equalTo(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void sessionAttributeNull() {
|
||||
|
||||
session = new Session();
|
||||
@@ -126,10 +111,7 @@ public class SpelIndexResolverUnitTests {
|
||||
assertThat(indexes.size(), equalTo(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolvePrincipalName() {
|
||||
|
||||
Set<IndexedData> indexes = resolver.resolveIndexesFor(typeInformation, session);
|
||||
@@ -137,10 +119,7 @@ public class SpelIndexResolverUnitTests {
|
||||
assertThat(indexes, hasItem(new SimpleIndexedPropertyValue(keyspace, indexName, username)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = SpelEvaluationException.class)
|
||||
@Test(expected = SpelEvaluationException.class) // DATAREDIS-425
|
||||
public void spelError() {
|
||||
|
||||
session.setAttribute(securityContextAttrName, "");
|
||||
@@ -148,10 +127,7 @@ public class SpelIndexResolverUnitTests {
|
||||
resolver.resolveIndexesFor(typeInformation, session);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void withBeanAndThis() {
|
||||
|
||||
this.resolver = createWithExpression("@bean.run(#this)");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,10 +26,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class IndexConfigurationUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void redisIndexSettingIndexNameDefaulted() {
|
||||
|
||||
String path = "path";
|
||||
@@ -37,10 +34,7 @@ public class IndexConfigurationUnitTests {
|
||||
assertThat(setting.getIndexName(), equalTo(path));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void redisIndexSettingIndexNameExplicit() {
|
||||
|
||||
String indexName = "indexName";
|
||||
@@ -48,10 +42,7 @@ public class IndexConfigurationUnitTests {
|
||||
assertThat(setting.getIndexName(), equalTo(indexName));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void redisIndexSettingIndexNameUsedInEquals() {
|
||||
|
||||
SimpleIndexDefinition setting1 = new SimpleIndexDefinition("keyspace", "path", "indexName1");
|
||||
@@ -61,10 +52,7 @@ public class IndexConfigurationUnitTests {
|
||||
assertThat(setting1, not(equalTo(setting2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void redisIndexSettingIndexNameUsedInHashCode() {
|
||||
|
||||
SimpleIndexDefinition setting1 = new SimpleIndexDefinition("keyspace", "path", "indexName1");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -61,10 +61,7 @@ public class BasicRedisPersistentEntityUnitTests<T, ID extends Serializable> {
|
||||
entity = new BasicRedisPersistentEntity<T>(entityInformation, keySpaceResolver, ttlAccessor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void addingMultipleIdPropertiesWithoutAnExplicitOneThrowsException() {
|
||||
|
||||
expectedException.expect(MappingException.class);
|
||||
@@ -81,10 +78,7 @@ public class BasicRedisPersistentEntityUnitTests<T, ID extends Serializable> {
|
||||
entity.addPersistentProperty(property2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addingMultipleExplicitIdPropertiesThrowsException() {
|
||||
|
||||
@@ -104,10 +98,7 @@ public class BasicRedisPersistentEntityUnitTests<T, ID extends Serializable> {
|
||||
entity.addPersistentProperty(property2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
@SuppressWarnings("unchecked")
|
||||
public void explicitIdPropertiyShouldBeFavoredOverNonExplicit() {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,26 +38,17 @@ public class ConfigAwareKeySpaceResolverUnitTests {
|
||||
this.resolver = new ConfigAwareKeySpaceResolver(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void resolveShouldThrowExceptionWhenTypeIsNull() {
|
||||
resolver.resolveKeySpace(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveShouldUseClassNameAsDefaultKeyspace() {
|
||||
assertThat(resolver.resolveKeySpace(TypeWithoutAnySettings.class), is(TypeWithoutAnySettings.class.getName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void resolveShouldFavorConfiguredNameOverClassName() {
|
||||
|
||||
config.addKeyspaceSettings(new KeyspaceSettings(TypeWithoutAnySettings.class, "ji'e'toh"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,26 +42,17 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
accessor = new ConfigAwareTimeToLiveAccessor(config, new RedisMappingContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREDIS-425
|
||||
public void getTimeToLiveShouldThrowExceptionWhenSourceObjectIsNull() {
|
||||
accessor.getTimeToLive(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnNullIfNothingConfiguredOrAnnotated() {
|
||||
assertThat(accessor.getTimeToLive(new SimpleType()), nullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnConfiguredValueForSimpleType() {
|
||||
|
||||
KeyspaceSettings setting = new KeyspaceSettings(SimpleType.class, null);
|
||||
@@ -71,18 +62,12 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(accessor.getTimeToLive(new SimpleType()), is(10L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnValueWhenTypeIsAnnotated() {
|
||||
assertThat(accessor.getTimeToLive(new TypeWithRedisHashAnnotation()), is(5L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveConsidersAnnotationOverConfig() {
|
||||
|
||||
KeyspaceSettings setting = new KeyspaceSettings(TypeWithRedisHashAnnotation.class, null);
|
||||
@@ -92,34 +77,22 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(accessor.getTimeToLive(new TypeWithRedisHashAnnotation()), is(5L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnValueWhenPropertyIsAnnotatedAndHasValue() {
|
||||
assertThat(accessor.getTimeToLive(new TypeWithRedisHashAnnotationAndTTLProperty(20L)), is(20L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnValueFromTypeAnnotationWhenPropertyIsAnnotatedAndHasNullValue() {
|
||||
assertThat(accessor.getTimeToLive(new TypeWithRedisHashAnnotationAndTTLProperty()), is(10L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnNullWhenPropertyIsAnnotatedAndHasNullValue() {
|
||||
assertThat(accessor.getTimeToLive(new SimpleTypeWithTTLProperty()), nullValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnConfiguredValueWhenPropertyIsAnnotatedAndHasNullValue() {
|
||||
|
||||
KeyspaceSettings setting = new KeyspaceSettings(SimpleTypeWithTTLProperty.class, null);
|
||||
@@ -129,10 +102,7 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(accessor.getTimeToLive(new SimpleTypeWithTTLProperty()), is(10L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldFavorAnnotatedNotNullPropertyValueOverConfiguredOne() {
|
||||
|
||||
KeyspaceSettings setting = new KeyspaceSettings(SimpleTypeWithTTLProperty.class, null);
|
||||
@@ -142,18 +112,12 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(accessor.getTimeToLive(new SimpleTypeWithTTLProperty(25L)), is(25L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnMethodLevelTimeToLiveIfPresent() {
|
||||
assertThat(accessor.getTimeToLive(new TypeWithTtlOnMethod(10L)), is(10L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnConfiguredValueWhenMethodLevelTimeToLiveIfPresentButHasNullValue() {
|
||||
|
||||
KeyspaceSettings setting = new KeyspaceSettings(TypeWithTtlOnMethod.class, null);
|
||||
@@ -163,10 +127,7 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(accessor.getTimeToLive(new TypeWithTtlOnMethod(null)), is(10L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void getTimeToLiveShouldReturnValueWhenMethodLevelTimeToLiveIfPresentAlthoughConfiguredValuePresent() {
|
||||
|
||||
KeyspaceSettings setting = new KeyspaceSettings(TypeWithTtlOnMethod.class, null);
|
||||
@@ -176,10 +137,7 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(accessor.getTimeToLive(new TypeWithTtlOnMethod(100L)), is(100L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void getTimeToLiveShouldReturnDefaultValue() {
|
||||
|
||||
Long ttl = accessor
|
||||
@@ -188,10 +146,7 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(ttl, is(5L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void getTimeToLiveShouldReturnValueWhenUpdateModifiesTtlProperty() {
|
||||
|
||||
Long ttl = accessor
|
||||
@@ -201,10 +156,7 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(ttl, is(100L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void getTimeToLiveShouldReturnPropertyValueWhenUpdateModifiesTtlProperty() {
|
||||
|
||||
Long ttl = accessor.getTimeToLive(new PartialUpdate<TypeWithRedisHashAnnotationAndTTLProperty>("123",
|
||||
@@ -213,10 +165,7 @@ public class ConfigAwareTimeToLiveAccessorUnitTests {
|
||||
assertThat(ttl, is(100L));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-471
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-471
|
||||
public void getTimeToLiveShouldReturnDefaultValueWhenUpdateDoesNotModifyTtlProperty() {
|
||||
|
||||
Long ttl = accessor.getTimeToLive(new PartialUpdate<TypeWithRedisHashAnnotationAndTTLProperty>("123",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -246,10 +246,7 @@ public abstract class AbstractDefaultScriptExecutorTests {
|
||||
assertEquals("HELLO", scriptExecutor.execute(script, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-356
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-356
|
||||
public void shouldTransparentlyReEvaluateScriptIfNotPresent() throws Exception {
|
||||
|
||||
this.template = new StringRedisTemplate();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -53,10 +53,7 @@ public class DefaultScriptExecutorUnitTests {
|
||||
executor = new DefaultScriptExecutor<String>(template);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-347
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-347
|
||||
public void excuteCheckForPresenceOfScriptViaEvalSha1() {
|
||||
|
||||
when(redisConnectionMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenReturn("FOO".getBytes());
|
||||
@@ -66,10 +63,7 @@ public class DefaultScriptExecutorUnitTests {
|
||||
verify(redisConnectionMock, times(1)).evalSha(anyString(), any(ReturnType.class), anyInt());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-347
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-347
|
||||
public void excuteShouldNotCallEvalWhenSha1Exists() {
|
||||
|
||||
when(redisConnectionMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenReturn("FOO".getBytes());
|
||||
@@ -79,10 +73,7 @@ public class DefaultScriptExecutorUnitTests {
|
||||
verify(redisConnectionMock, never()).eval(any(byte[].class), any(ReturnType.class), anyInt());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-347
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-347
|
||||
public void excuteShouldUseEvalInCaseNoSha1PresentForGivenScript() {
|
||||
|
||||
when(redisConnectionMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenThrow(
|
||||
@@ -93,10 +84,7 @@ public class DefaultScriptExecutorUnitTests {
|
||||
verify(redisConnectionMock, times(1)).eval(any(byte[].class), any(ReturnType.class), anyInt());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-347
|
||||
*/
|
||||
@Test(expected = UnsupportedOperationException.class)
|
||||
@Test(expected = UnsupportedOperationException.class) // DATAREDIS-347
|
||||
public void excuteShouldThrowExceptionInCaseEvalShaFailsWithOtherThanRedisSystemException() {
|
||||
|
||||
when(redisConnectionMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenThrow(
|
||||
@@ -105,10 +93,7 @@ public class DefaultScriptExecutorUnitTests {
|
||||
executor.execute(SCRIPT, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-347
|
||||
*/
|
||||
@Test(expected = RedisSystemException.class)
|
||||
@Test(expected = RedisSystemException.class) // DATAREDIS-347
|
||||
public void excuteShouldThrowExceptionInCaseEvalShaFailsWithAlthoughTheScriptExists() {
|
||||
|
||||
when(redisConnectionMock.evalSha(anyString(), any(ReturnType.class), anyInt())).thenThrow(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,10 +28,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class ExpirationUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void fromDefault() throws Exception {
|
||||
|
||||
Expiration expiration = Expiration.from(5, null);
|
||||
@@ -40,10 +37,7 @@ public class ExpirationUnitTests {
|
||||
assertThat(expiration.getTimeUnit(), is(TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void fromNanos() throws Exception {
|
||||
|
||||
Expiration expiration = Expiration.from(5L * 1000 * 1000, TimeUnit.NANOSECONDS);
|
||||
@@ -52,10 +46,7 @@ public class ExpirationUnitTests {
|
||||
assertThat(expiration.getTimeUnit(), is(TimeUnit.MILLISECONDS));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-316
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-316
|
||||
public void fromMinutes() throws Exception {
|
||||
|
||||
Expiration expiration = Expiration.from(5, TimeUnit.MINUTES);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -81,10 +81,7 @@ public class KeyExpirationEventMessageListenerTests {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void listenerShouldPublishEventCorrectly() throws InterruptedException {
|
||||
|
||||
byte[] key = ("to-expire:" + UUID.randomUUID().toString()).getBytes();
|
||||
@@ -110,10 +107,7 @@ public class KeyExpirationEventMessageListenerTests {
|
||||
assertThat((byte[]) captor.getValue().getSource(), is(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void listenerShouldNotReactToDeleteEvents() throws InterruptedException {
|
||||
|
||||
byte[] key = ("to-delete:" + UUID.randomUUID().toString()).getBytes();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -53,10 +53,7 @@ public class KeyExpirationEventMessageListenerUnitTests {
|
||||
listener.setApplicationEventPublisher(publisherMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void handleMessageShouldPublishKeyExpiredEvent() {
|
||||
|
||||
listener.onMessage(MESSAGE, "*".getBytes());
|
||||
@@ -68,10 +65,7 @@ public class KeyExpirationEventMessageListenerUnitTests {
|
||||
assertThat((byte[]) captor.getValue().getSource(), is(MESSAGE_BODY.getBytes()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void handleMessageShouldNotRespondToNullMessage() {
|
||||
|
||||
listener.onMessage(null, "*".getBytes());
|
||||
@@ -79,10 +73,7 @@ public class KeyExpirationEventMessageListenerUnitTests {
|
||||
verifyZeroInteractions(publisherMock);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-425
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-425
|
||||
public void handleMessageShouldNotRespondToEmptyMessage() {
|
||||
|
||||
listener.onMessage(new DefaultMessage(null, null), "*".getBytes());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2013 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -175,11 +175,8 @@ public class PubSubTests<T> {
|
||||
container.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-251
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@Test // DATAREDIS-251
|
||||
public void testStartListenersToNoSpecificChannelTest() throws InterruptedException {
|
||||
container.removeMessageListener(adapter, new ChannelTopic(CHANNEL));
|
||||
container.addMessageListener(adapter, Arrays.asList(new PatternTopic("*")));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -79,10 +79,7 @@ public class RedisMessageListenerContainerTests {
|
||||
connectionFactory.destroy();
|
||||
}
|
||||
|
||||
/*
|
||||
* @see DATAREDIS-415
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-415
|
||||
public void interruptAtStart() throws Exception {
|
||||
|
||||
final Thread main = Thread.currentThread();
|
||||
|
||||
@@ -124,7 +124,7 @@ public class SubscriptionConnectionTests {
|
||||
|
||||
if (connectionFactory instanceof JedisConnectionFactory) {
|
||||
// Need to sleep shortly as jedis cannot deal propery with multiple repsonses within one connection
|
||||
// @see https://github.com/xetorthio/jedis/issues/186
|
||||
// see https://github.com/xetorthio/jedis/issues/186
|
||||
Thread.sleep(100);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2014 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -139,10 +139,7 @@ public class MessageListenerTest {
|
||||
verify(target).customMethodWithChannel(PAYLOAD, CHANNEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-92
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-92
|
||||
public void triggersListenerImplementingInterfaceCorrectly() {
|
||||
|
||||
SampleListener listener = new SampleListener();
|
||||
@@ -158,10 +155,7 @@ public class MessageListenerTest {
|
||||
assertEquals(1, listener.count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-337
|
||||
public void defaultConcreteHandlerMethodShouldOnlyBeInvokedOnce() {
|
||||
|
||||
ConcreteMessageHandler listener = spy(new ConcreteMessageHandler());
|
||||
@@ -174,10 +168,7 @@ public class MessageListenerTest {
|
||||
verify(listener, times(1)).handleMessage(anyString(), anyString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-337
|
||||
public void defaultConcreteHandlerMethodWithoutSerializerShouldOnlyBeInvokedOnce() {
|
||||
|
||||
ConcreteMessageHandler listener = spy(new ConcreteMessageHandler());
|
||||
@@ -191,10 +182,7 @@ public class MessageListenerTest {
|
||||
verify(listener, times(1)).handleMessage(any(byte[].class), anyString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-337
|
||||
public void defaultConcreteHandlerMethodWithCustomSerializerShouldOnlyBeInvokedOnce() {
|
||||
|
||||
ConcreteMessageHandler listener = spy(new ConcreteMessageHandler());
|
||||
@@ -208,10 +196,7 @@ public class MessageListenerTest {
|
||||
verify(listener, times(1)).handleMessage(any(Pojo.class), anyString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-337
|
||||
public void customConcreteHandlerMethodShouldOnlyBeInvokedOnce() {
|
||||
|
||||
ConcreteMessageHandler listener = spy(new ConcreteMessageHandler());
|
||||
@@ -225,10 +210,7 @@ public class MessageListenerTest {
|
||||
verify(listener, times(1)).handle(anyString(), anyString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-337
|
||||
public void customConcreteMessageOnlyHandlerMethodShouldOnlyBeInvokedOnce() {
|
||||
|
||||
ConcreteMessageHandler listener = spy(new ConcreteMessageHandler());
|
||||
@@ -242,10 +224,7 @@ public class MessageListenerTest {
|
||||
verify(listener, times(1)).handleMessageOnly(anyString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-337
|
||||
public void customConcreteHandlerMethodWithoutSerializerShouldOnlyBeInvokedOnce() {
|
||||
|
||||
ConcreteMessageHandler listener = spy(new ConcreteMessageHandler());
|
||||
@@ -260,10 +239,7 @@ public class MessageListenerTest {
|
||||
verify(listener, times(1)).handle(any(byte[].class), anyString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-337
|
||||
public void customConcreteHandlerMethodWithCustomSerializerShouldOnlyBeInvokedOnce() {
|
||||
|
||||
ConcreteMessageHandler listener = spy(new ConcreteMessageHandler());
|
||||
@@ -289,7 +265,6 @@ public class MessageListenerTest {
|
||||
|
||||
/**
|
||||
* @author Thomas Darimont
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
static class AbstractMessageHandler {
|
||||
|
||||
@@ -310,7 +285,6 @@ public class MessageListenerTest {
|
||||
|
||||
/**
|
||||
* @author Thomas Darimont
|
||||
* @see DATAREDIS-337
|
||||
*/
|
||||
static class ConcreteMessageHandler extends AbstractMessageHandler {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2015 the original author or authors.
|
||||
* Copyright 2011-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,10 +55,7 @@ public abstract class AbstractHashMapperTest {
|
||||
assertBackAndForwardMapping(new Person("George", "Enescu", 74, new Address("liveni", 19)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-421
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-421
|
||||
public void toHashShouldTreatNullValuesCorrectly() {
|
||||
|
||||
Person source = new Person("rand", null, 19);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -78,10 +78,7 @@ public class Jackson2HashMapperTests {
|
||||
this.mapper = new Jackson2HashMapper(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREDIS-423
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREDIS-423
|
||||
public void shouldWriteReadHashCorrectly() {
|
||||
|
||||
Person jon = new Person("jon", "snow", 19);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user