DonalEvans commented on a change in pull request #7478:
URL: https://github.com/apache/geode/pull/7478#discussion_r838976220
##########
File path:
geode-for-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/commands/executor/GeodeRedisServerStartupUsingGfshAcceptanceTest.java
##########
@@ -149,13 +151,26 @@ public void
gfshStartsRedisServer_whenCustomPortAndBindAddress() {
}
@Test
- public void gfshDoesNotStartRedisServer_whenNotRedisEnabled() {
+ public void gfshStartsRedisServer_whenAllBindAddress() {
Review comment:
This test name seems incomplete.
##########
File path:
geode-for-redis/src/commonTest/java/org/apache/geode/redis/TestRedisConfiguration.java
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional
information regarding
+ * copyright ownership. The ASF licenses this file to You 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.apache.geode.redis;
+
+import org.apache.geode.redis.internal.RedisConfiguration;
+import org.apache.geode.test.dunit.rules.RedisClusterStartupRule;
+
+public class TestRedisConfiguration implements RedisConfiguration {
+
+ private final String bindAddress;
+ private final int port;
+ private final int redundantCopies;
+ private final String username;
+
+ public static class Builder {
+ private String address = RedisClusterStartupRule.BIND_ADDRESS;
+ private int port = RedisConfiguration.DEFAULT_REDIS_PORT;
+ private int redundantCopies =
RedisConfiguration.DEFAULT_REDIS_REDUNDANT_COPIES;
+ private String username = RedisConfiguration.DEFAULT_REDIS_USERNAME;
+
+ private Builder() {}
+
+ public RedisConfiguration build() {
+ return new TestRedisConfiguration(address, port, redundantCopies,
username);
+ }
+
+ public Builder withAddress(String address) {
+ this.address = address;
+ return this;
+ }
+
+ public Builder withPort(int port) {
+ this.port = port;
+ return this;
+ }
+
+ public Builder withRedundantCopies(int redundantCopies) {
+ this.redundantCopies = redundantCopies;
+ return this;
+ }
+
+ public Builder withUsername(String username) {
+ this.username = username;
+ return this;
+ }
+ }
+
+ private TestRedisConfiguration(String bindAddress, int port, int
redundantCopies,
+ String username) {
+ this.bindAddress = bindAddress;
+ this.port = port;
+ this.redundantCopies = redundantCopies;
+ this.username = username;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return true;
+ }
+
+ @Override
+ public int getPort() {
+ return port;
+ }
+
+ @Override
+ public String getBindAddress() {
+ return bindAddress;
+ }
+
+ @Override
+ public int getRedundantCopies() {
+ return 0;
Review comment:
Should this return `redundantCopies`?
##########
File path:
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/commands/executor/connection/AuthIntegrationTest.java
##########
@@ -117,15 +118,19 @@ private void setupCache(String username, boolean
withSecurityManager) throws Exc
cf.set(LOG_LEVEL, "error");
cf.set(MCAST_PORT, "0");
cf.set(LOCATORS, "");
- if (username != null) {
- cf.set(ConfigurationProperties.GEODE_FOR_REDIS_USERNAME, username);
- }
if (withSecurityManager) {
cf.set(ConfigurationProperties.SECURITY_MANAGER,
SimpleSecurityManager.class.getName());
}
cache = cf.create();
port = AvailablePortHelper.getRandomAvailableTCPPort();
- server = new GeodeRedisServer("localhost", port, (InternalCache) cache);
+
+ TestRedisConfiguration.Builder redisConfigBuilder =
TestRedisConfiguration.builder();
+ redisConfigBuilder.withAddress("localhost").withPort(port).build();
Review comment:
I think the `build()` at the end of this is not necessary here.
##########
File path:
geode-for-redis/src/main/java/org/apache/geode/redis/internal/GeodeRedisServer.java
##########
@@ -69,13 +69,13 @@
/**
* Constructor for {@code GeodeRedisServer} that will configure the server
to bind to the given
* address and port.
Review comment:
This comment should not reference the address and port, but rather the
`RedisConfiguration`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]