Search in sources :

Example 1 with DataSet

use of org.dashbuilder.dataset.DataSet 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 DataSet

use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method testQuarterSelector.

@Test
public void testQuarterSelector() {
    Displayer displayer = presenter.getCommitsByQuarterDisplayer();
    DataSet dataSet = displayer.getDataSetHandler().getLastDataSet();
    assertDataSetValues(dataSet, new String[][] { { "1", "2.00" }, { "2", "2.00" } }, 0);
}
Also used : DataSet(org.dashbuilder.dataset.DataSet) RawDataSet(org.dashbuilder.dataset.RawDataSet) Displayer(org.dashbuilder.displayer.client.Displayer) AbstractDisplayer(org.dashbuilder.displayer.client.AbstractDisplayer) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Example 3 with DataSet

use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method testAllCommits.

@Test
public void testAllCommits() {
    Displayer displayer = presenter.getAllCommitsDisplayer();
    DataSet dataSet = displayer.getDataSetHandler().getLastDataSet();
    assertDataSetValues(dataSet, new String[][] { { "user2", "06/04/19 12:00", "Commit 4" }, { "user2", "04/03/19 12:00", "Commit 3" }, { "user1", "03/02/19 12:00", "Commit 2" }, { "user1", "01/01/19 12:00", "Commit 1" } }, 0);
}
Also used : DataSet(org.dashbuilder.dataset.DataSet) RawDataSet(org.dashbuilder.dataset.RawDataSet) Displayer(org.dashbuilder.displayer.client.Displayer) AbstractDisplayer(org.dashbuilder.displayer.client.AbstractDisplayer) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Example 4 with DataSet

use of org.dashbuilder.dataset.DataSet in project kie-wb-common by kiegroup.

the class ProjectMetricsScreenTest method testCommitsPerAuthor.

@Test
public void testCommitsPerAuthor() {
    Displayer displayer = presenter.getCommitsPerAuthorDisplayer();
    DataSet dataSet = displayer.getDataSetHandler().getLastDataSet();
    assertDataSetValues(dataSet, new String[][] { { "user1", "2.00", "2.00", "user1", "1.00" }, { "user2", "2.00", "2.00", "user2", "1.00" } }, 0);
}
Also used : DataSet(org.dashbuilder.dataset.DataSet) RawDataSet(org.dashbuilder.dataset.RawDataSet) Displayer(org.dashbuilder.displayer.client.Displayer) AbstractDisplayer(org.dashbuilder.displayer.client.AbstractDisplayer) AbstractDisplayerTest(org.dashbuilder.displayer.client.AbstractDisplayerTest) Test(org.junit.Test)

Example 5 with DataSet

use of org.dashbuilder.dataset.DataSet 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)

Aggregations

DataSet (org.dashbuilder.dataset.DataSet)41 Test (org.junit.Test)27 AbstractDisplayerTest (org.dashbuilder.displayer.client.AbstractDisplayerTest)25 AbstractDisplayer (org.dashbuilder.displayer.client.AbstractDisplayer)17 Displayer (org.dashbuilder.displayer.client.Displayer)13 ArrayList (java.util.ArrayList)12 RawDataSet (org.dashbuilder.dataset.RawDataSet)11 HashMap (java.util.HashMap)6 SelectorDisplayer (org.dashbuilder.renderer.client.selector.SelectorDisplayer)6 DataColumn (org.dashbuilder.dataset.DataColumn)3 DataSetLookup (org.dashbuilder.dataset.DataSetLookup)2 ProcessInstanceWithVarsDesc (org.jbpm.services.api.model.ProcessInstanceWithVarsDesc)2 UserTaskInstanceWithPotOwnerDesc (org.jbpm.services.api.model.UserTaskInstanceWithPotOwnerDesc)2 UserTaskInstanceWithVarsDesc (org.jbpm.services.api.model.UserTaskInstanceWithVarsDesc)2 Date (java.util.Date)1 List (java.util.List)1 DataSetBuilder (org.dashbuilder.dataset.DataSetBuilder)1 DataSetMetadata (org.dashbuilder.dataset.DataSetMetadata)1 DataColumnDef (org.dashbuilder.dataset.def.DataColumnDef)1 DataSetDef (org.dashbuilder.dataset.def.DataSetDef)1