Skip to content

Commit

Permalink
refactor(:core:test): fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zero88 committed Aug 5, 2024
1 parent de69af8 commit d93632b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
17 changes: 9 additions & 8 deletions core/src/test/java/cloud/playio/qwe/QWEConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.json.DecodeException;
import io.vertx.core.json.JsonObject;

import cloud.playio.qwe.QWEConfig.QWEDeployConfig;
import cloud.playio.qwe.exceptions.ConfigException;

Expand Down Expand Up @@ -94,10 +95,10 @@ public void test_blank() {
Assertions.assertNotNull(cfg.getAppConfig().dataDir());
Assertions.assertTrue(cfg.getAppConfig().other().isEmpty());
Assertions.assertNotNull(cfg.getDeployConfig());
JsonHelper.assertJson(new JsonObject("{\"worker\":false,\"workerPoolSize\":20," +
"\"maxWorkerExecuteTime\":60000000000,\"ha\":false,\"instances\":1," +
"\"maxWorkerExecuteTimeUnit\":\"NANOSECONDS\"}"),
cfg.getDeployConfig().toJson());
JsonHelper.assertJson(new JsonObject(
"{\"worker\":false,\"workerPoolSize\":20,\"threadingModel\":\"EVENT_LOOP\"," +
"\"maxWorkerExecuteTime\":60000000000,\"ha\":false,\"instances\":1," +
"\"maxWorkerExecuteTimeUnit\":\"NANOSECONDS\"}"), cfg.getDeployConfig().toJson());
Assertions.assertNull(cfg.getBootConfig());
}

Expand All @@ -110,10 +111,10 @@ public void test_blank_with_app_cfg() {
Assertions.assertEquals(1, config.getAppConfig().other().size());
Assertions.assertEquals(1, config.getAppConfig().lookup("hello"));
Assertions.assertNotNull(config.getDeployConfig());
JsonHelper.assertJson(new JsonObject("{\"worker\":false,\"workerPoolSize\":20," +
"\"maxWorkerExecuteTime\":60000000000,\"ha\":false,\"instances\":1," +
"\"maxWorkerExecuteTimeUnit\":\"NANOSECONDS\"}"),
config.getDeployConfig().toJson());
JsonHelper.assertJson(new JsonObject(
"{\"worker\":false,\"workerPoolSize\":20,\"threadingModel\":\"EVENT_LOOP\"," +
"\"maxWorkerExecuteTime\":60000000000,\"ha\":false,\"instances\":1," +
"\"maxWorkerExecuteTimeUnit\":\"NANOSECONDS\"}"), config.getDeployConfig().toJson());
Assertions.assertNull(config.getBootConfig());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class NetworkUtilsTest {

@Test
public void test_get_public_ipv4() {
Assertions.assertNotNull(NetworkUtils.getPublicIpv4());
final String address = NetworkUtils.getPublicIpv4();
System.out.println(address);
Assertions.assertNotNull(address);
}

@Test
Expand All @@ -18,8 +20,8 @@ public void test_get_socket_ipv4_address() {
Assertions.assertNotNull(address);
Assertions.assertEquals("127.0.0.1", address.getHostName());
Assertions.assertEquals("127.0.0.1", address.getHostString());
Assertions.assertEquals("127.0.0.1:9090", address.toString());
Assertions.assertEquals(9090, address.getPort());
Assertions.assertEquals("127.0.0.1/<unresolved>:9090", address.toString());
}

}
5 changes: 2 additions & 3 deletions core/src/test/resources/def-system-cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
"crlValues": [],
"enabledCipherSuites": [],
"enabledSecureTransportProtocols": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
"TLSv1.2",
"TLSv1.3"
],
"idleTimeout": 0,
"idleTimeoutUnit": "SECONDS",
Expand Down
5 changes: 2 additions & 3 deletions core/src/test/resources/full-system-cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@
"crlValues": [],
"useAlpn": false,
"enabledSecureTransportProtocols": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
"TLSv1.2",
"TLSv1.3"
],
"tcpFastOpen": false,
"tcpCork": false,
Expand Down

0 comments on commit d93632b

Please sign in to comment.