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