Search in sources :

Example 11 with TestEntity

use of com.questdb.model.TestEntity in project questdb by bluestreak01.

the class SortTest method testDefaultSort.

@Test
public void testDefaultSort() throws JournalException {
    long last = 0;
    for (TestEntity p : q.all().asResultSet().sort("anInt").sort().bufferedIterator()) {
        Assert.assertTrue("Journal records are out of order", last <= p.getTimestamp());
        last = p.getTimestamp();
    }
}
Also used : TestEntity(com.questdb.model.TestEntity) AbstractTest(com.questdb.test.tools.AbstractTest) Test(org.junit.Test)

Example 12 with TestEntity

use of com.questdb.model.TestEntity in project questdb by bluestreak01.

the class SortTest method testSortDoubleDesc.

@Test
public void testSortDoubleDesc() throws JournalException {
    double last = Double.MAX_VALUE;
    for (TestEntity p : q.all().asResultSet().sort(ResultSet.Order.DESC, "aDouble").bufferedIterator()) {
        Assert.assertTrue("Journal records are out of order", last >= p.getADouble());
        last = p.getADouble();
    }
}
Also used : TestEntity(com.questdb.model.TestEntity) AbstractTest(com.questdb.test.tools.AbstractTest) Test(org.junit.Test)

Aggregations

TestEntity (com.questdb.model.TestEntity)12 Test (org.junit.Test)11 AbstractTest (com.questdb.test.tools.AbstractTest)10 NumericException (com.questdb.common.NumericException)1 Quote (com.questdb.model.Quote)1 StripCRLFStringConverter (com.questdb.printer.converter.StripCRLFStringConverter)1 Rnd (com.questdb.std.Rnd)1 JournalException (com.questdb.std.ex.JournalException)1 CountDownLatch (java.util.concurrent.CountDownLatch)1