This is an automated email from the ASF dual-hosted git repository.
yx9o pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new e2c296491a9 Add more assertions for ConfigurationPropertiesTest
(#19843)
e2c296491a9 is described below
commit e2c296491a9e9f38a0f119c89539054e0b1567f5
Author: Da Xiang Huang <[email protected]>
AuthorDate: Thu Aug 4 10:33:06 2022 +0800
Add more assertions for ConfigurationPropertiesTest (#19843)
* add test
* add test
---
.../config/props/ConfigurationPropertiesTest.java | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
index 800309fb251..4a746b84540 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
@@ -40,6 +40,14 @@ public final class ConfigurationPropertiesTest {
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE),
is("PostgreSQL"));
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD),
is(20));
assertTrue(actual.getValue(ConfigurationPropertyKey.PROXY_HINT_ENABLED));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_QUERY_FETCH_SIZE),
is(20));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_EXECUTOR_SIZE),
is(20));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_EXECUTOR_SUITABLE),
is("OLTP"));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_MAX_CONNECTIONS),
is(20));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_DRIVER_TYPE),
is("JDBC"));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION),
is("5.7.22"));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_DEFAULT_PORT),
is(3308));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_NETTY_BACKLOG),
is(1024));
}
private Properties createProperties() {
@@ -53,6 +61,14 @@ public final class ConfigurationPropertiesTest {
result.setProperty(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE.getKey(),
"PostgreSQL");
result.setProperty(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD.getKey(),
"20");
result.setProperty(ConfigurationPropertyKey.PROXY_HINT_ENABLED.getKey(),
Boolean.TRUE.toString());
+
result.setProperty(ConfigurationPropertyKey.PROXY_BACKEND_QUERY_FETCH_SIZE.getKey(),
"20");
+
result.setProperty(ConfigurationPropertyKey.PROXY_FRONTEND_EXECUTOR_SIZE.getKey(),
"20");
+
result.setProperty(ConfigurationPropertyKey.PROXY_BACKEND_EXECUTOR_SUITABLE.getKey(),
"OLTP");
+
result.setProperty(ConfigurationPropertyKey.PROXY_FRONTEND_MAX_CONNECTIONS.getKey(),
"20");
+
result.setProperty(ConfigurationPropertyKey.PROXY_BACKEND_DRIVER_TYPE.getKey(),
"JDBC");
+
result.setProperty(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION.getKey(),
"5.7.22");
+
result.setProperty(ConfigurationPropertyKey.PROXY_DEFAULT_PORT.getKey(),
"3308");
+
result.setProperty(ConfigurationPropertyKey.PROXY_NETTY_BACKLOG.getKey(),
"1024");
return result;
}
@@ -68,5 +84,13 @@ public final class ConfigurationPropertiesTest {
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE),
is(""));
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD),
is(128));
assertFalse(actual.getValue(ConfigurationPropertyKey.PROXY_HINT_ENABLED));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_QUERY_FETCH_SIZE),
is(-1));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_EXECUTOR_SIZE),
is(0));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_EXECUTOR_SUITABLE),
is("OLAP"));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_FRONTEND_MAX_CONNECTIONS),
is(0));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_BACKEND_DRIVER_TYPE),
is("JDBC"));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_MYSQL_DEFAULT_VERSION),
is("5.7.22"));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_DEFAULT_PORT),
is(3307));
+
assertThat(actual.getValue(ConfigurationPropertyKey.PROXY_NETTY_BACKLOG),
is(1024));
}
}