Search in sources :

Example 1 with TableColumnDescriptor

use of org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor in project tracecompass by tracecompass.

the class TableColumnDescriptorTest method test.

// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------
/**
 * Test @{link TableColumnDescriptor) construction using {@link Builder}.
 */
@Test
public void test() {
    TableColumnDescriptor.Builder builder = new TableColumnDescriptor.Builder();
    ITableColumnDescriptor desc = builder.setText(COLUMN_TEXT0).build();
    assertEquals("Column header", COLUMN_TEXT0, desc.getText());
    assertTrue("Empty tooltip", desc.getTooltip().isEmpty());
    builder = new TableColumnDescriptor.Builder();
    desc = builder.setText(COLUMN_TEXT0).setTooltip(COLUMN_TOOLTIP0).build();
    assertEquals("Column header", COLUMN_TEXT0, desc.getText());
    assertEquals("Column tooltip", COLUMN_TOOLTIP0, desc.getTooltip());
    builder = new TableColumnDescriptor.Builder();
    desc = builder.setTooltip(COLUMN_TOOLTIP0).build();
    assertTrue("Empty Text", desc.getText().isEmpty());
    assertEquals("Column tooltip", COLUMN_TOOLTIP0, desc.getTooltip());
}
Also used : Builder(org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor.Builder) ITableColumnDescriptor(org.eclipse.tracecompass.tmf.core.model.ITableColumnDescriptor) ITableColumnDescriptor(org.eclipse.tracecompass.tmf.core.model.ITableColumnDescriptor) TableColumnDescriptor(org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor) Builder(org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor.Builder) Test(org.junit.Test)

Example 2 with TableColumnDescriptor

use of org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor in project tracecompass by tracecompass.

the class TableColumnDescriptorTest method testToString.

/**
 * Test {@link TableColumnDescriptor#toString()}
 */
@Test
public void testToString() {
    TableColumnDescriptor.Builder builder = new TableColumnDescriptor.Builder();
    ITableColumnDescriptor desc = builder.setText(COLUMN_TEXT0).setTooltip(COLUMN_TOOLTIP0).build();
    assertEquals(TO_STRING, "[text=Name tooltip=Tooltip]", desc.toString());
}
Also used : Builder(org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor.Builder) ITableColumnDescriptor(org.eclipse.tracecompass.tmf.core.model.ITableColumnDescriptor) ITableColumnDescriptor(org.eclipse.tracecompass.tmf.core.model.ITableColumnDescriptor) TableColumnDescriptor(org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor) Builder(org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor.Builder) Test(org.junit.Test)

Aggregations

TableColumnDescriptor (org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor)2 Builder (org.eclipse.tracecompass.internal.provisional.tmf.core.model.TableColumnDescriptor.Builder)2 ITableColumnDescriptor (org.eclipse.tracecompass.tmf.core.model.ITableColumnDescriptor)2 Test (org.junit.Test)2