@Test
  public void selectAllTest() {
    String[] retArray =
        new String[] {
          "1,1,1", "2,2,2", "3,3,3", "4,4,4", "5,5,0", "6,6,1", "7,7,2", "8,8,3", "9,9,4"
        };

    String selectSql = "select * from root.**";

    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement1 = connection.createStatement();
        Statement statement2 = connection.createStatement()) {
      statement1.setFetchSize(10);
      ResultSet resultSet1 = statement1.executeQuery(selectSql);
      int cnt1 = 0;
      while (resultSet1.next() && cnt1 < 5) {
        String ans =
            resultSet1.getString(TestConstant.TIMESTAMP_STR)
                + ","
                + resultSet1.getString("root.fans.d0.s0")
                + ","
                + resultSet1.getString("root.fans.d1.s0");
        Assert.assertEquals(retArray[cnt1], ans);
        cnt1++;
      }

      statement2.setFetchSize(10);
      ResultSet resultSet2 = statement2.executeQuery(selectSql);
      int cnt2 = 0;
      while (resultSet2.next()) {
        String ans =
            resultSet2.getString(TestConstant.TIMESTAMP_STR)
                + ","
                + resultSet2.getString("root.fans.d0.s0")
                + ","
                + resultSet2.getString("root.fans.d1.s0");
        Assert.assertEquals(retArray[cnt2], ans);
        cnt2++;
      }
      Assert.assertEquals(9, cnt2);

      // use do-while instead of while because in the previous while loop, we have executed the next
      // function,
      // and the cursor has been moved to the next position, so we should fetch that value first.
      do {
        String ans =
            resultSet1.getString(TestConstant.TIMESTAMP_STR)
                + ","
                + resultSet1.getString("root.fans.d0.s0")
                + ","
                + resultSet1.getString("root.fans.d1.s0");
        Assert.assertEquals(retArray[cnt1], ans);
        cnt1++;
      } while (resultSet1.next());
      // Although the statement2 has the same sql as statement1, they shouldn't affect each other.
      // So the statement1's ResultSet should also have 9 rows in total.
      Assert.assertEquals(9, cnt1);

    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
  }
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/IoTDBSameMeasurementsDifferentTypesIT.java