Search in sources :

Example 1 with FactoryClosedException

use of com.questdb.ex.FactoryClosedException in project questdb by bluestreak01.

the class CachingWriterFactoryTest method testFactoryCloseBeforeRelease.

@Test
public void testFactoryCloseBeforeRelease() throws Exception {
    final JournalMetadata<?> m = new JournalStructure("x").$date("ts").$().build();
    JournalWriter x;
    x = wf.writer(m);
    try {
        Assert.assertEquals(0, wf.countFreeWriters());
        Assert.assertNotNull(x);
        Assert.assertTrue(x.isOpen());
        Assert.assertTrue(x == wf.writer(m));
        wf.close();
    } finally {
        x.close();
    }
    Assert.assertFalse(x.isOpen());
    try {
        wf.writer(m);
    } catch (FactoryClosedException ignored) {
    }
}
Also used : JournalWriter(com.questdb.store.JournalWriter) FactoryClosedException(com.questdb.ex.FactoryClosedException) JournalStructure(com.questdb.store.factory.configuration.JournalStructure) AbstractTest(com.questdb.test.tools.AbstractTest) Test(org.junit.Test)

Aggregations

FactoryClosedException (com.questdb.ex.FactoryClosedException)1 JournalWriter (com.questdb.store.JournalWriter)1 JournalStructure (com.questdb.store.factory.configuration.JournalStructure)1 AbstractTest (com.questdb.test.tools.AbstractTest)1 Test (org.junit.Test)1