ome.formats
Class OMEROImportFixture

java.lang.Object
  extended by ome.formats.OMEROImportFixture

public class OMEROImportFixture
extends Object

test fixture for importing files without a GUI. Sample usage:

 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.

Since:
4.0
Author:
Josh Moore, josh.moore at gmx.de
See Also:
OMEROMetadataStoreClient

Field Summary
protected  OMEROMetadataStoreClient store
           
 
Constructor Summary
OMEROImportFixture(OMEROMetadataStoreClient store, OMEROWrapper reader)
           
 
Method Summary
 void doImport()
          runs import by looping through all files and then calling: ImportLibrary.open(String) ImportLibrary#calculateImageCount(String) ImportLibrary#importMetadata() ImportLibrary#importData(long, String, ome.formats.testclient.ImportLibrary.Step)
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

store

protected OMEROMetadataStoreClient store
Constructor Detail

OMEROImportFixture

public OMEROImportFixture(OMEROMetadataStoreClient store,
                          OMEROWrapper reader)
Method Detail

setUp

public void setUp()
           throws Exception
checks for the necessary fields and initializes the ImportLibrary

Throws:
Exception

tearDown

public void tearDown()
sets ImportLibrary, OMEROMetadataStore, and file array to null. Also attempts to call FormatReader.close().


fullImport

public List<omero.model.Pixels> fullImport(File f,
                                           String name)
                                    throws Exception
Provides one complete import cycle.

Throws:
Exception

doImport

public void doImport()
              throws Exception
runs import by looping through all files and then calling:

Parameters:
step - an action to take per plane. not null.
Throws:
Exception

setFile

public void setFile(File file)

setName

public void setName(String name)

getPixels

public List<omero.model.Pixels> getPixels()
                                   throws Exception
Accessor for the created pixels. Should be called before the next call to doImport()

Throws:
Exception


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

Copyright © 2009 The University of Dundee. All Rights Reserved.