Class ExpressionDataFileServiceTest

java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.analysis.service.ExpressionDataFileServiceTest

@ContextConfiguration public class ExpressionDataFileServiceTest extends BaseTest5
  • Constructor Details

    • ExpressionDataFileServiceTest

      public ExpressionDataFileServiceTest()
  • Method Details

    • testStreamAndWriteTeesOneBuildIntoStreamAndCache

      @Test public void testStreamAndWriteTeesOneBuildIntoStreamAndCache() throws Exception
      Throws:
      Exception
    • testCallerDeathDoesNotAbortTheCacheBuild

      @Test public void testCallerDeathDoesNotAbortTheCacheBuild() throws Exception
      The caller going away mid-stream must not abort the cache build — otherwise an impatient client re-cools the cold path forever. This was the one property the replaced fire-and-forget executor build had that a naive tee would lose.
      Throws:
      Exception
    • testConcurrentWriterDegradesToPlainStream

      @Test public void testConcurrentWriterDegradesToPlainStream() throws Exception
      A concurrent builder holding the cache file degrades the call to a plain stream.
      Throws:
      Exception
    • testDeleteAll

      @Test public void testDeleteAll() throws IOException
      Throws:
      IOException
    • testGetMetadata

      @Test public void testGetMetadata() throws IOException
      Throws:
      IOException
    • testCopyMetadata

      @Test public void testCopyMetadata() throws IOException
      Throws:
      IOException
    • testCopyMetadataFileWhenTheLockFailsKeepsTheExistingFile

      @Test public void testCopyMetadataFileWhenTheLockFailsKeepsTheExistingFile() throws IOException
      The catch that deletes the destination after a failed copy also enclosed the lock acquisition, so a lock that could not be acquired deleted a valid metadata file this call never wrote.
      Throws:
      IOException
    • testFailedProcessedDataFileDeleteReachesTheCaller

      @Test public void testFailedProcessedDataFileDeleteReachesTheCaller() throws IOException
      A data file that could not be deleted was only logged: deleteProcessedData reported "Deleted processed data." and exited 0, and writeOrLocateProcessedDataFile went on serving the stale file.
      Throws:
      IOException
    • testFailedRawDataFileDeleteReachesTheCaller

      @Test public void testFailedRawDataFileDeleteReachesTheCaller() throws IOException
      As for processed data: deleteRawData reported "Deleted raw data." when a file could not be deleted.
      Throws:
      IOException
    • testDeleteMetadata

      @Test public void testDeleteMetadata() throws IOException
      Throws:
      IOException
    • testFailedDiffExArchiveBuildLeavesNoFile

      @Test public void testFailedDiffExArchiveBuildLeavesNoFile()
      A failed DEA archive build must not leave the truncated file behind: the next request finds it and serves it as the archive. 304 of the 774 archives on gemma2 were 0 bytes.
    • testDiffExArchiveIsNotAtItsPathWhileBeingBuilt

      @Test public void testDiffExArchiveIsNotAtItsPathWhileBeingBuilt()
      Nothing may be at the archive's path while it is being built. A JVM that dies at that point, or a daemon writer thread halted by System.exit, leaves whatever is there, and it is then served as the archive.
    • testErrorDuringDiffExArchiveBuildLeavesNoFile

      @Test public void testErrorDuringDiffExArchiveBuildLeavesNoFile() throws IOException
      An Error is not caught by a catch of Exception, so the partial archive stayed at its path.
      Throws:
      IOException
    • testWriteOrLocateJsonProcessedDataFile

      @Test public void testWriteOrLocateJsonProcessedDataFile() throws Exception
      The JSON processed-data writer returned toShared() of the shared lock that toExclusive() had already closed, which throws IllegalStateException.
      Throws:
      Exception
    • testTimedOutLockUpgradeDoesNotDeleteTheFile

      @Test public void testTimedOutLockUpgradeDoesNotDeleteTheFile() throws Exception
      The delete-on-failure catch also covered the lock upgrade, so a timed-out upgrade deleted the file that another holder had locked.
      Throws:
      Exception