@Test
  public void testSetAndActivateTemplateOnSGNode() throws SQLException {
    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement = connection.createStatement()) {
      statement.execute("CREATE DATABASE root.test.sg_satosg");
      statement.execute("SET DEVICE TEMPLATE t1 TO root.test.sg_satosg");
      statement.execute("INSERT INTO root.test.sg_satosg(time, s1) VALUES (1, 1)");
      statement.execute("INSERT INTO root.test.sg_satosg(time, s1) VALUES (2, 2)");
      ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES root.test.sg_satosg.**");

      Set<String> expRes =
          new HashSet<>(
              Arrays.asList(new String[] {"root.test.sg_satosg.s1", "root.test.sg_satosg.s2"}));
      int resCnt = 0;
      while (resultSet.next()) {
        resCnt++;
        expRes.remove(resultSet.getString(ColumnHeaderConstant.TIMESERIES));
      }
      Assert.assertEquals(2, resCnt);
      Assert.assertTrue(expRes.isEmpty());

      resultSet = statement.executeQuery("SELECT COUNT(s1) from root.test.sg_satosg");
      while (resultSet.next()) {
        Assert.assertEquals(2L, resultSet.getLong("COUNT(root.test.sg_satosg.s1)"));
      }
    }
  }
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