Search in sources :

Example 1 with TableEntry

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

the class FilteredTableDataSetTest method testRemoveFilter.

@Test
public void testRemoveFilter() {
    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);
    RangeFilter filter = new RangeFilter(0, 3, 5, RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
    dataSet.addFilter(filter);
    dataSet.addFilter(new SortFilter(2, SortFilter.ASCENDING));
    dataSet.removeFilter(filter);
    assertEquals(1, dataSet.getRowCount());
    Object[] row = dataSet.getRow(0);
    assertEquals(5, ((Integer) row[0]).intValue());
    assertEquals(2, ((Integer) row[2]).intValue());
}
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 2 with TableEntry

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

the class FilteredTableDataSetTest method testGetData.

@Test
public void testGetData() {
    TableEntry entry = new TableEntry();
    entry.add(new String[] { "1", "2", "3" });
    data.append(entry);
    Object[][] d = dataSet.getData();
    assertNotNull(d);
    assertEquals(1, d.length);
    assertEquals("3", d[0][2]);
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) Test(org.junit.Test)

Example 3 with TableEntry

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

the class TableDataSetTest method testSetData.

@Test
public void testSetData() {
    assertEquals(2, data.getEntryCount());
    TableEntry entry = new TableEntry();
    entry.putRow(0, new String[] { "1", "2", "3" });
    data.setData(entry);
    assertEquals(3, data.getEntryCount());
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) Test(org.junit.Test)

Example 4 with TableEntry

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

the class TableDataSetTest method testAppend.

@Test
public void testAppend() {
    assertEquals(2, data.getEntryCount());
    TableEntry entry = new TableEntry();
    entry.putRow(0, new String[] { "1", "2", "3" });
    data.append(entry);
    assertEquals(3, data.getEntryCount());
}
Also used : TableEntry(org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.TableEntry) Test(org.junit.Test)

Example 5 with TableEntry

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

the class TableEntryTest method testGetColCount.

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

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