use of org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFile in project activemq-artemis by apache.
the class JDBCSequentialFileFactoryTest method testAsyncAppendToFile.
@Test
public void testAsyncAppendToFile() throws Exception {
JDBCSequentialFile file = (JDBCSequentialFile) factory.createSequentialFile("test.txt");
file.open();
// Create buffer and fill with test data
int bufferSize = 1024;
ActiveMQBuffer src = ActiveMQBuffers.fixedBuffer(bufferSize);
for (int i = 0; i < bufferSize; i++) {
src.writeByte((byte) 1);
}
IOCallbackCountdown callback = new IOCallbackCountdown(1);
file.internalWrite(src, callback);
callback.assertEmpty(5);
checkData(file, src);
}
Aggregations