@Test
  public void testDropAndShowSchemaTemplates() throws SQLException {
    // show device templates
    String[] expectedResult = new String[] {"t1", "t2", "t3"};
    Set<String> expectedResultSet = new HashSet<>(Arrays.asList(expectedResult));
    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement = connection.createStatement()) {
      try (ResultSet resultSet = statement.executeQuery("SHOW DEVICE TEMPLATES")) {
        while (resultSet.next()) {
          Assert.assertTrue(
              expectedResultSet.contains(resultSet.getString(ColumnHeaderConstant.TEMPLATE_NAME)));
          expectedResultSet.remove(resultSet.getString(ColumnHeaderConstant.TEMPLATE_NAME));
        }
      }
      Assert.assertEquals(0, expectedResultSet.size());

      // drop device template
      statement.execute("DROP DEVICE TEMPLATE t2");
      expectedResult = new String[] {"t1", "t3"};
      expectedResultSet = new HashSet<>(Arrays.asList(expectedResult));
      try (ResultSet resultSet = statement.executeQuery("SHOW DEVICE TEMPLATES")) {
        while (resultSet.next()) {
          Assert.assertTrue(
              expectedResultSet.contains(resultSet.getString(ColumnHeaderConstant.TEMPLATE_NAME)));
          expectedResultSet.remove(resultSet.getString(ColumnHeaderConstant.TEMPLATE_NAME));
        }
      }
      Assert.assertEquals(0, expectedResultSet.size());
    }
  }
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