Search in sources :

Example 6 with RuntimeIntervalModel

use of io.questdb.griffin.model.RuntimeIntervalModel in project questdb by bluestreak01.

the class IntervalBwdDataFrameCursorTest method testClose.

@Test
public void testClose() throws Exception {
    TestUtils.assertMemoryLeak(() -> {
        try (TableModel model = new TableModel(configuration, "x", PartitionBy.NONE).col("a", ColumnType.INT).col("b", ColumnType.INT).timestamp()) {
            CairoTestUtils.create(model);
        }
        TableReader reader = new TableReader(configuration, "x");
        IntervalBwdDataFrameCursor cursor = new IntervalBwdDataFrameCursor(new RuntimeIntervalModel(intervals), reader.getMetadata().getTimestampIndex());
        cursor.of(reader, null);
        cursor.close();
        Assert.assertFalse(reader.isOpen());
        cursor.close();
        Assert.assertFalse(reader.isOpen());
    });
}
Also used : RuntimeIntervalModel(io.questdb.griffin.model.RuntimeIntervalModel) Test(org.junit.Test)

Aggregations

RuntimeIntervalModel (io.questdb.griffin.model.RuntimeIntervalModel)6 Rnd (io.questdb.std.Rnd)4 Test (org.junit.Test)2