@Test
public void test() throws IOException, IllegalPathException {

  QueryDataSource dataSource = new QueryDataSource(
    new PartialPath(SERIES_READER_TEST_SG + ".device0.sensor0"),
    seqResources, unseqResources);
  Set<String> allSensors = new HashSet<>();
  allSensors.add("sensor0");
  SeriesReaderByTimestamp seriesReader = new SeriesReaderByTimestamp(
    new PartialPath(SERIES_READER_TEST_SG + ".device0.sensor0"), allSensors,
    TSDataType.INT32, new QueryContext(), dataSource, null);
  for (int time = 0; time < 500; time++) {
    Integer value = (Integer) seriesReader.getValueInTimestamp(time);
    if (time < 200) {
      Assert.assertEquals(time + 20000, value.intValue());
    } else if (time < 260 || (time >= 300 && time < 380) || (time >= 400)) {
      Assert.assertEquals(time + 10000, value.intValue());
    } else {
      Assert.assertEquals(time, value.intValue());
    }
  }
}