Skip to content

Commit 105de13

Browse files
committed
Validate JDK 11 HttpClient-based impementation as well
1 parent fd4b47f commit 105de13

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ jobs:
3434
matrix:
3535
# most recent LTS releases as well as latest stable builds
3636
clickhouse: ["21.3", "21.8", "latest"]
37-
protocol: ["http", "grpc"]
37+
# http2 here represents http protocol + JDK HttpClient(http_connection_provider=HTTP_CLIENT)
38+
protocol: ["http", "http2", "grpc"]
3839
exclude:
3940
- clickhouse: "21.3"
4041
protocol: grpc

clickhouse-jdbc/src/test/java/com/clickhouse/jdbc/JdbcIntegrationTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
import com.clickhouse.client.BaseIntegrationTest;
1111
import com.clickhouse.client.ClickHouseNode;
1212
import com.clickhouse.client.ClickHouseProtocol;
13+
import com.clickhouse.client.http.config.ClickHouseHttpOption;
1314

1415
public abstract class JdbcIntegrationTest extends BaseIntegrationTest {
1516
private static final String CLASS_PREFIX = "ClickHouse";
1617
private static final String CLASS_SUFFIX = "Test";
1718

19+
protected static final String CUSTOM_PROTOCOL_NAME = System.getProperty("protocol", "http").toUpperCase();
1820
protected static final ClickHouseProtocol DEFAULT_PROTOCOL = ClickHouseProtocol
19-
.valueOf(System.getProperty("protocol", "http").toUpperCase());
21+
.valueOf(CUSTOM_PROTOCOL_NAME.startsWith("HTTP") ? "HTTP" : CUSTOM_PROTOCOL_NAME);
2022

2123
protected final String dbName;
2224

@@ -48,6 +50,9 @@ protected String buildJdbcUrl(ClickHouseProtocol protocol, String prefix, String
4850
builder.append(url);
4951
}
5052

53+
if ("HTTP2".equals(CUSTOM_PROTOCOL_NAME)) {
54+
builder.append('?').append(ClickHouseHttpOption.CONNECTION_PROVIDER.getKey()).append("=HTTP_CLIENT");
55+
}
5156
return builder.toString();
5257
}
5358

0 commit comments

Comments
 (0)