@Test
public void testCloneFile() 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) 5);
   }
   IOCallbackCountdown callback = new IOCallbackCountdown(1);
   file.internalWrite(src, callback);
   assertEquals(bufferSize, file.size());
   JDBCSequentialFile copy = (JDBCSequentialFile) file.cloneFile();
   copy.open();
   assertEquals(bufferSize, copy.size());
   assertEquals(bufferSize, file.size());
}