Search in sources :

Example 1 with RoiI

use of omero.model.RoiI 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);
        }
    };
}
Also used : DefaultGenericTable(net.imagej.table.DefaultGenericTable) BoolColumn(net.imagej.table.BoolColumn) DefaultColumn(net.imagej.table.DefaultColumn) ROIData(omero.gateway.model.ROIData) GenericTable(net.imagej.table.GenericTable) DefaultGenericTable(net.imagej.table.DefaultGenericTable) Verifications(mockit.Verifications) DoubleColumn(net.imagej.table.DoubleColumn) IntArray(org.scijava.util.IntArray) RoiI(omero.model.RoiI) TableData(omero.gateway.model.TableData) Test(org.junit.Test)

Aggregations

Verifications (mockit.Verifications)1 BoolColumn (net.imagej.table.BoolColumn)1 DefaultColumn (net.imagej.table.DefaultColumn)1 DefaultGenericTable (net.imagej.table.DefaultGenericTable)1 DoubleColumn (net.imagej.table.DoubleColumn)1 GenericTable (net.imagej.table.GenericTable)1 ROIData (omero.gateway.model.ROIData)1 TableData (omero.gateway.model.TableData)1 RoiI (omero.model.RoiI)1 Test (org.junit.Test)1 IntArray (org.scijava.util.IntArray)1