Search in sources :

Example 1 with WellSampleData

use of omero.gateway.model.WellSampleData in project imagej-omero by imagej.

the class UploadTableTest method testReferenceTable.

@Test
public void testReferenceTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
    final GenericTable table = new DefaultGenericTable();
    final OMERORefColumn rc0 = new OMERORefColumn(OMERORef.WELL);
    final OMERORefColumn rc1 = new OMERORefColumn(OMERORef.WELL);
    final OMERORefColumn rc2 = new OMERORefColumn(OMERORef.WELL);
    rc0.fill(new long[] { 2314, 3141324, 1235 });
    rc1.fill(new long[] { 1234, 18367, 82156 });
    rc2.fill(new long[] { 3198, 968431, 5489 });
    table.add(rc0);
    table.add(rc1);
    table.add(rc2);
    final Object[][] wells = new Object[3][3];
    for (int c = 0; c < table.getColumnCount(); c++) {
        for (int r = 0; r < table.getRowCount(); r++) {
            wells[c][r] = new WellSampleData(new WellSampleI((long) table.get(c, r), false));
        }
        ((OMERORefColumn) table.get(c)).setOriginalData(wells[c]);
    }
    // Create expectations
    setUpMethodCalls();
    final long id = service.uploadTable(credentials, "table", table, 0);
    assertEquals(id, -1);
    // NB: Can only capture in a Verifications block
    new Verifications() {

        {
            TableData td;
            tablesFacility.addTable((SecurityContext) any, (ImageData) any, anyString, td = withCapture());
            tableEquals(table, td, WellSampleData.class);
        }
    };
}
Also used : DefaultGenericTable(net.imagej.table.DefaultGenericTable) WellSampleData(omero.gateway.model.WellSampleData) GenericTable(net.imagej.table.GenericTable) DefaultGenericTable(net.imagej.table.DefaultGenericTable) DataObject(omero.gateway.model.DataObject) Verifications(mockit.Verifications) TableData(omero.gateway.model.TableData) WellSampleI(omero.model.WellSampleI) Test(org.junit.Test)

Aggregations

Verifications (mockit.Verifications)1 DefaultGenericTable (net.imagej.table.DefaultGenericTable)1 GenericTable (net.imagej.table.GenericTable)1 DataObject (omero.gateway.model.DataObject)1 TableData (omero.gateway.model.TableData)1 WellSampleData (omero.gateway.model.WellSampleData)1 WellSampleI (omero.model.WellSampleI)1 Test (org.junit.Test)1