Skip to content

Commit 9c36afe

Browse files
committed
Add tests and templates
1 parent ecbfd32 commit 9c36afe

File tree

290 files changed

+1247
-805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+1247
-805
lines changed

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,8 @@
848848
<configuration>
849849
<directories>
850850
<directory>${project.build.sourceDirectory}</directory>
851-
<directory>${project.build.directory}/generated-sources</directory>
851+
<directory>${project.build.testSourceDirectory}</directory>
852+
<directory>${project.basedir}/src/main/templates</directory>
852853
</directories>
853854
</configuration>
854855
<executions>

src/main/java/io/lettuce/core/dynamic/SimpleBatcher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,5 @@ private List<RedisCommand<Object, Object, Object>> prepareDefaultFlush(int consu
184184
private <T> ArrayList<T> newDrainTarget() {
185185
return new ArrayList<>(Math.max(0, Math.min(batchSize, queue.size())));
186186
}
187+
187188
}

src/main/templates/io/lettuce/core/api/BaseRedisCommands.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,18 @@ public interface BaseRedisCommands<K, V> {
180180

181181
/**
182182
* @return {@code true} if the connection is open (connected and not closed).
183-
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#isOpen()} method on the connection
184-
* interface. To be removed with Lettuce 7.0.
183+
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#isOpen()} method on the
184+
* connection interface. To be removed with Lettuce 7.0.
185185
*/
186186
@Deprecated
187187
boolean isOpen();
188188

189189
/**
190190
* Reset the command state. Queued commands will be canceled and the internal state will be reset. This is useful when the
191191
* internal state machine gets out of sync with the connection.
192-
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#reset()} method on the connection
193-
* interface. To be removed with Lettuce 7.0.
192+
*
193+
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#reset()} method on the
194+
* connection interface. To be removed with Lettuce 7.0.
194195
*/
195196
@Deprecated
196197
void reset();
@@ -201,19 +202,20 @@ public interface BaseRedisCommands<K, V> {
201202
* issued. After calling {@link #flushCommands()} commands are sent to the transport and executed by Redis.
202203
*
203204
* @param autoFlush state of autoFlush.
204-
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#setAutoFlushCommands(boolean)} method on the connection
205-
* interface. To be removed with Lettuce 7.0.
206-
205+
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#setAutoFlushCommands(boolean)}
206+
* method on the connection interface. To be removed with Lettuce 7.0.
207+
*
207208
*/
208209
@Deprecated
209210
void setAutoFlushCommands(boolean autoFlush);
210211

211212
/**
212213
* Flush pending commands. This commands forces a flush on the channel and can be used to buffer ("pipeline") commands to
213214
* achieve batching. No-op if channel is not connected.
214-
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#flushCommands()} method on the connection
215-
* interface. To be removed with Lettuce 7.0.
216-
215+
*
216+
* @deprecated since 6.2. Use the corresponding {@link io.lettuce.core.api.StatefulConnection#flushCommands()} method on the
217+
* connection interface. To be removed with Lettuce 7.0.
218+
*
217219
*/
218220
@Deprecated
219221
void flushCommands();

src/main/templates/io/lettuce/core/api/RedisAclCommands.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public interface RedisAclCommands<K, V> {
110110
List<String> aclList();
111111

112112
/**
113-
* When Redis is configured to use an ACL file (with the aclfile configuration option), this command
114-
* will reload the ACLs from the file, replacing all the current ACL rules with the ones defined in the file.
113+
* When Redis is configured to use an ACL file (with the aclfile configuration option), this command will reload the ACLs
114+
* from the file, replacing all the current ACL rules with the ones defined in the file.
115115
*
116116
* @return String simple-string-reply OK or error message.
117117
*/
@@ -140,8 +140,8 @@ public interface RedisAclCommands<K, V> {
140140
String aclLogReset();
141141

142142
/**
143-
* When Redis is configured to use an ACL file (with the aclfile configuration option),
144-
* this command will save the currently defined ACLs from the server memory to the ACL file.
143+
* When Redis is configured to use an ACL file (with the aclfile configuration option), this command will save the currently
144+
* defined ACLs from the server memory to the ACL file.
145145
*
146146
* @return String simple-string-reply OK or error message.
147147
*/
@@ -169,4 +169,5 @@ public interface RedisAclCommands<K, V> {
169169
* @return K bulk-string-reply the username of the current connection.
170170
*/
171171
String aclWhoami();
172+
172173
}

src/main/templates/io/lettuce/core/api/RedisGeoCommands.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ Long georadius(K key, double longitude, double latitude, double distance, GeoArg
191191
Long georadiusbymember(K key, V member, double distance, GeoArgs.Unit unit, GeoRadiusStoreArgs<K> geoRadiusStoreArgs);
192192

193193
/**
194-
* Retrieve members selected by distance with the center of {@code reference} the search {@code predicate}.
195-
* Use {@link GeoSearch} to create reference and predicate objects.
194+
* Retrieve members selected by distance with the center of {@code reference} the search {@code predicate}. Use
195+
* {@link GeoSearch} to create reference and predicate objects.
196196
*
197197
* @param key the key of the geo set.
198198
* @param reference the reference member or longitude/latitude coordinates.
@@ -203,8 +203,8 @@ Long georadius(K key, double longitude, double latitude, double distance, GeoArg
203203
Set<V> geosearch(K key, GeoSearch.GeoRef<K> reference, GeoSearch.GeoPredicate predicate);
204204

205205
/**
206-
* Retrieve members selected by distance with the center of {@code reference} the search {@code predicate}.
207-
* Use {@link GeoSearch} to create reference and predicate objects.
206+
* Retrieve members selected by distance with the center of {@code reference} the search {@code predicate}. Use
207+
* {@link GeoSearch} to create reference and predicate objects.
208208
*
209209
* @param key the key of the geo set.
210210
* @param reference the reference member or longitude/latitude coordinates.
@@ -224,7 +224,8 @@ Long georadius(K key, double longitude, double latitude, double distance, GeoArg
224224
* @param reference the reference member or longitude/latitude coordinates.
225225
* @param predicate the bounding box or radius to search in.
226226
* @param geoArgs args to control the result.
227-
* @param storeDist stores the items in a sorted set populated with their distance from the center of the circle or box, as a floating-point number, in the same unit specified for that shape.
227+
* @param storeDist stores the items in a sorted set populated with their distance from the center of the circle or box, as
228+
* a floating-point number, in the same unit specified for that shape.
228229
* @return Long integer-reply the number of elements in the result.
229230
* @since 6.1
230231
*/

src/main/templates/io/lettuce/core/api/RedisHashCommands.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,4 +575,5 @@ public interface RedisHashCommands<K, V> {
575575
* associated timeout.
576576
*/
577577
Boolean hpersist(K key, K... fields);
578+
578579
}

src/main/templates/io/lettuce/core/api/RedisSortedSetCommands.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ public interface RedisSortedSetCommands<K, V> {
488488
* Return {@code count} random members from the sorted set stored at {@code key}.
489489
*
490490
* @param key the key.
491-
* @param count the number of members to return. If the provided count argument is positive, return an array of distinct fields.
491+
* @param count the number of members to return. If the provided count argument is positive, return an array of distinct
492+
* fields.
492493
* @return List&lt;ScoredValue&lt;V&gt;&gt; array-reply list of scores and elements.
493494
* @since 6.1
494495
*/
@@ -507,7 +508,8 @@ public interface RedisSortedSetCommands<K, V> {
507508
* Return {@code count} random members along their value from the sorted set stored at {@code key}.
508509
*
509510
* @param key the key.
510-
* @param count the number of members to return. If the provided count argument is positive, return an array of distinct fields.
511+
* @param count the number of members to return. If the provided count argument is positive, return an array of distinct
512+
* fields.
511513
* @return List&lt;ScoredValue&lt;V&gt;&gt; array-reply list of scores and elements.
512514
* @since 6.1
513515
*/
@@ -909,7 +911,8 @@ Long zrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, Stri
909911
Long zrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, Range<? extends Number> range, Limit limit);
910912

911913
/**
912-
* Get the specified range of elements in the sorted set stored at {@code srcKey} and stores the result in the {@code dstKey} destination key.
914+
* Get the specified range of elements in the sorted set stored at {@code srcKey} and stores the result in the
915+
* {@code dstKey} destination key.
913916
*
914917
* @param dstKey the dst key.
915918
* @param srcKey the src key.
@@ -920,7 +923,8 @@ Long zrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, Stri
920923
Long zrangestore(K dstKey, K srcKey, Range<Long> range);
921924

922925
/**
923-
* Get the specified range of elements in the sorted set stored at {@code srcKey} and stores the result in the {@code dstKey} destination key.
926+
* Get the specified range of elements in the sorted set stored at {@code srcKey} and stores the result in the
927+
* {@code dstKey} destination key.
924928
*
925929
* @param dstKey the dst key.
926930
* @param srcKey the src key.
@@ -932,7 +936,8 @@ Long zrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, Stri
932936
Long zrangestorebylex(K dstKey, K srcKey, Range<? extends V> range, Limit limit);
933937

934938
/**
935-
* Get the specified range of elements in the sorted set stored at {@code srcKey} and stores the result in the {@code dstKey} destination key.
939+
* Get the specified range of elements in the sorted set stored at {@code srcKey} and stores the result in the
940+
* {@code dstKey} destination key.
936941
*
937942
* @param dstKey the dst key.
938943
* @param srcKey the src key.
@@ -1409,7 +1414,8 @@ Long zrevrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, S
14091414
Long zrevrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, Range<? extends Number> range, Limit limit);
14101415

14111416
/**
1412-
* Get the specified range of elements ordered from high to low in the sorted set stored at {@code srcKey} and stores the result in the {@code dstKey} destination key.
1417+
* Get the specified range of elements ordered from high to low in the sorted set stored at {@code srcKey} and stores the
1418+
* result in the {@code dstKey} destination key.
14131419
*
14141420
* @param dstKey the dst key.
14151421
* @param srcKey the src key.
@@ -1420,7 +1426,8 @@ Long zrevrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, S
14201426
Long zrevrangestore(K dstKey, K srcKey, Range<Long> range);
14211427

14221428
/**
1423-
* Get the lexicographical range ordered from high to low of elements in the sorted set stored at {@code srcKey} and stores the result in the {@code dstKey} destination key.
1429+
* Get the lexicographical range ordered from high to low of elements in the sorted set stored at {@code srcKey} and stores
1430+
* the result in the {@code dstKey} destination key.
14241431
*
14251432
* @param dstKey the src key.
14261433
* @param srcKey the dst key.
@@ -1432,9 +1439,11 @@ Long zrevrangebyscoreWithScores(ScoredValueStreamingChannel<V> channel, K key, S
14321439
Long zrevrangestorebylex(K dstKey, K srcKey, Range<? extends V> range, Limit limit);
14331440

14341441
/**
1435-
* Get the specified range of elements in the sorted set stored at {@code srcKey with scores ordered from high to low and stores the result in the {@code dstKey} destination key.
1442+
* Get the specified range of elements in the sorted set stored at {@code srcKey with scores ordered from high to low and
1443+
* stores the result in the {@code dstKey} destination key.
14361444
*
14371445
* @param dstKey the src key.
1446+
*
14381447
* @param srcKey the dst key.
14391448
* @param range the score range.
14401449
* @param limit the limit to apply.

src/main/templates/io/lettuce/core/api/RedisStreamCommands.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,5 @@ public interface RedisStreamCommands<K, V> {
373373
* @since 6.1
374374
*/
375375
Long xtrim(K key, XTrimArgs args);
376+
376377
}

src/test/java/biz/paluch/redis/extensibility/LettuceGeoDemo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ public static void main(String[] args) {
4747
redis.getStatefulConnection().close();
4848
redisClient.shutdown();
4949
}
50+
5051
}

src/test/java/biz/paluch/redis/extensibility/MyExtendedRedisClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ protected <K, V> StatefulRedisPubSubConnectionImpl<K, V> newStatefulRedisPubSubC
3232
RedisChannelWriter channelWriter, RedisCodec<K, V> codec, Duration timeout) {
3333
return new MyPubSubConnection<>(endpoint, channelWriter, codec, timeout);
3434
}
35+
3536
}

0 commit comments

Comments
 (0)