Search in sources :

Example 1 with AbstractDisplayer

use of org.dashbuilder.displayer.client.AbstractDisplayer in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method testAlwaysShow7Days.

@Test
public void testAlwaysShow7Days() throws Exception {
    AbstractDisplayer displayer = (AbstractDisplayer) presenter.getTopAuthorSelectorDisplayer();
    displayer.filterUpdate(COLUMN_AUTHOR, // "user" selected
    1);
    DataSet dataSet = presenter.getAllCommitsDisplayer().getDataSetHandler().getLastDataSet();
    assertEquals(dataSet.getRowCount(), 2);
    // Bar chart must always show 7 bars, one per day of week
    dataSet = presenter.getCommitsByDayOfWeekDisplayer().getDataSetHandler().getLastDataSet();
    assertEquals(dataSet.getRowCount(), 7);
}
Also used : AbstractDisplayer(org.dashbuilder.displayer.client.AbstractDisplayer) DataSet(org.dashbuilder.dataset.DataSet) RawDataSet(org.dashbuilder.dataset.RawDataSet) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Example 2 with AbstractDisplayer

use of org.dashbuilder.displayer.client.AbstractDisplayer in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method testSelectAuthorAndWeekOfDay.

@Test
public void testSelectAuthorAndWeekOfDay() throws Exception {
    AbstractDisplayer displayer = (AbstractDisplayer) presenter.getTopAuthorSelectorDisplayer();
    displayer.filterUpdate(COLUMN_AUTHOR, // "user" selected
    1);
    DataSet dataSet = presenter.getAllCommitsDisplayer().getDataSetHandler().getLastDataSet();
    assertEquals(dataSet.getRowCount(), 2);
    displayer = (AbstractDisplayer) presenter.getCommitsByDayOfWeekDisplayer();
    displayer.filterUpdate(COLUMN_DATE, // "Tuesday" selected
    2);
    dataSet = presenter.getAllCommitsDisplayer().getDataSetHandler().getLastDataSet();
    assertEquals(dataSet.getRowCount(), 1);
}
Also used : AbstractDisplayer(org.dashbuilder.displayer.client.AbstractDisplayer) DataSet(org.dashbuilder.dataset.DataSet) RawDataSet(org.dashbuilder.dataset.RawDataSet) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Example 3 with AbstractDisplayer

use of org.dashbuilder.displayer.client.AbstractDisplayer in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method testSelectYear.

@Test
public void testSelectYear() throws Exception {
    AbstractDisplayer displayer = (AbstractDisplayer) presenter.getCommitsByYearDisplayer();
    displayer.filterUpdate(COLUMN_DATE, // "2019" selected
    0);
    DataSet dataSet = presenter.getAllCommitsDisplayer().getDataSetHandler().getLastDataSet();
    assertEquals(dataSet.getRowCount(), 4);
}
Also used : AbstractDisplayer(org.dashbuilder.displayer.client.AbstractDisplayer) DataSet(org.dashbuilder.dataset.DataSet) RawDataSet(org.dashbuilder.dataset.RawDataSet) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Example 4 with AbstractDisplayer

use of org.dashbuilder.displayer.client.AbstractDisplayer in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method testSelectWeekOfDay.

@Test
public void testSelectWeekOfDay() throws Exception {
    AbstractDisplayer displayer = (AbstractDisplayer) presenter.getCommitsByDayOfWeekDisplayer();
    displayer.filterUpdate(COLUMN_DATE, // "Tuesday" selected
    2);
    DataSet dataSet = presenter.getAllCommitsDisplayer().getDataSetHandler().getLastDataSet();
    assertEquals(dataSet.getRowCount(), 2);
}
Also used : AbstractDisplayer(org.dashbuilder.displayer.client.AbstractDisplayer) DataSet(org.dashbuilder.dataset.DataSet) RawDataSet(org.dashbuilder.dataset.RawDataSet) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Aggregations

DataSet (org.dashbuilder.dataset.DataSet)4 RawDataSet (org.dashbuilder.dataset.RawDataSet)4 AbstractDisplayer (org.dashbuilder.displayer.client.AbstractDisplayer)4 AbstractDisplayerTest (org.dashbuilder.displayer.client.AbstractDisplayerTest)4 Test (org.junit.Test)4