Search in sources :

Example 1 with ExecutionCounter

use of com.epam.ta.reportportal.database.entity.statistics.ExecutionCounter in project commons-dao by reportportal.

the class TestItemRepositoryTest method updateExecutionStatisticsTest.

@Test
public void updateExecutionStatisticsTest() {
    final TestItem testItem = new TestItem();
    testItem.setStatistics(new Statistics(new ExecutionCounter(2, 2, 0, 0), new IssueCounter()));
    testItem.setStatus(Status.PASSED);
    testItemRepository.save(testItem);
    testItemRepository.updateExecutionStatistics(testItem);
    final TestItem item = testItemRepository.findOne(testItem.getId());
    final ExecutionCounter executionCounter = item.getStatistics().getExecutionCounter();
    assertThat(executionCounter.getTotal()).isEqualTo(3);
    assertThat(executionCounter.getFailed()).isEqualTo(0);
    assertThat(executionCounter.getPassed()).isEqualTo(3);
    assertThat(executionCounter.getSkipped()).isEqualTo(0);
}
Also used : ExecutionCounter(com.epam.ta.reportportal.database.entity.statistics.ExecutionCounter) IssueCounter(com.epam.ta.reportportal.database.entity.statistics.IssueCounter) Statistics(com.epam.ta.reportportal.database.entity.statistics.Statistics) TestItem(com.epam.ta.reportportal.database.entity.item.TestItem) BaseDaoTest(com.epam.ta.reportportal.BaseDaoTest) Test(org.junit.Test)

Aggregations

BaseDaoTest (com.epam.ta.reportportal.BaseDaoTest)1 TestItem (com.epam.ta.reportportal.database.entity.item.TestItem)1 ExecutionCounter (com.epam.ta.reportportal.database.entity.statistics.ExecutionCounter)1 IssueCounter (com.epam.ta.reportportal.database.entity.statistics.IssueCounter)1 Statistics (com.epam.ta.reportportal.database.entity.statistics.Statistics)1 Test (org.junit.Test)1