|
21 | 21 | import io.opengemini.client.api.Address; |
22 | 22 | import io.opengemini.client.api.AuthConfig; |
23 | 23 | import io.opengemini.client.api.AuthType; |
| 24 | +import io.opengemini.client.api.CompressMethod; |
24 | 25 | import io.opengemini.client.api.Configuration; |
25 | 26 | import io.opengemini.client.api.OpenGeminiException; |
26 | 27 | import io.opengemini.client.api.Point; |
@@ -76,6 +77,21 @@ protected List<OpenGeminiClient> clientList() throws OpenGeminiException { |
76 | 77 | .build(); |
77 | 78 | clients.add(OpenGeminiClientFactory.create(configuration)); |
78 | 79 | } |
| 80 | + List<CompressMethod> compressMethods = Arrays.asList(CompressMethod.SNAPPY, CompressMethod.GZIP, |
| 81 | + CompressMethod.ZSTD); |
| 82 | + for (CompressMethod compressMethod : compressMethods) { |
| 83 | + HttpClientConfig httpConfig = new HttpClientConfig.Builder() |
| 84 | + .engine(HttpClientEngine.AsyncHttpClient) |
| 85 | + .connectTimeout(Duration.ofSeconds(3)) |
| 86 | + .timeout(Duration.ofSeconds(3)) |
| 87 | + .build(); |
| 88 | + Configuration configuration = Configuration.builder() |
| 89 | + .addresses(Collections.singletonList(new Address("127.0.0.1", 8086))) |
| 90 | + .httpConfig(httpConfig) |
| 91 | + .compressMethod(compressMethod) |
| 92 | + .build(); |
| 93 | + clients.add(OpenGeminiClientFactory.create(configuration)); |
| 94 | + } |
79 | 95 | return clients; |
80 | 96 | } |
81 | 97 |
|
@@ -375,8 +391,10 @@ void retention_policy_create_failed_for_wrong_duration_param(OpenGeminiClient cl |
375 | 391 |
|
376 | 392 | // todo jdk doesn't throw ExecutionException |
377 | 393 | Exception exception = Assertions.assertThrows(Exception.class, createRpFuture::get); |
378 | | - if (exception instanceof ExecutionException exp) { |
379 | | - if (exp.getCause() instanceof OpenGeminiException e) { |
| 394 | + if (exception instanceof ExecutionException) { |
| 395 | + ExecutionException exp = (ExecutionException) exception; |
| 396 | + if (exp.getCause() instanceof OpenGeminiException) { |
| 397 | + OpenGeminiException e = (OpenGeminiException) exp.getCause(); |
380 | 398 | Assertions.assertTrue( |
381 | 399 | e.getMessage().contains("syntax error: unexpected IDENT, expecting DURATIONVAL")); |
382 | 400 | } |
@@ -417,7 +435,6 @@ private static Point testPoint(String measurementName, int valueIndex, int field |
417 | 435 | return testPoint; |
418 | 436 | } |
419 | 437 |
|
420 | | - |
421 | 438 | @ParameterizedTest |
422 | 439 | @MethodSource("clientList") |
423 | 440 | void testQueryPrecision(OpenGeminiClient client) throws Exception { |
|
0 commit comments