Search in sources :

Example 1 with JavaTransferObject

use of org.eclipse.scout.rt.client.ui.dnd.JavaTransferObject in project scout.rt by eclipse.

the class OrganizeColumnsFormTest method testNoNPEInExecDrop.

@Test
public void testNoNPEInExecDrop() {
    ITable table = mock(ITable.class);
    List<ITableRow> list = new LinkedList<ITableRow>();
    list.add(mock(ITableRow.class));
    JavaTransferObject transfer = mock(JavaTransferObject.class);
    when(transfer.getLocalObjectAsList(ITableRow.class)).thenReturn(list);
    OrganizeColumnsForm form = new OrganizeColumnsForm(table);
    try {
        form.getColumnsTableField().getTable().execDrop(null, null);
        form.getColumnsTableField().getTable().execDrop(null, transfer);
        form.getColumnsTableField().getTable().execDrop(mock(ITableRow.class), null);
    } catch (NullPointerException e) {
        fail("Null-Argument should not lead to NullPointerException " + e);
    }
}
Also used : ITable(org.eclipse.scout.rt.client.ui.basic.table.ITable) ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) JavaTransferObject(org.eclipse.scout.rt.client.ui.dnd.JavaTransferObject) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Aggregations

LinkedList (java.util.LinkedList)1 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)1 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)1 JavaTransferObject (org.eclipse.scout.rt.client.ui.dnd.JavaTransferObject)1 Test (org.junit.Test)1