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);
}
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);
}
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);
}
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));
}
}
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);
}
Aggregations