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) {
}
}
Aggregations