Search in sources :

Example 11 with TableEntry

use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry in project linuxtools by eclipse.

the class FilteredTableDataSetTest method testClearFilters.

@Test
public void testClearFilters() {
    TableEntry entry;
    entry = new TableEntry();
    entry.add(new Integer[] { 3, 2, 5 });
    dataSet.append(entry);
    entry = new TableEntry();
    entry.add(new Integer[] { 4, 2, 3 });
    dataSet.append(entry);
    entry = new TableEntry();
    entry.add(new Integer[] { 7, 2, 9 });
    dataSet.append(entry);
    entry = new TableEntry();
    entry.add(new Integer[] { 2, 2, 6 });
    dataSet.append(entry);
    entry = new TableEntry();
    entry.add(new Integer[] { 5, 2, 2 });
    dataSet.append(entry);
    dataSet.addFilter(new RangeFilter(0, 3, 5, RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS));
    dataSet.addFilter(new SortFilter(2, SortFilter.ASCENDING));
    assertEquals(2, dataSet.getFilters().length);
    dataSet.clearFilters();
    assertEquals(1, dataSet.getRowCount());
    Object[] row = dataSet.getRow(0);
    assertEquals(5, ((Integer) row[0]).intValue());
    assertEquals(2, ((Integer) row[2]).intValue());
    assertEquals(0, dataSet.getFilters().length);
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) SortFilter(org.eclipse.linuxtools.systemtap.graphing.core.filters.SortFilter) RangeFilter(org.eclipse.linuxtools.systemtap.graphing.core.filters.RangeFilter) Test(org.junit.Test)

Example 12 with TableEntry

use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry in project linuxtools by eclipse.

the class TableDataSetTest method setUp.

@Before
public void setUp() {
    data = new TableDataSet(new String[] { "a", "b", "c" });
    entry0 = new TableEntry();
    entry0.putRow(0, new String[] { "1", "2", "3" });
    data.setData(entry0);
    TableEntry entry = new TableEntry();
    entry.putRow(0, new String[] { "4", "5", "6" });
    data.setData(entry);
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) TableDataSet(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableDataSet) Before(org.junit.Before)

Example 13 with TableEntry

use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry in project linuxtools by eclipse.

the class TableDataSetTest method testRemove.

@Test
public void testRemove() {
    assertFalse(data.remove(null));
    assertFalse(data.remove(new TableEntry()));
    assertFalse(data.remove(-1));
    assertFalse(data.remove(10));
    assertEquals(2, data.getEntryCount());
    IDataEntry entry = data.getEntry(0);
    assertTrue(data.remove(entry));
    assertEquals(1, data.getEntryCount());
    assertFalse(data.remove(entry));
    assertTrue(data.remove(0));
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) IDataEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataEntry) Test(org.junit.Test)

Example 14 with TableEntry

use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry in project linuxtools by eclipse.

the class TableEntryTest method testGetRowCount.

@Test
public void testGetRowCount() {
    TableEntry entry2 = new TableEntry();
    assertEquals(0, entry2.getRowCount());
    entry2 = new TableEntry();
    entry2.putRow(0, null);
    assertEquals(0, entry2.getRowCount());
    assertEquals(2, entry.getRowCount());
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) Test(org.junit.Test)

Example 15 with TableEntry

use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry in project linuxtools by eclipse.

the class TableEntryTest method setUp.

@Before
public void setUp() {
    entry = new TableEntry();
    data = new Integer[] { 2, 5, 4 };
    entry.add(data);
    data = new Integer[] { 5, 1, 3 };
    entry.add(data);
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) Before(org.junit.Before)

Aggregations

TableEntry (org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry)15 Test (org.junit.Test)13 RangeFilter (org.eclipse.linuxtools.systemtap.graphing.core.filters.RangeFilter)3 SortFilter (org.eclipse.linuxtools.systemtap.graphing.core.filters.SortFilter)2 Before (org.junit.Before)2 IDataEntry (org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataEntry)1 RowEntry (org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowEntry)1 TableDataSet (org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableDataSet)1