@Test
public void testGetFileSizeWorksWhenNotOpen() throws Exception {

   // Create test file with some data.
   int testFileSize = 1024;
   String fileName = "testFile.txt";
   SequentialFile file = factory.createSequentialFile(fileName);
   file.open();
   // Write some data to the file
   ActiveMQBuffer buffer = ActiveMQBuffers.wrappedBuffer(new byte[1024]);
   file.write(buffer, true);
   file.close();
   try {
      // Create a new pointer to the test file and ensure file.size() returns the correct value.
      SequentialFile file2 = factory.createSequentialFile(fileName);
      assertEquals(testFileSize, file2.size());
   } catch (Throwable t) {
      t.printStackTrace();
   }
}