public class OMEROImportFixture extends Object
OMEROMetadataStoreClient client = new OMEROMetadataStoreClient(sf); OMEROImportFixture fixture = new OMEROImportFixture(client); fixture.setUp(); fixture.setFile(ResourceUtils.getFile("classpath:tinyTest.d3d.dv")); fixture.setName(name); fixture.doImport(); List<Pixels> p = fixture.getPixels(); fixture.tearDown(); i.setName(name); i = userSave(i);This class is not thread safe.
OMEROMetadataStoreClient
Modifier and Type | Field and Description |
---|---|
protected OMEROMetadataStoreClient |
store |
Constructor and Description |
---|
OMEROImportFixture(OMEROMetadataStoreClient store,
OMEROWrapper reader) |
Modifier and Type | Method and Description |
---|---|
void |
doImport()
Runs import by looping through all files and then calling
ImportLibrary.importCandidates(ImportConfig, ImportCandidates) . |
List<omero.model.Pixels> |
fullImport(File f,
String name)
Provides one complete import cycle.
|
List<omero.model.Pixels> |
getPixels()
Accessor for the created pixels.
|
void |
setFile(File file) |
void |
setName(String name) |
void |
setUp()
checks for the necessary fields and initializes the
ImportLibrary |
void |
tearDown()
sets
ImportLibrary , OMEROMetadataStore , and file array to
null. |
protected OMEROMetadataStoreClient store
public OMEROImportFixture(OMEROMetadataStoreClient store, OMEROWrapper reader)
public void setUp() throws Exception
ImportLibrary
Exception
- if the import library could not be instantiatedpublic void tearDown()
ImportLibrary
, OMEROMetadataStore
, and file array to
null. Also attempts to call FormatReader.close()
.public List<omero.model.Pixels> fullImport(File f, String name) throws Exception
f
- the file to importname
- the name (ignored)Pixels
instance(s) created by the importException
- if the import failedpublic void doImport() throws Exception
ImportLibrary.importCandidates(ImportConfig, ImportCandidates)
.Exception
- if import failed in a way that is not handled by an ErrorHandler.EXCEPTION_EVENT
public void setFile(File file)
public void setName(String name)
public List<omero.model.Pixels> getPixels() throws Exception
doImport()
Pixels
instance(s) created by the importException
- from an ErrorHandler.EXCEPTION_EVENT
if the import failed
Version: 5.2.4-ice35-b23
Copyright © 2016 The University of Dundee & Open Microscopy Environment. All Rights Reserved.