Search in sources :

Example 6 with Memoizer

use of loci.formats.Memoizer in project bioformats by openmicroscopy.

the class MemoizerTest method testConstructorTimeElapsedNull.

@Test
public void testConstructorTimeElapsedNull() throws Exception {
    Memoizer memoizer = new Memoizer(0, null);
    // Check null memo directory returns null
    assertNull(memoizer.getMemoFile(id));
    checkNoMemo(memoizer, id);
}
Also used : Memoizer(loci.formats.Memoizer) Test(org.testng.annotations.Test)

Example 7 with Memoizer

use of loci.formats.Memoizer in project bioformats by openmicroscopy.

the class MemoizerTest method testConstructorTimeElapsedDirectory.

@Test
public void testConstructorTimeElapsedDirectory() throws Exception {
    File directory = createTempDir();
    directory.delete();
    Memoizer memoizer = new Memoizer(0, directory);
    // Check non-existing memo directory returns null
    assertNull(memoizer.getMemoFile(id));
    directory.mkdirs();
    String memoDir = idDir.getAbsolutePath();
    memoDir = memoDir.substring(memoDir.indexOf(File.separator) + 1);
    checkMemoFile(memoizer.getMemoFile(id), new File(directory, memoDir));
    checkMemo(memoizer, id);
    recursiveDeleteOnExit(directory);
}
Also used : Memoizer(loci.formats.Memoizer) File(java.io.File) Test(org.testng.annotations.Test)

Example 8 with Memoizer

use of loci.formats.Memoizer in project bioformats by openmicroscopy.

the class MemoizerTest method testConstructorReaderTimeElapsedNull.

@Test
public void testConstructorReaderTimeElapsedNull() throws Exception {
    Memoizer memoizer = new Memoizer(reader, 0, null);
    // Check null memo directory returns null
    assertNull(memoizer.getMemoFile(id));
    checkNoMemo(memoizer, id);
}
Also used : Memoizer(loci.formats.Memoizer) Test(org.testng.annotations.Test)

Example 9 with Memoizer

use of loci.formats.Memoizer in project bioformats by openmicroscopy.

the class MemoizerTest method testGetMemoFilePermissionsDirectory.

@Test
public void testGetMemoFilePermissionsDirectory() throws Exception {
    File directory = createTempDir();
    Memoizer memoizer = new Memoizer(reader, 0, directory);
    if (directory.setWritable(false)) {
        assertNull(memoizer.getMemoFile(id));
    }
}
Also used : Memoizer(loci.formats.Memoizer) File(java.io.File) Test(org.testng.annotations.Test)

Example 10 with Memoizer

use of loci.formats.Memoizer in project bioformats by openmicroscopy.

the class MemoizerTest method testConstructorReaderTimeElapsedDirectory.

@Test
public void testConstructorReaderTimeElapsedDirectory() throws Exception {
    File directory = createTempDir();
    directory.delete();
    Memoizer memoizer = new Memoizer(reader, 0, directory);
    // Check non-existing memo directory returns null
    assertNull(memoizer.getMemoFile(id));
    directory.mkdirs();
    String memoDir = idDir.getAbsolutePath();
    memoDir = memoDir.substring(memoDir.indexOf(File.separator) + 1);
    checkMemoFile(memoizer.getMemoFile(id), new File(directory, memoDir));
    checkMemo(memoizer, id);
    recursiveDeleteOnExit(directory);
}
Also used : Memoizer(loci.formats.Memoizer) File(java.io.File) Test(org.testng.annotations.Test)

Aggregations

Memoizer (loci.formats.Memoizer)15 Test (org.testng.annotations.Test)11 File (java.io.File)8 FileStitcher (loci.formats.FileStitcher)3 ImageReader (loci.formats.ImageReader)3 IOException (java.io.IOException)2 Location (loci.common.Location)2 ServiceException (loci.common.services.ServiceException)2 ChannelFiller (loci.formats.ChannelFiller)2 ChannelMerger (loci.formats.ChannelMerger)2 ChannelSeparator (loci.formats.ChannelSeparator)2 DimensionSwapper (loci.formats.DimensionSwapper)2 FormatException (loci.formats.FormatException)2 MinMaxCalculator (loci.formats.MinMaxCalculator)2 BufferedImageReader (loci.formats.gui.BufferedImageReader)2 RandomAccessInputStream (loci.common.RandomAccessInputStream)1 DependencyException (loci.common.services.DependencyException)1 ServiceFactory (loci.common.services.ServiceFactory)1 IFormatReader (loci.formats.IFormatReader)1 MissingLibraryException (loci.formats.MissingLibraryException)1