rpuch commented on code in PR #4919:
URL: https://github.com/apache/ignite-3/pull/4919#discussion_r1890023193


##########
modules/runner/src/testFixtures/java/org/apache/ignite/internal/ClusterConfiguration.java:
##########
@@ -0,0 +1,202 @@
+/*
+ * 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.ignite.internal;
+
+import java.nio.file.Path;
+import java.util.Objects;
+import org.junit.jupiter.api.TestInfo;
+
+/**
+ * Class for configuring {@link Cluster} instances.
+ */
+public class ClusterConfiguration {
+    public static final int DEFAULT_BASE_PORT = 3344;
+
+    public static final int DEFAULT_BASE_CLIENT_PORT = 10800;
+
+    public static final int DEFAULT_BASE_HTTP_PORT = 10300;
+
+    public static final int DEFAULT_BASE_HTTPS_PORT = 10400;
+
+    /** Default nodes bootstrap configuration pattern. */
+    private static final String DEFAULT_NODE_BOOTSTRAP_CFG = "ignite {\n"
+            + "  \"network\": {\n"
+            + "    \"port\":{},\n"
+            + "    \"nodeFinder\":{\n"
+            + "      \"netClusterNodes\": [ {} ]\n"
+            + "    }\n"
+            + "  },\n"
+            + "  clientConnector: { port:{} }\n"
+            + "  rest: {\n"
+            + "    port: {},\n"
+            + "    ssl.port: {}\n"
+            + "  }\n"
+            + "}";
+
+    private final TestInfo testInfo;
+
+    private final Path workDir;
+
+    private final String defaultNodeBootstrapConfigTemplate;
+
+    private final String clusterName;
+
+    private final int basePort;
+
+    private final int baseClientPort;
+
+    private final int baseHttpPort;
+
+    private final int baseHttpsPort;
+
+    private ClusterConfiguration(
+            TestInfo testInfo,
+            Path workDir,
+            String defaultNodeBootstrapConfigTemplate,
+            String clusterName,
+            int basePort,
+            int baseClientPort,
+            int baseHttpPort,
+            int baseHttpsPort
+    ) {
+        this.testInfo = testInfo;
+        this.workDir = workDir;
+        this.defaultNodeBootstrapConfigTemplate = 
defaultNodeBootstrapConfigTemplate;
+        this.clusterName = clusterName;
+        this.basePort = basePort;
+        this.baseClientPort = baseClientPort;
+        this.baseHttpPort = baseHttpPort;
+        this.baseHttpsPort = baseHttpsPort;
+    }
+
+    public TestInfo testInfo() {
+        return testInfo;
+    }
+
+    public Path workDir() {
+        return workDir;
+    }
+
+    public String defaultNodeBootstrapConfigTemplate() {
+        return defaultNodeBootstrapConfigTemplate;
+    }
+
+    public String clusterName() {
+        return clusterName;
+    }
+
+    public int basePort() {
+        return basePort;
+    }
+
+    public int baseClientPort() {
+        return baseClientPort;
+    }
+
+    public int baseHttpPort() {
+        return baseHttpPort;
+    }
+
+    public int baseHttpsPort() {
+        return baseHttpsPort;
+    }
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder for {@link ClusterConfiguration}.
+     */
+    public static class Builder {
+        private TestInfo testInfo;
+
+        private Path workDir;

Review Comment:
   I don't think this inconsistency is a problem; it seems more important to 
avoid error by making the user supply the mandatory parameters. Probably we 
should fix this in other builders as well



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to