diff --git a/java/README.md b/java/README.md index 5d0077c3da..fc2d560e85 100644 --- a/java/README.md +++ b/java/README.md @@ -95,9 +95,9 @@ Other useful gradle developer commands: ### Standalone Redis: ```java -import glide.api.RedisClient; +import glide.api.GlideClient; -RedisClient client = RedisClient.CreateClient().get(); +GlideClient client = GlideClient.CreateClient().get(); CompletableFuture setResponse = client.set("key", "foobar"); assert setResponse.get() == "OK" : "Failed on client.set("key", "foobar") request"; diff --git a/java/benchmarks/src/main/java/glide/benchmarks/clients/glide/GlideAsyncClient.java b/java/benchmarks/src/main/java/glide/benchmarks/clients/glide/GlideAsyncClient.java index 3cb1361ee1..7bd05ffaec 100644 --- a/java/benchmarks/src/main/java/glide/benchmarks/clients/glide/GlideAsyncClient.java +++ b/java/benchmarks/src/main/java/glide/benchmarks/clients/glide/GlideAsyncClient.java @@ -4,11 +4,11 @@ import static java.util.concurrent.TimeUnit.SECONDS; import glide.api.BaseClient; -import glide.api.RedisClient; -import glide.api.RedisClusterClient; +import glide.api.GlideClient; +import glide.api.GlideClusterClient; +import glide.api.models.configuration.GlideClientConfiguration; +import glide.api.models.configuration.GlideClusterClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClientConfiguration; -import glide.api.models.configuration.RedisClusterClientConfiguration; import glide.benchmarks.clients.AsyncClient; import glide.benchmarks.utils.ConnectionSettings; import java.util.concurrent.CompletableFuture; @@ -23,8 +23,8 @@ public class GlideAsyncClient implements AsyncClient { public void connectToRedis(ConnectionSettings connectionSettings) { if (connectionSettings.clusterMode) { - RedisClusterClientConfiguration config = - RedisClusterClientConfiguration.builder() + GlideClusterClientConfiguration config = + GlideClusterClientConfiguration.builder() .address( NodeAddress.builder() .host(connectionSettings.host) @@ -33,14 +33,14 @@ public void connectToRedis(ConnectionSettings connectionSettings) { .useTLS(connectionSettings.useSsl) .build(); try { - redisClient = RedisClusterClient.CreateClient(config).get(10, SECONDS); + redisClient = GlideClusterClient.CreateClient(config).get(10, SECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new RuntimeException(e); } } else { - RedisClientConfiguration config = - RedisClientConfiguration.builder() + GlideClientConfiguration config = + GlideClientConfiguration.builder() .address( NodeAddress.builder() .host(connectionSettings.host) @@ -50,7 +50,7 @@ public void connectToRedis(ConnectionSettings connectionSettings) { .build(); try { - redisClient = RedisClient.CreateClient(config).get(10, SECONDS); + redisClient = GlideClient.CreateClient(config).get(10, SECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new RuntimeException(e); } diff --git a/java/client/src/main/java/glide/api/RedisClient.java b/java/client/src/main/java/glide/api/GlideClient.java similarity index 97% rename from java/client/src/main/java/glide/api/RedisClient.java rename to java/client/src/main/java/glide/api/GlideClient.java index 0f8607afb7..cbafdfea39 100644 --- a/java/client/src/main/java/glide/api/RedisClient.java +++ b/java/client/src/main/java/glide/api/GlideClient.java @@ -53,7 +53,7 @@ import glide.api.models.commands.InfoOptions; import glide.api.models.commands.SortOptions; import glide.api.models.commands.function.FunctionRestorePolicy; -import glide.api.models.configuration.RedisClientConfiguration; +import glide.api.models.configuration.GlideClientConfiguration; import glide.managers.CommandManager; import glide.managers.ConnectionManager; import java.util.Arrays; @@ -66,14 +66,14 @@ * Async (non-blocking) client for Redis in Standalone mode. Use {@link #CreateClient} to request a * client to Redis. */ -public class RedisClient extends BaseClient +public class GlideClient extends BaseClient implements GenericCommands, ServerManagementCommands, ConnectionManagementCommands, ScriptingAndFunctionsCommands, TransactionsCommands { - protected RedisClient(ConnectionManager connectionManager, CommandManager commandManager) { + protected GlideClient(ConnectionManager connectionManager, CommandManager commandManager) { super(connectionManager, commandManager); } @@ -81,11 +81,11 @@ protected RedisClient(ConnectionManager connectionManager, CommandManager comman * Async request for an async (non-blocking) Redis client in Standalone mode. * * @param config Redis client Configuration - * @return A Future to connect and return a RedisClient + * @return A Future to connect and return a GlideClient */ - public static CompletableFuture CreateClient( - @NonNull RedisClientConfiguration config) { - return CreateClient(config, RedisClient::new); + public static CompletableFuture CreateClient( + @NonNull GlideClientConfiguration config) { + return CreateClient(config, GlideClient::new); } @Override diff --git a/java/client/src/main/java/glide/api/RedisClusterClient.java b/java/client/src/main/java/glide/api/GlideClusterClient.java similarity index 98% rename from java/client/src/main/java/glide/api/RedisClusterClient.java rename to java/client/src/main/java/glide/api/GlideClusterClient.java index 26fc3e86e7..8cfe2d78ad 100644 --- a/java/client/src/main/java/glide/api/RedisClusterClient.java +++ b/java/client/src/main/java/glide/api/GlideClusterClient.java @@ -54,7 +54,7 @@ import glide.api.models.commands.InfoOptions; import glide.api.models.commands.SortClusterOptions; import glide.api.models.commands.function.FunctionRestorePolicy; -import glide.api.models.configuration.RedisClusterClientConfiguration; +import glide.api.models.configuration.GlideClusterClientConfiguration; import glide.api.models.configuration.RequestRoutingConfiguration.Route; import glide.api.models.configuration.RequestRoutingConfiguration.SingleNodeRoute; import glide.managers.CommandManager; @@ -72,14 +72,14 @@ * Async (non-blocking) client for Redis in Cluster mode. Use {@link #CreateClient} to request a * client to Redis. */ -public class RedisClusterClient extends BaseClient +public class GlideClusterClient extends BaseClient implements ConnectionManagementClusterCommands, GenericClusterCommands, ServerManagementClusterCommands, ScriptingAndFunctionsClusterCommands, TransactionsClusterCommands { - protected RedisClusterClient(ConnectionManager connectionManager, CommandManager commandManager) { + protected GlideClusterClient(ConnectionManager connectionManager, CommandManager commandManager) { super(connectionManager, commandManager); } @@ -87,11 +87,11 @@ protected RedisClusterClient(ConnectionManager connectionManager, CommandManager * Async request for an async (non-blocking) Redis client in Cluster mode. * * @param config Redis cluster client Configuration - * @return A Future to connect and return a RedisClusterClient + * @return A Future to connect and return a GlideClusterClient */ - public static CompletableFuture CreateClient( - @NonNull RedisClusterClientConfiguration config) { - return CreateClient(config, RedisClusterClient::new); + public static CompletableFuture CreateClient( + @NonNull GlideClusterClientConfiguration config) { + return CreateClient(config, GlideClusterClient::new); } @Override diff --git a/java/client/src/main/java/glide/api/models/commands/FlushMode.java b/java/client/src/main/java/glide/api/models/commands/FlushMode.java index 9ba5c2938c..1643a97271 100644 --- a/java/client/src/main/java/glide/api/models/commands/FlushMode.java +++ b/java/client/src/main/java/glide/api/models/commands/FlushMode.java @@ -1,8 +1,8 @@ /** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */ package glide.api.models.commands; -import glide.api.RedisClient; -import glide.api.RedisClusterClient; +import glide.api.GlideClient; +import glide.api.GlideClusterClient; import glide.api.models.configuration.RequestRoutingConfiguration.Route; import glide.api.models.configuration.RequestRoutingConfiguration.SingleNodeRoute; @@ -11,15 +11,15 @@ * Defines flushing mode for: * *
    - *
  • FLUSHALL command implemented by {@link RedisClient#flushall(FlushMode)}, - * {@link RedisClusterClient#flushall(FlushMode)}, and {@link - * RedisClusterClient#flushall(FlushMode, SingleNodeRoute)}. - *
  • FLUSHDB command implemented by {@link RedisClient#flushdb(FlushMode)}, {@link - * RedisClusterClient#flushdb(FlushMode)}, and {@link RedisClusterClient#flushdb(FlushMode, + *
  • FLUSHALL command implemented by {@link GlideClient#flushall(FlushMode)}, + * {@link GlideClusterClient#flushall(FlushMode)}, and {@link + * GlideClusterClient#flushall(FlushMode, SingleNodeRoute)}. + *
  • FLUSHDB command implemented by {@link GlideClient#flushdb(FlushMode)}, {@link + * GlideClusterClient#flushdb(FlushMode)}, and {@link GlideClusterClient#flushdb(FlushMode, * SingleNodeRoute)}. *
  • FUNCTION FLUSH command implemented by {@link - * RedisClient#functionFlush(FlushMode)}, {@link RedisClusterClient#functionFlush(FlushMode)}, - * and {@link RedisClusterClient#functionFlush(FlushMode, Route)}. + * GlideClient#functionFlush(FlushMode)}, {@link GlideClusterClient#functionFlush(FlushMode)}, + * and {@link GlideClusterClient#functionFlush(FlushMode, Route)}. *
* * @see flushall, mockedClient; private ChannelHandler channelHandler; @@ -64,17 +65,17 @@ public void teardown() { @Test @SneakyThrows - public void createClient_with_default_config_successfully_returns_RedisClient() { + public void createClient_with_default_config_successfully_returns_GlideClient() { // setup CompletableFuture connectToRedisFuture = new CompletableFuture<>(); connectToRedisFuture.complete(null); - RedisClientConfiguration config = RedisClientConfiguration.builder().build(); + GlideClientConfiguration config = GlideClientConfiguration.builder().build(); when(connectionManager.connectToRedis(eq(config))).thenReturn(connectToRedisFuture); // exercise - CompletableFuture result = CreateClient(config); - RedisClient client = result.get(); + CompletableFuture result = CreateClient(config); + GlideClient client = result.get(); // verify assertEquals(connectionManager, client.connectionManager); @@ -83,18 +84,18 @@ public void createClient_with_default_config_successfully_returns_RedisClient() @Test @SneakyThrows - public void createClient_with_custom_config_successfully_returns_RedisClient() { + public void createClient_with_custom_config_successfully_returns_GlideClient() { // setup CompletableFuture connectToRedisFuture = new CompletableFuture<>(); connectToRedisFuture.complete(null); - RedisClientConfiguration config = - RedisClientConfiguration.builder().threadPoolResource(threadPoolResource).build(); + GlideClientConfiguration config = + GlideClientConfiguration.builder().threadPoolResource(threadPoolResource).build(); when(connectionManager.connectToRedis(eq(config))).thenReturn(connectToRedisFuture); // exercise - CompletableFuture result = CreateClient(config); - RedisClient client = result.get(); + CompletableFuture result = CreateClient(config); + GlideClient client = result.get(); // verify assertEquals(connectionManager, client.connectionManager); @@ -108,13 +109,13 @@ public void createClient_error_on_connection_throws_ExecutionException() { CompletableFuture connectToRedisFuture = new CompletableFuture<>(); ClosingException exception = new ClosingException("disconnected"); connectToRedisFuture.completeExceptionally(exception); - RedisClientConfiguration config = - RedisClientConfiguration.builder().threadPoolResource(threadPoolResource).build(); + GlideClientConfiguration config = + GlideClientConfiguration.builder().threadPoolResource(threadPoolResource).build(); when(connectionManager.connectToRedis(eq(config))).thenReturn(connectToRedisFuture); // exercise - CompletableFuture result = CreateClient(config); + CompletableFuture result = CreateClient(config); ExecutionException executionException = assertThrows(ExecutionException.class, result::get); diff --git a/java/client/src/test/java/glide/api/RedisClientTest.java b/java/client/src/test/java/glide/api/GlideClientTest.java similarity index 99% rename from java/client/src/test/java/glide/api/RedisClientTest.java rename to java/client/src/test/java/glide/api/GlideClientTest.java index e254d364ba..7674e703ef 100644 --- a/java/client/src/test/java/glide/api/RedisClientTest.java +++ b/java/client/src/test/java/glide/api/GlideClientTest.java @@ -324,12 +324,12 @@ import org.junit.jupiter.params.provider.MethodSource; import redis_request.RedisRequestOuterClass.RequestType; -public class RedisClientTest { +public class GlideClientTest { // bypass import conflict between Set (collection) and Set (enum variant) private static final RequestType pSet = RequestType.Set; - RedisClient service; + GlideClient service; ConnectionManager connectionManager; @@ -339,7 +339,7 @@ public class RedisClientTest { public void setUp() { connectionManager = mock(ConnectionManager.class); commandManager = mock(CommandManager.class); - service = new RedisClient(connectionManager, commandManager); + service = new GlideClient(connectionManager, commandManager); } @SneakyThrows diff --git a/java/client/src/test/java/glide/api/RedisClusterClientTest.java b/java/client/src/test/java/glide/api/GlideClusterClientTest.java similarity index 99% rename from java/client/src/test/java/glide/api/RedisClusterClientTest.java rename to java/client/src/test/java/glide/api/GlideClusterClientTest.java index 7a82ff5e35..1efa659f12 100644 --- a/java/client/src/test/java/glide/api/RedisClusterClientTest.java +++ b/java/client/src/test/java/glide/api/GlideClusterClientTest.java @@ -10,9 +10,6 @@ import static glide.api.models.commands.SortBaseOptions.LIMIT_COMMAND_STRING; import static glide.api.models.commands.SortBaseOptions.OrderBy.DESC; import static glide.api.models.commands.SortBaseOptions.STORE_COMMAND_STRING; -import static glide.api.models.commands.SortOptions.ALPHA_COMMAND_STRING; -import static glide.api.models.commands.SortOptions.LIMIT_COMMAND_STRING; -import static glide.api.models.commands.SortOptions.STORE_COMMAND_STRING; import static glide.api.models.commands.function.FunctionListOptions.LIBRARY_NAME_REDIS_API; import static glide.api.models.commands.function.FunctionListOptions.WITH_CODE_REDIS_API; import static glide.api.models.configuration.RequestRoutingConfiguration.SimpleMultiNodeRoute.ALL_NODES; @@ -82,9 +79,9 @@ import response.ResponseOuterClass.ConstantResponse; import response.ResponseOuterClass.Response; -public class RedisClusterClientTest { +public class GlideClusterClientTest { - RedisClusterClient service; + GlideClusterClient service; ConnectionManager connectionManager; @@ -96,7 +93,7 @@ public class RedisClusterClientTest { public void setUp() { connectionManager = mock(ConnectionManager.class); commandManager = mock(CommandManager.class); - service = new RedisClusterClient(connectionManager, commandManager); + service = new GlideClusterClient(connectionManager, commandManager); } @Test @@ -160,7 +157,7 @@ public void custom_command_returns_single_value_on_constant_response() { } } - private static class TestClient extends RedisClusterClient { + private static class TestClient extends GlideClusterClient { private final Object object; @@ -726,7 +723,7 @@ public void configResetStat_with_route_returns_success() { assertEquals(OK, payload); } - // TODO copy/move tests from RedisClientTest which call super for coverage + // TODO copy/move tests from GlideClientTest which call super for coverage @SneakyThrows @Test public void configGet_returns_success() { diff --git a/java/client/src/test/java/glide/connection/ConnectionWithGlideMockTests.java b/java/client/src/test/java/glide/connection/ConnectionWithGlideMockTests.java index 27e00ef52b..0a553f07cd 100644 --- a/java/client/src/test/java/glide/connection/ConnectionWithGlideMockTests.java +++ b/java/client/src/test/java/glide/connection/ConnectionWithGlideMockTests.java @@ -10,7 +10,7 @@ import connection_request.ConnectionRequestOuterClass.ConnectionRequest; import connection_request.ConnectionRequestOuterClass.NodeAddress; -import glide.api.RedisClient; +import glide.api.GlideClient; import glide.api.models.exceptions.ClosingException; import glide.connectors.handlers.CallbackDispatcher; import glide.connectors.handlers.ChannelHandler; @@ -182,7 +182,7 @@ public void rethrow_error_if_UDS_channel_closed() { } } - private static class TestClient extends RedisClient { + private static class TestClient extends GlideClient { public TestClient(ChannelHandler channelHandler) { super(new ConnectionManager(channelHandler), new CommandManager(channelHandler)); diff --git a/java/client/src/test/java/glide/managers/ConnectionManagerTest.java b/java/client/src/test/java/glide/managers/ConnectionManagerTest.java index 792259799b..8c3ca0c5b2 100644 --- a/java/client/src/test/java/glide/managers/ConnectionManagerTest.java +++ b/java/client/src/test/java/glide/managers/ConnectionManagerTest.java @@ -19,10 +19,10 @@ import connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy; import connection_request.ConnectionRequestOuterClass.TlsMode; import glide.api.models.configuration.BackoffStrategy; +import glide.api.models.configuration.GlideClientConfiguration; +import glide.api.models.configuration.GlideClusterClientConfiguration; import glide.api.models.configuration.NodeAddress; import glide.api.models.configuration.ReadFrom; -import glide.api.models.configuration.RedisClientConfiguration; -import glide.api.models.configuration.RedisClusterClientConfiguration; import glide.api.models.configuration.RedisCredentials; import glide.api.models.exceptions.ClosingException; import glide.connectors.handlers.ChannelHandler; @@ -69,7 +69,7 @@ public void setUp() { @Test public void connection_request_protobuf_generation_default_standalone_configuration() { // setup - RedisClientConfiguration redisClientConfiguration = RedisClientConfiguration.builder().build(); + GlideClientConfiguration glideClientConfiguration = GlideClientConfiguration.builder().build(); ConnectionRequest expectedProtobufConnectionRequest = ConnectionRequest.newBuilder() .setTlsMode(TlsMode.NoTls) @@ -82,7 +82,7 @@ public void connection_request_protobuf_generation_default_standalone_configurat // execute when(channel.connect(eq(expectedProtobufConnectionRequest))).thenReturn(completedFuture); - CompletableFuture result = connectionManager.connectToRedis(redisClientConfiguration); + CompletableFuture result = connectionManager.connectToRedis(glideClientConfiguration); // verify // no exception @@ -93,8 +93,8 @@ public void connection_request_protobuf_generation_default_standalone_configurat @Test public void connection_request_protobuf_generation_default_cluster_configuration() { // setup - RedisClusterClientConfiguration redisClusterClientConfiguration = - RedisClusterClientConfiguration.builder().build(); + GlideClusterClientConfiguration glideClusterClientConfiguration = + GlideClusterClientConfiguration.builder().build(); ConnectionRequest expectedProtobufConnectionRequest = ConnectionRequest.newBuilder() .setTlsMode(TlsMode.NoTls) @@ -108,7 +108,7 @@ public void connection_request_protobuf_generation_default_cluster_configuration // execute when(channel.connect(eq(expectedProtobufConnectionRequest))).thenReturn(completedFuture); CompletableFuture result = - connectionManager.connectToRedis(redisClusterClientConfiguration); + connectionManager.connectToRedis(glideClusterClientConfiguration); // verify assertNull(result.get()); @@ -119,8 +119,8 @@ public void connection_request_protobuf_generation_default_cluster_configuration @Test public void connection_request_protobuf_generation_with_all_fields_set() { // setup - RedisClientConfiguration redisClientConfiguration = - RedisClientConfiguration.builder() + GlideClientConfiguration redisClientConfiguration = + GlideClientConfiguration.builder() .address(NodeAddress.builder().host(HOST).port(PORT).build()) .address(NodeAddress.builder().host(DEFAULT_HOST).port(DEFAULT_PORT).build()) .useTLS(true) @@ -180,7 +180,7 @@ public void connection_request_protobuf_generation_with_all_fields_set() { @Test public void response_validation_on_constant_response_returns_successfully() { // setup - RedisClientConfiguration redisClientConfiguration = RedisClientConfiguration.builder().build(); + GlideClientConfiguration redisClientConfiguration = GlideClientConfiguration.builder().build(); CompletableFuture completedFuture = new CompletableFuture<>(); Response response = Response.newBuilder().setConstantResponse(ConstantResponse.OK).build(); completedFuture.complete(response); @@ -197,7 +197,7 @@ public void response_validation_on_constant_response_returns_successfully() { @Test public void connection_on_empty_response_throws_ClosingException() { // setup - RedisClientConfiguration redisClientConfiguration = RedisClientConfiguration.builder().build(); + GlideClientConfiguration redisClientConfiguration = GlideClientConfiguration.builder().build(); CompletableFuture completedFuture = new CompletableFuture<>(); Response response = Response.newBuilder().build(); completedFuture.complete(response); @@ -217,7 +217,7 @@ public void connection_on_empty_response_throws_ClosingException() { @Test public void connection_on_resp_pointer_throws_ClosingException() { // setup - RedisClientConfiguration redisClientConfiguration = RedisClientConfiguration.builder().build(); + GlideClientConfiguration glideClientConfiguration = GlideClientConfiguration.builder().build(); CompletableFuture completedFuture = new CompletableFuture<>(); Response response = Response.newBuilder().setRespPointer(42).build(); completedFuture.complete(response); @@ -227,7 +227,7 @@ public void connection_on_resp_pointer_throws_ClosingException() { ExecutionException executionException = assertThrows( ExecutionException.class, - () -> connectionManager.connectToRedis(redisClientConfiguration).get()); + () -> connectionManager.connectToRedis(glideClientConfiguration).get()); assertTrue(executionException.getCause() instanceof ClosingException); assertEquals("Unexpected data in response", executionException.getCause().getMessage()); diff --git a/java/examples/src/main/java/glide/examples/ExamplesApp.java b/java/examples/src/main/java/glide/examples/ExamplesApp.java index 98dfbe6d59..b3685fd425 100644 --- a/java/examples/src/main/java/glide/examples/ExamplesApp.java +++ b/java/examples/src/main/java/glide/examples/ExamplesApp.java @@ -1,9 +1,9 @@ /** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */ package glide.examples; -import glide.api.RedisClient; +import glide.api.GlideClient; +import glide.api.models.configuration.GlideClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClientConfiguration; import java.util.concurrent.ExecutionException; public class ExamplesApp { @@ -18,14 +18,14 @@ private static void runGlideExamples() { Integer port = 6379; boolean useSsl = false; - RedisClientConfiguration config = - RedisClientConfiguration.builder() + GlideClientConfiguration config = + GlideClientConfiguration.builder() .address(NodeAddress.builder().host(host).port(port).build()) .useTLS(useSsl) .build(); try { - RedisClient client = RedisClient.CreateClient(config).get(); + GlideClient client = GlideClient.CreateClient(config).get(); System.out.println("PING: " + client.ping().get()); System.out.println("PING(found you): " + client.ping("found you").get()); diff --git a/java/integTest/src/test/java/glide/ConnectionTests.java b/java/integTest/src/test/java/glide/ConnectionTests.java index 4e9f978604..add35ce31e 100644 --- a/java/integTest/src/test/java/glide/ConnectionTests.java +++ b/java/integTest/src/test/java/glide/ConnectionTests.java @@ -1,9 +1,9 @@ /** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */ package glide; -import glide.api.RedisClient; +import glide.api.GlideClient; +import glide.api.models.configuration.GlideClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClientConfiguration; import lombok.SneakyThrows; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; @@ -15,8 +15,8 @@ public class ConnectionTests { @SneakyThrows public void basic_client() { var regularClient = - RedisClient.CreateClient( - RedisClientConfiguration.builder() + GlideClient.CreateClient( + GlideClientConfiguration.builder() .address( NodeAddress.builder().port(TestConfiguration.STANDALONE_PORTS[0]).build()) .build()) @@ -28,8 +28,8 @@ public void basic_client() { @SneakyThrows public void cluster_client() { var regularClient = - RedisClient.CreateClient( - RedisClientConfiguration.builder() + GlideClient.CreateClient( + GlideClientConfiguration.builder() .address(NodeAddress.builder().port(TestConfiguration.CLUSTER_PORTS[0]).build()) .build()) .get(); diff --git a/java/integTest/src/test/java/glide/CustomThreadPoolResourceTest.java b/java/integTest/src/test/java/glide/CustomThreadPoolResourceTest.java index 1523df7c15..fab24aeda8 100644 --- a/java/integTest/src/test/java/glide/CustomThreadPoolResourceTest.java +++ b/java/integTest/src/test/java/glide/CustomThreadPoolResourceTest.java @@ -3,9 +3,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import glide.api.RedisClient; +import glide.api.GlideClient; +import glide.api.models.configuration.GlideClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClientConfiguration; import glide.connectors.resources.EpollResource; import glide.connectors.resources.KQueuePoolResource; import glide.connectors.resources.Platform; @@ -32,8 +32,8 @@ public void standalone_client_with_custom_threadPoolResource() { } var regularClient = - RedisClient.CreateClient( - RedisClientConfiguration.builder() + GlideClient.CreateClient( + GlideClientConfiguration.builder() .address( NodeAddress.builder().port(TestConfiguration.STANDALONE_PORTS[0]).build()) .threadPoolResource(customThreadPoolResource) diff --git a/java/integTest/src/test/java/glide/ErrorHandlingTests.java b/java/integTest/src/test/java/glide/ErrorHandlingTests.java index cb9b889758..504fa5dd35 100644 --- a/java/integTest/src/test/java/glide/ErrorHandlingTests.java +++ b/java/integTest/src/test/java/glide/ErrorHandlingTests.java @@ -5,9 +5,9 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import glide.api.RedisClient; +import glide.api.GlideClient; +import glide.api.models.configuration.GlideClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClientConfiguration; import glide.api.models.exceptions.ClosingException; import glide.api.models.exceptions.RequestException; import java.net.ServerSocket; @@ -26,8 +26,8 @@ public void basic_client_tries_to_connect_to_wrong_address() { assertThrows( ExecutionException.class, () -> - RedisClient.CreateClient( - RedisClientConfiguration.builder() + GlideClient.CreateClient( + GlideClientConfiguration.builder() .address(NodeAddress.builder().port(getFreePort()).build()) .build()) .get()); @@ -40,8 +40,8 @@ public void basic_client_tries_to_connect_to_wrong_address() { @SneakyThrows public void basic_client_tries_wrong_command() { try (var regularClient = - RedisClient.CreateClient( - RedisClientConfiguration.builder() + GlideClient.CreateClient( + GlideClientConfiguration.builder() .address( NodeAddress.builder().port(TestConfiguration.STANDALONE_PORTS[0]).build()) .build()) @@ -60,8 +60,8 @@ public void basic_client_tries_wrong_command() { @SneakyThrows public void basic_client_tries_wrong_command_arguments() { try (var regularClient = - RedisClient.CreateClient( - RedisClientConfiguration.builder() + GlideClient.CreateClient( + GlideClientConfiguration.builder() .address( NodeAddress.builder().port(TestConfiguration.STANDALONE_PORTS[0]).build()) .build()) diff --git a/java/integTest/src/test/java/glide/SharedClientTests.java b/java/integTest/src/test/java/glide/SharedClientTests.java index 0dd919d557..577f8b4fcd 100644 --- a/java/integTest/src/test/java/glide/SharedClientTests.java +++ b/java/integTest/src/test/java/glide/SharedClientTests.java @@ -8,8 +8,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import glide.api.BaseClient; -import glide.api.RedisClient; -import glide.api.RedisClusterClient; +import glide.api.GlideClient; +import glide.api.GlideClusterClient; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -28,17 +28,17 @@ @Timeout(25) // seconds public class SharedClientTests { - private static RedisClient standaloneClient = null; - private static RedisClusterClient clusterClient = null; + private static GlideClient standaloneClient = null; + private static GlideClusterClient clusterClient = null; @Getter private static List clients; @BeforeAll @SneakyThrows public static void init() { - standaloneClient = RedisClient.CreateClient(commonClientConfig().build()).get(); + standaloneClient = GlideClient.CreateClient(commonClientConfig().build()).get(); clusterClient = - RedisClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(10000).build()) + GlideClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(10000).build()) .get(); clients = List.of(Arguments.of(standaloneClient), Arguments.of(clusterClient)); diff --git a/java/integTest/src/test/java/glide/SharedCommandTests.java b/java/integTest/src/test/java/glide/SharedCommandTests.java index 408f07ed4c..d6e97c41fc 100644 --- a/java/integTest/src/test/java/glide/SharedCommandTests.java +++ b/java/integTest/src/test/java/glide/SharedCommandTests.java @@ -29,8 +29,8 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; import glide.api.BaseClient; -import glide.api.RedisClient; -import glide.api.RedisClusterClient; +import glide.api.GlideClient; +import glide.api.GlideClusterClient; import glide.api.models.GlideString; import glide.api.models.Script; import glide.api.models.commands.ConditionalChange; @@ -78,9 +78,9 @@ import glide.api.models.commands.stream.StreamReadOptions; import glide.api.models.commands.stream.StreamTrimOptions.MaxLen; import glide.api.models.commands.stream.StreamTrimOptions.MinId; +import glide.api.models.configuration.GlideClientConfiguration; +import glide.api.models.configuration.GlideClusterClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClientConfiguration; -import glide.api.models.configuration.RedisClusterClientConfiguration; import glide.api.models.exceptions.RequestException; import java.time.Instant; import java.util.Arrays; @@ -109,8 +109,8 @@ @Timeout(10) // seconds public class SharedCommandTests { - private static RedisClient standaloneClient = null; - private static RedisClusterClient clusterClient = null; + private static GlideClient standaloneClient = null; + private static GlideClusterClient clusterClient = null; @Getter private static List clients; @@ -122,16 +122,16 @@ public class SharedCommandTests { @SneakyThrows public static void init() { standaloneClient = - RedisClient.CreateClient( - RedisClientConfiguration.builder() + GlideClient.CreateClient( + GlideClientConfiguration.builder() .address(NodeAddress.builder().port(STANDALONE_PORTS[0]).build()) .requestTimeout(5000) .build()) .get(); clusterClient = - RedisClusterClient.CreateClient( - RedisClusterClientConfiguration.builder() + GlideClusterClient.CreateClient( + GlideClusterClientConfiguration.builder() .address(NodeAddress.builder().port(CLUSTER_PORTS[0]).build()) .requestTimeout(5000) .build()) @@ -2509,9 +2509,9 @@ public void bzpopmin_timeout_check(BaseClient client) { String key = UUID.randomUUID().toString(); // create new client with default request timeout (250 millis) try (var testClient = - client instanceof RedisClient - ? RedisClient.CreateClient(commonClientConfig().build()).get() - : RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { + client instanceof GlideClient + ? GlideClient.CreateClient(commonClientConfig().build()).get() + : GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { // ensure that commands doesn't time out even if timeout > request timeout assertNull(testClient.bzpopmin(new String[] {key}, 1).get()); @@ -2581,9 +2581,9 @@ public void bzpopmax_timeout_check(BaseClient client) { String key = UUID.randomUUID().toString(); // create new client with default request timeout (250 millis) try (var testClient = - client instanceof RedisClient - ? RedisClient.CreateClient(commonClientConfig().build()).get() - : RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { + client instanceof GlideClient + ? GlideClient.CreateClient(commonClientConfig().build()).get() + : GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { // ensure that commands doesn't time out even if timeout > request timeout assertNull(testClient.bzpopmax(new String[] {key}, 1).get()); @@ -2725,7 +2725,8 @@ public void zmscore(BaseClient client) { .zmscore( gs(key1), new GlideString[] { - gs("one"), gs("nonExistentMember"), gs("nonExistentMember"), gs("three") + gs("one"), gs("nonExistentMember"), + gs("nonExistentMember"), gs("three") }) .get()); assertArrayEquals( @@ -3570,9 +3571,9 @@ public void bzmpop_timeout_check(BaseClient client) { String key = UUID.randomUUID().toString(); // create new client with default request timeout (250 millis) try (var testClient = - client instanceof RedisClient - ? RedisClient.CreateClient(commonClientConfig().build()).get() - : RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { + client instanceof GlideClient + ? GlideClient.CreateClient(commonClientConfig().build()).get() + : GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { // ensure that commands doesn't time out even if timeout > request timeout assertNull(testClient.bzmpop(new String[] {key}, MAX, 1).get()); @@ -3755,9 +3756,9 @@ public void xread_return_failures(BaseClient client) { assertInstanceOf(RequestException.class, executionException.getCause()); try (var testClient = - client instanceof RedisClient - ? RedisClient.CreateClient(commonClientConfig().build()).get() - : RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { + client instanceof GlideClient + ? GlideClient.CreateClient(commonClientConfig().build()).get() + : GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { // ensure that commands doesn't time out even if timeout > request timeout long oneSecondInMS = 1000L; @@ -4185,9 +4186,9 @@ public void xreadgroup_return_failures(BaseClient client) { assertInstanceOf(RequestException.class, executionException.getCause()); try (var testClient = - client instanceof RedisClient - ? RedisClient.CreateClient(commonClientConfig().build()).get() - : RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { + client instanceof GlideClient + ? GlideClient.CreateClient(commonClientConfig().build()).get() + : GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { String timeoutKey = "{key}:2" + UUID.randomUUID(); String timeoutGroupName = "group" + UUID.randomUUID(); String timeoutConsumerName = "consumer" + UUID.randomUUID(); @@ -5641,9 +5642,9 @@ public void getbit(BaseClient client) { assertEquals(1, client.getbit(gs(key1), 1).get()); assertEquals(0, client.getbit(gs(key1), 1000).get()); assertEquals(0, client.getbit(gs(missingKey), 1).get()); - if (client instanceof RedisClient) { + if (client instanceof GlideClient) { assertEquals( - 1L, ((RedisClient) client).customCommand(new String[] {"SETBIT", key1, "5", "0"}).get()); + 1L, ((GlideClient) client).customCommand(new String[] {"SETBIT", key1, "5", "0"}).get()); assertEquals(0, client.getbit(key1, 5).get()); } @@ -5890,9 +5891,9 @@ public void blmpop_timeout_check(BaseClient client) { String key = UUID.randomUUID().toString(); // create new client with default request timeout (250 millis) try (var testClient = - client instanceof RedisClient - ? RedisClient.CreateClient(commonClientConfig().build()).get() - : RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { + client instanceof GlideClient + ? GlideClient.CreateClient(commonClientConfig().build()).get() + : GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { // ensure that commands doesn't time out even if timeout > request timeout assertNull(testClient.blmpop(new String[] {key}, ListDirection.LEFT, 1).get()); @@ -6113,9 +6114,9 @@ public void blmove_timeout_check(BaseClient client) { String key2 = "{key}-2" + UUID.randomUUID(); // create new client with default request timeout (250 millis) try (var testClient = - client instanceof RedisClient - ? RedisClient.CreateClient(commonClientConfig().build()).get() - : RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { + client instanceof GlideClient + ? GlideClient.CreateClient(commonClientConfig().build()).get() + : GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()) { // ensure that commands doesn't time out even if timeout > request timeout assertNull(testClient.blmove(key1, key2, ListDirection.LEFT, ListDirection.LEFT, 1).get()); diff --git a/java/integTest/src/test/java/glide/TestUtilities.java b/java/integTest/src/test/java/glide/TestUtilities.java index eb0f578312..bbb9809ff9 100644 --- a/java/integTest/src/test/java/glide/TestUtilities.java +++ b/java/integTest/src/test/java/glide/TestUtilities.java @@ -9,9 +9,9 @@ import static org.junit.jupiter.api.Assertions.fail; import glide.api.models.ClusterValue; +import glide.api.models.configuration.GlideClientConfiguration; +import glide.api.models.configuration.GlideClusterClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClientConfiguration; -import glide.api.models.configuration.RedisClusterClientConfiguration; import java.security.SecureRandom; import java.util.HashMap; import java.util.List; @@ -71,15 +71,15 @@ public static Map parseInfoResponseToMap(String serverInfo) { HashMap::new)); } - public static RedisClientConfiguration.RedisClientConfigurationBuilder + public static GlideClientConfiguration.GlideClientConfigurationBuilder commonClientConfig() { - return RedisClientConfiguration.builder() + return GlideClientConfiguration.builder() .address(NodeAddress.builder().port(STANDALONE_PORTS[0]).build()); } - public static RedisClusterClientConfiguration.RedisClusterClientConfigurationBuilder + public static GlideClusterClientConfiguration.GlideClusterClientConfigurationBuilder commonClusterClientConfig() { - return RedisClusterClientConfiguration.builder() + return GlideClusterClientConfiguration.builder() .address(NodeAddress.builder().port(CLUSTER_PORTS[0]).build()); } diff --git a/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java b/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java index 65a4f40572..37bc38963b 100644 --- a/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java +++ b/java/integTest/src/test/java/glide/cluster/ClusterClientTests.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import glide.api.RedisClusterClient; +import glide.api.GlideClusterClient; import glide.api.models.configuration.RedisCredentials; import glide.api.models.exceptions.ClosingException; import glide.api.models.exceptions.RequestException; @@ -30,8 +30,8 @@ public void register_client_name_and_version() { REDIS_VERSION.isGreaterThanOrEqualTo(minVersion), "Redis version required >= " + minVersion); - RedisClusterClient client = - RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get(); + GlideClusterClient client = + GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get(); String info = (String) client.customCommand(new String[] {"CLIENT", "INFO"}).get().getSingleValue(); @@ -44,8 +44,8 @@ public void register_client_name_and_version() { @SneakyThrows @Test public void can_connect_with_auth_requirepass() { - RedisClusterClient client = - RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get(); + GlideClusterClient client = + GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get(); String password = "TEST_AUTH"; client.customCommand(new String[] {"CONFIG", "SET", "requirepass", password}).get(); @@ -54,12 +54,12 @@ public void can_connect_with_auth_requirepass() { ExecutionException exception = assertThrows( ExecutionException.class, - () -> RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get()); + () -> GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get()); assertTrue(exception.getCause() instanceof ClosingException); // Creation of a new client with credentials - RedisClusterClient auth_client = - RedisClusterClient.CreateClient( + GlideClusterClient auth_client = + GlideClusterClient.CreateClient( commonClusterClientConfig() .credentials(RedisCredentials.builder().password(password).build()) .build()) @@ -81,8 +81,8 @@ public void can_connect_with_auth_requirepass() { @SneakyThrows @Test public void can_connect_with_auth_acl() { - RedisClusterClient client = - RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get(); + GlideClusterClient client = + GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get(); String username = "testuser"; String password = "TEST_AUTH"; @@ -112,8 +112,8 @@ public void can_connect_with_auth_acl() { assertEquals(OK, client.set(key, value).get()); // Creation of a new cluster client with credentials - RedisClusterClient testUserClient = - RedisClusterClient.CreateClient( + GlideClusterClient testUserClient = + GlideClusterClient.CreateClient( commonClusterClientConfig() .credentials( RedisCredentials.builder().username(username).password(password).build()) @@ -135,8 +135,8 @@ public void can_connect_with_auth_acl() { @SneakyThrows @Test public void client_name() { - RedisClusterClient client = - RedisClusterClient.CreateClient( + GlideClusterClient client = + GlideClusterClient.CreateClient( commonClusterClientConfig().clientName("TEST_CLIENT_NAME").build()) .get(); @@ -150,8 +150,8 @@ public void client_name() { @Test @SneakyThrows public void closed_client_throws_ExecutionException_with_ClosingException_as_cause() { - RedisClusterClient client = - RedisClusterClient.CreateClient(commonClusterClientConfig().build()).get(); + GlideClusterClient client = + GlideClusterClient.CreateClient(commonClusterClientConfig().build()).get(); client.close(); ExecutionException executionException = diff --git a/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java b/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java index 5aacc3c65a..5cf560770b 100644 --- a/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java +++ b/java/integTest/src/test/java/glide/cluster/ClusterTransactionTests.java @@ -16,11 +16,11 @@ import glide.TestConfiguration; import glide.TransactionTestUtilities.TransactionBuilder; -import glide.api.RedisClusterClient; +import glide.api.GlideClusterClient; import glide.api.models.ClusterTransaction; import glide.api.models.commands.SortClusterOptions; +import glide.api.models.configuration.GlideClusterClientConfiguration; import glide.api.models.configuration.NodeAddress; -import glide.api.models.configuration.RedisClusterClientConfiguration; import glide.api.models.configuration.RequestRoutingConfiguration.SingleNodeRoute; import glide.api.models.configuration.RequestRoutingConfiguration.SlotIdRoute; import glide.api.models.configuration.RequestRoutingConfiguration.SlotType; @@ -39,14 +39,14 @@ @Timeout(10) // seconds public class ClusterTransactionTests { - private static RedisClusterClient clusterClient = null; + private static GlideClusterClient clusterClient = null; @BeforeAll @SneakyThrows public static void init() { clusterClient = - RedisClusterClient.CreateClient( - RedisClusterClientConfiguration.builder() + GlideClusterClient.CreateClient( + GlideClusterClientConfiguration.builder() .address(NodeAddress.builder().port(TestConfiguration.CLUSTER_PORTS[0]).build()) .requestTimeout(5000) .build()) diff --git a/java/integTest/src/test/java/glide/cluster/CommandTests.java b/java/integTest/src/test/java/glide/cluster/CommandTests.java index c8793d33b4..d41ede4b1a 100644 --- a/java/integTest/src/test/java/glide/cluster/CommandTests.java +++ b/java/integTest/src/test/java/glide/cluster/CommandTests.java @@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import glide.api.RedisClusterClient; +import glide.api.GlideClusterClient; import glide.api.models.ClusterTransaction; import glide.api.models.ClusterValue; import glide.api.models.GlideString; @@ -87,7 +87,7 @@ @Timeout(10) // seconds public class CommandTests { - private static RedisClusterClient clusterClient = null; + private static GlideClusterClient clusterClient = null; private static final String INITIAL_VALUE = "VALUE"; @@ -139,7 +139,7 @@ public class CommandTests { @SneakyThrows public static void init() { clusterClient = - RedisClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) + GlideClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) .get(); } @@ -1267,7 +1267,7 @@ public void functionStats_and_functionKill_without_route() { assertEquals(libName, clusterClient.functionLoad(code, true).get()); try (var testClient = - RedisClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) + GlideClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) .get()) { // call the function without await // Using a random primary node route, otherwise FCALL can go to a replica. @@ -1348,7 +1348,7 @@ public void functionStats_and_functionKill_with_route(boolean singleNodeRoute) { assertEquals(libName, clusterClient.functionLoad(code, true, route).get()); try (var testClient = - RedisClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) + GlideClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) .get()) { // call the function without await var promise = testClient.fcall(funcName, route); @@ -1434,7 +1434,7 @@ public void functionStats_and_functionKill_with_key_based_route() { assertEquals(libName, clusterClient.functionLoad(code, true, route).get()); try (var testClient = - RedisClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) + GlideClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) .get()) { // call the function without await var promise = testClient.fcall(funcName, new String[] {key}, new String[0]); @@ -1505,7 +1505,7 @@ public void functionStats_and_functionKill_write_function() { assertEquals(libName, clusterClient.functionLoad(code, true, route).get()); try (var testClient = - RedisClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) + GlideClusterClient.CreateClient(commonClusterClientConfig().requestTimeout(7000).build()) .get()) { // call the function without await var promise = testClient.fcall(funcName, new String[] {key}, new String[0]); diff --git a/java/integTest/src/test/java/glide/standalone/CommandTests.java b/java/integTest/src/test/java/glide/standalone/CommandTests.java index d69cb817e8..fd4a94b7dd 100644 --- a/java/integTest/src/test/java/glide/standalone/CommandTests.java +++ b/java/integTest/src/test/java/glide/standalone/CommandTests.java @@ -38,7 +38,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import glide.api.RedisClient; +import glide.api.GlideClient; import glide.api.models.GlideString; import glide.api.models.commands.InfoOptions; import glide.api.models.commands.SortOptions; @@ -63,13 +63,13 @@ public class CommandTests { private static final String INITIAL_VALUE = "VALUE"; - private static RedisClient regularClient = null; + private static GlideClient regularClient = null; @BeforeAll @SneakyThrows public static void init() { regularClient = - RedisClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get(); + GlideClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get(); } @AfterAll @@ -627,7 +627,7 @@ public void functionStats_and_functionKill() { assertEquals(libName, regularClient.functionLoad(code, true).get()); try (var testClient = - RedisClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get()) { + GlideClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get()) { // call the function without await var promise = testClient.fcall(funcName); @@ -698,7 +698,7 @@ public void functionStats_and_functionKill_write_function() { assertEquals(libName, regularClient.functionLoad(code, true).get()); try (var testClient = - RedisClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get()) { + GlideClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get()) { // call the function without await var promise = testClient.fcall(funcName, new String[] {key}, new String[0]); diff --git a/java/integTest/src/test/java/glide/standalone/StandaloneClientTests.java b/java/integTest/src/test/java/glide/standalone/StandaloneClientTests.java index 9da65bf6c3..ea17c3af36 100644 --- a/java/integTest/src/test/java/glide/standalone/StandaloneClientTests.java +++ b/java/integTest/src/test/java/glide/standalone/StandaloneClientTests.java @@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import glide.api.RedisClient; +import glide.api.GlideClient; import glide.api.models.configuration.RedisCredentials; import glide.api.models.exceptions.ClosingException; import glide.api.models.exceptions.RequestException; @@ -30,7 +30,7 @@ public void register_client_name_and_version() { REDIS_VERSION.isGreaterThanOrEqualTo(minVersion), "Redis version required >= " + minVersion); - RedisClient client = RedisClient.CreateClient(commonClientConfig().build()).get(); + GlideClient client = GlideClient.CreateClient(commonClientConfig().build()).get(); String info = (String) client.customCommand(new String[] {"CLIENT", "INFO"}).get(); assertTrue(info.contains("lib-name=GlideJava")); @@ -42,7 +42,7 @@ public void register_client_name_and_version() { @SneakyThrows @Test public void can_connect_with_auth_require_pass() { - RedisClient client = RedisClient.CreateClient(commonClientConfig().build()).get(); + GlideClient client = GlideClient.CreateClient(commonClientConfig().build()).get(); String password = "TEST_AUTH"; client.customCommand(new String[] {"CONFIG", "SET", "requirepass", password}).get(); @@ -51,12 +51,12 @@ public void can_connect_with_auth_require_pass() { ExecutionException exception = assertThrows( ExecutionException.class, - () -> RedisClient.CreateClient(commonClientConfig().build()).get()); + () -> GlideClient.CreateClient(commonClientConfig().build()).get()); assertTrue(exception.getCause() instanceof ClosingException); // Creation of a new client with credentials - RedisClient auth_client = - RedisClient.CreateClient( + GlideClient auth_client = + GlideClient.CreateClient( commonClientConfig() .credentials(RedisCredentials.builder().password(password).build()) .build()) @@ -78,7 +78,7 @@ public void can_connect_with_auth_require_pass() { @SneakyThrows @Test public void can_connect_with_auth_acl() { - RedisClient client = RedisClient.CreateClient(commonClientConfig().build()).get(); + GlideClient client = GlideClient.CreateClient(commonClientConfig().build()).get(); String username = "testuser"; String password = "TEST_AUTH"; @@ -107,8 +107,8 @@ public void can_connect_with_auth_acl() { assertEquals(OK, client.set(key, value).get()); // Creation of a new client with credentials - RedisClient testUserClient = - RedisClient.CreateClient( + GlideClient testUserClient = + GlideClient.CreateClient( commonClientConfig() .credentials( RedisCredentials.builder().username(username).password(password).build()) @@ -129,7 +129,7 @@ public void can_connect_with_auth_acl() { @SneakyThrows @Test public void select_standalone_database_id() { - RedisClient client = RedisClient.CreateClient(commonClientConfig().databaseId(4).build()).get(); + GlideClient client = GlideClient.CreateClient(commonClientConfig().databaseId(4).build()).get(); String clientInfo = (String) client.customCommand(new String[] {"CLIENT", "INFO"}).get(); assertTrue(clientInfo.contains("db=4")); @@ -140,8 +140,8 @@ public void select_standalone_database_id() { @SneakyThrows @Test public void client_name() { - RedisClient client = - RedisClient.CreateClient(commonClientConfig().clientName("TEST_CLIENT_NAME").build()).get(); + GlideClient client = + GlideClient.CreateClient(commonClientConfig().clientName("TEST_CLIENT_NAME").build()).get(); String clientInfo = (String) client.customCommand(new String[] {"CLIENT", "INFO"}).get(); assertTrue(clientInfo.contains("name=TEST_CLIENT_NAME")); @@ -152,7 +152,7 @@ public void client_name() { @Test @SneakyThrows public void closed_client_throws_ExecutionException_with_ClosingException_as_cause() { - RedisClient client = RedisClient.CreateClient(commonClientConfig().build()).get(); + GlideClient client = GlideClient.CreateClient(commonClientConfig().build()).get(); client.close(); ExecutionException executionException = diff --git a/java/integTest/src/test/java/glide/standalone/TransactionTests.java b/java/integTest/src/test/java/glide/standalone/TransactionTests.java index fa82d16f42..e71d99dbda 100644 --- a/java/integTest/src/test/java/glide/standalone/TransactionTests.java +++ b/java/integTest/src/test/java/glide/standalone/TransactionTests.java @@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; import glide.TransactionTestUtilities.TransactionBuilder; -import glide.api.RedisClient; +import glide.api.GlideClient; import glide.api.models.GlideString; import glide.api.models.Transaction; import glide.api.models.commands.InfoOptions; @@ -39,12 +39,12 @@ @Timeout(10) // seconds public class TransactionTests { - private static RedisClient client = null; + private static GlideClient client = null; @BeforeAll @SneakyThrows public static void init() { - client = RedisClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get(); + client = GlideClient.CreateClient(commonClientConfig().requestTimeout(7000).build()).get(); } @AfterAll