use of omero.gateway.model.ROIData in project imagej-omero by imagej.
the class UploadTableTest method testMixedTable.
@Test
public void testMixedTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
final GenericTable table = new DefaultGenericTable();
final BoolColumn ijc0 = new BoolColumn("h0");
final DoubleColumn ijc1 = new DoubleColumn("h1");
final DefaultColumn<String> ijc2 = new DefaultColumn<>(String.class, "h2");
final DefaultColumn<IntArray> ijc3 = new DefaultColumn<>(IntArray.class, "h3");
final OMERORefColumn ijc4 = new OMERORefColumn("h4", OMERORef.ROI);
ijc0.fill(new boolean[] { true, false });
ijc1.fill(new double[] { 0.03125, -2134.5 });
ijc2.add("abc");
ijc2.add("123");
ijc3.add(new IntArray(new int[] { 9012, 1294 }));
ijc3.add(new IntArray(new int[] { -4123, -9 }));
ijc4.fill(new long[] { 2314, 1234 });
ijc4.setOriginalData(new Object[] { new ROIData(new RoiI(2314, true)), new ROIData(new RoiI(1234, true)) });
table.add(ijc0);
table.add(ijc1);
table.add(ijc2);
table.add(ijc3);
table.add(ijc4);
// 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, Boolean.class, Double.class, String.class, Long[].class, ROIData.class);
}
};
}
Aggregations