This is an automated email from the ASF dual-hosted git repository.

ericpai pushed a commit to branch improve/iotdb-3489
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit c05be3e3ca291430e6ce602537c69f4d34ebebd2
Author: ericpai <[email protected]>
AuthorDate: Tue Jun 14 17:35:49 2022 +0800

    [IOTDB-3489] Add test name to log folder in cluster test
---
 .../org/apache/iotdb/it/env/ClusterEnvBase.java    | 16 ++++++--
 .../org/apache/iotdb/it/env/IoTDBTestRunner.java   | 44 ++++++++++++++++++++++
 .../org/apache/iotdb/it/env/RemoteServerEnv.java   |  4 ++
 .../java/org/apache/iotdb/itbase/env/BaseEnv.java  |  2 +
 .../org/apache/iotdb/db/it/IoTDBExampleIT.java     |  3 ++
 .../db/it/aligned/IoTDBAlignedSeriesQuery2IT.java  |  3 ++
 .../db/it/aligned/IoTDBAlignedSeriesQuery3IT.java  |  3 ++
 .../db/it/aligned/IoTDBAlignedSeriesQueryIT.java   |  3 ++
 .../db/it/aligned/IoTDBInsertAlignedValues2IT.java |  3 ++
 .../db/it/aligned/IoTDBInsertAlignedValues3IT.java |  3 ++
 .../db/it/aligned/IoTDBInsertAlignedValues4IT.java |  3 ++
 .../db/it/aligned/IoTDBInsertAlignedValuesIT.java  |  3 ++
 .../it/aligned/IoTDBLastQueryWithDeletion2IT.java  |  3 ++
 .../it/aligned/IoTDBLastQueryWithDeletionIT.java   |  3 ++
 .../aligned/IoTDBLastQueryWithoutLastCache2IT.java |  3 ++
 .../aligned/IoTDBLastQueryWithoutLastCacheIT.java  |  3 ++
 ...DBLastQueryWithoutLastCacheWithDeletion2IT.java |  3 ++
 ...TDBLastQueryWithoutLastCacheWithDeletionIT.java |  3 ++
 ...BRawQueryWithoutValueFilterWithDeletion2IT.java |  3 ++
 ...DBRawQueryWithoutValueFilterWithDeletionIT.java |  3 ++
 .../org/apache/iotdb/db/it/env/StandaloneEnv.java  |  8 ++--
 21 files changed, 115 insertions(+), 7 deletions(-)

diff --git 
a/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvBase.java 
b/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvBase.java
index a4b1bb2b1d..6f1dd50019 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvBase.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/ClusterEnvBase.java
@@ -47,12 +47,16 @@ public abstract class ClusterEnvBase implements BaseEnv {
   private List<ConfigNode> configNodes;
   private List<DataNode> dataNodes;
   private final Random rand = new Random();
+  private String nextTestCase = null;
 
   protected void initEnvironment(int configNodesNum, int dataNodesNum) throws 
InterruptedException {
     this.configNodes = new ArrayList<>();
     this.dataNodes = new ArrayList<>();
 
     String testName = getTestClassName();
+    if (nextTestCase != null) {
+      testName = testName + "_" + nextTestCase;
+    }
 
     ConfigNode seedConfigNode = new ConfigNode(true, "", testName);
     seedConfigNode.createDir();
@@ -94,6 +98,7 @@ public abstract class ClusterEnvBase implements BaseEnv {
       configNode.waitingToShutDown();
       configNode.destroyDir();
     }
+    nextTestCase = null;
   }
 
   public String getTestClassName() {
@@ -110,9 +115,9 @@ public abstract class ClusterEnvBase implements BaseEnv {
   public String getTestClassNameAndDate() {
     Date date = new Date();
     SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd-HHmmss");
-    StackTraceElement stack[] = Thread.currentThread().getStackTrace();
-    for (int i = 0; i < stack.length; i++) {
-      String className = stack[i].getClassName();
+    StackTraceElement[] stack = Thread.currentThread().getStackTrace();
+    for (StackTraceElement stackTraceElement : stack) {
+      String className = stackTraceElement.getClassName();
       if (className.endsWith("IT")) {
         return className.substring(className.lastIndexOf(".") + 1) + "-" + 
formatter.format(date);
       }
@@ -165,6 +170,11 @@ public abstract class ClusterEnvBase implements BaseEnv {
     return new ClusterTestConnection(getWriteConnection(null), 
getReadConnections(null));
   }
 
+  @Override
+  public void setNextTestCaseName(String testCaseName) {
+    nextTestCase = testCaseName;
+  }
+
   private IoTDBConnection getConnection(int queryTimeout) throws SQLException {
     IoTDBConnection connection =
         (IoTDBConnection)
diff --git 
a/integration-test/src/main/java/org/apache/iotdb/it/env/IoTDBTestRunner.java 
b/integration-test/src/main/java/org/apache/iotdb/it/env/IoTDBTestRunner.java
new file mode 100644
index 0000000000..433c7dc357
--- /dev/null
+++ 
b/integration-test/src/main/java/org/apache/iotdb/it/env/IoTDBTestRunner.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.it.env;
+
+import org.junit.runner.Description;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IoTDBTestRunner extends BlockJUnit4ClassRunner {
+
+  private static final Logger logger = 
LoggerFactory.getLogger(IoTDBTestRunner.class);
+
+  public IoTDBTestRunner(Class<?> testClass) throws InitializationError {
+    super(testClass);
+  }
+
+  @Override
+  protected void runChild(final FrameworkMethod method, RunNotifier notifier) {
+    Description description = describeChild(method);
+    logger.info("Run {}", description.getMethodName());
+    EnvFactory.getEnv().setNextTestCaseName(description.getMethodName());
+    super.runChild(method, notifier);
+  }
+}
diff --git 
a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java 
b/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
index bb206cd836..4bf339f335 100644
--- 
a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
+++ 
b/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
@@ -104,4 +104,8 @@ public class RemoteServerEnv implements BaseEnv {
     }
     return connection;
   }
+
+  public void setNextTestCaseName(String testCaseName) {
+    // Do nothing
+  }
 }
diff --git 
a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java 
b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
index b7d3d30ca5..5ed57e05b8 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
@@ -36,4 +36,6 @@ public interface BaseEnv {
   Connection getConnection() throws SQLException;
 
   Connection getConnection(Constant.Version version) throws SQLException;
+
+  void setNextTestCaseName(String testCaseName);
 }
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java 
b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
index cc05d5f929..dd4176003b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.db.it;
 
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
@@ -28,12 +29,14 @@ import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.Statement;
 
 /** This is an example for integration test. */
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBExampleIT {
   @BeforeClass
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java
index cb74784fee..5d22310bcc 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java
@@ -20,13 +20,16 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedSeriesQuery2IT extends IoTDBAlignedSeriesQueryIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java
index d5555ff875..d663893231 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java
@@ -20,13 +20,16 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedSeriesQuery3IT extends IoTDBAlignedSeriesQueryIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java
index 5e488440a3..b9cab8fd19 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java
@@ -20,6 +20,7 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
@@ -27,6 +28,7 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -48,6 +50,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedSeriesQueryIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java
index 55a22749a3..19c87f72df 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java
@@ -20,10 +20,12 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -32,6 +34,7 @@ import java.sql.Statement;
 
 import static org.junit.Assert.assertEquals;
 
+@RunWith(IoTDBTestRunner.class)
 public class IoTDBInsertAlignedValues2IT {
   private int numOfPointsPerPage;
   private boolean autoCreateSchemaEnabled;
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java
index 11c99feb45..af6455c03c 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java
@@ -20,10 +20,12 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -32,6 +34,7 @@ import java.sql.Statement;
 
 import static org.junit.Assert.assertEquals;
 
+@RunWith(IoTDBTestRunner.class)
 public class IoTDBInsertAlignedValues3IT {
   private int numOfPointsPerPage;
   private boolean autoCreateSchemaEnabled;
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java
index 0afc85d0cf..2369f86f6e 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java
@@ -20,10 +20,12 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.SQLException;
@@ -31,6 +33,7 @@ import java.sql.Statement;
 
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 public class IoTDBInsertAlignedValues4IT {
   private boolean autoCreateSchemaEnabled;
   private int primitiveArraySize;
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
index 11d0d1b646..1e273439ff 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
@@ -29,6 +30,7 @@ import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -41,6 +43,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBInsertAlignedValuesIT {
   private boolean autoCreateSchemaEnabled;
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java
index 66e70700be..b614dca45e 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java
@@ -20,18 +20,21 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.Statement;
 
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithDeletion2IT extends 
IoTDBLastQueryWithDeletionIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java
index 8dddbe9444..9b1d64d211 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java
@@ -20,6 +20,7 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
@@ -27,6 +28,7 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -45,6 +47,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithDeletionIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java
index 8882cdb719..1fd490faa1 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java
@@ -20,13 +20,16 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithoutLastCache2IT extends 
IoTDBLastQueryWithoutLastCacheIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java
index d662945e51..d63f00302e 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java
@@ -20,6 +20,7 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
@@ -27,6 +28,7 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -45,6 +47,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithoutLastCacheIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java
index 27f12867e8..989e07a76a 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java
@@ -20,18 +20,21 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.Statement;
 
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithoutLastCacheWithDeletion2IT
     extends IoTDBLastQueryWithoutLastCacheWithDeletionIT {
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java
index 9d75b705c2..a0d79541f3 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java
@@ -20,18 +20,21 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.Statement;
 
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithoutLastCacheWithDeletionIT extends 
IoTDBLastQueryWithDeletionIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java
index f97225fff7..6ea9ceb205 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java
@@ -20,12 +20,14 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.Statement;
@@ -33,6 +35,7 @@ import java.sql.Statement;
 import static org.junit.Assert.fail;
 
 /** IoTDBRawQueryWithoutValueFilter2IT */
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBRawQueryWithoutValueFilterWithDeletion2IT
     extends IoTDBRawQueryWithoutValueFilterWithDeletionIT {
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java
index 41f734a329..c0c162d3dc 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java
@@ -20,6 +20,7 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
@@ -27,6 +28,7 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -39,6 +41,7 @@ import java.util.Map;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+@RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBRawQueryWithoutValueFilterWithDeletionIT {
 
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java 
b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
index 63280c70e5..efe6c728b2 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
@@ -23,9 +23,6 @@ import org.apache.iotdb.itbase.env.BaseEnv;
 import org.apache.iotdb.jdbc.Config;
 import org.apache.iotdb.jdbc.Constant;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
@@ -35,7 +32,6 @@ import static org.junit.Assert.fail;
 
 /** This class is used by EnvFactory with using reflection. */
 public class StandaloneEnv implements BaseEnv {
-  Logger logger = LoggerFactory.getLogger(StandaloneEnv.class);
 
   @Override
   public void initBeforeClass() {
@@ -90,4 +86,8 @@ public class StandaloneEnv implements BaseEnv {
     }
     return null;
   }
+
+  public void setNextTestCaseName(String testCaseName) {
+    // Do nothing
+  }
 }

Reply via email to