@Test
  public void testShowPathsSetOrUsingSchemaTemplate() throws SQLException {
    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement = connection.createStatement()) {
      // set device template
      statement.execute("SET DEVICE TEMPLATE t1 TO root.sg1.d1");
      statement.execute("SET DEVICE TEMPLATE t1 TO root.sg1.d2");
      statement.execute("SET DEVICE TEMPLATE t1 TO root.sg2.d1");
      statement.execute("SET DEVICE TEMPLATE t1 TO root.sg2.d2");
      statement.execute("SET DEVICE TEMPLATE t2 TO root.sg3.d1");
      statement.execute("SET DEVICE TEMPLATE t2 TO root.sg3.d2");
      statement.execute("INSERT INTO root.sg3.d2.verify(time, show) ALIGNED VALUES (1, 1)");

      try (ResultSet resultSet = statement.executeQuery("SHOW PATHS USING DEVICE TEMPLATE t1")) {
        String resultRecord;
        while (resultSet.next()) {
          resultRecord = resultSet.getString(1);
          Assert.assertEquals("", resultRecord);
        }
      }

      // activate device template
      statement.execute("CREATE TIMESERIES OF DEVICE TEMPLATE ON root.sg1.d2");
      statement.execute("CREATE TIMESERIES OF DEVICE TEMPLATE ON root.sg2.d1");

      // show paths set device template
      String[] expectedResult =
          new String[] {"root.sg1.d1", "root.sg2.d2", "root.sg1.d2", "root.sg2.d1"};
      Set<String> expectedResultSet = new HashSet<>(Arrays.asList(expectedResult));
      try (ResultSet resultSet = statement.executeQuery("SHOW PATHS SET DEVICE TEMPLATE t1")) {
        String resultRecord;
        while (resultSet.next()) {
          resultRecord = resultSet.getString(1);
          Assert.assertTrue(expectedResultSet.contains(resultRecord));
          expectedResultSet.remove(resultRecord);
        }
      }
      Assert.assertEquals(0, expectedResultSet.size());

      expectedResult = new String[] {"root.sg3.d1", "root.sg3.d2"};
      expectedResultSet = new HashSet<>(Arrays.asList(expectedResult));
      try (ResultSet resultSet = statement.executeQuery("SHOW PATHS SET DEVICE TEMPLATE t2")) {
        String resultRecord;
        while (resultSet.next()) {
          resultRecord = resultSet.getString(1);
          Assert.assertTrue(expectedResultSet.contains(resultRecord));
          expectedResultSet.remove(resultRecord);
        }
      }
      Assert.assertEquals(0, expectedResultSet.size());

      expectedResult = new String[] {"root.sg1.d2", "root.sg2.d1"};
      expectedResultSet = new HashSet<>(Arrays.asList(expectedResult));
      try (ResultSet resultSet = statement.executeQuery("SHOW PATHS USING DEVICE TEMPLATE t1")) {
        String resultRecord;
        while (resultSet.next()) {
          resultRecord = resultSet.getString(1);
          Assert.assertTrue(expectedResultSet.contains(resultRecord));
          expectedResultSet.remove(resultRecord);
        }
      }
      Assert.assertEquals(0, expectedResultSet.size());

      ResultSet resultSet = statement.executeQuery("SHOW PATHS USING DEVICE TEMPLATE t2");
      Assert.assertTrue(resultSet.next());
    }
  }
Notice that, all test begins with "IoTDB" is integration test. All test which will start the
IoTDB server should be defined as integration test.
integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java