Search in sources :

Example 1 with DefaultCharTable

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

the class UploadTableTest method testCharTable.

@Test
public void testCharTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
    final CharTable table = new DefaultCharTable(5, 2);
    table.get(0).fill(new char[] { 'q', 'V' });
    table.get(1).fill(new char[] { '2', '$' });
    table.get(2).fill(new char[] { 'b', 'a' });
    table.get(3).fill(new char[] { '\t', '\n' });
    table.get(4).fill(new char[] { '.', ' ' });
    // 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, String.class);
        }
    };
}
Also used : DefaultCharTable(net.imagej.table.DefaultCharTable) Verifications(mockit.Verifications) TableData(omero.gateway.model.TableData) DefaultCharTable(net.imagej.table.DefaultCharTable) CharTable(net.imagej.table.CharTable) Test(org.junit.Test)

Aggregations

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