From 1b9aa40aa79c5e0f6e2daec7da5853136d9791cb Mon Sep 17 00:00:00 2001 From: Chen YZ Date: Sun, 26 May 2024 19:15:01 +0800 Subject: [PATCH] done --- .../iotdb/itbase/runtime/RequestDelegate.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/runtime/RequestDelegate.java b/integration-test/src/main/java/org/apache/iotdb/itbase/runtime/RequestDelegate.java index 99ecbf40a6a0..bc32c31e7932 100644 --- a/integration-test/src/main/java/org/apache/iotdb/itbase/runtime/RequestDelegate.java +++ b/integration-test/src/main/java/org/apache/iotdb/itbase/runtime/RequestDelegate.java @@ -79,13 +79,37 @@ public final T requestAllAndCompare() throws SQLException { T data = results.get(0); for (int i = 1; i < results.size(); i++) { T anotherData = results.get(i); - if (!Objects.equals(data, anotherData)) { + if (!compare(data, anotherData)) { throw new InconsistentDataException(results, endpoints); } } return data; } + private boolean compare(T data, T anotherData) { + if (data instanceof byte[] && anotherData instanceof byte[]) { + return Arrays.equals((byte[]) data, (byte[]) anotherData); + } else if (data instanceof short[] && anotherData instanceof short[]) { + return Arrays.equals((short[]) data, (short[]) anotherData); + } else if (data instanceof int[] && anotherData instanceof int[]) { + return Arrays.equals((int[]) data, (int[]) anotherData); + } else if (data instanceof long[] && anotherData instanceof long[]) { + return Arrays.equals((long[]) data, (long[]) anotherData); + } else if (data instanceof char[] && anotherData instanceof char[]) { + return Arrays.equals((char[]) data, (char[]) anotherData); + } else if (data instanceof float[] && anotherData instanceof float[]) { + return Arrays.equals((float[]) data, (float[]) anotherData); + } else if (data instanceof double[] && anotherData instanceof double[]) { + return Arrays.equals((double[]) data, (double[]) anotherData); + } else if (data instanceof boolean[] && anotherData instanceof boolean[]) { + return Arrays.equals((boolean[]) data, (boolean[]) anotherData); + } else if (data instanceof Object[] && anotherData instanceof Object[]) { + return Arrays.equals((Object[]) data, (Object[]) anotherData); + } else { + return Objects.equals(data, anotherData); + } + } + protected void handleExceptions(Exception[] exceptions) throws SQLException { if (exceptions.length == 0) { return;