Search in sources :

Example 1 with ShortTable

use of net.imagej.table.ShortTable in project imagej-omero by imagej.

the class UploadTableTest method testShortTable.

@Test
public void testShortTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
    final ShortTable table = new DefaultShortTable(6, 3);
    table.get(0).fill(new short[] { -32768, 0, 32767 });
    table.get(1).fill(new short[] { 12, -12, 5 });
    table.get(2).fill(new short[] { 10000, 20000, -30000 });
    table.get(3).fill(new short[] { 1111, 2222, 8888 });
    table.get(4).fill(new short[] { -4, -17, -31194 });
    table.get(5).fill(new short[] { 0, 17239, -20 });
    // 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, Long.class);
        }
    };
}
Also used : ShortTable(net.imagej.table.ShortTable) DefaultShortTable(net.imagej.table.DefaultShortTable) DefaultShortTable(net.imagej.table.DefaultShortTable) Verifications(mockit.Verifications) TableData(omero.gateway.model.TableData) Test(org.junit.Test)

Aggregations

Verifications (mockit.Verifications)1 DefaultShortTable (net.imagej.table.DefaultShortTable)1 ShortTable (net.imagej.table.ShortTable)1 TableData (omero.gateway.model.TableData)1 Test (org.junit.Test)1